The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
function activate(f){
if (timeLeft > 0 && confirm('You still have some time, do you want to stay?')) return false;
for( var i=0; i < f.elements.length; ++i) {
f.elements[i].disabled=false;
}
return true;
}
and have
var minutes = 15;
var timeLeft = minutes*60*1000;
var tId = "";
var leave = "";
function countdown() { timeLeft -= 1000; }
window.onload=function() {
leave = setTimeout("nextPage()", timeLeft);
tId = setInterval('countdown()',1000)
}
instead of
window.onload=init;
function init(){
var minutes=(15);
setTimeout("nextPage()", 1000*60*minutes );
}
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
the script was kindly suggested by hielo and working perfectly.
When the time out is paused after submit button is clicked and the user is given the chance to go back and use the remaining time to check the answers, the submit command should not be activated, unless the user decides to reject the 'go back' option t (i.e. decides not to go back to the test page from the alert message, but to continue to the next page). If the user chooses to go back to the current test, the submit command should then only be activated if:
1- timeout occurs (whole 15 minutes)
2- User again clicks the submit button and there are now less than say, 4 minutes remaining for the test.