How to dynamically manipulate timing of trials with undefined end time

I am building an experiment on PsychoJS. The gist of the task is that participants will be asked to answer trivia questions either in a timed condition or an untimed condition. Across both conditions, I have implemented a time delay for their answer (e.g., keypress advance does not until 2s after the trial has begun). This is to ensure participants do not accidentally (or intentionally) advance through multiple questions.

In the timed condition, participants are given a variable amount of time to complete the questions, which I am setting using a conditions file. This is working as intended with elements utilizing

Start [time (s)] 2; Stop [time (s)] allowedTime (variable in the conditions file)

For the untimed condition, I have tried to set allowedTime to an empty string, 0, or null, but none of these methods work. Instead, the trials are simply not showing up. I thought I remembered that to prevent auto-advancing trials, you should leave the section for Stop blank (and possibly to use duration (s) instead of time (s), but I wasn’t sure how to dynamically do this given that participants can be randomized into the timed/untimed conditions.

Any thoughts are appreciated!

Hello, I have since solved this issue.

Essentially, for elements within routines that you do not want to expire in PsychoJS, you can set the variable that is used in the Stop box to the JavaScript keyword Infinity.

Hope this helps someone!