Reply To: Behavioural task score

PennController for IBEX Forums Support Behavioural task score Reply To: Behavioural task score

#5445
zoe_f
Participant

Hello Jeremy,

Thank you so much for your response. That really does clarify why my .test.pressed wouldn’t be evaluated…there’s no time!

However, I’ve tried implementing this, and the problem is that it still won’t read the .test.pressed line. Here’s my code: I implemented the .callback that you provided, and to narrow down what the problem was, I simplified the test.pressed to test for “F” and print a message when that is done.

Template("recall_practice_stimuli.csv",
    row => 
    newTrial("recall-"+row.block,
    newVar("score", 0).global(), 
    newText(row.item)
        .center()
        .css("font-size", "2em")
	.css("font-family", "verdana")
        .print()
    ,
    newText("instruction", "In which condition did you encounter this word in the experiment? Press the F KEY for INNER, the J KEY for OUTER, and the SPACEBAR for NEW WORD")
        .print()
    ,
    newTimer("window", 5000)
        .start()
    ,
    newKey("question1", "FJ ")
        .log()
        .callback(
            getText(row.item).remove()
            ,
            getText("instruction").remove()
            ,
            getKey("question1")
                .test.pressed("F")
                .success(newText("Good job!").print())
            ,
            getTimer("window").stop()
            )
    ,
    getTimer("window")
        .wait()
    )
    .log(row.item)
    .log(row.Group)
    .log(row.condition)
    .log(row.correctKey)
);

So, the problem is that when I press “F” at the Key Press, it just takes me to the next trial with no ‘Good job!’ output. I must be doing something wrong with the .callback element (I suspect I may be using the Timer element wrong which in turn impacts .callback?); any insight would be appreciated.

Thank you so much for your replies so far!

Best wishes, Zoë