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;
}
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.