View source: R/webexercises_fns.R
mcq | R Documentation |
Create a multiple-choice question
mcq(opts)
opts |
Vector of alternatives. The correct answer is the element(s) of this vector named 'answer'. |
Writes html code that creates an option box widget, with one or more correct answers. Call this function inline in an RMarkdown document. See the Web Exercises RMarkdown template for further examples.
A character string with HTML code to generate a pull-down menu.
# How many planets orbit closer to the sun than the Earth?
mcq(c(1, answer = 2, 3))
# Which actor played Luke Skywalker in the movie Star Wars?
mcq(c("Alec Guinness", answer = "Mark Hamill", "Harrison Ford"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.