How can I disable the timer from refreshing? | XM Community
Skip to main content
Solved

How can I disable the timer from refreshing?

  • September 25, 2018
  • 4 replies
  • 141 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

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 original

4 replies

PeeyushBansal
Level 6 ●●●●●●
Forum|alt.badge.img+39
  • Level 6 ●●●●●●
  • 1149 replies
  • September 25, 2018
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

  • Author
  • 2 replies
  • September 25, 2018
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

SaurabhPujare_Ugam
QPN Level 5 ●●●●●
Forum|alt.badge.img+18
  • QPN Level 5 ●●●●●
  • 145 replies
  • Answer
  • September 25, 2018
@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.

  • Author
  • 2 replies
  • September 25, 2018

Leave a Reply