Returns information about the current tutorial. Ideally the function should
be evaluated in a Shiny context, i.e. in a chunk with option
context = "server". Note that the values of this function may change after
the tutorial is completely initialized. If called in a non-reactive context,
get_tutorial_info() will return default values that will most likely
correspond to the current tutorial.
Arguments
- session
The
sessionobject passed to function given toshinyServer.Default isshiny::getDefaultReactiveDomain().- tutorial_path
Path to a tutorial
.Rmdsource file- ...
Arguments passed on to
rmarkdown::yaml_front_matterinputInput file (Rmd or plain markdown)
encodingIgnored. The encoding is always assumed to be UTF-8.
Value
Returns an ordinary list with the following elements:
tutorial_id: The ID of the tutorial, auto-generated or from thetutorial$idkey in the tutorial's YAML front matter.tutorial_version: The tutorial's version, auto-generated or from thetutorial$versionkey in the tutorial's YAML front matter.items: A data frame with columnsorder,label,typeanddatadescribing the items (questions and exercises) in the tutorial. This item is only available in the running tutorial, not during the static pre-render step.user_id: The current user.learnr_version: The current version of the running learnr package.language: The current language of the tutorial, either as chosen by the user or as specified in thelanguageitem of the YAML front matter.
