Show block for fixed time | XM Community
Skip to main content

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!

There are multiple questions to that effect already answered - from many different angles.
See here, here, here, here, here, or here.


Unfortunately, I searched in the forum and in Google (even before I wrote the question), and was unsuccessful.
If anyone can help, I would be very grateful


Leave a Reply