Modify a timeline to set parameter values

set_parameters(timeline, ...)

## Arguments

timeline The timeline object A set of name/value pairs defining the parameters

## Value

The modified timeline object

## Details

The set_parameters() function provides a general purpose method of adding arbitrary parameters to an existing timeline. Anything that jsPsych recognises as a possible timeline parameter can be inserted using this method. Some possibilities are shown in the examples section.

## See also

build_timeline, set_variables

## Examples

# typically we begin with a trial template:
trial_template <- trial_html_button_response(
stimulus = insert_variable(name = "my_stimulus"),
choices = c("true", "false")
)

# then we fill it out so that there is now a "block" of trials:
equations <- c("13 + 23 = 36",  "17 - 9 = 6", "125 / 5 = 25")
trials <- build_timeline(trial_template) %>%
set_variables(my_stimulus = equations)

# we can randomise presentation order and repeat the block:
trials <- trials %>%
set_parameters(randomize_order = TRUE, repetitions = 2)