Skip to content

Continuously looping a trial for a predetermined duration #1408

Answered by becky-gilbert
awb99cu asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @awb99cu, your approach is totally sensible from a 'normal' programming perspective. The reason this doesn't work is that jsPsych needs to construct the timeline before the experiment starts, so it's not really possible to add new trials onto the timeline array in the way that you've been trying to do here. However, jsPsych provides other ways to change the flow during the experiment, for instance with conditional nodes and looping nodes. I think a looping node would work for what you're trying to do.

Also, note that you'll also need to use a dynamic parameter for the survey-text questions parameter, since this text is determined during the experiment.

Here's one method that might work…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by jodeleeuw
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1399 on January 25, 2021 15:07.