I am using R markdown to create a PDF R course. I want to insert a quiz like the following:
---
output: pdf_document
---
What is the class of the following R ob
I wasn't thinking of a full shiny app, but something like this .Rmd
---
output: html_document
---
## q1 what is `class(pi)?`
<div id="spoiler" style="display:none">
```{r}
class(pi)
```
</div>
<button title="Click to show answer" type="button"
onclick="if(document.getElementById('spoiler') .style.display=='none')
{document.getElementById('spoiler') .style.display=''}
else{document.getElementById('spoiler') .style.display='none'}">
Show/hide
</button>
And then to click