Replies: 2 comments
-
Hi @anshu-97 I'm guessing this is a scoping issue where the One solution would be to add the event handlers using However, because you are modifying I would add something like this: for (var i = 0; i < matrix.length; i++) {
paper.querySelector('#jspsych-spatial-span-grid-button-' + i).addEventListener('click', (e) => recordClick(e.target))
} probably right before var start_time = Date.now(); |
Beta Was this translation helpful? Give feedback.
-
Hi @jodeleeuw Thanks for the quick reply! I implemented the for loop as suggested and while the error was fixed, the
got the function to work as expected! Thanks a lot for the help! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I have been trying to implement an OSpan task using jspsych and recently came across a really helpful repository. However, the original repository includes a lot of custom plugins that make use of the jsPsych 6.0.4 lib. Since I am already implementing various other tasks using the newer 7.2.3 lib, I was hoping to adapt the script to make use of the newer version of jsPsych as well so that I would not have to download both sets of plugins.
While this has mostly been manageable, I have some trouble migrating one of the custom plugins (see below):
In particular, when implementing, I get the error message "Uncaught ReferenceError: recordClick is not defined at HTMLDivElement.onclick (operation_span_task.html:1:1)"
Would greatly appreciate any help on this since we are hoping to implement this task soon 😅
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions