Pavlovia Coding Errors

Hello,

I’m posting to ask if I could gain some help with issues that I am experiencing as I am very new to coding. The experiment that I am working on has firstly been created in Psychopy and we have uploaded it to Pavlovia. The issue I am experiencing is that once I pilot the experiment on Pavlovia, it unfortunately gets stuck on a blank page.

The people that I am working with have tried to fix the coding linked to the full experiment multiple times but unfortunately this issue keeps happening and we cannot progress though the experiment or find the errors in the code which can be altered and fixed to allow the experiment to progress.

If I could gain information or to be pointed in the right direction in regard to fixing the errors within the experiments code I would greatly appreciate it. I’ll happily provide more information regarding this issue to clarify it more.

Thank you,

Kyle

Hello

If possible please get the text of the error message from the browser’s developer console (go to view or window → developer to find the console).

Am I right in assuming that the experiment runs without problems offline?

Best wishes Jens

Is the “blank page” a white screen that reads as “initialising experiment” or a 404 file missing error?

If the former this means that there is a syntax error in the compiled JS (in which case please do follow the suggestion by Jens to examine the error message in the console).

Just to check, was the experiment made in psychopy builder + code components (recommended) or was the psychojs code edited independently of the builder file?

Thanks!

Becca

Hello Jens and Becca,

Yes Jens the experiment does run without any issues offline. I have looked at the the console and the error specifically says “Uncaught SyntaxError: Invalid or unexpected token”, this is linked to “js:1939” in the java script code. I will place the code down below.

1938 - ISI = random() * (1.1 - .5) + .500
1939 - ISI = round(ISI, 1) # round to 1 decimal place
1940 - thisExp.addData(‘ISI’, ISI)

Becca, the blank screen is a white screen that says “initialising experiment”. The experiment wasn’t coded independently as it was completely made through psychopy’s builder and code components.

Do let me know if any more information is needed and I’ll gladly provide it!

Thank you for your help on this,

Kyle

Are you use an Auto code component or did you type JS code? I’m noticing that your JS code doesn’t end on semi-colons.

Hello,

I’m using code that has provided to me, unfortunately I do not know if the code has been originally created or typed or if it has been automatically created. So far I am only aware that the experiment itself has been created directly through Psychopy and it has been uploaded directly to Pavlovia.

I am unfortunately extremely new to coding but I will add the semi-colons to see if it will fix the issues I have described previously.

Thank you,

Kyle

Hello Kyle

try to locate the code-component where you enter your ISI-definition. It should look like this

Notice the difference between the left side (Python) and the right side (JavaScript). The right side is auto-translated from PsychoPy when Code Type is set to Auto → JS. PsychoPy writes a JavaScript-file each time you sync (default). This is then uploaded to Pavlovia and executed in your browser. So what you posted looks like Python-script.

Best wishes Jens

2 Likes