PsychoPy v2020.2.8, running on MacOS big sur v11.1. Pavlovia run from Google Chrome v87.0.4280.141 (x86_64)
Hello all, I have an experiment I am doing in Builder and that I am subsequently putting online. The issue I am having lies in a variable not being recognized. Before the experiment I define in a code routine in the Begin experiment tab the following:
In python:
listInput = expInfo['participant'] + expInfo['GENDER'] + '.csv'
In JS:
listInput = ((expInfo["participant"] + expInfo["GENDER"]) + ".csv");
Later, in my experimental loop, in conditions I write $listInput. This is so that based on the participant, a different .csv file will be selected. e.g., participant 1m gets 1m.csv and so forth.
This works on Builder great, ONLY when I use the Python code. When I use the JS code, the experiment runs until I get to my experimental loop, and then it crashes and I get the error
trialList=data.importConditions(listInput),
NameError: name 'listInput' is not defined
When I sync the experiment online to pavlovia, same thing, the experiment runs until the experimental loop, then i get the error:
ReferenceError: listInput is not defined
I’ve tried putting the JS code in the Before Experiment, Begin Routine, End Routine tabs of the initializing code routine. I’ve tried adding the code in my experimental loop. The same error every time.
I’ve read on this forum cases of global versus local variable issues in PsychoJS but I haven’t found a solution. Suggestions?
Thank you kindly.