Routine with text box set to certain duration does not continue to next routine

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): 3
Standard Standalone? (y/n): y
**What are you trying to achieve?: I am using a text box to get typed responses from my participants. Additionally the routine includes a text box for instructions. Both components are set to a duration of 30s. It works perfectly fine but it won’t continue to the next routine after the 30s. The routine is part of a loop.

What did you try to make it work?: I tried to use a code saying if t >= 30.0: continueRoutine = False. This didn’t work.

What specifically went wrong when you tried that?: It doesn’t continue to the next routine. There is nor error message.
Include pasted full error message if possible. “That didn’t work” is not enough information.

I hope it is understandable and maybe someone can help me with that. I would be very thankful!

Hello Linda

insert a code-element in the relevant routine. In the Begin Routine tab of the element insert

trialEnd = core.Clock()

In the Each Frame tab insert

if trialEnd.getTime() * 1000 >= 30000.00:
    continueRoutine = False

Best Jens

Thank you!!