Stuck at initializing experiment

URL of experiment: https://run.pavlovia.org/HwaMok/testrun-copy

Description of the problem: I do not know why my experiment is stuck on initializing the experiment and after reading the forum I think there is a problem with my code, but I can’t seem to find the problem.

There are 2 codes used in this experiment:
Auto JS

slider proceed

from psychopy import event
slider = slider_1

has_selected_amount = slider.getRating() is not None
space_key_pressed = len(event.getKeys([“space”])) > 0

can_proceed = has_selected_amount and space_key_pressed
if can_proceed:
continueRoutine = False

JS
rating = (slider_1.getRating() * 2);
if (order1) {
msg = trustee shared the money with you, . You:${rating}cents, . Trustee:${rating}cents
;
earning = (earning + rating);
amount = You now have ${earning}cents in total;
} else {
msg = trustee kept all the money, . You:0cents, . Trustee:${rating}cents
;
earning = (earning - (rating / 4));
amount = You now have ${earning}cents in total;
}

Is there any problem with the codes?

I don’t understand the use of the dollar symbols in your code.

If slider proceed is auto translate then it will probably fail due to the import and None doesn’t always translate correctly.

Please take a look at my crib sheet (see pinned post in the online category).

Thank you so much for the crib sheet. I was able to upload it to pavlovia now but I ran into another problem.

When I add this section into my code, for some reason it will skip the trail before selecting or pressing space on the keyboard. However, this works as perfectly fine in psychopy.

That might be related to None translating to null instead of undefined

I would use print / console.log statements to monitor the values of the variables you are using to create can_proceed