PennController for IBEX › Forums › FAQ / Tips › Randomly Shuffle Positions of Elements › Reply To: Randomly Shuffle Positions of Elements
September 28, 2022 at 7:27 pm
#8564

Participant
Hi Jeremy,
I’m sorry I’m bugging you with a simple question again. I want to display 3 words in a random order horizontally in one line. When I’m using your trick above, I am losing 1 word and there are no spaces between them. Can I add spaces between and move it down a bit? Do you have any suggestions on how to fix it?
Template("triplets_English_version3.csv", row =>
newTrial("trials",
newText("agent",row.agent).bold().color("red"),
newText("verb",row.verb).bold().color("red"),
newText("patient",row.patient).bold().color("red"),
getText("agent")
.after(getText("verb")
.after(getText("patient")))
.print()
,
newSelector("triads")
.add(getText("agent"),getText("verb"),getText("patient"))
.shuffle()
.disableClicks()
.center()
,
newText("instructions","Please make up a sentence using all 3 words above and type it in the box below"),
newTextInput("answer", "")
.size(400,200)
.center()
.print()
.log()
,
newCanvas("trial_display", 1000, 500)
.add("center at 50%", "middle at 20%", getSelector("triads"))
.add("center at 50%", "middle at 40%", getText("instructions") )
.add("center at 50%", "middle at 65%", getTextInput("answer") )
.print()
,