Creates HTML code for n-alternative forced-choice response options.

make_ui_NAFC(
  choices,
  labels = NULL,
  hide = FALSE,
  arrange_vertically = length(choices) > 2L,
  id = "response_ui",
  button_style = ""
)

Arguments

choices

Character vector of choices for the participant. If unnamed, then these values will be used both for button IDs and for button labels. If named, then values will be used for button IDs and names will be used for button labels.

labels

Optional vector of labels for the 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().

hide

Whether the response buttons should be hidden (possibly to be shown later).

arrange_vertically

Whether to arrange the response buttons vertically (the default) as opposed to horizontally.

id

HTML ID for the div containing the response buttons.

button_style

Button CSS style information (character scalar).