gradethis helps scale feedback for learnr exercises. Instructors can use a model solution as a template or write highly customized testing logic to provide specific feedback for common mistakes.
gradethis is designed for use in learnr tutorials. We recommend that you first be comfortable writing learnr tutorials before you begin incorporating exercise feedback with gradethis. You can learn more about learnr tutorials with the learnr package documentation.
Installation
gradethis is still in development and not on CRAN yet. The development version of gradethis can be installed from GitHub with:
# install.packages("remotes")
remotes::install_github("rstudio/gradethis")
Usage
To use gradethis in a learnr tutorial, start by loading gradethis after learnr in the setup
chunk of your tutorial:
```{r setup}
library(learnr)
library(gradethis)
```
gradethis provides two grading modalities. You can:
Compare student code to model solution code with
grade_this_code()
, orWrite custom grading logic with
grade_this()
.
Learn more about where and how to write exercise-checking code in vignette("gradethis")
.
Getting help
There are two main places to get help:
The gradethis tag on RStudio Community is a friendly place to ask any questions about gradethis and the R Markdown family of packages. Additionally, we invite instructors to join the Teaching Category on RStudio Community, where any discussions about teaching are welcome.
Stack Overflow can be a source of answers to common gradethis questions. It is also a great place to get help, once you have created a reproducible example that illustrates your problem.
Code of Conduct
Please note that the gradethis project is released with a Contributor Code of Conduct. By contributing to this project, you agree to abide by its terms.