Creates an n-alternative forced-foced choice page with an audio prompt.

audio_NAFC_page(label, prompt, choices, url, labels = NULL,
  type = tools::file_ext(url), save_answer = TRUE,
  on_complete = NULL, arrange_choices_vertically = length(choices) >
  2L, wait = TRUE, loop = FALSE, admin_ui = NULL)

Arguments

label

Label for the current page (character scalar).

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 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.

url

URL to the audio Can be an absolute URL (e.g. "http://mysite.com/audio.mp3") or a URL relative to the /www directory (e.g. "audio.mp3").

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().

type

Audio type (e.g. 'mp3'). Defaults to the provided file extension.

save_answer

See page.

on_complete

See page.

arrange_choices_vertically

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

wait

Whether to wait for the audio to finish before displaying the response buttons.

loop

Whether the audio should loop.

admin_ui

See page.