Reply To: Side-by-side buttons in a selector that is removed after selection

PennController for IBEX Forums Support Side-by-side buttons in a selector that is removed after selection Reply To: Side-by-side buttons in a selector that is removed after selection

#8280
Jeremy
Keymaster

Hi,

If you haven’t done so yet, I invite you to read the tutorial, more specifically section 5.1.2 which explains how to display elements side by side

A Selector element has no visible content: it just makes some elements that are independently printed onto the page, selectable (by a click, by a keypress, or either). You remove an element by calling remove on that element

Applying these points to your code (and updating it to modern PennController syntax and commands):

Template("practice.csv", variable => 
  newTrial("trial_prac",
    newText("sentence", "<p>testing</p>")
      .center()
      .print()
    ,
    newSelector("position")
    ,
    newCanvas("buttons", 200, 50)
      .add(              0, 0, newButton("XXXX").selector("position") )
      .add("right at 100%", 0, newButton("YYYY").selector("position") )
      .center()
      .print()
    ,
    getSelector("position")
      .shuffle()
      .once()
      .wait()
      .log()
    ,
    getCanvas("buttons").remove()
    ,
    newButton("Next")
    .center()
    .print()
    .wait()
  )
)

Jeremy