Replies: 8 comments
-
You would need to modify the plugin file to do this. Right now it is set up to be a single button response. The key line is L68 of the button response plugin. That line causes the trial to end when a button is pressed. You could modify the logic inside the after_response function to record the button press and the timing. Then you could end the trial when the video file ends, borrowing the technique from the video plugin: document.getElementById('jspsych-video-player').onended = function(){
end_trial();
} If you are comfortable modifying the video plugin to include this as an option, it would be a great addition to the plugin and I would be eager to add it to the library. |
Beta Was this translation helpful? Give feedback.
-
In the button-response plugin, I've set response_ends_trial to false, and i've set timing_response to the end of the video (manually). I've tried to use an event handler to record the button press but this didn't work. Any idea's on how I could record each button press in L68 of the plugin? |
Beta Was this translation helpful? Give feedback.
-
I would suggest modifying the after_response function. Perhaps create an array to hold the responses, and then push each response onto the array. When the trial ends, you can record the JSON encoding of that array as data for the trial. Sorry that's a bit vague, but hopefully it gets you pointed in the right direction. |
Beta Was this translation helpful? Give feedback.
-
I'm closing this issue, but feel free to continue to use the thread if you have further questions. |
Beta Was this translation helpful? Give feedback.
-
With help we were able to change the button-response plugin to record every button press and rt. I've attached the plugin. Maybe it'll be useful to someone else. |
Beta Was this translation helpful? Give feedback.
-
Hi Josh, |
Beta Was this translation helpful? Give feedback.
-
Hi Cecilie, I don't think there are any more recent developments that will support this. I know @davidjohnbaker1 was doing some work with music and jsPsych. @davidjohnbaker1 do you know of anything that fits this task? Josh |
Beta Was this translation helpful? Give feedback.
-
Thanks Josh, |
Beta Was this translation helpful? Give feedback.
-
Hi Josh,
Is is possible to record the data of all button presses when using the button-response plugin?
My stimulus is a video and participants have to respond several times throughout the video using 2 buttons. I thus need the data of every button that was pressed during the trial.
Is there any way to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions