"MultipleChoice" (Question Interface Type)
"MultipleChoice" (Question Interface Type)
"MultipleChoice"
presents multiple values from which one is chosen.
Properties
- In QuestionInterface["MultipleChoice",props], props is an Association that supports the following keys:
-
"Prompt" None text asking the user a question "Choices" required list of choices - Additionally, options for RadioButtonBar are supported, including:
-
Appearance Automatic the overall appearance of the radio button bar Background Automatic background color to use
Corresponding AssessmentFunction
- Except for limited special cases, "MultipleChoice" is the automatically assigned interface type for an AssessmentFunction of the form AssessmentFunction[{k11,k20,k30…}] with multiple defined keys and only one correct key.
- The values in the assessment function can be True and False or numeric values, in which case positive values are interpreted as correct.
Examples
open all close allBasic Examples (2)
Create a multiple-choice interface:
QuestionObject[QuestionInterface["MultipleChoice", <|"Choices" -> {"Red", "Blue", "Green"}, "Prompt" -> "Pick a color"|>]]Multiple choice with assessment:
QuestionObject[QuestionInterface["MultipleChoice", "How many career home runs did Hank Aaron hit?"], AssessmentFunction[{714 -> False, 755 -> True, 868 -> False}]]Scope (2)
A multiple-choice question with multiple possible correct answers:
QuestionObject[QuestionInterface["MultipleChoice", "Pick one correct square root of 4:"], AssessmentFunction[{-2 -> True, 0 -> False, 2 -> True, 1 -> False}]]A multiple-choice question with customized appearance using the options of RadioButtonBar:
QuestionObject[QuestionInterface["MultipleChoice", <|"Prompt" -> "Select a prime number", Appearance -> {Tiny, "Horizontal" -> {Automatic, 7}}, Method -> "Active", ImageMargins -> 4|>], AssessmentFunction[(# -> PrimeQ@#)& /@ DeleteCases[Range[101, 141], _ ? EvenQ]]]Properties & Relations (1)
An automatically generated multiple-choice question interface with assessment:
QuestionObject["Pick a color", AssessmentFunction[{"Red" -> 1, "Blue" -> 0, "Green" -> 0}]]The same question explicitly specified as multiple choice:
QuestionObject[QuestionInterface["MultipleChoice", "Pick a color"], AssessmentFunction[{"Red" -> 1, "Blue" -> 0, "Green" -> 0}]]See Also
QuestionInterface QuestionObject
Question Interface Types: MultipleChoiceGrid ChooseMultiple