Function reference
-
run_tutorial()
- Run a tutorial
-
available_tutorials()
- List available tutorials
-
safe()
- Execute R code in a safe R environment
-
tutorial()
- Tutorial document format
-
tutorial_options()
- Set tutorial options
-
tutorial_package_dependencies()
- List tutorial dependencies
-
quiz()
question()
- Tutorial quiz questions
-
question_checkbox()
- Checkbox question
-
question_radio()
- Radio question
-
question_numeric()
- Number question
-
question_text()
- Text box question
-
answer()
answer_fn()
- Question answer options
-
correct()
incorrect()
mark_as()
- Mark submission as correct or incorrect
-
random_praise()
random_encouragement()
- Random praise and encouragement
-
random_phrases_add()
- Add phrases to the bank of random phrases
Developer Tools
These functions were designed for use by developers who want to extend learnr with custom formats or interactive question types, or for those who wish to deploy learnr tutorials in custom environments.
-
mock_exercise()
mock_chunk()
- Mock a learnr interactive exercise
-
expect_feedback()
- Does user code for an exercise return the expected feedback?
-
test_that_exercise()
- Run automated tests for an exercise
-
test_tutorial()
- Test the exercises of a learnr tutorial
-
disable_all_tags()
- Disable all html tags
-
finalize_question()
- Finalize a question
-
question_ui_initialize()
question_ui_try_again()
question_ui_completed()
question_is_valid()
question_is_correct()
- Custom question methods
-
knit_print(<tutorial_question>)
knit_print(<tutorial_quiz>)
- Knitr quiz print methods
-
format(<tutorial_question_answer>)
format(<tutorial_question>)
format(<tutorial_quiz>)
print(<tutorial_question>)
print(<tutorial_question_answer>)
print(<tutorial_quiz>)
- Formatting and printing quizzes, questions, and answers
-
get_tutorial_info()
- Get information about the current tutorial
-
get_tutorial_state()
- Observe the user's progress in the tutorial
-
filesystem_storage()
- Filesystem-based storage for tutor state data
-
event_register_handler()
- Register an event handler callback
-
one_time()
- Wrap an expression that will be executed one time in an event handler
-
duplicate_env()
- Create a duplicate of an environment
-
initialize_tutorial()
- Initialize tutorial R Markdown extensions
-
external_evaluator()
- External execution evaluator
-
tutorial_html_dependency()
- Tutorial HTML dependency