Reply To: Scale feedback and timeout

PennController for IBEX Forums Support Scale feedback and timeout Reply To: Scale feedback and timeout

#9901
Jeremy
Keymaster

Hi,

I wrote a simplified version of your trial where I took out some elements for the sake of illustration. The main takeaway is that, since all three scenarios (correct choice, incorrect choice, no choice) end the same way (print “press a key” and wait for a keypress) you don’t have to repeat that sequence of events three times, you can write it just once at the end of the trial instead (you also don’t have to use a Var element to check the value of a column, you can pass it directly to test):

newTrial(row.condition,
    defaultText.center().print()
    ,
    newText("prueba", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>")
    ,
    newTimer("timer", 7000)
    ,
    newScale("acceptability_checks", 7)
            .before(newText("<p style=font-family:lucilda margin-right:2em><i>completamente inaceptable</i></p>"))
            .after(newText("<p style=font-family:lucilda><i>completamente aceptable</i></p>"))
            .callback( getTimer("timer").stop() )
            .button()
            .keys()
            .center()
            .print()
            .log("all")
    ,
    getTimer("timer").start().wait()
    ,
    clear()
    ,
    getScale("acceptability_checks")
        .test.selected()
        .success(
            getScale("acceptability_checks").test.selected(row.check)
                .success( newText("<p style=font-family:helvetica;color:darkgreen padding-bottom: 25px>¡Correcto!</p>") )
                .failure( newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Incorrecto!</p>") )
        )
        .failure( newText("lento","<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Muy lento!</p>") )
    ,
    newText("<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>")
    ,
    newKey(" ").wait()
)
.log("group", row.group)
.log("item", row.item)
.log("condition", row.condition)

Jeremy