How can I add events to a timeline in progress based upon user responses #3142
-
GoalThis simple demonstration should generate a task using jsPsych that ideally displays two or three screens, depending upon the choices made by the participant. The first event, IssueWhile the QuestionHow could I dynamically add new events, based upon participant responses, in the middle of a jsPsych Timeline?Solutions TriedI initially programmed the task to simply as a
Lastly, I've tried switching to creating a new timeline, pushing to that new timeline, and then using the Example CodeI believe this example should be reproducible and demonstrate my issue. Thanks for your time and effort!
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @wj-mitchell Version 8 will support this way of doing it, but version 7 has limitations on what can be added to the timeline mid-experiment. The recommended approach for version 7 is to use conditional timelines. |
Beta Was this translation helpful? Give feedback.
-
@jodeleeuw 's direction pointed me to a solution for this specific problem. The missing piece was conditional functions, which allow me to add events that either are included or skipped depending upon responses to questions that precede the conditional one on the timeline. See the solution I used below:
|
Beta Was this translation helpful? Give feedback.
Hi @wj-mitchell
Version 8 will support this way of doing it, but version 7 has limitations on what can be added to the timeline mid-experiment.
The recommended approach for version 7 is to use conditional timelines.