"Manually" ending a trial (and store trial data) #2947
-
I want to use a joystick as input (stimulus categorization by pushing and pulling). As I have not found a plugin, I use a normal html-keyboard response but include the following code in the "on_load" function:
This seems to work: It checks every 100 ms for the joystick position and interrupts the trial (correct 'push' and 'pull' console output). However, it does not record/store any data. I guess with using "jsPsych.finishTrial()" I jump that part specified in the plugin itself. Is there any way to get this to work? I tried with including information I found in the plugin like
But I guess that I cannot access "response" from outside the plugin(?) I appreciate any suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @psyxcience, The I would recommend modifying the plugin and adding joystick input directly to the plugin code. Don't forget to cancel the interval function once you are done with the trial. |
Beta Was this translation helpful? Give feedback.
Hi @psyxcience,
The
finishTrial()
method isn't really intended to be called outside the plugin context. You can do it, but it is likely to create problems.I would recommend modifying the plugin and adding joystick input directly to the plugin code.
Don't forget to cancel the interval function once you are done with the trial.