You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, thank you very much for your great works on jsPsych plugins!
I just want to report that response data was not saved in canvas-button-response (both on my local PC and on demo on https://www.jspsych.org/7.0).
The current code:
// add event listeners to buttons
for (var i = 0; i < trial.choices.length; i++) {
display_element
.querySelector("#jspsych-canvas-button-response-button-" + i)
.addEventListener("click", function (e) {
var choice = e.currentTarget;
choice.getAttribute("data-choice"); // don't use dataset for jsdom compatibility
after_response(choice);
});
}
The problem was fixed with the following:
// add event listeners to buttons
for (var i = 0; i < trial.choices.length; i++) {
display_element
.querySelector("#jspsych-canvas-button-response-button-" + i)
.addEventListener("click", function (e) {
var btn_el = e.currentTarget;
var choice = btn_el.getAttribute("data-choice"); // don't use dataset for jsdom compatibility
after_response(choice);
});
}
The text was updated successfully, but these errors were encountered:
Hi, thank you very much for your great works on jsPsych plugins!
I just want to report that response data was not saved in canvas-button-response (both on my local PC and on demo on https://www.jspsych.org/7.0).
The current code:
The problem was fixed with the following:
The text was updated successfully, but these errors were encountered: