Reply To: While loop compatability?

PennController for IBEX Forums Support While loop compatability? Reply To: While loop compatability?

#5421
caljones
Participant

Hello,
I am also trying to create a task where if the participant doesn’t respond in a certain amount of time, the task moves onto the next trial. However, the response is a key press, and for some reason my code doesn’t seem to move on after a key press. I’ve attached what I have below, could you tell me what I’m doing wrong?

newTrial("keySelection"
        newImage(variable.ImgFile)
            .size(650,452)
            .print()
       , 
        newKey("FJ")
            .log()
            .wait()
        ,
        newSelector("timeout")
            .add (getKey("FJ"))
            .callback(getTimer("timerout").stop())
        ,
        newTimer("timerout", 2000)
            .start()
            .wait()
        ,
        clear()
        ,
        getSelector("timeout") .test.selected()
            .success(newText(" ") .print())
            .failure(newText("Too slow!") .print())

Thanks,
Callie