Reply To: Scale feedback and timeout

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

#9891
Mercedes
Participant

Hi! Sorry for the stack replies, but I solved the problem with the correct/incorrect feedback below the scale. Now the issue is that when I implement the timer, the incorrect/correct feedback overlaps with the “Too Slow” message and they both appear together on the same screen.

My idea is that when they press the button on the scale, they will see whether they pressed the correct key or not and then they press the space bar to continue to the next trial. If the timer times out before they select a key, they will get the too slow message and then press the space bar to continue to the next trial. This is my code now:

Template("attention_checks.csv", row =>
    newTrial(row.condition,
        newText("prueba", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>")
            .center()
            .print()
        ,
        newKey("separador_2", " ")
            .callback(getText("prueba").remove())
                .wait()
        ,
        newAudio(row.audio) 
        ,
        newImage("speaker_1", "altavoz.png")
               .print()
               .center()
               .size(250, 200)
        ,
        newTimer("focus",250) 
                .start()
                .wait()
        ,
        getAudio(row.audio) 
                .play() 
                .wait()
        ,
        getImage("speaker_1")
            .remove()
        ,
        newTimer("timer", 7000)
                .start()
                .callback(getScale("acceptability_checks").remove(),
                        newText("lento","<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Muy lento!</p>") .center() .print(),
                        newText("seguir", "<p style=font-family:helvetica>Presione la barra espaciadora para continuar</p>") .center() .print(),
                        newKey("recomenzar", " ")
                        )
                .callback(getText("label_practice") .remove())
        ,
        newText("label_checks", "<p style=font-family:lucilda margin-right:2em>Usá el teclado o el mouse para responder</p>")
            .css("font-size", "0.9em")
            .css("font-style", "italic")
            .css("position", "relative")
            .css("top", "120px")
            .css("font-weight", "100")
            .center()
            .print()
        ,
        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()
                .wait()
        ,
        newVar("score_attention")
            .set(getScale("acceptability_checks"))
        ,
        newVar("check_attention") .set(row.check)
            .test.is("")
            .or(getVar("check_attention").test.is(getVar("score_attention")))
            .success(
                newText("bien", "<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Correcto!</p>")
                    
                    .print()
                    .center()
                ,
                newText("continuar_bien","<p style=font-family:helvetica;color:red padding-bottom: 25px>Presione la barra espaciadora para continuar</p>")
                    
                    .print()
                    .center()
                ,
                newKey(" ") .wait()
                )
            .failure(
                newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>¡Incorrecto!</p>")
                    
                    .print()
                    .center()
                ,
                newText("<p style=font-family:helvetica;color:red padding-bottom: 25px>Presione la barra espaciadora para continuar</p>")
                    
                    .print()
                    .center()
                ,
                newKey("continuar_mal" , " ") .wait()
            
            )
        ,
        getTimer("timer")
                .callback(getText("lento") .remove())
                .callback(getText("seguir") .remove())
                .callback(getKey("recomenzar") .wait())
                .wait("first")    
        )
    .log("group", row.group)
    .log("item", row.item)
    .log("condition", row.condition)
)