Experiment unable to run on Pavlovia

URL of experiment: Pavlovia

Description of the problem:
When I try to run my experiment on Pavlovia, I see the dialog box and then just a blank grey screen and nothing happens.

This is the error message that I get from the Javascript console:
Screenshot 2020-05-05 at 16.03.12

These screenshots show the contents of all my code snippets:
Screenshot 2020-05-05 at 16.26.05 Screenshot 2020-05-05 at 16.26.16 Screenshot 2020-05-05 at 16.26.21

Screenshot 2020-05-05 at 16.26.43 Screenshot 2020-05-05 at 16.26.52

It seems there’s an issue with the images that I’m using?
My experiment has quite a few code components and I was wondering if that may be part of the issue.
How can I solve this?

Thank you in advance!

All of your code appears to by pure Python code. You will need to change each one’s “code type” (the drop-down menu at the top of the window) to auto->JS to make it generate the appropriate JavaScript code (this requires the most recent version of PsychoPy).

There are a couple of things that probably won’t translate very well, at a glance core.Clock will need to be changed to “util.Clock” in the JavaScript, and STARTED will need to be PsychoJS.status.STARTED. @wakecarter has assembled a handy guide to code translation pitfalls here:

1 Like

Thank you for your reply!

I’ve changed everything as suggested/following the linked guide, but I am still getting a blank screen. They study then attempts to save the results and quits after a few seconds.

From psychopy, it seems javascript doesn’t like the continue and break:

How do I fix this?

My updated experiment is here: Pavlovia

Thank you for all your help!

I’ve downloaded it and found a couple of errors.

You can’t define the window colour as black since this happens before black itself gets defined. However, there shouldn't be any problem with [-1.000,-1.000,-1.000]

In the Python use core.clock() not util.Clock()

Equally, Math is just for the Javascript version.

I would recommend you get the experiment working locally and then use my crib sheet to help refine the translations (switching the code components to both so you don’t have to break the Python code in the process).

Best wishes,

Wakefield

1 Like