<script>

    function loadAssements(){

       
        var CampusID = $('#header-campusid').val();
        var studentID = $('#user_id').val();
        var session = $('#prosloadsession option:selected').val();
        var term = $('#prosloadterm option:selected').val();
        var UserType = $('#user_type_holder').val();

        var classID = $('#prosloadclassfor_assement option:selected').val();
        var SubjectID = $('#prosgetsubjectforassement option:selected').val();



           

    $('#loadAssements').html('<div class="text-center p-5"> <span class="spinner-border spinner-border-lg" role="status" aria-hidden="true" style="color:#007ffb;"></span></div>');


    $.ajax({
        type: "POST",
        url: "../../controller/scripts/student/cbt/tari_get_all_student_assesements_settings.php",
        data: {CampusID:CampusID, 
            studentID:studentID, 
            session:session,
             term:term,
            classID:classID,
            SubjectID:SubjectID},
        //cache: false,
        success: function (output) {

            // alert(output);

            $('#loadAssements').html(output);
            
            $(function() {
                $('[data-plugin="knob"]').knob();
            });
        

            
        }
    });

    }

    $(document).ready(function () {

        loadAssements();


              

    });


    $(document).ready(function () {




                var CampusID = $('#header-campusid').val();
                var studentID = $('#user_id').val();
                var classID = $('#prosloadclassfor_assement option:selected').val();

                    $.ajax({
                        type: "POST",
                        url: "../../controller/scripts/student/cbt/prosloadsubjectfor_assement.php",
                        data: {
                                CampusID:CampusID, 
                                studentID:studentID, 
                                classID:classID
                            },
                        //cache: false,
                        success: function (output) {
                               $('#prosgetsubjectforassement').html(output);
                        }

                    });
    });


    $('body').on('click', '#prosload_assementbtn', function () {
        loadAssements();
    });


    $('body').on('change', '#prosloadclassfor_assement', function () {


            var CampusID = $('#header-campusid').val();
            var studentID = $('#user_id').val();
            var classID = $(this).val();
            


            if(classID == '0' || classID == '' || classID == 'NULL')
            {


                $('#prosgetsubjectforassement').html('<option value="NULL">Select class first</option>');

            }else
            {

                   $('#prosgetsubjectforassement').html('<option value="NULL"> loading..</option>');

                    $.ajax({
                        type: "POST",
                        url: "../../controller/scripts/student/cbt/prosloadsubjectfor_assement.php",
                        data: {
                                CampusID:CampusID, 
                                studentID:studentID, 
                                classID:classID
                            },
                        //cache: false,
                        success: function (output) {

                               $('#prosgetsubjectforassement').html(output);


                        }

                    });

            }

    });


</script>