New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Provides instructions on parse error caused by code scaffolding in learnr tutorial #153
Provides instructions on parse error caused by code scaffolding in learnr tutorial #153
Conversation
Fixes #134 |
Thank you! |
Merge branch 'master' into syntax-scaffold-parse-error # Conflicts: # R/grade_learnr.R # tests/testthat/test_zzzz-grade_learnr.R
Incporates and closes rstudio#175
@schloerke @garrettgman this is ready for re-review. In short, this PR adds The only argument to the parse error function is the gradethis check environment, typically called Finally, the parse error function should return a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given small changes!
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Co-authored-by: Barret Schloerke <barret@rstudio.com>
Fixes #134
Currently, the code scaffolding commonly used in exercises, e.g.
____(mtcars, ____)
, causes a parse error, resulting in an error message like the one below:This PR adds logic to the default user code error handler in
grade_learnr()
to detect three or more_
in the user code and produce an informative error message with instructions.Because the logic adds a bit of complexity to the error handler, I moved the default handler into a new function:
grade_learnr_parse_error()
.