refreshing countdown timer with timeline sections #2673
-
Hi, I am programming a simple experiment where I would like participants to list all of the "X" they can think of in 3 mins, where X changes in each block (e.g., animals, foods, etc.). I want to display a countdown on the screen for each block and after 3 minutes have passed, I would like the loop to end and move to the next domain (e.g., foods). see screenshot below: I was able to display a timer and make it work with the jsPsych plugins using some of the previous discussion threads. I have two issues:
The experiment is available here for a quick demo. @jodeleeuw any thoughts on this? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Hi @abhilasha-kumar, The timer is starting before the loop because you are setting As for ending the loop using the timer info directly, it should be possible but it will be a little messy. You can call |
Beta Was this translation helpful? Give feedback.
Hi @abhilasha-kumar,
The timer is starting before the loop because you are setting
on_load: countDown()
, which invokes thecountDown
function immediately on page loading due to the()
. You can instead pass the function without calling it, and it should then be called when the plugin loads:on_load: countDown
.As for ending the loop using the timer info directly, it should be possible but it will be a little messy. You can call
jsPsych.finishTrial()
to end the current trial. However, this wasn't designed for use outside of plugins, so calling it won't prevent the plugin from also calling it, especially if the plugin uses some kind of timer mechanism to trigger the call. You therefore might…