Description Usage Arguments See Also Examples
View source: R/question_text.R
Creates a text box group tutorial quiz question.
1 2 3 4 5 6 7 8 9 10 11 12 |
text |
Question or option text |
... |
answers and extra parameters passed onto |
correct |
For |
incorrect |
Text to print for an incorrect answer (defaults to "Incorrect")
when |
try_again |
Text to print for an incorrect answer (defaults to "Incorrect")
when |
allow_retry |
Allow retry for incorrect answers. Defaults to |
random_answer_order |
Display answers in a random order. |
placeholder |
A character string giving the user a hint as to what can be entered into the control. Internet Explorer 8 and 9 do not support this option. |
trim |
Logical to determine if whitespace before and after the answer should be removed. Defaults to |
options |
Extra options to be stored in the question object. |
question_radio
, question_checkbox
1 2 3 4 5 6 7 8 9 10 | question_text(
"Please enter the word 'C0rrect' below:",
answer("correct", message = "Don't forget to capitalize"),
answer("c0rrect", message = "Don't forget to capitalize"),
answer("Correct", message = "Is it really an 'o'?"),
answer("C0rrect ", message = "Make sure you do not have a trailing space"),
answer("C0rrect", correct = TRUE),
allow_retry = TRUE,
trim = FALSE
)
|
Question: "Please enter the word 'C0rrect' below:"
type: "learnr_text"
allow_retry: TRUE
random_answer_order: FALSE
answers:
X: "correct"; "Don't forget to capitalize"
X: "c0rrect"; "Don't forget to capitalize"
X: "Correct"; "Is it really an 'o'?"
X: "C0rrect "; "Make sure you do not have a trailing space"
✔: "C0rrect"
messages:
correct: "Correct!"
incorrect: "Incorrect"
try_again: "Incorrect"
Options:
placeholder: "Enter answer here..."
trim: FALSE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.