Creates a reactive page. A reactive page is defined by a function that is called once the participant reaches a given location in the timeline. This function must be idempotent, i.e. calling it multiple times should have the same effect as calling it once).
reactive_page(fun, next_elt = TRUE)
Function that returns a page
argument.
This function's argument list must include ...
.
It should also include one or more named arguments that provide
information for generating the new page: potential arguments
include state
, corresponding to the participant's
state
object,
answer
, which is the most recent participant response,
and opt
, which is the test's option list as created by
test_options
.
The function should always return an object of class page
.
(Logical scalar) Whether to go to the next element
in the timeline once this page is completed.
This will typically be TRUE
,
except for special cases such as pages that load
testing sessions from file (get_p_id
).