Feedback message is not displaying correctly online

URL of the experiment: link
Description of the problem: I have been trying to create a simple experiment which would randomly display 3 pictures (each presented 4 times) and one of the two letters on the left or right side of each picture. Picture and letter presentation should be counterbalanced. Participants are required to press the corresponding key followed by an instant feedback message communicating if their response was correct or not.

The experiment runs smoothly in PsychoPy, but when launched on Pavlovia or in browser pilot mode the feedback message is not always shown correctly. I have been investigating the issue and noticed that when translated to Java script the value of the variable corrAns seem to align with the particular picture and not the letter presented on the screen. As such, when participant presses the right key, it is sometimes registered as incorrect in Pavlovia.

Do you know what might be the problem?
I would be grateful for any suggestions to fix this issue.

2 posts were merged into an existing topic: Skip a routine when two routines both have time limitation

Are you using .pop() in your experiment? It returns a list online and I use code like this to compensate:

if online:
    thisColour=useColours.pop()[0]
    thisCondition=conditions.pop()[0]
else:
    thisColour=useColours.pop()
    thisCondition=conditions.pop()

I have a Both code component which has Python online = False and JS online = true; in Begin Experiment

I have been using the following code for randomization of letters and their positions:

I also have a separate routine and code for the feedback:

I have added online = False and JS online = true in the Begin Experiment, but this did not solve the issue.

It seems to be fine when I click on the link apart from the number of decimal places. Try

msg = "Congratulations! You got it right! RT=" + str(round(resp.rt,3)) + " seconds."

I tried the suggested solution, but, unfortunately, it did not help. When I press the right letter on the keyboard I still sometimes receive the message that my response is not correct.

Here´s the solution I was advised to follow, and it solved the issue.

I removed “let” from the let corrAns = letter_dis.toLowerCase() in the Begin Routine.
Instead, I have added let corrAns in the Begin Experiment.

Now, feedback messages are always displayed properly.

I never write the command let when creating PsychoPy/PsychoJS experiments