wq_multiple: Template for multiple choice question

Description Usage Arguments Examples

Description

Template for multiple choice question

Usage

1
2
3
wq_multiple(output = "ask the multiple choice question here",
  answer_choices = c("ANS", "2", "3"), correct_answer = "ANS",
  answer_tests = "omnitest(correctVal= 'ANS')", hint = "hint")

Arguments

output

Text that is displayed to the user.

answer_choices

A vector of strings containing a user's choices.

correct_answer

A string that designates the correct answer.

answer_tests

An internal function from swirl for testing the user's choice. See AnswerTests.

hint

A string that is printed to the console if the user answers this question incorrectly.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Not run: 
# While writing a new lesson by hand just use:
wq_multiple()

# If converting from another format to a swirl course you may want to sue the
# API:
wq_multiple("Which of the following is not a planet in our solar system?",
 c("Venus", "Saturn", "Pluto"), "Pluto", "omnitest(correctVal= 'Pluto')",
   "It's the smallest celestial body you can choose.")

## End(Not run)

swirlify documentation built on May 28, 2019, 9:02 a.m.