OS (e.g. Win10): macOS Monterey
PsychoPy version (e.g. 1.84.x): 2022.2.5
**What are you trying to achieve?:**I have 5 different condition files. One those five, “Conditions_x.xlsx”. The other four are “Conditions_y_1”, “Conditions_y_2”, “…3” and “…4”. So for each participant I need one trial to be picked from the “x” file (this file is the same for all participants), and the next from one of the four “y” files, based one the participant number, assigned with Morys-Carter “Participant IDs for Pavlovia” method.
What did you try to make it work?:
In other experiments where I needed to assign only four files based on participant number, it always worked to write this in the Begin Experiment tab of a code component
and then to specify $"Conditions_" + nCond + ".xlsx"
in the loop around the trial routine.
In this case, I tried modifying that approach accordingly, by creating the “typeCond” variable in the Begin Routine tab and assign different value to it based on the current trial being odd or even
and then this in the loop window
What specifically went wrong when you tried that?:
I need to run the experiment online through pavlovia, but it did not work locally either. The error displayed on pavlovia is
I am not a python expert but it seems the problem is typeCond not being defined. I thought it might be because of how I accessed the trial number. I tried different methods with no luck.
If I define it in Begin Experiment with an empty or fake string like typeCond=“hello” the error stays the same only with “Conditions_hello” which of course does not exist, meaning that it does not get reassigned with the Begin routine code.
Stuck on this for quite a while now, any idea is appreciated! Apologies for anything wrong with this post, it’s my first.