Delay on response before moving to next trial #1909
-
Hi there, It feels like I'm overlooking something simple here but I figured I'd just ask. I'm building a decision-making task where the participant has to choose between two images in each trial, using The animation is completely controlled in CSS - I just need a 1s delay from the moment the button is pressed until Cheers! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @rayoverweij, this should be pretty straightforward if you don't mind editing the plugin file. If I understand correctly, then I think what you want to do is insert a delay between the response and the end of the trial. You can do that by editing the jsPsych/plugins/jspsych-html-button-response.js Lines 146 to 148 in 7b16a1d So you can insert a delay between the response and the end of the trial here using a if (trial.response_ends_trial) {
// after the participant responds, wait 1000 ms, then call the end_trial function
jsPsych.pluginAPI.setTimeout(function() {
end_trial();
}, 1000);
} Does this work for you? |
Beta Was this translation helpful? Give feedback.
Hi @rayoverweij, this should be pretty straightforward if you don't mind editing the plugin file. If I understand correctly, then I think what you want to do is insert a delay between the response and the end of the trial. You can do that by editing the
after_response
function in the plugin. Specifically, this bit of code checks to see whether the trial should end after a response, and if so, then it immediately ends the trial:jsPsych/plugins/jspsych-html-button-response.js
Lines 146 to 148 in 7b16a1d
So you can insert a delay between the response and the end of the trial here using a
setTimeout
timer. I recommen…