Reply To: Compute accuracy for each trial

PennController for IBEX Forums Support Compute accuracy for each trial Reply To: Compute accuracy for each trial

#7239
Jeremy
Keymaster

Hello Aymeric,

I think what you are looking for are test commands, one of which is illustrated in the Stroop task template (line 42)

If you need to report whether the choice was correct as an extra column for every result line of the corresponding trial, you can use a global Var element:

Template( "table.csv" , row =>
  newTrial(
    newVar("correct").global()
    ,
    newText( row.Word ).bold().center().print()
    ,
    newText("F: word ")
        .after(newText(" J: not a word"))
        .center()
        .print()
    ,
    newKey("FJ")
        .log()
        .wait()
        .test.pressed( row.Key )
        .success( getVar("correct").set(1) ) 
        .failure( getVar("correct").set(0) )
  )
  .log( "correct" , getVar("correct") )
)

Sample of table.csv:

Word,Key
Hello,F
Wold,J

I don’t see any general argument for doing it one way or another, just do what’s more convenient for you

Jeremy