Reply To: Eye Tracking: Time limit and webcam resolution

PennController for IBEX Forums Support Eye Tracking: Time limit and webcam resolution Reply To: Eye Tracking: Time limit and webcam resolution

#8301
Jeremy
Keymaster

Hi Henrik,

You could use add a Footer to every trial that checks how long it’s been since the experiment started and jumps to a trial that sends the results if it’s been too long:

const start_time = Date.now()

Footer(
    newFunction( ()=>Date.now()-start_time>(20 * 60 * 1000) ) // 20min
        .test.is( true )
        .success( jump("timeout") )
)

Sequence("intro", randomize("trials"), SendResults(), "end", "timeout")

newTrial("intro", newButton("Start the experiment").print().wait() )

newTrial("end", newText("This is the end").print(),newButton().wait() )

newTrial("timeout", 
    newText("You have timed out, we are sending your results to the server").print()
    ,
    SendResults()
    ,
    newText("Your results have been sent, thank you for your participation").print()
    ,
    newButton().wait()
)

Jeremy