answer <- runif(5)
correct <- (1:5)==3 # Third answer is correct, the rest wrong
sc <- to_choice(answer, correct)
str(sc) # Answers are ordered by size
sc$questions <- c(format(sc$questions, nsmall=2), "No answer is correct") # Additional answer
sc$solutions <- c(sc$solutions, FALSE) # TRUE or FALSE?
sc <- to_choice(answer, correct, shuffle=2)
str(sc) # One correct answer and two wrong answers selected
Run the code above in your browser using DataLab