Making endCurrentTimeline() also end the current trial and move to next timeline/block #2861
Unanswered
vrtliceralde
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hi @vrtliceralde |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm making a letter comparison task where participants have to judge whether two letter strings are the same (BYX---BYX) or different (RTL---RFL). There are multiple blocks of this task, and for each block, participants have 20 seconds to judge as many pairs as they can out of 32 pairs/trials. When the 20 secs are up or when participants judge all 32 pairs before 20 secs are up, the task should move automatically to the next block. To implement this flow, I wrote some code based on suggestions made by @becky-gilbert on this reply. (jsPsych version 6.3).
I lay out a full example at the end for context/reference, but I'm encountering an issue with this set of code in particular.
I'm finding that while this code does make the task move on after 20 sec (yay!), the next block starts on the second trial, instead of the first, and I suspect that it's because of the order of the commands under the
setTimeout
function, i.e., the timeline is ended, and then after it's ended, the code moves on to and "finishes" the next trial, which is in the next timeline/block.I tried to play around the order of these commands but neither satisfied the flow I described earlier: for example, when
finishTrial
is first, the participant gets an extra trial before the current timeline is ended (not good!). The best workaround I've arrived at is to only keepjsPsych.endCurrentTimeline()
, but in this case, when the timeline is ended, the screen is still stuck visually (and maybe internally?) on the very last trial, waiting on the participant's response before it moves on to the next block. So hypothetically, the participant can move on to a trial at 19.9 secs and still be able to respond to it (when they shouldn't be able to!) because the task doesn't move on until they've responded to that trial.I was wondering if I can add anything to my code so that
endCurrentTimeline()
also ends whatever trial the participant is on so that the task moves on visually and internally to the next block---maybe something similar whatfinishTrial
does as described in the docs (in particular, the part about the next trial [in this case, block], if one exists, is started). Also open to other thoughts about how I might achieve the same flow I'm aiming for (i.e., task moves on to next block after 20 seconds or after completing all 32 trials). Thanks a lot!Worked-out example
Beta Was this translation helpful? Give feedback.
All reactions