"MultipleChoiceGrid" (Question Interface Type)
"MultipleChoiceGrid" (Question Interface Type)
"MultipleChoiceGrid"
provides a grid of values and categories, where one category is selected for each value.
Properties
- In QuestionInterface["MultipleChoiceGrid",props], props is an Association that supports the following keys:
-
"Prompt" None text asking the user a question "Choices" required values available for selection "Categories" required classifications available for selection - Additionally, options for RadioButton are supported, including:
-
Appearance Automatic the overall appearance of the radio button bar Background Automatic background color to use
Corresponding AssessmentFunction
- "MultipleChoiceGrid" is the automatically assigned interface type for an AssessmentFunction of the form AssessmentFunction[{k1<|"Category"c1|>k2<|"Category"c2|>…},<|"ElementwiseAssessment"True|>].
Examples
open all close allBasic Examples (2)
A multiple-choice grid question:
QuestionObject[QuestionInterface["MultipleChoiceGrid", <|"Prompt" -> "Rate these foods:", "Choices" -> {"Ice cream", "Pizza", "Watermelon", "Popcorn"}, "Categories" -> {1, 2, 3, 4, 5}|>]]A multiple-choice grid question with assessment:
QuestionObject["Which of these exercises are aerobic/anaerobic?", AssessmentFunction[{"Running" -> <|"Category" -> "Aerobic"|>, "Swimming" -> <|"Category" -> "Aerobic"|>, "Weightlifting" -> <|"Category" -> "Anaerobic"|>, "Interval Training" -> <|"Category" -> "Anaerobic"|>}, <|"ElementwiseAssessment" -> True|>]]Scope (2)
A logic question with assessment:
QuestionObject[QuestionInterface["MultipleChoiceGrid",
<|"Choices" -> {"Paul", "Carl", "Lara", "Rose", "John" }, "Prompt" -> "..."|>],
AssessmentFunction[{
"Lara" -> <|"Category" -> "Sundae"|>,
"Carl" -> <|"Category" -> "Pie"|>,
"John" -> <|"Category" -> "Shake"|>,
"Rose" -> <|"Category" -> "Concrete"|>,
"Paul" -> <|"Category" -> "Float"|>
}, <|"ListAssessment" -> "SeparatelyScoreElements"|>]]Create a question with large spaces and buttons for more accessible use:
QuestionObject[QuestionInterface["MultipleChoiceGrid",
<|"Prompt" -> "Rate these foods:", Appearance -> Large, ImageMargins -> 20|>], AssessmentFunction[{"Running" -> <|"Category" -> "Aerobic"|>, "Swimming" -> <|"Category" -> "Aerobic"|>, "Weightlifting" -> <|"Category" -> "Anaerobic"|>, "Interval Training" -> <|"Category" -> "Anaerobic"|>}, <|"ElementwiseAssessment" -> True|>]]Properties & Relations (1)
Choices inferred from an AssessmentFunction are sorted to avoid spoiling the correct answer:
QuestionObject["In what order were these presidents?", AssessmentFunction[{"Washington" -> <|"Category" -> "First"|>, "Adams" -> <|"Category" -> "Second"|>, "Jefferson" -> <|"Category" -> "Third"|>}, <|"ElementwiseAssessment" -> True|>]]