"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 FieldSize Automatic size of input fields - 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)
Applications (1)
Possible Issues (2)
The values in the AssessmentFunction should be lists:
![](Files/TextCompletion.en/1.gif)
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:
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":