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
If I want to run a single check function that is run before the code is evaluated, I place it in a code chunk whose label is suffixed with -code-check per #2. I'd like this to be a sufficient signal to learnr to add a "Submit Button" to the exercise chunk. However, learnr does not do this (example below). To get the "Submit Button," I also need to add a non-empty chunk whose label is suffixed with-check.
Here is the output of the document that follows. Note the absence of a Submit Answer button.
---
title: "Issue #351"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r setup, include=FALSE}
library(learnr)
checker <- function(label, user_code, check_code, envir_result, evaluate_result, ...) {
list(message = check_code, correct = FALSE, location = "append")
}
tutorial_options(exercise.checker = checker)
```
## There is no submit answer button
### ...because I don't use a -check chunk in addition to my -code-check chunk
Click Submit Answer to open the `iris` dataset.
```{r iris, exercise = TRUE}
Iris
```
```{r iris-solution}
iris
```
```{r iris-code-check}
"You mis-capitalized iris."
```
The text was updated successfully, but these errors were encountered:
If I want to run a single check function that is run before the code is evaluated, I place it in a code chunk whose label is suffixed with
-code-check
per #2. I'd like this to be a sufficient signal to learnr to add a "Submit Button" to the exercise chunk. However, learnr does not do this (example below). To get the "Submit Button," I also need to add a non-empty chunk whose label is suffixed with-check
.Here is the output of the document that follows. Note the absence of a Submit Answer button.
The text was updated successfully, but these errors were encountered: