PennController for IBEX › Forums › Support › Maze task › Reply To: Maze task
July 14, 2020 at 10:30 am
#5795
Keymaster
Hi Susanne,
The Maze controller, being designed for native Ibex, handles feedback the native-Ibex way: it flags a value for the next controller to check. The command failure is a PennController command that is only defined in the context of a .test command, the only test command on a Controller element being the standard printed.
The good news is that you can easily add a custom PennController test command. Add this to your script:
_AddStandardCommands(function(PennEngine){
this.test = {
passed: function(){
return !PennEngine.controllers.running.utils.valuesForNextElement ||
!PennEngine.controllers.running.utils.valuesForNextElement.failed
}
}
});
Then you can do this:
Template("training.csv", row =>
newTrial("training",
newController("Maze", {s: row.Sentence, a: row.Distractor})
.print()
.log()
.wait()
.remove()
.test.passed()
.failure( newText("oops!").print() )
,
newTimer(500).start().wait()
)
)
Jeremy