tutorial_options | R Documentation |
Set various tutorial options that control the display and evaluation of exercises.
tutorial_options(
exercise.cap = NULL,
exercise.eval = FALSE,
exercise.timelimit = 30,
exercise.lines = NULL,
exercise.pipe = NULL,
exercise.blanks = NULL,
exercise.checker = NULL,
exercise.error.check.code = NULL,
exercise.completion = TRUE,
exercise.diagnostics = TRUE,
exercise.startover = TRUE,
exercise.reveal_solution = TRUE
)
exercise.cap |
Caption for exercise chunk (defaults to the engine's icon or the combination of the engine and |
exercise.eval |
Whether to pre-evaluate the exercise so the reader can
see some default output (defaults to |
exercise.timelimit |
Number of seconds to limit execution time to
(defaults to |
exercise.lines |
Lines of code for exercise editor (defaults to the number of lines in the code chunk). |
exercise.pipe |
The characters to enter when the user presses the
"Insert Pipe" keyboard shortcut in the exercise editor
( |
exercise.blanks |
A regular expression to be used to identify blanks in
submitted code that the user should fill in. If |
exercise.checker |
Function used to check exercise answers
(e.g., |
exercise.error.check.code |
A string containing R code to use for checking
code when an exercise evaluation error occurs (e.g., |
exercise.completion |
Use code completion in exercise editors. |
exercise.diagnostics |
Show diagnostics in exercise editors. |
exercise.startover |
Show "Start Over" button on exercise. |
exercise.reveal_solution |
Whether to reveal the exercise solution if a solution chunk is provided. |
Nothing. Invisibly sets knitr::opts_chunk settings.
if (interactive()) {
tutorial_options(exercise.eval = TRUE, exercise.timelimt = 10)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.