How to use attribute data outputted by a plugin to create conditional logic in the timeline? #2985
-
Hi all, I'm trying to create conditional logic in my timeline by having people complete a task multiple times only if, after each time they do it, they indicate that they would like to repeat said task. The task—or the plugin which instantiates it—is called What I'm struggling with is how I can use the I think this is fundamentally actually just an issue of trying to access the data from the last plugin trial outside of a plugin and set it as a variable—I've included the bare minimum of my code because it's quite long, but please lmk if you require more context. Thanks in advance for all the help!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I have created a minimal example of what I think you want to achieve using only the jsPsychHtmlButtonResponse components. It is based on the concept of condition timelines.. The basic idea is that you have two trials,
let me know if this is what you need! |
Beta Was this translation helpful? Give feedback.
I have created a minimal example of what I think you want to achieve using only the jsPsychHtmlButtonResponse components. It is based on the concept of condition timelines..
The basic idea is that you have two trials,
select
andcontinue_trial
, which can in principle occur 8 times across 4 blocks. These two trials are added in a timeline toblockTrial
. This trial has a conditional function, which is executed right before the start of its corresponding timeline. The timeline will only be executed if this function returns true. This should happen on the first trial of a block, or if the response to the last question was to read more opinions. This function needs thecurrentBlockTrial
variab…