| Reference | Downloads | Github

Reference Error: variable not defined issues

URL of experiment:

Description of the problem:
This is a gambling task in which people choose their preference for one of two gambles. Participants hit either the left or right arrow key to make their choice. In each trial participants are shown a full green or white circle with a value in it on one side and a 50/50 green/white circle on the other, indicating a 100% chance value and a 50/50% chance value respectively. The task runs without issue in PsychoPy on my computer, but when I try to run it on pavlovia it gives an error that the variable is not defined. I;ve had more experienced colleagues look at it and they’ve agreed that the variables are seemingly fine. I’ve seen similar topics in the discourse, but when I try solutions from previous posts it doesn’t resolve this issue. I inherited the task from a previous team member, and am not really familiar with PsychoPy, so it definitely could be that this is a relatively minor issue I’m overlooking, but I’d really appreciate some feedback!
Thank you for your time :grinning:

Please could you give the specific error?

It could be related to colours or because Pavlovia requires some things to be definied at the beginning of the experiment.

Best wishes,


Yes, sorry. I think the specific error is in the circle images. Since the task runs in PsychoPy, I think maybe they have to be defined in a different way for Pavlovia, like you suggest. But I’m not sure how that might be?

Are you using images or polygons. Components or code? If code, Begin Experiment or Begin Routine?

Like I mentioned earlier, I am a novice at using Psychopy and Pavlovia - so I’m not sure what you mean by those questions? I can tell you that if I look at the compiled code from PsychoPy, it is formatted as a “routine” (e.g. “Initialize components for Routine”) but never says “Begin Routine” - does that help isolate what the issue might be? Again, I really appreciate the help!