-
Notifications
You must be signed in to change notification settings - Fork 239
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
Write all hints in chunks #632
Comments
The breaking change would be that we'd drop support for |
I like this change, that all exercise related material is chunk defined. If we are going this route, can we add |
Here are two possible downsides to the change:
Regarding the second point, here is a little example based on a larger example in a learnr tutorial I was editing just today:
Here's how it looks in the hint: |
Thanks @rpruim, it's helpful to have your example in thinking about this. Theoretically, I'd like the interface to support that kind of hint with syntax like this: ````{markdown residual-hint}
Residuals are calculated by subtracting the region mean from the observed per capita
GDP for each country....
Here are residuals for two of the countries.
```{r, echo = FALSE}
set.seed(123)
means <- mean( imf_estimate ~ region, data = GDP |> filter(region != "World"), na.rm = TRUE)
# more code omitted
```
```` (Or maybe we'd need to call this engine Thankfully, while the change would be breaking, it's a small adjustment that would open up a pathway toward an improved hint experience. |
Actually, we might want to use the new |
If that sort of nesting can be supported in the new system, then I think the temporary pain of breaking changes is probably worth it. |
Those new knitr features look handy. |
Now that we have a data structure for describing the interactive exercises, we're still missing hints. The primary problem is that they can be added via supporting R chunks or by using a
<div>
with an id that ends in-hint
.I'd like to restructure the hints so that they are always written in chunks in a tutorial. I'd also like to build on this to have the pop-up display all hints, not just code hints. We'd support any other language via knitr chunk engine, or we could use a chunk option on
markdown
,md
, orhtml
chunks —exercise.hint.render = TRUE
— that would render the markdown or display the literal HTML in the pop-up.The text was updated successfully, but these errors were encountered: