# Editing Pavlovia Experiments

**URL:** <https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939>\
**Category:** Online experiments\
**Created:** [May 28, 2019, 8:01pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939 "2019-05-28T20:01:14Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [May 28, 2019, 8:01pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/1 "2019-05-28T20:01:14Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [May 29, 2019, 8:17am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/2 "2019-05-29T08:17:42Z")

</div>

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:

> [@Conditional Loop Works in PsychoPy but not on Pavlovia](https://discourse.psychopy.org/t/conditional-loop-works-in-psychopy-but-not-on-pavlovia/7921/3):
>
> Hi @maisonallen, if you have Python code in a code component, you will have to translate the Python code to JavaScript manually. To translate the code, open your code component dialog and select the code type as “Both”, so you can see Python and JavaScript panels on the left and right, respectively. Now you can see the Python code in the left panel, and you can type in the equivalent JavaScript in the right panel. JS is not so different from Python, so translating the code will not be too challe…

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [May 30, 2019, 10:25am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/3 "2019-05-30T10:25:44Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [May 31, 2019, 12:41pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/4 "2019-05-31T12:41:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [May 31, 2019, 2:34pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/5 "2019-05-31T14:34:08Z")

</div>

[https://pavlovia.org/run/MRLab/brazilianfractions/](https://pavlovia.org/run/MRLab/brazilianfractions/)

[https://pavlovia.org/run/MRLab/braziliandecimals/](https://pavlovia.org/run/MRLab/braziliandecimals/)

These throw out 403 forbidden errors.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [May 31, 2019, 3:49pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/6 "2019-05-31T15:49:19Z")

</div>

I think the infinite loop is caused by having the filename as a value in your spreadsheet, creating a [_mise en abyme_ effect](https://en.wikipedia.org/wiki/Mise_en_abyme), 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).

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [June 12, 2019, 8:09am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/7 "2019-06-12T08:09:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 12, 2019, 8:20am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/8 "2019-06-12T08:20:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [June 12, 2019, 8:26am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/9 "2019-06-12T08:26:18Z")

</div>

Where would I find the conditions file?

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [June 12, 2019, 8:28am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/10 "2019-06-12T08:28:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 12, 2019, 8:41am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/11 "2019-06-12T08:41:12Z")

</div>

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](https://www.psychopy.org/online/usingPavlovia.html)).

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

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [June 13, 2019, 6:55pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/12 "2019-06-13T18:55:34Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 13, 2019, 7:16pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/13 "2019-06-13T19:16:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [June 13, 2019, 7:34pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/14 "2019-06-13T19:34:34Z")

</div>

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](https://discourse.psychopy.org/uploads/short-url/rGVCp24yfTPZVnAhfcoExb0fu39.xlsx) (9.5 KB)

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [July 2, 2019, 3:53pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/15 "2019-07-02T15:53:50Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 3, 2019, 9:22am UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/16 "2019-07-03T09:22:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [July 4, 2019, 3:27pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/17 "2019-07-04T15:27:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 4, 2019, 3:37pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/18 "2019-07-04T15:37:01Z")

</div>

@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](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/c/4c408b63d28318d69ce7c53c298bd03419dad5cf.png)

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [July 4, 2019, 4:56pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/19 "2019-07-04T16:56:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![JavanMRLab](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/javanmrlab/32/4866_2.png) [@JavanMRLab](https://discourse.psychopy.org/u/JavanMRLab)\
**Post date:** [July 4, 2019, 5:02pm UTC](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939/20 "2019-07-04T17:02:30Z")

</div>

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.

[Next page](https://discourse.psychopy.org/t/editing-pavlovia-experiments/7939.md?page=2)
