You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The help file for grade_this_code() states the following:
If grade_this_code() is called in a -code-check chunk and returns feedback, either passing or failing feedback, then the user's code is not executed. If you want the user to see the output of their code, call grade_this_code() in the -check chunk.
When I call grade_this_code() in a -check chuck, it works as expected when an exercise is submitted.
If I change the -check chunk into a -code-check chunk, the tutorial raises an error: "A problem occurred with the grading code for this exercise" when an exercise is submitted.
If I change grade_this_code() to grade_code() in the -code-check chunk, everything works as expected when an exercise is submitted, but grade-code() is tagged as superseded by grade_this_code()
learnr: version 0.11.5.9000
gradethis: version 0.2.14
Here is a reproducible example:
---
title: "Reproducible"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
knitr::opts_chunk$set(echo = FALSE)
gradethis::gradethis_setup()
```
## Topic 1
Write the R code required to add two plus two:
```{r two-plus-two, exercise=TRUE}
```
```{r two-plus-two-solution}
2+2
```
<!-- The following works fine: note `-check` chunk with `grade_this_code()`
```{r two-plus-two-check}
gradethis::grade_this_code()
```
-->
<!-- The following works fine: note `-code-check` chunk with `grade_code()`
```{r two-plus-two-code-check}
gradethis::grade_code()
```
-->
<!-- the following fails with an error: `-code-check` chunk with `grade_this_code() -->
```{r two-plus-two-code-check}
gradethis::grade_this_code()
```
The text was updated successfully, but these errors were encountered:
The help file for
grade_this_code()
states the following:grade_this_code()
in a-check
chuck, it works as expected when an exercise is submitted.-check
chunk into a-code-check
chunk, the tutorial raises an error: "A problem occurred with the grading code for this exercise" when an exercise is submitted.grade_this_code()
tograde_code()
in the-code-check
chunk, everything works as expected when an exercise is submitted, butgrade-code()
is tagged as superseded bygrade_this_code()
learnr: version 0.11.5.9000
gradethis: version 0.2.14
Here is a reproducible example:
The text was updated successfully, but these errors were encountered: