Skip to content
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

replace checkthis and grader with gradethis in docs #269

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ learnr 0.10.0 (unreleased)

* Added a fail-safe to try-catch bad student code that would crash the tutorial. ([@adamblake](https://github.com/adamblake), [#229](https://github.com/rstudio/learnr/issues/229))

* Replace references to `checkthat` and `grader` in docs with [gradethis](https://github.com/rstudio-education/gradethis)

learnr 0.9.2
===========
Expand Down
9 changes: 4 additions & 5 deletions docs/exercises.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,13 @@ You can also use `data-allow-skip=FALSE` to disable exercise skipping rendering

## Exercise Checking

The **learnr** package doesn't directly include features for checking exercise inputs however it does include lower-level hooks that enable other packages to provide tools for exercise checking. You can provide an external function for exercise checking by setting the `exercise.checker` knitr chunk option within the `setup` chunk of your tutorial, then adding a "-check" chunk for any exercise you want to check. For example, if a package called `checkthat` existed and had a `check_exercise` function, you would specify it as an exercise checker using:
The **learnr** package doesn't directly include features for checking exercise inputs however it does include lower-level hooks that enable other packages to provide tools for exercise checking. You can provide an external function for exercise checking by setting the `exercise.checker` knitr chunk option within the `setup` chunk of your tutorial.
The [gradethis](https://github.com/rstudio-education/gradethis) package has utilities for grading exercises; suggestions and contributions are very welcome.

<div id="exercisecheck"></div>
<script type="text/javascript">loadSnippet('exercisecheck')</script>

The [grader](https://github.com/rstudio-education/grader) package has utilities for grading exercises; suggestions and contributions are very welcome.

When you provide a "-check" chunk for an exercise, an additional "Submit Answer" button is added to the exercise editor:
When you provide a "-check" chunk for an exercise you want to check, an additional "Submit Answer" button is added to the exercise editor:

<img src="images/exercise-submit.png" width="730" height="92"/>

Expand Down Expand Up @@ -269,7 +268,7 @@ Here the `is_bad_code` function is a proxy for whatever logic your code checking

### Checking Packages

The **[checkr](https://github.com/dtkaplan/checkr)** package currently provides code checking functions that are compatible with **learnr**.
The **[gradethis](https://github.com/rstudio-education/gradethis)** and **[checkr](https://github.com/dtkaplan/checkr)** packages currently provide code checking functions that are compatible with **learnr**.

We expect that additional **learnr** compatible checking packages will be developed and will update this section as they become available.

Expand Down
5 changes: 3 additions & 2 deletions docs/snippets/exercisecheck.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
```{r setup, include=FALSE}
library(learnr)
tutorial_options(exercise.checker = checkthat::check_exercise)

knitr::opts_chunk$set(exercise.checker = gradethis::grade_learnr)
```

```{r exercise1-check}
# code to check exercise here
```
```