Reply To: timeout and skip to next task

PennController for IBEX Forums Support timeout and skip to next task Reply To: timeout and skip to next task



Let me know whether I understood your design correctly: you have a first block of trials labeled task_A and a second block of trials labeled task_B. In case your participant takes more than 4 minutes completing the first block (task_A) you want to prematurely end whichever trial the participant is currently on and skip all the remaining task_A trials, and jump directly to the first task_B trial.

What you can do to that end is set a global Var element before starting block task_A to a timecode corresponding to four minutes later. Then at the beginning of each trial of block task_A, you look up the current timecode and skip the trial if it’s over the timecode from the global Var element. Otherwise, you launch a Timer element that will check again later and either end the trial prematurely or re-launch itself.

Here is an example:

newTrial("pre_task_A", newVar("four_minutes_later").global().set(v=>*60*1000) )

Template( row => newTrial( "task_A" ,
        newTimer("check_end", 100).callback(
                .success( end() )
                .failure( getTimer("check_end").start() )
        newText("Task A").print(),
) )

Template( row => newTrial( "task_B" ,
    newText("Task B").print(),
) )

Let me know if you have any questions