Description Usage Arguments Examples
Template for R command question
1 2 3 4 | wq_command(output = "explain what the user must do here",
correct_answer = "EXPR or VAL",
answer_tests = "omnitest(correctExpr='EXPR', correctVal=VAL)",
hint = "hint")
|
output |
Text that is displayed to the user. |
correct_answer |
A string that designates the correct answer, in this case an R expression or a value. |
answer_tests |
An internal function from |
hint |
A string that is printed to the console if the user answers this question incorrectly. |
1 2 3 4 5 6 7 8 9 10 | ## Not run:
# While writing a new lesson by hand just use:
wq_command()
# If converting from another format to a swirl course you may want to sue the
# API:
wq_command("Assign the value 5 to the variable x.",
"x <- 5", "omnitest(correctExpr='x <- 5')", "Just type: x <- 5")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.