Defines the options for running a given test.
test_options(
title,
admin_password,
researcher_email = NULL,
max_num_participants = NULL,
demo = FALSE,
languages = "en",
log_error = TRUE,
show_full_error_msg = TRUE,
notify_error = FALSE,
notify_new_participant = FALSE,
pushbullet_email = NULL,
pushbullet_apikey = NULL,
max_participants_msg = NULL,
server_closed_msg = NULL,
problems_info = "default",
theme = shinythemes::shinytheme("yeti"),
auto_p_id = TRUE,
enable_resume_session = TRUE,
allow_any_p_id_url = FALSE,
force_p_id_from_url = FALSE,
enable_admin_panel = TRUE,
output_dir = "output",
session_timeout_min = 31 * 24 * 60,
clean_sessions_interval_min = 15,
logo = NULL,
logo_width = NULL,
logo_height = NULL,
display = display_options(),
allow_url_rewrite = TRUE,
advance_delay = 0,
additional_scripts = character(),
logo_position = "right",
on_start_fun = NULL,
on_stop_fun = NULL,
on_session_ended_fun = NULL
)
The test's title. This can either be an unnamed character scalar, in which case the same title will be shown irrespective of internationalisation, or a named vector of titles with the names corresponding to language codes.
Password to access the admin panel.
Researcher's email; used in participant help message.
Maximum number of participant completes before the test automatically closes (excludes pilot participants as indicated through the admin panel).
Whether the test is to be run in demo mode.
Character vector of languages that may be selected via the URL parameter 'language'. If no language is provided by the URL parameter, defaults to the first language in this vector. Languages should be encoded according to ISO 639-2 conventions, lower-case, e.g. 'en'.
Whether to log errors (this feature is under development).
Whether to show full error messages.
Whether to send a Pushbullet message when the test experiences an error (this feature is under development).
Whether to send a Pushbullet message when a new participant completes the test.
Email to send Pushbullet notifications to.
Pushbullet API key (see https://www.pushbullet.com/).
Message to display when the participant
quota is reached
(NULL
gives default).
Message to display when the server is closed
via the admin panel
(NULL
gives default).
Message to display at the bottom of the screen
with advice about what to do if a problem occurs.
The default value, "default", gives
a standard English message including the researcher's email (if provided).
Alternatively, the argument can be either
a) an unnamed character scalar providing a non-internationalised message,
b) a named character vector of internationalised messages with the names
corresponding to language codes,
c) a named list of HTML tag objects providing internationalised messages,
for example:
list(en = shiny::tags$span("Problems? Send an email to ",
shiny::tags$b("researcher@domain.com")),
de = shiny::tags$span("Probleme? Sende eine E-Mail an ",
shiny::tags$b("researcher@domain.com")))
.
Shiny theme: see e.g. the shinythemes
package.
Whether or not to automatically generate an ID for each participant.
Whether to allow participants to resume sessions by refreshing the page.
Whether to allow new participants to give themselves an arbitrary participant ID by passing it as a URL parameter.
Whether to force new participants to provide their participant ID as a URL parameter.
Wheter to enable the admin panel.
String identifying psychTestR's output directory.
Minimum time until a participant's session times out (minutes).
How often should psychTestR check for expired participant sessions (minutes).
Path to a logo to display in the header (optional).
Logo width, e.g. "100px"
.
Logo height, e.g. "50px"
.
A list of display options as created by
display_options
.
Whether to allow psychTestR to rewrite the page's URL. This is required
for psychTestR's built-in session management system, but
can be disabled as long as enable_resume_session
is also set to FALSE
.
Number of seconds to wait before advancing to the next page upon button press.
A character vector containing file paths to any additional scripts which should be included. These will be sourced with includeScript.
Which side should the logo be on? Can be "left" or "right".
An optional function to execute when the Shiny server function begins. The function should include the "..." argument.
An optional function to execute when the Shiny server function terminates. The function should include the "..." argument.
An optional function to execute when a Shiny user session ends. The function should take the arguments state and "...".