Experiment freezes at incorrect response

I am learning PsychoPy right now as a hobby. I was given an experiment by a senior to replicate to aid in my learning. In the trial section of this experiment, the user needs to press the left arrow key when an X appears on the screen, and the right arrow key when an O appears. Moreover, in some trial cases, a green circle appears above these letters, upon which the user should not press any key. 24 such trial cases run.

The experiment that I have built so far works fine when the user presses the correct key. Upon pressing an incorrect key, the experiment freezes and does not end even with the esc key. It only ends upon pressing cmd + opt + esc.

Here’s the experiment: final_test_esst.psyexp - Google Drive

Any help is much appreciated!

Hello jolly_dock

We cannot run the experiment with the stimuli. You use a lot of code for rather trivial things, keeping track of the number of trials, storing information in the result file, importing libraries, importing them again and again. A lot of these things are done automatically by the Builder.

So your experiment is difficult to debug at the moment because we don’t have the stimuli, and your code is difficult to debug because of the manual coding. You might want to create a simple version of your experiment that gives you the same error, stripped of all the bells and whistles that are currently implemented.

Best wishes Jens