Urgent- thisexp not defined

Please could you show the relevant code component?

Here is a sample. When I sync, I receive the ValueError: stat: path too long for Windows


Those screenshots look fine. What subfolders are there in the folder with your psyexp file?

That looks fine too. Next please could you show me the full error message for when you sync.

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 1344, in onPavloviaSync
self.fileExport(htmlPath=htmlPath)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\builder\builder.py”, line 793, in fileExport
target=“PsychoJS”)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 74, in generateScript
compileScript(infile=exp, version=None, outfile=filename)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 247, in compileScript
_makeTarget(thisExp, outfile, targetOutput)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\scripts\psyexpCompile.py”, line 219, in _makeTarget
script = thisExp.writeScript(outfile, target=targetOutput, modular=True)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 254, in writeScript
self_copy.flow.writeFlowSchedulerJS(script)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment\flow.py”, line 309, in writeFlowSchedulerJS
resourceFiles = set([resource[‘rel’].replace("\", “/”) for resource in self.exp.getResourceFiles()])
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 888, in getResourceFiles
thisFile = getPaths(thisParam.val)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\experiment_experiment.py”, line 815, in getPaths
if os.path.isfile(thisFile[‘abs’]):
File “C:\Program Files\PsychoPy\lib\genericpath.py”, line 30, in isfile
st = os.stat(path)
ValueError: stat: path too long for Windows

I think that the error message may simply be a result of invalid code.

Please could you add me as a Developer on your study (see my crib sheet for how to do this and unprotect the master branch) and also send me your latest psyexp file via private message

Stat path too long can indicate too many nested if statements. I’ll have a go at simplifying your code later.

Yes, I have nested if statements however I do not know how to simplfy because it was so hard for me to even create this one. Your help is much appreciated.

Bests

Sync the experiment.

Then reopen the psyexp file in PsychoPy.

I solved the stat path error by changing from elifs to ifs

That led to a .remove is not a function error so I’ve created a .remove method for JavaScript

Array.prototype.remove = function(value) {
return this.filter(function(ele){
return ele != value;
});
}

(from 9 Ways To Remove 🗑️ Elements From A JavaScript Array 📇[Examples])

The next error is about language5 (which I think is related to not having the latest spreadsheets).

2 Likes

Heyy, thank you so much!!!
Now images are seen like this. They were .jpg format. It was .png before but I changes now the provlem continues

Check which spreadsheet each loop is attached to. While testing I may have pointed loops at old spreadsheets because I didn’t have the new ones.

I updated all the spreadsheets. It works locally

DId it sync? I can’t see the new online version.

Have you used Ctrl-Shift-R or an incognito tab to run the latest version?

Yes. I downloaded your last update and re-created a project. I now added you as a developer. Is there a way to sycn my local file from pavlovia?

No, I did not do that either.

To sync your own (or someone else’s) project to a new local folder, you need to search for the project from Builder and select the local folder. Sync and then reopen the psyexp file.

ok thanks, what about the black images? how am i going to fix them. can it be due to including polygons around each image?

Is the problem that you have a polygon in front of an image? You could try moving the polygon components up so they are drawn first.

polygon does not have fill color. It only frames the image in the background color. I did it to remove lines appearing around the images

Transparent polygons don’t work online.

You can put polygonName.setFillColor(undefined) in Begin Routine (for each of the polygons)

1 Like