HEX
Server: Apache/2.4.58 (Ubuntu)
System: Linux ip-172-31-18-78 6.17.0-1017-aws #17~24.04.1-Ubuntu SMP Tue May 26 21:09:53 UTC 2026 aarch64
User: ubuntu (1000)
PHP: 8.2.31
Disabled: NONE
Upload Files
File: //proc/self/cwd/interest-test/tet_assign_question.js
var jQ = jQuery.noConflict();
jQ(document).ready(function () {
    var notVisited = jQ('.not_visit').length;
    jQ('#McountNot').text(notVisited);
    jQ('#ppcountNot').text(notVisited);

    setCountDown();
    //-------------Next button click -----------------
    jQ('.tet_mock_next').on('click', function () {
        var timee = (document.getElementById("tt_timer").innerHTML).replace(/\s/g, '');
        var buttonId = this.id;
        var current_ques = parseInt(buttonId.substring(7));
        var id = parseInt(buttonId.substring(7));
        var prevId = 'ques_' + id;
        
        ++id;
        var nextId = 'ques_' + id;

        jQ('#' + prevId).css({ 'display': 'none', 'width': '100%' });
        jQ('#' + nextId).css({ 'display': 'block', 'width': '100%' });
        jQ('#tet_previous' + id).css({ 'display': 'block' }); // show previous button 
        jQ('#tet_previous_disable' + id).css({ 'display': 'none' }); // show previous button 
        jQ("#currentQuestionId").val(id);



        var MaxQuestionNo = jQ("#MaxQuestionNo").val();
        if (id == MaxQuestionNo) // hide the next button
        {
            jQ('#tet_mock_next' + id).css({ 'display': 'none' });
            jQ('#tet_mock_next_disable' + id).css({ 'display': 'block' }); // show next disable button 
        }
    });
    //-------------End of next  button click -----------------
    //------------ PREVIOUS BUTTON CLICK--------------------
    // previous click
    jQ('.tet_prevoius').on('click', function () {
        var timee = (document.getElementById("tt_timer").innerHTML).replace(/\s/g, '');
        var buttonId = this.id;
        var id = parseInt(buttonId.substring(7));
        var current_ques = parseInt(buttonId.substring(7));
        var curId = 'ques_' + id;

        --id;
        var prevId = 'ques_' + id;


        jQ('#' + curId).css({ 'display': 'none', 'width': '100%' });
        jQ('#' + prevId).css({ 'display': 'block', 'width': '100%' });
        if (id == 1) {
            jQ('#tet_previous' + id).css({ 'display': 'none' });
            jQ('#tet_previous_disable' + id).css({ 'display': 'block' }); // show previous button 
        }
        else {
            jQ('#tet_previous' + id).css({ 'display': 'block' });
            jQ('#tet_previous_disable' + id).css({ 'display': 'none' }); // show previous button 
        }
        jQ("#currentQuestionId").val(id);


        var MaxQuestionNo = jQ("#MaxQuestionNo").val();
        if (id == MaxQuestionNo) // hide the next button
        {
            jQ('#tet_mock_next' + id).css({ 'display': 'none' });
            jQ('#tet_mock_next_disable' + id).css({ 'display': 'block' }); // show next disable button 
        }
    });
    //-------------END OF PREVIOUS BUTTON CLICK-------------

    jQ('.tt_test_option').on('click', function () {

        var buttonId = "'"+this.name+"'";
        var id = parseInt(this.name.substring(7));
        var selected = [];
            jQ.each(jQ("input[name="+buttonId+"]:checked"), function(){            
                selected.push(jQ(this).val());
            });
            
            jsonQues[id].answer = selected.join(",");
            
    });
});
function saveSubmitTest(idd) {

    jQ("#finish-exit-load").addClass("loading_image");
    var type_mock = idd;
    var time_taken_in_seconds = document.getElementById("time_taken").value;
    jQ.ajax({
        type: "POST",
        url: "/interest-test/test_save.php",
        dataType: 'json',
        data: { "type": type_mock, "time_taken_in_seconds": time_taken_in_seconds, "param": jsonQues },
        success: function (data) {
            data.map(function (item) {
                if (item.status == 'success') {
                    jQ("#finish-exit-load").removeClass("loading_image");
                    if (item.type_test == 'complete') {
                        window.location = "/interest-test/test-report?testId=" + item.test_taken_id;
                    }
                } else {
                    jQ("#finish-exit-load").removeClass("loading_image");
                }
            });
        }
    });
    return false;
    //clearInterval(myVar);
}
//var myVar = setInterval(saveSubmitTest, 1200000);
function changeFontSize(target) {
    var demo = document.getElementsByClassName("fontControl");
    var fontSize;
    for (var i = 0; i < demo.length; i++) {
        var computedStyle = window.getComputedStyle
            ? getComputedStyle(demo[i]) // Standards
            : demo[i].currentStyle;     // Old IE
        if (computedStyle) { // This will be true on nearly all browsers
            fontSize = parseFloat(computedStyle && computedStyle.fontSize);
            if (target == document.getElementById("button1")) {
                fontSize += 1;
            } else if (target == document.getElementById("button2")) {
                fontSize -= 1;
            }
            demo[i].style.fontSize = fontSize + "px";
        }
    }
}

jQ(function () {
    jQ('form[onload]').trigger('onload');
});
/********exam timing************ */