Remove exercise.error.checker in favor of exercise.error.check.code and -error-check chunks #426
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #356
Fixes #425
Fixes rstudio/gradethis#140
Related rstudio/gradethis#143
After feedback from @garrettgman, and discussion with @schloerke, it's becoming apparent the
exercise.error.checker
probably isn't the right approach to exercise (evaluation) error checking.This PR replaces
exercise.error.checker
with a slightly different option,exercise.error.check.code
, which defines what checking code to run when an exercise error occurs. This option, in some sense, provides a global default value, which can be overridden for a particular exercise with a-error-check
chunk. Overall this seems like a much cleaner solution thanexercise.error.checker
since it decouples error checking code from-code-check
(pre-evaluation) and-check
(post evaluation)Testing notes
Install
remotes::install_github("rstudio/learnr"); remotes::install_github("rstudio-education/gradethis")
, thenrmarkdown::run()
the following document:mtcars
, then click "Submit". You should see positive (green) feedback.cars
, then click "Submit". You should see negative feedback with"This is the cars (not mtcars) dataset."
in the messagemtc
, then click "Submit". You should see negative feedback with both the submission (mtc
) and the solution (mtcars
)mtc
, then click "Run Code". You should see negative feedback that saysobject 'mtc' not found