wq_text: Template for text question

Description Usage Arguments Examples

Description

Template for text question

Usage

1
2
3
wq_text(output = "explain the question here",
  correct_answer = "answer",
  answer_tests = "omnitest(correctVal='answer')", hint = "hint")

Arguments

output

Text that is displayed to the user.

correct_answer

The answer to the question in the form of a string.

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
## Not run: 
# While writing a new lesson by hand just use:
wq_text()

# If converting from another format to a swirl course you may want to sue the
# API:
wq_text("Where is the Johns Hopkins Bloomberg School of Public Health located?",
 "Baltimore", "omnitest(correctVal='Baltimore')", "North of Washington, south of Philadelphia.")

## End(Not run)

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