# Short-answer question: Where is the best coffee?
cloze_shortanswer(
options = c("Melbourne" = 1),
case_sensitive = FALSE
)
# Multiple-choice question: Select all lower-case answers
cloze_multichoice(
options = c("a" = 1, "F" = 0, "g" = 1, "V" = 0, "K" = 0),
type = "vertical"
)
# Where is Melbourne?
cloze_singlechoice(
choices(
c("New South Wales", "Victoria", "Queensland", "Western Australia",
"South Australia", "Tasmania", "Australian Capital Territory",
"Northern Territory"),
"Victoria"
),
type = "dropdown"
)
# Numerical question: Pick a number between 1 and 10
cloze_numerical(
answer = 5.5,
tolerance = 4.5
)
# Automatic cloze questions
cloze(42) # Numerical
cloze("Australia") # Short answer
cloze("rep_len", c("rep", "rep.int", "rep_len", "replicate")) # Single choice
cloze(c("A", "B", "C"), LETTERS) # Multiple choice
Run the code above in your browser using DataLab