QuestionInterface[type,<|p1s1,p2s2,…|>]
defines an interface for a QuestionObject using the given type and properties pi with settings si.
QuestionInterface
List of interface types »QuestionInterface[type,<|p1s1,p2s2,…|>]
defines an interface for a QuestionObject using the given type and properties pi with settings si.
Details
- QuestionInterface is typically used within QuestionObject[QuestionInterface[…],…] to directly specify an interface.
- Interfaces are also listed on the Listing of Question Interface Types.
- Supported interface types in type include:
-
"MultipleChoice" select a correct answer from a list
"ShortAnswer"enter an answer using an input field
"MultipleShortAnswers"enter multiple answers into input fields
"ChooseMultiple"select any number of items from a defined list
"MultipleChoiceGrid"group items into categories using a table
"TrueFalse"determine whether a question is true or false
"NumericRange"choose a value from within a range
"Code"write code to answer a question
"TextCompletion"type to fill in blanks
"SelectCompletion"choose items to fill in blanks
"DragCompletion"drag items from a pool to fill in blanks
"DragCategorize"group items into categories using a drag-and-drop interface
"ClickLocations"locate items on an image
"Sort"order a list using a drag-and-drop interface
"SelectPair"categorize an item
"SelectColor"choose a color - The supported properties pi differ for each interface type. Common properties with default settings include:
-
"Prompt" "" question or prompt shown with the interface "ShowAssessment" True whether to show the assessment result in the QuestionObject "MaxAnswers" Infinity maximum answers allowed for elementwise assessments "MinAnswers" 1 minimum answers allowed for elementwise assessments - Additionally, each interface type supports the options of the related controller as properties. For example, "ShortAnswer" supports FieldHint as a property.
- QuestionInterface[type,"prompt"] is equivalent to QuestionInterface[type,<|"Prompt""prompt"|>].
- In QuestionObject[QuestionInterface[type,props],assessment], properties not included in props are inferred from assessment whenever possible.
Examples
open all close allBasic Examples (2)
Create a multiple-choice poll question:
QuestionObject[QuestionInterface["MultipleChoice", <|"Prompt" -> "What is your favorite ice cream flavor?", "Choices" -> {"Vanilla", "Strawberry", "Chocolate", "Cookie Dough"}|>]]Create a free-form poll question:
QuestionObject[QuestionInterface["ShortAnswer", <|"Prompt" -> "What is your favorite Sci-Fi movie?"|>]]Scope (8)
Create a grid for assigning an answer to each of several items:
QuestionObject[QuestionInterface["MultipleChoiceGrid", <|"Prompt" -> "Order the US Presidents by inauguration date:", "Choices" -> {"Washington", "Lincoln", "Kennedy"}, "Categories" -> {"First", "Second", "Third"}|>]]Make an interface for pairing two items:
QuestionObject[QuestionInterface["SelectPair", <|"Prompt" -> "Choose a good food and wine pairing?", "Choices" -> {"Steak", "Pancakes", "Cheese"}, "Categories" -> {"Pinot Grigio", "Chardonnay", "Merlot"}|>]]Create a multiple-choice question with assessment:
QuestionObject[QuestionInterface["MultipleChoice", <|"Prompt" -> "What is the capitol of Alberta?", "Choices" -> {"Calgary", "Edmonton", "Banff"}|>], AssessmentFunction["Edmonton"]]Create a true/false question with a test for assessment:
QuestionObject[QuestionInterface["TrueFalse", <|"Prompt" -> "A whale is a mammal, true or false?"|>], TrueQ]Create a quiz with a color as an input and assessment using tolerance:
QuestionObject[QuestionInterface["SelectColor", <|"Prompt" -> "What color is a pickle?"|>], AssessmentFunction[Green, Tolerance -> 0.2]]Create a multiple-choice question with multiple correct answers:
QuestionObject[QuestionInterface["ChooseMultiple", <|"Prompt" -> "Which quarterbacks have won a Super Bowl?", Appearance -> "Vertical"|>], AssessmentFunction[{"Joe Montana" -> 1, "Dan Marino" -> 0, "John Elway" -> 1, "Philip Rivers" -> 0, "Brett Favre" -> 1}, <|"ElementwiseAssessment" -> True|>]]Create a slider-based question interface with assessment using a test function:
QuestionObject[QuestionInterface["NumericRange", <|"Prompt" -> "How many people live in Tokyo?",
"Range" -> {.2, 5} * QuantityMagnitude[Entity["City", {"Tokyo", "Tokyo", "Japan"}][EntityProperty["City", "Population"]]]|>],
Between[{.8, 1.2} * QuantityMagnitude[Entity["City", {"Tokyo", "Tokyo", "Japan"}][EntityProperty["City", "Population"]]]]]Create a question that hides the results of the assessment from the user:
QuestionObject[QuestionInterface["MultipleChoice", <|"Prompt" -> "What is 4^3?", "ShowAssessment" -> False|>],
AssessmentFunction[{16, -64, 64 -> 1}]]The assessment above is lost. Use EpilogFunction in QuestionObject to record the result:
QuestionObject[QuestionInterface["MultipleChoice", <|"Prompt" -> "What is 4^3?", "ShowAssessment" -> False|>],
AssessmentFunction[{16, -64, 64 -> 1}], EpilogFunction -> (PutAppend[#Assessment, "assessmentresults"]&)]ReadList["assessmentresults"]DeleteFile["assessmentresults"]Generalizations & Extensions (1)
Use arbitrary content in the prompt:
QuestionObject[QuestionInterface["TrueFalse", <|"Prompt" -> Grid[{{Entity["TaxonomicSpecies", "BalaenopteraMusculus::mk5bs"][EntityProperty["TaxonomicSpecies", "Image"]]}, {Style["A whale is a fish", 16]}, {Style["TRUE OR FALSE", 12, Italic]}}]|>], Not]Related Guides
Text
Wolfram Research (2021), QuestionInterface, Wolfram Language function, https://reference.wolfram.com/language/ref/QuestionInterface.html (updated 2025).
CMS
Wolfram Language. 2021. "QuestionInterface." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2025. https://reference.wolfram.com/language/ref/QuestionInterface.html.
APA
Wolfram Language. (2021). QuestionInterface. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuestionInterface.html
BibTeX
@misc{reference.wolfram_2026_questioninterface, author="Wolfram Research", title="{QuestionInterface}", year="2025", howpublished="\url{https://reference.wolfram.com/language/ref/QuestionInterface.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_questioninterface, organization={Wolfram Research}, title={QuestionInterface}, year={2025}, url={https://reference.wolfram.com/language/ref/QuestionInterface.html}, note=[Accessed: 12-June-2026]}