Solved
How can I disable the timer from refreshing?
Hi,
I am trying to run a short quiz style survey. The quiz contains ten questions with a 10 second countdown timer on each question. I want respondents to proceed to the next page / question once the time runs out.
However, respondents can refresh the page and the timer appears to reset. Is there any way to either:
- Set the timer to continue from the same point after refresh?
- Disable the refresh option on the page to prevent this?
Either of the above would solve the problem.
Any help would be much appreciated.
Kyle
Best answer by SaurabhPujare_Ugam
@Kyle1878 ,
Hope this helps,
Qualtrics.SurveyEngine.addOnReady(function()
{
/*Place your JavaScript here to run when the page is fully displayed*/
document.onkeydown = function()
{
switch (event.keyCode)
{
case 116 : //F5 button
event.returnValue = false;
event.keyCode = 0;
return false;
case 82 : //R button
if (event.ctrlKey)
{
event.returnValue = false;
event.keyCode = 0;
return false;
}
}
}
window.oncontextmenu = function () {
console.log("Right Click Disabled");
return false;
}
});
Above mentioned code may still stop the user from Refreshing the page using F5, ctrl-R and right click.
However, It is not possible to completely stop user from Refreshing the page.
View originalLeave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.