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
)
Prompt to display (character scalar or Shiny tag object)
Placeholder text for the text box (character scalar).
Text for the submit button (character scalar).
Width of the text box (character scalar, should be valid HTML).
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.
Optional UI component for the admin panel.
Participant IDs must be between 1 and 100 characters long, and solely comprise alphanumeric characters and underscores.