Observe the user's progress in the tutorialSource:
As a student progresses through a learnr tutorial, their progress is
stored in a Shiny reactive values list for their session (see
shiny::reactiveValues()). Without arguments,
the full reactiveValues object that can be converted to a conventional list
shiny::reactiveValuesToList(). If the
label argument is provided,
the state of an individual question or exercise with that label is returned.
get_tutorial_state() introduces a reactive dependency on the state
of returned questions or exercises unless called within
get_tutorial_state() will only work for the tutorial author and must
be used in a reactive context, i.e. within
shiny::reactive(). Any logic observing the
user's tutorial state must be written inside a
context="server" chunk in
the tutorial's R Markdown source.
A length-1 character label of the exercise or question.
sessionobject passed to function given to
A reactiveValues object or a single reactive value (if
provided). The names of the full reactiveValues object correspond to the
label of the question or exercise. Each item contains the following
type: One of
answer: A character vector containing the user's submitted answer(s).
correct: A logical indicating whether the user's answer was correct, or a logical
NAif the submission was not checked for correctness.
timestamp: The time at which the user's submission was completed, as a character string in UTC, formatted as
"%F %H:%M:%OS3 %Z".