Skip to content

refreshing countdown timer with timeline sections #2673

Answered by jodeleeuw
abhilasha-kumar asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @abhilasha-kumar,

The timer is starting before the loop because you are setting on_load: countDown(), which invokes the countDown 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…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@abhilasha-kumar
Comment options

@jodeleeuw
Comment options

@jodeleeuw
Comment options

@abhilasha-kumar
Comment options

@AnneScholz
Comment options

Answer selected by jodeleeuw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants