Description Usage Arguments Details Value See Also Examples
View source: R/timeline_modify.R
Modify a timeline to set parameter values
1 | set_parameters(timeline, ...)
|
timeline |
The timeline object |
... |
A set of name/value pairs defining the parameters |
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.
The modified timeline object
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # 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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.