Experiment works locally on psychopy, but I get an error that a variable is undefined when I run it on pavlovia

URL of experiment: entrainment-v3 [PsychoPy]

Description of the problem:
My experiment works as expected on psychopy when running locally. When I pushed it to pavlovia and tried to run it, I get the error that my variable is undefined (seen below). The variable is defined as false in the beginning of my experiment, and if the participant indicates “y”, then the variable should change to True. The experiment does not work if they indicate “y” or “n”. Let me know if any more information is needed!

1 Like

******This is the link to the experiment code

You’ve put should_quit = False in a both component. Try changing it to auto rather than manually adding var on the JS side.

Your Each Frame code should be in End Routine since it is based on what key is pressed than your keyboard component is set to end the routine.

Thank you for your reply! So far I am still getting the same error. Do you know if it matters if I initialise the “should_quit” in begin experiment versus begin routine?

Oh never mind! I have got it working now with this solution. Thank you so much!!

1 Like