Reply To: Response time limit

PennController for IBEX Forums Support Response time limit Reply To: Response time limit

#8655
mwf2120
Participant

Hi! How would I adapt the code if I want participants to have up to three seconds to select the spacebar (and log when they do so) but if they hit the spacebar before those three seconds, they move on to the next trial and nothing is logged. Any tips for adapting my code?

newTrial("SorF",
    newText("Stranger","<p><strong>Stranger</strong></p>")
        .css("font-size", "2.5em")
        .css("text-align", "center")
        .settings.center()
        .print("center at 50%", "bottom at 50%")
    ,
    newTimer("Timer0",1000).start()
        .wait()
        .settings.center()
        .print()
    ,
    getText("Stranger")
        .remove()
    ,
    newImage("Focus", "Focus_Point.jpg")
        .center()
        .settings.center()
        .print("middle at 50%", "bottom at 50%")
    ,
    newTimer("Timer1",5000).start()
    .wait()
    ,
    getImage("Focus")
        .remove()
    ,
    newVideo("three", "CID_3.mp4")
        .size("70vw", "auto")
        .settings.center()
        .print("middle at 50%", "middle at 50%")
        .play()
        .disable(0.01)
    ,
    newKey("space")
        .wait()
)