PennController for IBEX › Forums › FAQ / Tips › DashedSentence in a PennController trial › Reply To: DashedSentence in a PennController trial
May 28, 2020 at 5:45 pm
#5504
Jeremy
Keymaster
Hi Sander,
If you go back to my first message, you will see that I edited it after introducing the Controller element in PennController 1.7. So you should probably try this:
Sequence( "practice" , rshuffle("trial") ) newTrial("practice", newController("DashedSentence", {s: "This is a practice item so that you know what the task looks like"}) .print() .wait() ) Template( "CSV_Template.csv", row => newTrial( "trial" , newController("DashedSentence", {s: row.Sentence}) .print() .wait() .remove() , newText("CompQ", row.CompQ) .print() , newText("Negative feedback", "Not correct!") , // This is a dirty javascript trick to randomize the answers newScale("result", ...[row.Results1, row.Results2].sort(()=>0.5-Math.random()) ) .labelsPosition("right") .print() // We wait until the participant selects the right answer .wait( getScale("result").test.selected(row.Results1) .failure( getText("Negative feedback").print() ) ) ) )
Jeremy