exercise_checker: R wrapper around 'python_grade_learnr'

View source: R/exercise_checker.R

exercise_checkerR Documentation

R wrapper around 'python_grade_learnr'

Description

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.

Usage

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,
  ...
)

Arguments

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

Value

The 'gradethis::graded()' list which contains several fields indicating the result of the check.


nischalshrestha/gradethispython documentation built on May 9, 2022, 5:17 p.m.