psychopy.org | Reference | Downloads | Github

Problem synch the exp with pavlova

Hi everybody,
I think psychoPy and Pavlovia are tricking me this morning. I’ll try to be as concise as possible: coding exp using builder and some code components. I’ve been able to push it online since some days ago (although I successfully added some form components - thank to @wakecarter - which I thought would be a problem).
Now, since a couple of days when I made changes (or don’t) and try to push it online this fatal error occurs (see below). The var I call myRangeFile is used to select a specific number on every trial according to a staircase (i.e. $‘ref15_N’+myRangeFile+’.xlsx’ , it goes and look for the specific xlsx files that are called lets say ref15_N6.xlsx and so on). Ofc I created in the before exp tab a var called myRangeFile on both python and js.
I’ve tried so many things… like starting a new program from scratch, deleting stuff, adding stuff, looking on the internet and crying mostly.
nb the program works on psychopy (if I get rid of the js code components for the forms) but when I push it online this happens:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 829, in findPathsInFile
File “”, line 1, in
NameError: name ‘myRangeFile’ is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1339, in onPavloviaRun
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 759, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 73, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 242, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 214, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 229, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/flow.py”, line 289, in writeFlowSchedulerJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 877, in getResourceFiles
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 843, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/_experiment.py”, line 860, in findPathsInFile
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py”, line 417, in importConditions
IndexError: list index out of range

I’d really really appreciate your help @jon @Becca @wakecarter

Where are you getting myRangeFile?

You could try

print('myRangeFile',myRangeFile)

to see what’s happening in the Browser console.

before the exp I define some var (here is the js:
var myRangeFile, CDOWN, CUP, REFERENCE, ct, maxProbe, minProbe, step;
maxProbe = 33;
minProbe = 4;
REFERENCE = 15;
ct = 0;
CUP = 0;
CDOWN = 0;
step = 3;
myFutureRangeUP = 0;
myFutureRangeDOWN = 0;

here is the code component I use in the js.
ct is the counter, SC is the staircase

ct = Number.parseInt((ct + 1));
randRowN = random.randint(0, 24);
randRow = randRowN.toString();
SCisupN = random.randint(0, 1);
if ((ct === 1)) {
SCisupN = 1;
myRangeUP = maxProbe;
myFutureRangeUP = myRangeUP;
myRangeFile = myFutureRangeUP.toString();
} else {
if ((ct === 2)) {
SCisupN = 0;
myRangeDOWN = minProbe;
myFutureRangeDOWN = myRangeDOWN;
myRangeFile = myFutureRangeDOWN.toString();
} else {
if ((ct > 2)) {
if ((SCisupN === 1)) {
myRangeUP = myFutureRangeUP;
myRangeFile = myRangeUP.toString();
} else {
if ((SCisupN === 0)) {
myRangeDOWN = myFutureRangeDOWN;
myRangeFile = myRangeDOWN.toString();
}
}
}
}
}
SCisup = SCisupN.toString();

not sure it will help.
I see your suggestion although since I can’t push it online not sure the print will work

Did you know that the staircase component doesn’t work online?

Search this forum for more details.

quick update. I delated the .git hidden files and I was able to push it online. hurray!!
but this error occurred:

I guessed it was a matter of not having the lib folder in my project folder. I put it in, I delated the caches, I cried again but nothing solved the problem.

Any kind idea on how to solve this issue now?