psychopy.org | Reference | Downloads | Github

Editing Pavlovia Experiments

Hello,

I am having several problems with uploading experiments to Pavlovia. The experiments I already have up do not reflect the changes I make to the JavaScript file in the html folder of the experiment. Also, when other experiments are ran, they only run correctly until a trial begins, during which an error comes up saying: [insert file name here] is not defined. Any advice?

Hi @JavanMRLab, what is probably happening is that any changes you make to your JS scripts are overwritten by Builder when you sync your files with Pavlovia, because the default settings in Builder will export the JS and html when you click the sync button (thus overwriting your changes). If you wanted to only export the JS manually (i.e., not when you save or sync), you can make these changes in the Export html drop down list in the Online tab of experiment settings. However, I think you would be better off using a code component if you want to add JS code to your experiment:

Ahh, I see, thank you. I’m also having an issue where an experiment I upload does not have it’s html file created at all. The error I’m getting in the Python terminal is “maximum recursion depth exceeded”. Any advice on that?

Ok, not sure what is happening so could you share the link to your project on Pavlovia?

https://pavlovia.org/run/MRLab/brazilianfractions/

https://pavlovia.org/run/MRLab/braziliandecimals/

These throw out 403 forbidden errors.

I think the infinite loop is caused by having the filename as a value in your spreadsheet, creating a mise en abyme effect, where your condition file points to a variable which points to the conditions file, in an infinite loop. Remove the column with the filename, or at least change the value of the filename in the conditions file (e.g., remove the extension).

Where would I be able to implement this change in the code? When I uploaded, the html files for the experiments weren’t created.

You would be better off implementing the change from your conditions file, which is the origin of the error. To fix, you can remove the column with the filename from your conditions file.

Where would I find the conditions file?

Also is the .gitignore file necessary for the experiment to run on pavlovia? On an experiment I manually uploaded the resources for, the link for the test just opens and says “loading the experiment” and never starts.

The conditions files are the excel or csv file that you are using in your loops in Builder. When you have this fixed, you should be able to compile and upload your experiment correctly using the sync button in Builder (see docs).

The .gitignore file is used to set which files/folders Git should ignore. I would leave it where it is.

Thank you for your help so far, I am now able to get the experiments online with the correct html file; however, when ran it says “initializing the experiment…” and does not launch the test.

Ok, would you mind sharing the URL so I can help debug?

I have had a look, and it looks like an issue that was fixed in PsychoPy. You have a psyexp file called FractionsBrailianUpload but you have changed the name of the experiment in the Experiment Settings to SIM2018_Fractions_Experiment. What is currently happening is that you have a JS file called FractionsBrailianUpload.js but your html file is looking for a JS file called SIM2018_Fractions_Experiment.js. We made the fix in recent versions so this could not happen anymore. To fix, you will need to change the name in Experiment Settings to match the filename - FractionsBrailianUpload (or update your version of PsychoPy to 3.1.2).

One more thing, I do not think you have applied the fix I suggested. Please take a look at the conditions file attached. I have fixed the conditions file by removing the column with the filenames in. This is what was causing the recursion error, explained above.

Practice_Stimuli_Fractions_brazil.xlsx (9.5 KB)