URL of experiment: https://run.pavlovia.org/sxc1127/task_switching_words2/html
Description of the problem:
I am calling an excel file containing info, word stimuli etc… in one of my loops (‘training_loop’).
I am using one of the variables from the file (‘task_tr’) to set some conditions by simply calling it inside the if-statements in the ‘code_for_trials’ routine.
(This routine is inside the loop that calls the excel file)
However, when I pilot the task online I get the error:
"ReferenceError: task_tr is not defined"
And if I try to solve this by initialising the variable at the beginning of the experiment, the error disappears but the variable is not updated according to the values in the excel file (therefore the code does not do what I want)
I find this weird because in a previous version of this task (same code, same psychopy version) I was calling file variables in the same way and everything was working correctly. This time I just edited the if-statements in the ‘code_for_trials’ routine but they should still work similarly. I guess the problem lays there somewhere but I don’t know how to solve it.
Any help would be greatly appreciated. Thank you in advance!