Error Codes when running with Pavlovia

OS (e.g. Win10): Windows 10 Enterprise
PsychoPy version (e.g. 1.84.x): 3.2.3
Standard Standalone? (y/n) If not then what?: y
**What are you trying to achieve?:

I’m working on a project that among others asks participants to chose a value between 0-40 on rating scales in several different trial conditions.
I used a project that had been created with an old version of Psychopy (1.90.3) and opened it in the new version (3.2.3) of Psychopy.The project is running fine in the builder, but whenever I upload it on Pavlovia, all I can see is the intro part of the project until I get to the routine that includes rating scales.
I then opened a new Psychopy file, recreated only one rating scale and uploaded it on Pavlovia to see whether it can open it, which it couldn’t.
So my first question is regarding the rating scales: what needs to change for the rating scales to work on Pavlovia?

The second option I tried was using range sliders instead that seem to at least open up in Pavlovia, but since the current value of the scale has to be shown to the participants a code had been added, in which we called the
beginning of the experiment: aktuell1 = ‘haha’ and
each frame: aktuell1 = slider.getRating()
Another text was created with the content ‘$aktuell1’. This way we can see the current value of the scale above it. This again works fine in the builder, but when being uploaded in Pavlovia, I receive the error message: “aktuell1 not defined.”

The project will run properly once the problem with the rating scales/range sliders is fixed. What can be done at this stage?

Hi @rebecca.shane

If your task is using Rating Scale components, these will not run in the online tasks because they have been superseded by the Slider component.

Regarding the coding, have you added the code to the JavaScript coding panel? If you open your code component, and select code type as “both”, you need to manually translate your python code (left panel) to JS (right panel).

Hi @dvbridges thank you for the quick reply! I will be using the Sliders then and try to create the Javascript code. Since I’m new to Java and writing codes, is there maybe a helpful guideline on psychopy that can help me writing it?

The PsychoJS library tries to match the PsychoPy library e.g., the calls to slider.getRating() are identical. Other language specific things, such as how to write an if statement, differ but not too greatly e.g., :

# Python
if slider.getRating() == 1:
    # Do something

// JavaScript
if ( slider.getRating() === 1 ) {
    // Do something

You can google these things when you get stuck, or ask on the forum. Also, in the future the code conversion in your code components will be automated.

@dvbridges: Thank you so much for your help!