Timed custom message | XM Community
Solved

Timed custom message

  • 13 March 2018
  • 7 replies
  • 45 views

Does anyone know if there is a way to set up a timer so that the respondent gets a message after X minutes spent on a question? I have a question that auto advances after 20 minutes but I'd like to be able to have a message pop up after 15 minutes telling them they have 5 minutes left. Thanks!
icon

Best answer by AnthonyR 13 March 2018, 21:44

View original

7 replies

Userlevel 7
Badge +27
Yes, you can use a JavaScript with a setTimeout function to unhide a hidden <div> in your question text.
Thanks so much Tom! I'm completely new to coding and trying to set this up. Would you be able to actually show me how the code should be written?
Userlevel 7
Badge +7
Assuming you actually want a popup, you could use an alert instead of unhiding a div. Add the following to the addOnReady section of the javascript for this question.

setTimeout(function(){
alert("This is your message");
}, 900000); //900000 ms is 900 seconds or 15 minutes
Thanks so much Anthony. This works great. Only problem is that after I click 'close', the alert message appears a second time. So a respondent would have to close it twice. Do you know why that might be?
Userlevel 7
Badge +7
> @ylit said:
> Thanks so much Anthony. This works great. Only problem is that after I click 'close', the alert message appears a second time. So a respondent would have to close it twice. Do you know why that might be?

This is because of the mobile preview, if you view a non-preview link, you will see it is not a problem!
Wow, yes, that worked! Thanks so very much!

I added this JS and it worked BEAUTIFULLY online. However, when I deploy the survey on the offline Qualtrics App, I no longer see the pop-up. Is there a way to fix that? Thank you!!!

Leave a Reply