test_options: Test options

View source: R/options.R

test_optionsR Documentation

Test options

Description

Defines the options for running a given test.

Usage

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,
  logo_url = NULL,
  get_user_info = FALSE
)

Arguments

title

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.

admin_password

Password to access the admin panel.

researcher_email

Researcher's email; used in participant help message.

max_num_participants

Maximum number of participant completes before the test automatically closes (excludes pilot participants as indicated through the admin panel).

demo

Whether the test is to be run in demo mode.

languages

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

log_error

Whether to log errors (this feature is under development).

show_full_error_msg

Whether to show full error messages.

notify_error

Whether to send a Pushbullet message when the test experiences an error (this feature is under development).

notify_new_participant

Whether to send a Pushbullet message when a new participant completes the test.

pushbullet_email

Email to send Pushbullet notifications to.

pushbullet_apikey

Pushbullet API key (see https://www.pushbullet.com/).

max_participants_msg

Message to display when the participant quota is reached (NULL gives default).

server_closed_msg

Message to display when the server is closed via the admin panel (NULL gives default).

problems_info

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

theme

Shiny theme: see e.g. the shinythemes package.

auto_p_id

Whether or not to automatically generate an ID for each participant.

enable_resume_session

Whether to allow participants to resume sessions by refreshing the page.

allow_any_p_id_url

Whether to allow new participants to give themselves an arbitrary participant ID by passing it as a URL parameter.

force_p_id_from_url

Whether to force new participants to provide their participant ID as a URL parameter.

enable_admin_panel

Wheter to enable the admin panel.

output_dir

String identifying psychTestR's output directory.

session_timeout_min

Minimum time until a participant's session times out (minutes).

clean_sessions_interval_min

How often should psychTestR check for expired participant sessions (minutes).

Path to a logo to display in the header (optional).

logo_width

Logo width, e.g. "100px".

logo_height

Logo height, e.g. "50px".

display

A list of display options as created by display_options.

allow_url_rewrite

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.

advance_delay

Number of seconds to wait before advancing to the next page upon button press.

additional_scripts

A character vector containing file paths to any additional scripts which should be included. These will be sourced with includeScript.

logo_position

Which side should the logo be on? Can be "left" or "right".

on_start_fun

An optional function to execute when the Shiny server function begins. The function should include the "..." argument.

on_stop_fun

An optional function to execute when the Shiny server function terminates. The function should include the "..." argument.

on_session_ended_fun

An optional function to execute when a Shiny user session ends. The function should take the arguments state and "...".

logo_url

An optional URL for the logo image to link to (if a logo is specified).

get_user_info

Optionally collect information about the user such as their IP address, browser, and hardware information.


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