Problem with code component on pavlovia - no error messages

URL of experiment: https://run.pavlovia.org/CGrove/ebbinghaus_test_version/html

Description of the problem:

I designed this experiment in the builder with the aim to run it online asap. The experiment is almost 100% made using the builder components and conditions files, but there is a code component that is designed to allow participants to resize a circle on the screen using their keyboard.

Basically, the structure is: Ebbinghaus illusion presented for 30s followed by a fixation point (press SPACE to continue), then finally, the participant resizes a green ring using the ‘a’ and ‘b’ keys.

It works fine when I run it offline but when I run the pilot I have had several issues.
Most of these I have managed to resolve using the Python to Javascript crib sheet (e.g. adding event=psychoJS.eventManager to the beginning of the experiment). However, now when I run the experiment, everything works up until you have to resize the circle. The circle appears but when I press ‘a’ or ‘b’ to begin resizing, the image disappears and is replaced by a blank screen until you press SPACE. When this happens there aren’t any error messages and it just continues the experiment as usual. The code component is also supposed to create a column in the data file called ‘size_judgement’, this does appear but the data just says NaN.

There is likely a rookie error that I am making here but I am really struggling to find the source of the problem!

Thanks in advance :slight_smile:

Hi Charlotte!

My guess would be that the code component tries to set the size of the circle to an invalid value. One way you can check this is by logging the size you’re trying to set to the console. See this demo: Thomas Pronk / tutorial_js_console_log · GitLab

Cheers, Thomas