Accessing jsPsych.timelineVariable() in the condition function

50 views
Skip to first unread message

Clara Kuper

unread,
Jul 29, 2021, 8:49:28 AM7/29/21
to jsPsych
Hello everyone, 

I am currently programming an experiment where I want to repeat specific trials in a random order at the end of the timeline. 
I have trial and feedback sections (both handled in separate plugins), and I collect them in a common timeline with a loop function. This timeline repeats until all trials were successfully completed. If after one iteration of the timeline some trials were not completed, I don't want to repeat all trials, but only those that were not completed. I keep a list of IDs of all trials that have to be repeated. What I wanted to do is use the conditional_function() to check before each trial if the trial ID is in my list. The trial ID is saved as a timeline variable. 
The problem is the following:
It seems that in the conditional function, I don't have access to the timeline variables of the next trial - only to those from the last trial. (I tried calling jsPsych.timelineVariable('ID', true) - undefined - and jsPsych.currentTrial() -returns the last trial-).

How can I check a timeline variable of the upcoming trial in the conditional_function()? 

Thanks for your help!
Clara
Reply all
Reply to author
Forward
0 new messages