Within a block, I have several questions that are presented one at a time in a random order via the Advanced Randomization feature. I am looking to implement a 90-second time limit on the block level. I want the Timer to carry on through all of the questions (i.e. so the Timer does not restart upon each new question). The timer should appear at the middle of the page, right-aligned. Ideally, participants are forced to answer each question before moving to the next one. When the Timer hits 0, it should auto-advance to the next block, even if the current question is unanswered. In addition to the Timer, there should be Reminders. Reminders consist of header texts that periodically appear at the top of the page, left-aligned (at 60, 30, and 15 seconds remaining), and then disappear after 5 seconds.
The Timer and the Reminders are cues for the 90-second deadline. There are 3 cue conditions: No (Reminders and Timer are hidden), Min (Reminders are shown, Timer is hidden), and Full (Reminders and Timer are shown). As such, I need a way to show and hide the Reminders and Timers according to the condition.
Right now, I have a global script placed in the header (Header Script.txt) and
and JavaScript for each question in a block (Question JavaScript.txt).
Header Script.txtQuestion JavaScript.txtAdditionally, I set an embedded variable in the survey flow (timeRemaining = 90), and then display logic for each question (if timeRemaining is greater than 0).
Currently, the questions only display if the display logic is set to: if timeRemaining is Empty. That logically does not make sense based on how the script is written, and I cannot figure out why this is the case.
Additionally, the countdown timer starts at 1:30, but then only counts down to NaN:NaN and I do not know what is causing this error.
Lastly, is it possible to add the Reminder alerts under the Timer so that participants don’t have to click “ok" to continue with the task? I only want the reminders to visually interfere with the task, not physically.
I am very inexperienced with JavaScript, so any assistance is greatly appreciated!
Be the first to reply!
Leave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.