radiobutton_NAFC_page: New radiobutton NAFC page

radiobutton_NAFC_pageR Documentation

New radiobutton NAFC page

Description

Creates a radiobutton n-alternative forced choice page.

Usage

radiobutton_NAFC_page(
  label,
  prompt,
  choices,
  subprompt = "",
  labels = NULL,
  trigger_button_text = "Continue",
  failed_validation_message = "Answer missing!",
  save_answer = TRUE,
  hide_response_ui = FALSE,
  response_ui_id = "response_ui",
  on_complete = NULL,
  admin_ui = NULL
)

Arguments

label

(Character scalar) Label for the current page.

prompt

Prompt to be displayed above the response choices. Can be either a character scalar (e.g. "What is 2 + 2?") or an object of class "shiny.tag", e.g. shiny::tags$p("What is 2 + 2?").

choices

(Character vector) Choices for the participant. If unnamed, then these values will be used both for radiobutton IDs and for radiobutton labels. If named, then values will be used for radiobutton IDs and names will be used for radiobutton labels.

subprompt

(Character scalar) Optional additional text in bold letters below the prompt.

labels

Optional vector of labels for the radiobutton NAFC choices. If not NULL, will overwrite the names of choices. This vector of labels can either be a character vector or a list of Shiny tag objects, e.g. as created by shiny::HTML().

trigger_button_text

(Character scalar) Text for the trigger button.

failed_validation_message

(Character scalar) Text to be displayed when validation fails.

save_answer

(Boolean scalar) Whether or not to save the answer.

hide_response_ui

(Boolean scalar) Whether to begin with the response interface hidden (it can be subsequently made visible through Javascript, using the element ID as set in response_ui_id. See audio_NAFC_page for an example.).

response_ui_id

(Character scalar) HTML ID for the response user interface.

on_complete

Optional function to execute on leaving the page (after successful validation). The argument list should include ..., and any of: state, the participant's state object; answer, the participant's most recent answer; input, the current page's Shiny input object; session, the current Shiny session object; opt, the test's option list as created by test_options().

admin_ui

Optional UI component for the admin panel.


pmcharrison/psychTestR documentation built on Nov. 10, 2024, 9:03 p.m.