View source: R/exercise_checker.R
exercise_checker | R Documentation |
To enable exercise checking in your learnr tutorial, you can set 'tutorial_options(exercise.checker = gradethispython::exercise_checker)' in the setup chunk of your tutorial. Or, set the 'exercise.checker' for an individual Python chunk.
exercise_checker( label = NULL, solution_code = NULL, user_code = NULL, check_code = NULL, envir_result = NULL, evaluate_result = NULL, envir_prep = NULL, last_value = NULL, ... )
label |
Label for exercise chunk |
solution_code |
Code provided within the “-solution” chunk for the exercise. |
user_code |
Python code submitted by the user |
check_code |
Code provided within the “-check” chunk for the exercise. |
envir_result |
The Python environment after the execution of the chunk. |
evaluate_result |
The return value from the 'evaluate::evaluate' function. |
envir_prep |
A copy of the Python environment before the execution of the chunk. |
last_value |
The last value from evaluating the exercise. |
... |
Extra arguments supplied by learnr |
The 'gradethis::graded()' list which contains several fields indicating the result of the check.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.