A psychTestR page that gets the participant to enter their ID.

get_p_id(
  prompt = "Please enter your participant ID.",
  placeholder = "e.g. 10492817",
  button_text = "Next",
  width = "300px",
  validate = "auto",
  admin_ui = NULL
)

Arguments

prompt

Prompt to display (character scalar or Shiny tag object)

placeholder

Placeholder text for the text box (character scalar).

button_text

Text for the submit button (character scalar).

width

Width of the text box (character scalar, should be valid HTML).

validate

Optional validation function. The argument list should include ..., and any of: answer, the participant's most recent answer; state, the participant's state object; input, the current page's Shiny input object; opt, the test's option list as created by test_options(); session, the current Shiny session object. It should return TRUE for a successful validation; for an unsuccessful validation, it should return either FALSE or a character scalar error message. If validation fails then the page will be refreshed, usually to give the user a chance to revise their input.

admin_ui

Optional UI component for the admin panel.

Note

Participant IDs must be between 1 and 100 characters long, and solely comprise alphanumeric characters and underscores.