Can I make time-based validation? | XM Community
Skip to main content

Hello,
I would like to create a validation option that if the participants answer the question under X minutes, they will have a message that it is too soon and are they sure they would like to continue?
I know I can have timer question so they won't be able to see the continue button before X minutes have passed, but I look for another solution.
Thanks,
Daniel

Here's something that could try:
Qualtrics.SurveyEngine.addOnReady(function () {
    let quest = this,
        all_inputs = quest.questionContainer.querySelectorAll(".type='radio'],ltype='checkbox']");
    all_inputs.forEach((ip) => {
        ip.oninput = function (e) {
            setTimeout(() => {
                // Change the question here
                let check = confirm("Yes or no");
                if (!check) {
                    quest.getSelectedChoices().forEach((ch) => {
                        quest.setChoiceValue(ch, false);
                    });
                }
            }, 100);
        };
    });
    setTimeout(() => {
        all_inputs.forEach((ip) => {
            ip.oninput = function (e) {};
        });
        // Change this to the delay in ms
    }, 6000);
});


https://community.qualtrics.com/XMcommunity/discussion/comment/40437#Comment_40437Hi Ahmed!
How come you know so much? (:
Thanks, I really appreciate it, but the problem is I need something that pop when the participants tries to submit their answers before a certain time period.
This solution is popping when I tried to click on an answer...
Would be great if you know what I could do.


Leave a Reply