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.
#> [1] "<select class='webex-select'><option value='blank'></option><option value=''>1</option><option value='answer'>2</option><option value=''>3</option></select>"# Which actor played Luke Skywalker in the movie Star Wars? mcq(c("Alec Guinness", answer = "Mark Hamill", "Harrison Ford"))#> [1] "<select class='webex-select'><option value='blank'></option><option value=''>Alec Guinness</option><option value='answer'>Mark Hamill</option><option value=''>Harrison Ford</option></select>"