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

-code-check chunk does not trigger inclusion of a Submit Answer button #352

Closed
garrettgman opened this issue Apr 16, 2020 · 1 comment
Closed

Comments

@garrettgman
Copy link
Member

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.

Screen Shot 2020-04-16 at 2 51 24 PM

---
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."
```
@cpsievert
Copy link
Contributor

This appears to have been fixed as a side-effect of #403

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy