Learn R Programming

webex (version 0.9.2)

mcq: Create a multiple-choice question

Description

Create a multiple-choice question

Usage

mcq(opts)

Arguments

opts

Vector of alternatives. The correct answer is the element(s) of this vector named 'answer'.

Details

Writes html code that creates an option box widget, with a single correct answer. Call this function inline in an RMarkdown document. See the Web Exercises RMarkdown template for further examples.

Examples

Run this code
# NOT RUN {
# 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"))
# }

Run the code above in your browser using DataLab