Reply To: Get the previous row of a column

PennController for IBEX Forums Support Get the previous row of a column Reply To: Get the previous row of a column

#10747
Jeremy
Keymaster

Hi Larissa,

There are two issues about getText in the code from your message (the same points apply to the “wait” button): first, you use getText("failure") before you even create it, which might cause a reference error for PennController. Second, you print() a Text element named “failure” (which you create at the same time, with newText) upon a click with no text in the input box: calling print() with empty parentheses always has the effect of appending the content of the element (if any) below the most recently print()-ed element; so in your case, the text will appear below the (also just print()-ed) button

What you want is something like this (ignoring CSS for simplicity):

newCanvas("my-canvas", 950,625) //950, 625
  .add(180,160, getText("welcome-researcher-msg"))
  .add(150,210, getText("type-ID-msg"))
  .add(225,240, getTextInput("inputID"))
  .add(320,320, newButton("wait", "START EXPERIMENT 👉"))
  .add(270,350, newText("failure","Please, type your participant's ID above 👆").hidden() )
// ...
getButton("wait")
  .wait( 
    getTextInput("inputID").testNot.text("") 
    .failure( getText("failure").visible() )
  )

Regarding the fullscreen issue, you are not waiting for the button so the browser tries to go fullscreen as soon as the experiment starts, which most browsers won’t allow for security/user-experience concerns

Jeremy