skip to end of survey if next button is not chosen within a certain time limit | XM Community
Skip to main content

Hello,
I am hiding the next button and displaying it after a delay successfully using
Qualtrics.SurveyEngine.addOnReady(function() {
$('NextButton').hide();
setTimeout(function() { jQuery("#NextButton").show(); },5000);
});.
I would like the participants to hit the next button within 3 seconds after it appears, otherwise, they will disqualify and the survey should end without them seeing another question. I tried using a timing question with auto-advance after delay option but I cannot auto-advance to the end of the survey, it skips to the next question. I should also be able to note that this participant exited the survey and not finish it. I'll be grateful for any help, thank you.

Search the forum for withdraw from survey. See how that's implemented. You can then configure those triggers along with clicking the next button.


thank you ahmedA ! I found many tips about withdrawal with a button, but I'm trying to do the opposite. The participants should withdraw if they don't respond within 3 seconds. I am trying to make sure that they pay attention to the task, and will disqualify them if they don't watch and press the button when it appears. I tried timing and auto-advance, but somehow I cannot skip to the end of the survey.


Keep the default choice of the withdraw survey question as "No". Then use this JS to select "Yes" if they do not click the next button in 3 seconds.
Qualtrics.SurveyEngine.addOnReady(function () {
    let qc = this;
    qc.questionContainer.hide();
    setTimeout(function () {
        // Assuming your first choice is "Yes". 
        // If the second choice is "Yes" change 0 to 1
        qc.questionContainer.querySelectorAll(".q-radio")0].click();
    }, 8000);
});
Its eight seconds, as you are diaplying the next button after five seconds. Change it accordingly.


thanks a alot @ahmedA ! This worked. I only removed the line
qc.questionContainer.hide() from the code since it was hiding all the questions text, which I didn't want. But this was really helpful, thank you!


Leave a Reply