URL of experiment: Pavlovia
Git: https://gitlab.pavlovia.org/knfernandez/risky-gambles/blob/master/gambleTask.js
Description of the problem:
When I add a keyboard response that does not force the end of a routine in the builder, I receive the following error:
- TypeError: gmKR.stop is not a function
That code refers to this block here:
return function () {
//------Ending Routine 'gamTrial'-------
for (const thisComponent of gamTrialComponents) {
if (typeof thisComponent.setAutoDraw === 'function') {
thisComponent.setAutoDraw(false);
}
}
psychoJS.experiment.addData('gmKR.keys', gmKR.keys);
if (typeof gmKR.keys !== 'undefined') { // we had a response
psychoJS.experiment.addData('gmKR.rt', gmKR.rt);
}
gmKR.stop();
return Scheduler.Event.NEXT;
};
}
I have a keyboard response (also created with the Bulider) before this keyboard response, so it does not appear that there is a problem with keyboard components in general. But, it seems related to the key press not ending the routine/ allowing a window of time to respond.
Things I have tried:
-Updating to the newest version of PsychoPy.
-Deleting and re-adding the keyboard component
-Switching between using duration or time to end the key response window
-Editing the code in the code element that refers to the keyboard response.
For this last item, I thought perhaps I was referencing the keyboard responses to display an image incorrectly (perhaps the proper syntax had been updated) but all of those changes only resulted in other errors.
I did notice in the js code, however, that routineTimer.reset() does not follow after gmKR.stop; is it possible that this is creating the error? How would I fix this while still being able to use the Builder? Since the Builder is “creating the code” where Pavlovia is pointing to an error, I am not sure what else I can try.