Example of an RTutor interactive Problemset
Adapt the working directory below and press Ctrl-Alt-R (run all chunks). This creates the problem set files and the sample solution from this solution file.
library(RTutor) library(yaml) #library(restorepoint) #setwd("D:/libraries/RTutor/examples") setwd("D:/libraries/RTutor/RTutor/inst/examples") ps.name = "QuizExample"; sol.file = paste0(ps.name,"_sol.Rmd") libs = c("yaml") # Important add the parameter addons="quiz" ! create.ps(sol.file=sol.file, ps.name=ps.name, user.name=NULL,libs=libs, stop.when.finished=FALSE, addons="quiz") show.ps(ps.name, user.name="John Does") 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!
Enter 2*2
2*2
Enter 2*2
2*2
That's all folks!
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.