Change broken selection in enable_button_after parameter

The button class was not being selected correctly resulting in a broken enable_button_after parameter
This commit is contained in:
levigoldberg 2024-07-29 10:25:23 +02:00 committed by GitHub
parent 2b1f93d232
commit 923057049e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -201,12 +201,12 @@ class HtmlButtonResponsePlugin implements JsPsychPlugin<Info> {
// disable all the buttons and set a timeout that enables them after a specified delay if timing is set
if (trial.enable_button_after > 0) {
var btns = document.querySelectorAll(".jspsych-html-button-response-button button");
var btns = document.querySelectorAll("#jspsych-html-button-response-btngroup button");
for (var i = 0; i < btns.length; i++) {
btns[i].setAttribute("disabled", "disabled");
}
this.jsPsych.pluginAPI.setTimeout(() => {
var btns = document.querySelectorAll(".jspsych-html-button-response-button button");
var btns = document.querySelectorAll("#jspsych-html-button-response-btngroup button");
for (var i = 0; i < btns.length; i++) {
btns[i].removeAttribute("disabled");
}