I’m having some trouble finding a JS equivalent for the Python code I’m using. I have been using event.clearEvents(‘keyboard’) at the Begin Routine stage in the builder and it is working as intended. I have let the Auto → JS translate the code to event.clearEvents(“keyboard”); however when trying to run the experiment on Pavlovia I receive the following error message:
TypeError: undefined is not an object (evaluating ‘event.clearEvents’)
Would anyone be able to give advice on why this error is occurring?
I’ve added thisExp=psychoJS.experiment; and event=psychoJS.eventManager; to code_JS and also changed event.clearEvents(‘keyboard’) to event.clearEvents() which has resolved the error, thanks!
I’m now having an issue recognising a correct/incorrect response. I have set feedback to display whether the participant’s response was correct or incorrect, however it keeps only displaying ‘incorrect’ on Pavlovia. I am using auto>JS to turn