Using code elements in PsychoPy, I added a visual feedback for responses (the chosen response flashes blue) and then a 0.5 delay to “force end of routine” so that participants actually see this visual feedback before proceeding to the next question.
I tried it in the two following combinations and it did not work. With the first, the experiment started but my second routine just flashed over and over on the screen, and with the second the experiment failed to successfully initialize.
I also tried it with the correct parentheses (below) but this also doesn’t totally work. The routine does begin but after giving the first response, it does not force the end of the routine and therefore “freezes”.
I was actually making the changed directly into the JS code in Github, but now I’ve gone back to making the changes in PsychoPy. Here’s what my Each Frame looks like now:
I can use the colors as variables, but as the color is now successfully changing I don’t think that is the main issue. The issue now is that the routine is not ending.
I tried
elif t > endTime+.5:
but that also didn’t work.
Should I be replacing
feedback_given = True
with something else?
The following code tries to avoid the issue with undefined only working online. If it fails then just change the first line to if feedback_given == False and key_resp != undefined: