PennController for IBEX › Forums › Support › Problems with test.text and selector.add in self-paced reading experiment › Reply To: Problems with test.text and selector.add in self-paced reading experiment
April 6, 2021 at 10:33 am
#6838
mschrumpf
Participant
Hi Jeremy,
thank you very much for your help. It’s those little details that slip through when I’m checking my own code. I have added the missing .wait()
command and a canvas for the selection task. The template looks like this now:
Template( "subco_english_acc2.csv" ,
row => newTrial( "experiment",
newController("DashedSentence", {hideUnderscores: true, display: "dashed", s : row.Sentence})
.print()
.log()
.wait()
.remove()
,
newText("Question", row.Question)
.center()
.print()
,
getText("Question")
.test.text( /\?$/ ) //Previously, this field contained " " and the instructions for failure and success were reversed
.failure( newTimer(500).start().wait())
.success(
newText("AnswerL", row.AnswerL).print()
.after(newText("AnswerR", row.AnswerR).print())
,
newText("F", "<b>F</b>")
,
newText ("J", "<b>J</b>")
,
newCanvas("Canvas", 600, 200)
.add(0, 0, getText("AnswerL"))
.add(400, 0, getText("AnswerR"))
.add(0, 50, getText("F"))
.add(400, 50, getText("J"))
.print()
,
newSelector("Answer")
.add( getText("AnswerL") , getText("AnswerR") )
.keys( "F" , "J" )
.print()
.log()
.wait()
)
)
)
It doesn’t look great, but it works – just in case anyone is faced with a similar problem.
Best regards
Matthias