Collecting non-predetermined-number of keystrokes in 1 "trial" #817
-
Thanks again for the answer on collecting a sequence of keystrokes (#801). I had marked that question as answered, so I don't know if my related question will get seen and therefore I am reposting that question here. The solution of stringing together several html-keyboard-response trials I think (haven't had a chance to try yet) will work well (haven't had a chance to try yet) when the number of keystrokes is known and forced to be a set amount. I am curious how one would manage setting up the trials when the number of keystrokes is not knows (e.g., a word, or to allow the user to make the error of typing too few or too many), with a set key (e.g., ) to end the sequence. I would think there would also be a maximum number of keystrokes allowed (so that they couldn't run on forever). But how would one terminate the set of trials when the terminating keystroke is entered? Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
One way you could set this up would be using a conditional loop: https://www.jspsych.org/overview/timeline/#looping-timelines You could set it up so that, for example, if the key pressed = 32 (spacebar), then continue to a new trial, otherwise keep looping the same trial. |
Beta Was this translation helpful? Give feedback.
-
This also might be a case where a custom plugin is worth writing. I wrote a sort of similar kind of plugin that I described in this answer: |
Beta Was this translation helpful? Give feedback.
-
Thank you, both of you. I'll try the conditional loop and also look at #819. |
Beta Was this translation helpful? Give feedback.
One way you could set this up would be using a conditional loop: https://www.jspsych.org/overview/timeline/#looping-timelines
You could set it up so that, for example, if the key pressed = 32 (spacebar), then continue to a new trial, otherwise keep looping the same trial.