Conditional Trial Interruption and Repetition Based on Response Time

Hello. I’m in the final stages of developing my task and have encountered a problem. In my trial loop, I have 30 conditions and need to implement an if condition in the code component such that if a participant’s response time exceeds 3 seconds, the current trial should be discontinued and a new trial (of a loop) should begin. Ultimately, after one round of all trials has been conducted (trials loop has 1 Rep), I want to repeat only those trials that were not successfully completed (and the same 3-second condition should apply for those too).

Here’s a snippet of my code:

pythonCopy code

elapsedTime = myClock.getTime()
if elapsedTime > 3.0:  # If your condition to cancel the trial is met
    postponed += 1
    continueRoutine = False  # Stop the current routine

Also, I’m unsure if there’s a way to set all subsequent routines to “False” until the start of the new trial.