Automatically end block after a fixed time | XM Community
Question

Automatically end block after a fixed time

  • 11 October 2020
  • 0 replies
  • 6 views

Userlevel 2
Badge

Hi everyone,
I want to set up a block with a number of questions (and page breaks), which after exactly 2 minutes will progress to the next block. Regardless of what the subject has accomplished / clicked / performed in that block.
I set a variable in the embedded data: timer1 = 120 and wrote the following code in each question in the block-

Qualtrics.SurveyEngine.addOnload(function()
{
var timer1= parseInt("${e://Field/timer1})");
var timer = setInterval(function(){
if(timer1<=0){
clearInterval(timer);
$('NextButton').click();
}
timer1--;
},1000);
$('NextButton').onclick = function(event){
Qualtrics.SurveyEngine.setEmbeddedData('timer1',timer1);
}
});

And it does not work ...
Can anyone tell me where I went wrong?
many thanks!


0 replies

Be the first to reply!

Leave a Reply