"TextCompletion" (Question Interface Type)
"TextCompletion"
provides a fill-in-the-blank interface with textual input fields.
Properties
- In QuestionInterface ["TextCompletion",props], props is an Association that supports the following keys in addition to the options supported by InputField :
-
"Prompt" None text asking the user a question"Template" (required) string template with slots to be filled
- The "Template" should be a string of the type used in StringTemplate . Template slots denoted by backticks `` define locations for blanks in the question interface.
Corresponding AssessmentFunction
- "TextCompletion" is not an automatically assigned interface type for an AssessmentFunction . It must be specified in QuestionInterface .
- The values vali in AssessmentFunction [{val1,…},…] should be strings containing the answers for each slot in order.
Examples
open allclose allBasic Examples (3)
Create a text completion interface without assessment:
Define a text completion question with assessment:
Create a text completion question providing a full TemplateObject :
Scope (3)
A question with multiple possible correct answers:
Specify an interpreter to standardize input as well as an image to include in the prompt:
Create a grammar question:
Applications (1)
Create a question generator for a fill-in-the-blank question:
Create three instances of the question:
Possible Issues (2)
The values in the AssessmentFunction should be lists:
Specify the values as a list instead:
The TemplateObject created by StringTemplate contains options incompatible with "TextCompletion" :
Attempting to use this template will create a broken interface:
Remove the option settings:
Now the template works in "TextCompletion" :
Alternatively, use TemplateObject directly instead of StringTemplate :
This template does not have any options settings:
It works in "TextCompletion" :
See Also
QuestionObject QuestionInterface TemplateObject
Question Interface Types: DragCompletion SelectCompletion DragCategorize MultipleShortAnswers
Comparison Methods: Expression