Example of different quiz formats in a shiny based RTutor problemset
Adapt the working directory below and run the setup chunk in RStudio. This creates the problem set files and the sample solution from this solution file.
library(RTutor) setwd("D:/libraries/RTutor/RTutor/inst/examples") ps.name = "QuizExample"; sol.file = paste0(ps.name,"_sol.Rmd") # Important to add the parameter addons="quiz" ! create.ps(sol.file=sol.file, ps.name=ps.name,libs=libs, addons="quiz") show.ps(ps.name) stop()
question: What is 2020? sc: - 100 - 200 - 400 - 500 success: Great, your answer is correct! failure: Try again.
question: Check all prime numbers mc: - 2 - 3 - 4 - 5 - 6 - 7 - 8 success: Great, all answers are correct! failure: Not all answers correct. Try again.
question: Johann ???? Bach answer: Sebastian
question: 2. State pi up to 2 digits answer: 3.14 roundto: 0.01
parts: - question: 1. What is 2020? choices: - 100 - 200 - 400 - 500 multiple: FALSE success: Great, your answer is correct! failure: Try again. - question: 2. State pi up to 2 digits answer: 3.14 roundto: 0.01
You solved the quiz!
Note that every problem set must have at least at one chunk in order to compile without error. Yeah... I was simply to lazy to implement all extra handling for problem sets without chunks, since the whole idea of RTutor is to have chunks.
Therefore one chunk at the end...
#< task_notest (0.3-0.2-0.1)==0 #>
So better don't build rockets with R...
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.