Hi Everyone. I’m hoping for some help on a problem that has vexed me for a couple of days now. I am building an experiment to run online using the builder with custom code for presenting stimuli. The experiment will begin with a QUEST staircase to determine the threshold. When piloting in the browser, I’m running into a problem where every time the staircase ends, the experiment freezes though.
The loop with the staircase has three blocks within it:
- Present fixation cross and determine trial parameters (except for level) using a code block
- Present RDK using a custom code component
- Display a text prompt for response and collect response using the keyboard (response is marked as correct or not by the keyboard component).
nReps for the loop are set to 1 and my setup file gives a confidence interval width for stopping the loop. I’ve also tried passing a maxTrials parameter, which hasn’t changed the behaviour below.
The loop runs fine, and the staircase seems to converge. Eventually, the loop freezes on the screen where the fixation cross is presented though. The timing of this and the way that timing changes with change in stop parameters are consistent with the freeze happening when the loop completes.
Debugging is JS is hard, but with print statements, I was able to figure out that the staircase had ended, but the loop hadn’t, so I’ve put in a conditional that sets the coherence of the RDK to a value when level
is undefined. Now I get this error in the console when it hangs:
PsychoJS.js:873 TypeError: Cannot read properties of undefined (reading 'addResponse')
at MultiStairHandler.addResponse (MultiStairHandler.js:149:27)
at Scheduler._currentTask (DPDM_1-Cued_metacognition_exp.js:2949:19)
at Scheduler._runNextTasks (Scheduler.js:225:24)
at async Scheduler._runNextTasks (Scheduler.js:232:13)
at async Scheduler._runNextTasks (Scheduler.js:232:13)
at async update (Scheduler.js:139:18)
It appears that the loop has been marked as complete and I’ve got past the RDK presentation with my conditional, but the keyboard component is still trying to pass the response to the staircase handler. I can’t work out what is different about my case that means this is happening here when it wouldn’t in other experiments though.
I’d be extremely appreciative if anyone has seen this before, or can suggest something I can try to solve it. Here are my system details.
OS: Win11
PsychoPy: 2024.2.4
Standard Standalone Installation? y