How can I disable the timer from refreshing? | XM Community
Solved

How can I disable the timer from refreshing?

  • 25 September 2018
  • 4 replies
  • 89 views

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
icon

Best answer by SaurabhPujare_Ugam 25 September 2018, 17:42

View original

4 replies

Userlevel 7
Badge +33
Hi Kyle,

You can add all questions in seperate block and can add timer question at start of each block. Doing so you have timer for each of the quiz questions.
https://www.qualtrics.com/support/survey-platform/survey-module/editing-questions/question-types-guide/advanced/timing/



Thanks
Peeyush
Hi Peeyush,

Thanks for your response. I think my original may not have been clear.

The timer counts down from 10 seconds on each questions. The idea is that users can't look up answers to the quiz online.

However, at the moment, I can reset once the timer is close to reaching 0 and it starts at 10 seconds again.

Is there any way to stop this?

Thanks,

Kyle
Userlevel 6
Badge +18
@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.
Thank you @SaurabhPujare_Ugam

Leave a Reply