Reply To: Timeout and button click conditions

PennController for IBEX Forums Support Timeout and button click conditions Reply To: Timeout and button click conditions

#10835
Jeremy
Keymaster

Hi,

Here’s a bare-bone illustration:

newTrial(
    newScale("first", 7).radio().log().print()
    ,
    newScale("second", 7).radio().log().print()
    ,
    newText("warning").hidden().print()
    ,
    newVar("timed out", false)
    ,
    newTimer("timeout", 10000)
        .callback( 
            getScale("first").disable(),
            getScale("second").disable(),
            getText("warning").text("You need to be faster").visible(),
            getVar("timed out").set(true)
        )
        .start()
    ,
    newButton("Continue")
        .print()
        .wait(
            getVar("timed out").test.is(true)
            .or(
                getScale("first").test.selected()
                .and( getScale("second").test.selected() )
                .failure( getText("warning").text("You need to select all the scales").visible() )
            )
        )
)

As long as you call .log() on the Scale elements, selections will be saved in the results file. If there’s no line for a Scale element, it means no selection was made on it

Jeremy