Hide multiple choice options until after 10 seconds | XM Community
Skip to main content

Hey! 

Im trying to hide multiple choice options for about 10 seconds and then show response options - to allow that people are properly watching the videos before answering! 

I was able to hide the multiple choice options using this code:

 const quest = this;
    const qc = quest.questionContainer;
    const video = qc.querySelector("#videoName");
    const choices = qc.querySelector(".QuestionBody");


    // quest.hideNextButton();


    choices.style.display = "none";
    video.onended = () => {
        choices.style.display = "";
        // quest.showNextButton();
    };

But since my videos need to be autolooped - it will just never show the options! Is there a way to alter this code so it goes by a time limit instead?

 

Cheers!

Hi @DP1234567 

You can try it with the setTimeout function

setTimeout(() => {

        choices.style.display = "";

    }, 10000);


For more info about this code: setTimeout() globale functie - Web-API's | MDN (mozilla.org)

 


@RickB you are my hero thank you so so much!!


Leave a Reply