QuestionObject
QuestionObject [q,assess]
represents the question q and the corresponding assessment assess.
QuestionObject [assess]
derives a question from the assessment.
Details and Options
- A QuestionObject is displayed as an interactive form in which answers are submitted and assessed.
- A QuestionObject is commonly created in a Question Notebook, available with CreateNotebook ["QuestionNotebook"].
- In QuestionObject [q,assess], q accepts the following form:
-
"question" text prompt asking a question
- The assessment assess accepts the following forms:
-
f test function
- The test function f should be a function that takes the submitted answer returns an assessment, either as True , False or as an AssessmentResultObject .
- Supported interface types are listed Question Interface Types and include:
-
"ChooseMultiple" select any number of items from a defined list"ClickLocations" locate an item on a graphical interface"Code" enter code using an input field"DragCategorize" group items into categories using a drag-and-drop interface"DragCompletion" drag items from a pool to fill in blanks"MultipleShortAnswers" enter multiple answers into input fields"MultipleChoice" select a correct answer from a list"MultipleChoiceGrid" group items into categories using a table"NumericRange" choose a value from within a range"SelectPair" match an item with a category"SelectColor" choose a color"SelectCompletion" choose text to fill in a blank"ShortAnswer" enter an answer using an input field"Sort" order a list using a drag-and-drop interface"TextCompletion" type text to fill in a blank"TrueFalse" determine whether a question is true or false
Examples
open allclose allBasic Examples (2)
Define a multiple-choice question:
Create a true/false question:
Scope (17)
Create a categorization question:
Specify a test function to assess the answer:
Create a question where multiple answers may be chosen:
Create a "ShortAnswer" question for assessing a free-form textual answer:
Create a "MultipleChoice" question for selecting a single correct answer from a list of choices:
Create a "MultipleShortAnswers" question to assess many free-form answers:
Create a "TextCompletion" question to assess free-form fill-in-the-blank answers:
Create a "SelectCompletion" question to select from a set of predefined answers for each blank:
Create a "DragCompletion" question to fill blanks from a common pool of predefined answers:
Create a "ClickLocations" question for locating items in a photo:
Create a "Sort" question for ordering items in a list:
Create a "NumericRange" question for choosing a value within an interval:
Create a "SelectPair" question for matching one item with a category:
Create a "SelectColor" question for assessing a color choice:
Create a "MultipleChoiceGrid" question for categorizing multiple items into common categories by selecting radio buttons:
Create a "DragCategorize" question for categorizing multiple items into common categories by dragging the items:
Create a "Code" question for assessing whether submitted code is equivalent to the code in the answer key:
Generalizations & Extensions (1)
Create a test function that returns an AssessmentResultObject where the score is a function of the answer:
Applications (1)
Define a function that generates random versions of a question:
Generate two versions of the question:
Create an equivalent QuestionGenerator :
Properties & Relations (2)
When an interface type cannot be inferred from the assessment, an input field is used:
When no assessment is defined, the submit button is omitted:
See Also
AssessmentFunction AssessmentResultObject QuestionInterface FormObject Ask
Function Repository: QuestionDeploy GetQuestionAssessments RandomEntityQuestion
History
Text
Wolfram Research (2021), QuestionObject, Wolfram Language function, https://reference.wolfram.com/language/ref/QuestionObject.html.
CMS
Wolfram Language. 2021. "QuestionObject." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/QuestionObject.html.
APA
Wolfram Language. (2021). QuestionObject. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuestionObject.html
BibTeX
@misc{reference.wolfram_2025_questionobject, author="Wolfram Research", title="{QuestionObject}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/QuestionObject.html}", note=[Accessed: 17-April-2025 ]}
BibLaTeX
@online{reference.wolfram_2025_questionobject, organization={Wolfram Research}, title={QuestionObject}, year={2021}, url={https://reference.wolfram.com/language/ref/QuestionObject.html}, note=[Accessed: 17-April-2025 ]}