"TextCompletion" (问题界面类型)
"TextCompletion" (问题界面类型)
"TextCompletion"
提供可进行文本输入的填空界面.
属性
- 在 QuestionInterface["TextCompletion",props] 中,props 是一个 Association,除了 InputField 支持的选项外,还支持以下键:
-
"Prompt" None 向用户提问的文字 "Template" (required) 含有可填充空白字符串模板 FieldSize Automatic 输入栏的大小 - "Template" 应为 StringTemplate 中使用的类型的字符串. 由反引号 `` 表示的模板槽将定义问题界面中空白的位置.
- Additionally, options for InputField are supported including:
-
Background Automatic input field background color FieldHint Null expression to display when the input field is empty FieldSize {{{{5,Infinity},{1,Infinity}}}} the size of the menu field - For an InputField setting optvalue, the following forms of value are supported:
-
expr use expr for all fields {expr1, expr2, …} use the expri in order for each field, then use defaults {expr1, expr2,…,{c},exprm,…,exprn} use the sequence of expri, then repeatedly use c, then use the last sequence of expri at the end {i1->v1,i2->v2,…} specify what to use at positions ik {spec,rules} use rules to override specifications in spec
对应的 AssessmentFunction
- "TextCompletion" 不是为 AssessmentFunction 自动分配的界面类型. 必须在 QuestionInterface 中指定.
- AssessmentFunction[{val1,…},…] 中的值 vali 应为按顺序包含每个填空的答案的字符串.
范例
打开所有单元 关闭所有单元基本范例 (3)
可能存在的问题 (2)
AssessmentFunction 中的值应为列表:
StringTemplate 创建的 TemplateObject 含有与 "TextCompletion" 不兼容的选项:
现在,"TextCompletion" 中的模板可以使用:
或者直接使用 TemplateObject,而不是 StringTemplate:
在 "TextCompletion" 中可以使用:
相关指南
-
▪
- 问题与评估