Description Usage Arguments Details Examples
Create a multiple-choice question
1 | 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 a single correct answer. Call this function inline in an RMarkdown document. See the Web Exercises RMarkdown template for further examples.
1 2 3 4 5 |
[1] "<select class='solveme' data-answer='[\"2\"]'> <option></option> <option>1</option> <option>2</option> <option>3</option></select>"
[1] "<select class='solveme' data-answer='[\"Mark Hamill\"]'> <option></option> <option>Alec Guinness</option> <option>Mark Hamill</option> <option>Harrison Ford</option></select>"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.