Reply To: Randomly Shuffle Positions of Elements

PennController for IBEX Forums FAQ / Tips Randomly Shuffle Positions of Elements Reply To: Randomly Shuffle Positions of Elements

#8654
Jeremy
Keymaster

Hi,

This is a bug caused by the embedding of after commands: shuffle will try to move the elements around, but since some are embedded inside other ones, it ends up crashing because of a recursion issue

A workaround consists in printing all three Text elements inside a container Text element:

newText("agent",row.agent).bold().color("red").css("margin-right","0.25em"),
newText("verb",row.verb).bold().color("red").css("margin-right","0.25em"),
newText("patient",row.patient).bold().color("red").css("margin-right","0.25em"),

newText("container", "").css("display","flex").print(),
getText("agent").print(getText("container")),
getText("verb").print(getText("container")),
getText("patient").print(getText("container"))
,

newSelector("triads")

Jeremy