I'm trying to create a math test generator which randomizes which questions that are included in a test. I imagine writing 20 questions or so in knitr, and then pressing a button to create a pdf with a subset of them. I'm using R Markdown in Rstudio. I imagine a solution somewhat like:
```{r}
start<-"";end<-""
if(0<runif(1)){
start1<-"```{r, echo=F}"
end1<-"```"
}
```
`r start1`
Question 1
`r end1`
But this results in a pdf with:
```{r, echo=F}
Question 1
```
How do I tell knitr to evaluate the inline code a second time? Or is there a slicker way of doing things?