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)

Hello again sir,

So I changed the experiment name and deleted the aforementioned column from the conditions file. The error I have now is * TypeError: Cannot assign to read only property ‘undefined’ of object ‘#’. I am trying to emulate the same fixes across all my experiments but it seems the issue may not be the same among them all, so I have started to try to debug them one by one. Do you have any insight on this issue? (This is with Brazilian Fractions.)

Thank you again if I didn’t say so before.

Hi @JavanMRLab, this error is found because you have an empty column called “fraction_type” in your sheet called Practice_Stimuli_Fractions_brazil.xlsx. There also appears to be a column with no header, you should also remove that column as all columns need a header. You will need to remove these to avoid the error. These errors should not persist in more recent versions of PsychoPy, e.g., 3.1.3. I would also recommend updating to the latest version to avoid encountering errors that have been fixed.

Hello again sir,

So I deleted the extra column “fraction_type”, added a name to the unnamed column and updated to PsychoPy 3.1.3 before I uploaded again and I am still getting the same error. Forgive me for being so repetitive or if I’ve misinterpreted any advice of yours. I truly appreciate your help.

@JavanMRLab, no problem, but the problem has not been fixed. In your Practice_Stimuli_Fractions_brazil.xlsx there is still a column with no header (see below)

image

Forgive me, I actually uploaded a new experiment altogether. I will change the previous one and report back.

So I have the new upload Fractions_Brazil and the old upload BrazilianFractions and both are giving me the same error. I BELIEVE I made the necessary changes.