trial_survey_multi_select: Specify a survey page with multiple selection items

Description Usage Arguments Details Value See Also

View source: R/trial_survey_multi_select.R

Description

The trial_survey_multi_select function is used to display a survey page with one or more multiple selection questions

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
trial_survey_multi_select(
  questions,
  preamble = "",
  randomize_question_order = FALSE,
  button_label = "Continue",
  required_message = "You must choose at least one response for this question",
  post_trial_gap = 0,
  on_finish = NULL,
  on_load = NULL,
  data = NULL
)

Arguments

questions

A question or list of questions

preamble

Text to appear above the questions

randomize_question_order

Should order be randomised?

button_label

Text for the continue button

required_message

Message to display if required response is not given.

post_trial_gap

The gap in milliseconds between the current trial and the next trial. If NULL, there will be no gap.

on_finish

A javascript callback function to execute when the trial finishes

on_load

A javascript callback function to execute when the trial begins, before any loading has occurred

data

An object containing additional data to store for the trial

Details

The trial_survey_multi_select function creates a trial that displays a set of questions with multiple selection responses.

Survey construction

There are five arguments that are relevant to the survey itself:

Other behaviour

Like all functions in the trial_ family it contains four additional arguments:

Data

When this function is called from R it returns the trial object that will later be inserted into the experiment when build_experiment is called. However, when the trial runs as part of the experiment it returns values that are recorded in the jsPsych data store and eventually form part of the data set for the experiment.

The data recorded by this trial is as follows:

In addition, it records default variables that are recorded by all trials:

Value

Functions with a trial_ prefix always return a "trial" object. A trial object is simply a list containing the input arguments, with NULL elements removed. Logical values in the input (TRUE and FALSE) are transformed to character vectors "true" and "false" and are specified to be objects of class "json", ensuring that they will be written to file as the javascript logicals, true and false.

See Also

Survey page trials are constructed using the trial_survey_text, trial_survey_likert, trial_survey_multi_choice and trial_survey_multi_select functions. Individual questions for survey trials can be specified using question_text, question_likert and question_multi.


djnavarro/jaysire documentation built on April 12, 2021, 4:25 a.m.