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
I have made a very basic reproducible LearnR example below/
I would like my test dataset to get re-created each time the person presses "start over", or if they reload the page, so that they can practice their calculation unlimited times - see my "mockup" screenshots. My question is underneath the screenshot.
---
title: "Tutorial basic"
output: learnr::tutorial
runtime: shiny_prerendered
---
```{r quiz}
library(learnr)
test <- round(runif(3,1,20))
test
quiz(
question("Calculate the sum of the numbers above",
answer(sum(test), correct = TRUE),
answer(max(test))
)
)
I understand that (runtime: shiny_prerendered) prevents this from happening. My searches have taken me down the route of dynamically embedding the quiz within a shiny document, but I'm not sure I'm on the right track. (I think this is a similar issue - https://forum.posit.co/t/dynamically-embed-learnr-tutorial-within-shiny-app/173283)
So.. apologies if I'm missing something basic - but is it possible to have a learnR page to update the dataset on a button-click - and if so, does anyone have a working reproducible example they could share?
(Finally, I should note that my actual tutorial would be a lot more complex than calculating the mean of a few numbers, this is just the simplest example I can think of)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello!
I have made a very basic reproducible LearnR example below/
I would like my test dataset to get re-created each time the person presses "start over", or if they reload the page, so that they can practice their calculation unlimited times - see my "mockup" screenshots. My question is underneath the screenshot.
I understand that (runtime: shiny_prerendered) prevents this from happening. My searches have taken me down the route of dynamically embedding the quiz within a shiny document, but I'm not sure I'm on the right track. (I think this is a similar issue - https://forum.posit.co/t/dynamically-embed-learnr-tutorial-within-shiny-app/173283)
So.. apologies if I'm missing something basic - but is it possible to have a learnR page to update the dataset on a button-click - and if so, does anyone have a working reproducible example they could share?
(Finally, I should note that my actual tutorial would be a lot more complex than calculating the mean of a few numbers, this is just the simplest example I can think of)
Many thanks in advance, Helen
Beta Was this translation helpful? Give feedback.
All reactions