add_choice | R Documentation |
Add a choice to a quiz question. Used in conjunction with create_question()
to generate a question.
add_choice(text, correct = FALSE)
add_numeric(correct)
add_slider(min = 0, max = 1, default_position = 0.5, correct)
add_text(correct, exact = FALSE)
text |
Text of the choice answer |
correct |
Boolean denoting if this |
min |
the minimum value of the slider range |
max |
the maximum value of the slider range |
default_position |
the default value the slider should take |
exact |
Boolean denoting if the grader should use exact matching. If FALSE, the user's answer will be compared to the correct answer after trimming whitespace, converting to lower case, and normalizing diacritics. If you wish to use your own normalizing function, please see |
an object of class 'quizChoice'
an object of class 'quizChoiceNumeric'
an object of class 'quizChoiceSlider'
an object of class 'quizChoiceText'
add_choice()
: Create a discrete choice
add_numeric()
: Create a numeric choice
add_slider()
: Create a slider choice
add_text()
: Create a free text choice
Joseph Marlo
George Perrett
create_question()
add_choice('39')
add_choice('39', TRUE)
add_slider(0, 1, 0.5, 0.8)
add_text('Correct answer')
q <- create_question(
'My question prompt',
add_choice('39'),
add_choice('41', TRUE)
)
q1_fuzzy <- create_question('My Label', add_text(correct = ' hEllo'))
q1_fuzzy@grader('Héllo ')
q1_exact <- create_question('My Label', add_text(correct = 'hEllo', exact = TRUE))
q1_exact@grader('Héllo ')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.