Problem displaying 'Too late' feedback online

URL of experiment:

Description of the problem: I’m trying to have the routine ‘Too late’ showing up when no response is given. In the Python code, I used the following code component in ‘Begin Routine’ of my ‘Too late’ routine:

key_press = response.keys
if response.keys: # if the list contains at least one entry,
    continueRoutine = False # don't show this feedback routine

And so I translated it as follows under ‘in each frame’ for JS:

key_press = response.keys;
continueRoutine= true;
if (!(key_press === undefined)) {
    continueRoutine = false;

The feedback runs perfectly in the builder - but online, once I have in one trial omitted to answer, all the following trials show up the ‘Too late!’ feedback. I’ve been looking around for a solution to this, but haven’t found any. I think it probably has to do with the fact that continueRoutine is for some reason not ‘refreshed’ to false…?
Any help is much appreciated!
Ps.: the key_press was in the beginning just to check how key_press was saved.

Hi There,

That code looks pretty good to me. This demo works online and offline and is very similar to what you need (you could set thisTxt to be ’ ’ if a response is made). tooLate.psyexp (7.9 KB)

Hopefully this could work as a solution,

1 Like