File: /var/www/selfanalyse/aptitude-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);
jQ('.quess input[type="radio"]').on('click', function () {
var buttonId = this.id;
var id = parseInt(buttonId.substring(7));
var radioName = 'rd_ans' + id;
if (jQ('input[name=' + radioName + ']:checked').length) {
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).addClass("answered");
var countAnswered = jQ('.answered').length;
jQ('#McountAn').text(countAnswered);
jQ('#pcountA').text(countAnswered);
jQ("#" + removeId).css({ 'background-color': '#00CC00', 'border': '1 px solid #00CC00' });
if ((jQ("#" + removeId).hasClass('not_select'))) {
jQ("#" + removeId).removeClass('not_select');
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
}
}
else {
jQ("#" + removeId).addClass("not_select");
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
}
if ((jQ("#" + removeId).hasClass('tagged'))) {
jQ("#" + removeId).removeClass('tagged');
var taggedQues = jQ('.tagged').length;
jQ('#ppcountTagged').text(taggedQues);
jQ('#McountTagged').text(taggedQues);
jQ("#" + removeId).addClass('attempted_tagged');
toastr["warning"]("Question Attempted and Tagged", "Attempt & Tagged", { 'closeButton': 'true', 'positionClass': 'toast-bottom-right', 'progressBar': 'true' }).show();
jQ("#" + removeId).css({ 'background-color': '#deec17', 'border': '1 px solid #deec17' });
var tagAndAttempQues = jQ('.attempted_tagged').length;
jQ('#ppcountAttempTag').text(tagAndAttempQues);
jQ('#McountAttempTag').text(tagAndAttempQues);
}
});
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;
var radioName = 'rd_ans' + id;
var sec_bound = jQ('#section_bound').val();
var sec_timing = jQ('#sectionalTiming').val();
if (jQ('input[name=' + radioName + ']:checked').length) {
var ques_status = "";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#00CC00', 'border': '1 px solid #00CC00' });
jQ("#" + removeId).removeClass("not_select");
jQ("#" + removeId).removeClass("not_visit");
var notVisited = jQ('.not_visit').length;
jQ('#countNot').text(notVisited);
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
jQ("#" + removeId).addClass("answered");
var countAnswered = jQ('.answered').length;
jQ('#McountAn').text(countAnswered);
jQ('#pcountA').text(countAnswered);
if (jQ("#" + removeId).hasClass('attempted_tagged')) {
var ques_status = "AT";
jQ("#" + removeId).css({ 'background-color': '#deec17', 'border': '1 px solid #deec17' });
}
}
else {
var ques_status = "NA";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': 'rgb(255, 51, 0)', 'border': '1 px solid rgb(255, 51, 0)' });
jQ("#" + removeId).addClass("not_select");
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
jQ("#" + removeId).removeClass("not_visit");
var notVisited = jQ('.not_visit').length;
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
if (jQ("#" + removeId).hasClass('tagged')) {
var ques_status = "T";
jQ("#" + removeId).css({ 'background-color': '#3355b7', 'border': '1 px solid #3355b7' });
}
}
++id;
var nextId = 'ques_' + id;
if (sec_bound == 'SB' && sec_timing == 'Y') {
if (jQ('#tt_pend_q' + id).hasClass('ques_pointer')) {
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);
}
else {
toastr["error"]("Please wait till time complete of this section", "Time Remain", { 'closeButton': 'true', 'positionClass': 'toast-top-left', 'progressBar': 'true' }).show();
}
}
else {
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
{
var removeId = "tt_pend_q" + id;
jQ('#tet_mock_next' + id).css({ 'display': 'none' });
jQ('#tet_mock_next_disable' + id).css({ 'display': 'block' }); // show next disable button
jQ("#" + removeId).removeClass("not_visit");
jQ("#" + removeId).css({ 'background-color': 'rgb(255, 51, 0)', 'border': '1 px solid rgb(255, 51, 0)' });
jQ("#" + removeId).addClass("not_select");
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
var notVisited = jQ('.not_visit').length;
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
}
jsonQues[current_ques].time_taken = timee;
jsonQues[current_ques].tag_status = ques_status;
jsonQues[id].entered_time = timee;
jsonQues[id].time_taken = 0;
});
//-------------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;
var radioName = 'rd_ans' + id;
var sec_bound = jQ('#section_bound').val();
var sec_timing = jQ('#sectionalTiming').val();
if (jQ('input[name=' + radioName + ']:checked').length) // button is checked mark thsi question as attempted
{
var ques_status = "";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#00CC00' });
if (jQ("#" + removeId).hasClass('attempted_tagged')) {
var ques_status = "AT";
jQ("#" + removeId).css({ 'background-color': '#deec17', 'border': '1 px solid #deec17' });
}
}
else {
var ques_status = "NA";
if (jQ("#" + removeId).hasClass('tagged')) {
var ques_status = "T";
jQ("#" + removeId).css({ 'background-color': '#3355b7', 'border': '1 px solid #3355b7' });
}
}
--id;
var prevId = 'ques_' + id;
if (sec_bound == 'SB' && sec_timing == 'Y') {
if (jQ('#tt_pend_q' + id).hasClass('ques_pointer')) {
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);
}
else {
}
}
else {
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
}
jsonQues[id].entered_time = timee;
jsonQues[current_ques].tag_status = ques_status;
jsonQues[id].entered_time = timee;
jsonQues[current_ques].time_taken = timee;
jsonQues[id].time_taken = 0;
});
//-------------END OF PREVIOUS BUTTON CLICK-------------
//------------- clear selection code---------------------
jQ('.tet_clear').on('click', function () {
var buttonId = this.id;
var id = parseInt(buttonId.substring(7));
var radioName = 'rd_ans' + id;
if (jQ('input[name=' + radioName + ']:checked').length) // button is checked mark thsi question as pending
{
var removeId = "tt_pend_q" + id;
var bgcolor = jQ("#" + removeId).css('background-color');
if (bgcolor == "rgb(0, 204, 0)") // check if this element bg color is green then change the color to white
{
jQ("#" + removeId).css({ 'background-color': '#FFFFFF' });
}
jQ("#" + removeId).removeClass("answered");
var countAnswered = jQ('.answered').length;
jQ('#McountAn').text(countAnswered);
jQ('#pcountA').text(countAnswered);
if ((jQ("#" + removeId).hasClass('attempted_tagged'))) {
jQ("#" + removeId).removeClass('attempted_tagged');
jQ("#" + removeId).css({ 'background-color': '#FFFFFF' });
var tagAndAttempQues = jQ('.attempted_tagged').length;
jQ('#ppcountAttempTag').text(tagAndAttempQues);
jQ('#McountAttempTag').text(tagAndAttempQues);
}
toastr["success"]("Option is cleared", "Clear Option", { 'closeButton': 'true', 'positionClass': 'toast-bottom-right', 'progressBar': 'true' }).show();
}
jQ('#' + 'rd_ans1' + id).removeAttr("checked");
jQ('#' + 'rd_ans2' + id).removeAttr("checked");
jQ('#' + 'rd_ans3' + id).removeAttr("checked");
jQ('#' + 'rd_ans4' + id).removeAttr("checked");
jQ('#' + 'rd_ans5' + id).removeAttr("checked");
});
jQ('.tet_tag').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 radioName = 'rd_ans' + id;
if (jQ('input[name=' + radioName + ']:checked').length) {
var ques_status = "AT";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#deec17', 'border': '1 px solid #deec17' });
jQ("#" + removeId).removeClass("not_select");
jQ("#" + removeId).removeClass("not_visit");
jQ("#" + removeId).addClass("attempted_tagged");
var notVisited = jQ('.not_visit').length;
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
var tagAndAttempQues = jQ('.attempted_tagged').length;
jQ('#ppcountAttempTag').text(tagAndAttempQues);
jQ('#McountAttempTag').text(tagAndAttempQues);
toastr["warning"]("Question Attempted and Tagged", "Attempted & Tagged", { 'closeButton': 'true', 'positionClass': 'toast-bottom-right', 'progressBar': 'true' }).show();
}
else {
var ques_status = "T";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#3355b7', 'border': '1 px solid #3355b7' });
jQ("#" + removeId).addClass("not_select");
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
jQ("#" + removeId).removeClass("not_visit");
var notVisited = jQ('.not_visit').length;
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
jQ("#" + removeId).addClass("tagged");
var taggedQues = jQ('.tagged').length;
jQ('#ppcountTagged').text(taggedQues);
jQ('#McountTagged').text(taggedQues);
toastr["info"]("Question is Tagged", "Tagged", { 'closeButton': 'true', 'positionClass': 'toast-bottom-right', 'progressBar': 'true' }).show();
}
++id;
jsonQues[current_ques].time_taken = timee;
jsonQues[current_ques].tag_status = ques_status;
});
jQ('#tt_pend_div').on('click', '.tt_pend_q', function () {
var timee = (document.getElementById("tt_timer").innerHTML).replace(/\s/g, '');
var buttonId = this.id;
var id = parseInt(buttonId.substring(9));
var currentId = jQ("#currentQuestionId").val();
var active_question = currentId;
var currentQuestionId = 'ques_' + currentId;
var radioName = 'rd_ans' + id;
if (jQ('input[name=' + radioName + ']:checked').length) // button is checked mark thsi question as attempted
{
var qid = "Q" + id;
var ques_status = "";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#00CC00' });
if (jQ("#" + removeId).hasClass('attempted_tagged')) {
var ques_status = "AT";
jQ("#" + removeId).css({ 'background-color': '#deec17', 'border': '1 px solid #deec17' });
}
else if (jQ("#" + removeId).hasClass('answered')) {
jQ("#" + removeId).addClass('answered');
var countAnswered = jQ('.answered').length;
jQ('#McountAn').text(countAnswered);
jQ('#pcountA').text(countAnswered);
}
} else {
var ques_status = "NA";
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': 'rgb(255, 51, 0)', 'border': '1 px solid rgb(255, 51, 0)' });
jQ("#" + removeId).removeClass("not_visit");
var notVisited = jQ('.not_visit').length;
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
if (jQ("#" + removeId).hasClass('tagged')) {
var ques_status = "T";
jQ("#" + removeId).css({ 'background-color': '#3355b7', 'border': '1 px solid #3355b7' });
}
jQ("#" + removeId).addClass("not_select");
}
var targetQuestionId = 'ques_' + id;
var next_question = id;
jQ('#' + currentQuestionId).css({ 'display': 'none', 'width': '100%' }); // hide current question
jQ('#' + targetQuestionId).css({ 'display': 'block', 'width': '100%' }); // display target question
jQ("#currentQuestionId").val(id);
var MaxQuestionNo = jQ("#MaxQuestionNo").val();
if (id == 1) // hide the previous button
{
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
}
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
}
jsonQues[active_question].time_taken = timee;
jsonQues[active_question].tag_status = ques_status;
jsonQues[next_question].entered_time = timee;
jsonQues[next_question].time_taken = 0;
});
jQ("#tt_at_q_hd").click(function () {
jQ("#tt_pend_div").slideToggle("slow");
});
jQ('.tt_test_option').on('click', function () {
var buttonId = this.name;
var answer = jQ('#' + this.id).val();
var id = parseInt(buttonId.substring(6));
jsonQues[id].answer = answer;
var removeId = "tt_pend_q" + id;
jQ("#" + removeId).css({ 'background-color': '#00CC00', 'border': '1 px solid #00CC00' });
jQ("#" + removeId).removeClass("not_select");
jQ("#" + removeId).removeClass("not_visit");
var notVisited = jQ('.not_visit').length;
var countNotAnswered = jQ('.not_select').length;
jQ('#McountNotAns').text(countNotAnswered);
jQ('#ppcountNotAns').text(countNotAnswered);
jQ('#countNot').text(notVisited);
jQ('#McountNot').text(notVisited);
jQ('#ppcountNot').text(notVisited);
jQ("#" + removeId).addClass("answered");
var countAnswered = jQ('.answered').length;
jQ('#McountAn').text(countAnswered);
jQ('#pcountA').text(countAnswered);
});
jQ('#fin_ex').on('click', function () {
var timee = (document.getElementById("tt_timer").innerHTML).replace(/\s/g, '');
var url = jQ("#siteUrl").val();
jQ('#t_l').text(timee);
});
});
function saveSubmitTest(idd) {
alert('Submitting your test,Please do not reload this page');
jQ(".sub_test").hide();
jQ("#finish-exit-load").addClass("loading_image");
var test_percent = localStorage.getItem("test_percent");
//if ((idd == 'pending') || view == 'Demo' || (test_percent > 35.00)) {
console.log("In -" + test_percent);
var divs = document.getElementsByClassName("check_id");
for (var i = 0; i < divs.length; i++) {
display = divs[i].style.display;
if (display == 'block') {
// alert(divs[i].getAttribute('id'));
var current_quesID = divs[i].getAttribute('id');
var current_ques = parseInt(current_quesID.substring(5));
//alert(current_ques);
var timee = (document.getElementById("tt_timer").innerHTML).replace(/\s/g, '');
var radioName = 'rd_ans' + current_ques;
if (jQ('input[name=' + radioName + ']:checked').length) // button is checked mark thsi question as attempted
{
var ques_status = "";
} else {
var ques_status = "NA";
}
jsonQues[current_ques].time_taken = timee;
jsonQues[current_ques].tag_status = ques_status;
}
}
var type_mock = idd;
var time_taken_in_seconds = document.getElementById("time_taken").value;
jQ.ajax({
type: "POST",
url: "/aptitude-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) {
localStorage.removeItem("test_percent");
if (item.status == 'success') {
jQ("#finish-exit-load").removeClass("loading_image");
if (item.type_test == 'complete') {
window.location = "/aptitude-test/test-report?testId=" + item.test_taken_id;
}
} else {
jQ("#finish-exit-load").removeClass("loading_image");
}
});
}
});
return false;
//clearInterval(myVar);
//}
// else {
// console.log("Out -" + test_percent);
// toastr["error"]("You have to spend 35% of total time to finish this test", "Not Allowed", { 'closeButton': 'true', 'positionClass': 'toast-top-right', 'progressBar': 'true' }).show();
// jQ(".img_load1").css({ 'display': 'none' })
// console.log(jQ(".img_load1").css({ 'display': 'none' }));
// }
}
//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************ */
/***********************/
var section_bound = document.getElementById("section_bound").value;
var sectionalTiming = document.getElementById("sectionalTiming").value;
//alert(ques_structure);
if (section_bound == 'SB' && sectionalTiming == 'Y') {
localStorage.removeItem("subject_modal");
var getid;
var set_subject;
var first_subject;
var subject_second;
//var hours=0;
var w = 0;
var nextId = document.getElementsByClassName("subject_dash")[1].id;
var arrayOfSubjectIds = jQ.map(jQ(".subject_dash"), function (n, i) {
var sub_id = n.id;
// console.log(sub_id);
var getid = parseInt(sub_id.substring(8));
var subject_time = document.getElementById("first_subject_" + getid).value;
//alert(sub_id+"/"+getid+"/"+subject_time);
var subject_second = (subject_time * 60);
var fxn = function () {
if (i == w) {
var modal_status = localStorage.getItem("subject_modal");
var check_modal = getid+"_1";
if(modal_status != check_modal)
{
clearInterval(SS);
jQ.ajax({
type: "POST",
url: "/aptitude-test/sectional_instruction.php",
dataType: 'html',
data: { "section_id": getid },
success: function (data) {
jQuery('#subjectInstruction').modal('show');
jQ("#instructionModal").html(data);
localStorage.setItem("subject_modal",getid+"_1");
}
});
}
var nextIdd = document.getElementById(nextId);
jQ("#subject_" + getid).nextUntil(nextIdd, ".tt_pend_q").css({ 'pointer-events': 'auto', 'opacity': '1' });
jQ("#subject_" + getid).nextUntil(nextIdd, ".tt_pend_q").addClass("ques_pointer");
jQ("#show_upper_sec_" + getid).css({ 'display': 'block' });
subject_second--;
var date = new Date(null);
date.setSeconds(subject_second); // specify value for SECONDS here
var timeString = date.toISOString().substr(11, 8);
document.getElementById("upper_time_" + getid).innerHTML = timeString;
var s = document.getElementById("subject_1" + getid).value = subject_second;
if (s == 20) {
var subjectName = jQ("#subjectName" + getid).val();
toastr["error"]("Less than 20 seconds left for " + subjectName + " section", "Section Timer", { 'closeButton': 'true', 'positionClass': 'toast-top-left', 'progressBar': 'true' }).show();
}
if (s == 0) {
var time_taken_in_seconds = document.getElementById("time_taken").value;
var url = jQ("#siteUrl").val();
// jQ.ajax({
// type: "POST",
// url: "/aptitude-test/test_save.php",
// dataType: 'json',
// data: { "type": "save", "time_taken_in_seconds": time_taken_in_seconds, "param": jsonQues },
// success: function (data) {
// data.map(function (item) {
// if (item.status == 'success') {
// console.log('save')
// } else {
// }
// });
// }
// });
jQ("#subject_" + getid).nextUntil(nextIdd, ".tt_pend_q").css({ 'pointer-events': 'none', 'opacity': '0.5' });
jQ("#subject_" + getid).nextUntil(nextIdd, ".tt_pend_q").removeClass("ques_pointer");
jQ("#show_upper_sec_" + getid).css({ 'display': 'none' });
var last_topic = jQ(".time_show").last().attr("id");
var last_topic_id = parseInt(last_topic.substring(9));
jQ("#subject_" + last_topic_id).find(".time_show_h4").addClass('bound');
if (jQ("#subject_" + getid).find(".time_show_h4").hasClass('bound')) {
clearInterval(SS);
alert('Time is up. Submitting your test,Please do not reload this page!');
var time_taken_in_seconds = document.getElementById("time_taken").value;
jQ(".sub_test").hide();
jQ.ajax({
type: "POST",
url: "/aptitude-test/test_save.php",
dataType: 'json',
data: { "type": "complete", "time_taken_in_seconds": time_taken_in_seconds, "param": jsonQues },
success: function (data) {
data.map(function (item) {
if (item.status == 'success') {
if (item.type_test == 'complete') {
window.location = "/aptitude-test/test-report?testId=" + item.test_taken_id;
}
} else {
}
});
}
});
}
var jumpsection = jQ("#" + nextId).next().attr("id");
var closeDiv = document.getElementById("currentQuestionId").value;
var openDiv = parseInt(jumpsection.substring(9));
jQ('#ques_' + closeDiv).css({ 'display': 'none', 'width': '100%' }); // hide current question
jQ('#ques_' + openDiv).css({ 'display': 'block', 'width': '100%' }); // display target question
jQ("#currentQuestionId").val(openDiv);
//console.log(jQ("#"+nextId));
w++;
nextId = document.getElementsByClassName("subject_dash")[w + 1].id;
}
}
// w++;
}
var SS = setInterval(fxn, 1000);
//start timer function
var SS;
var timer = function(){
SS = setInterval(fxn,1000);
};
//console.log(fxn);
jQuery("#startTimer").on("click", function() {
clearInterval(SS);
timer();
});
});
}