URL of experiment:
Description of the problem: Pavlovia
I used “data.importConditions” to read from my files in Psychopy, but when I try to run it online I get the error data not defined. I have seen some solutions where they add some JS code to the beginning of the experiment, but it doesn’t work for me as I use this in 3 different places, and I generate the name of the file randomly in that routine.
To go into more detail, this is the JS code I am referring to:
myData = new TrialHandler({
psychoJS: psychoJS,
nReps: 1, method: TrialHandler.Method.SEQUENTIAL,
extraInfo: expInfo, originPath: undefined,
trialList: ‘conditions.xlsx’,
seed: undefined, name: ‘myData’});
However, I have various trialLists and the names of the files are not ‘conditions.xlsx’
This is my code:
primeCond = randint(0, 2)
fileName = str(primeCond) + 'list.xlsx'
primeList=data.importConditions(fileName)
Thanks!