I’ve created a task using the Builder (PsychoPy v2020.1.2) which works fine when tested locally from PsychoPy, but gives me problems when I pilot it online with Pavlovia.
The errors I get are Reference Errors and they involve variables I create with a coding component at the beginning of the experiment.
E.g. ReferenceError: $instr_block1 is not defined
E.g. ReferenceError: $others_tr is not defined
These are variables with value of either 0 or 1 which I use in nReps$ to define whether certain loops should run or not depending on task conditions
Here below is my ‘begin experiment section’ where I define the variables, which will be then modified throughout the task
(initially I specified the variables simply as n = 0; etc… and not as var n = 0; so I tried like this but the problem is still there)
I also attach an example of loop where I use one of these variables:
I’ve seen many posts with reference errors here on the forum but I can’t figure out what my issue is exactly, since I do create these variables at the beginning of my experiment.
I am new to Python and JS (and online testing in general), so I tried to use the Builder components as much as possible and only include these small pieces of simple code.
Thank you, I really appreciate your help!