psychopy.org | Reference | Downloads | Github

ReferenceError: thisExp is not defined and other missed characteristics

URL of experiment: https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/

Description of the problem:
Hi everybody,

I’m a beginner with Psychopy and Pavlovia. I’m having some troubles. My experiment is a modification of OpenIAT (https://gitlab.pavlovia.org/demos/openiat). Locally is working ok, but when I try in Pavlovia this happens:

Unfortunately we encountered the following error:

  • ReferenceError: thisExp is not defined

Try to run the experiment again. If the error persists, contact the experiment designer.

I have checked the JavaScript code and it seems to be defined (I’m a beginner)

Also, the instructions are not “centred” as the local version and my “plate stimulus” is disappeared, (I’m using two images overlapped).

I’ve tried the exp in the version of PsychoPy v2020 1.3 and now in 2.4 (always Windows and Firefox)

Url: https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/

Thank you for your help!

Hi!

You have to change the JS-code from thisExp.addData to psychoJS.experiment.addData in your code snippets.

Hi D3njo,

Thank you for your reply. I did as you said but I have the same error.

Ok, it seems that it worked, BUT…
now I have another problem:

Unfortunately we encountered the following error:

  • TypeError: this is undefined

Try to run the experiment again. If the error persists, contact the experiment designer.

It happens after the third slide of instructions when it should stard the experiment.

At least now (I don’t know way, but it changed) the instructions are presented as they were in the local version.