"DragCategorize" (问题界面类型)
"DragCategorize" (问题界面类型)
"DragCategorize"
给出用于分组的项.
属性
- 在拖放-分类问题中,必须对每一项进行分类,每个类别中可以放置多个项.
- 在 QuestionInterface["DragCategorize",props] 中,props 是一个 Association,支持以下键:
-
"Prompt" None 向用户提问的文字 "Categories" required 包含要显示的类别的列表 "Choices" required 列出要分类的项 "Labels" None 列出每个选项对应的标签 "ChoiceStyle" None 应用于选项列表的样式 "DefaultZoneSize" 0.2 类别之外界面的相对大小 - "Choices" 的格式应为 {choice1,choice2,choice3,…}.
- "Categories" 的格式应为 {category1,category2,category3,…}.
- 如果在 props 中没有给出,"Choices" 和 "Categories" 自动从 AssessmentFunction 中继承.
对应的 AssessmentFunction
- "DragCategorize" 不是为 AssessmentFunction 自动分配的界面类型. 必须在 QuestionInterface 中指定.
- AssessmentFunction 将收到格式为 AssessmentFunction[…][{ch1cat1,ch2cat2,…}] 的答案. 支持任何可接收此种格式的评估函数.
- 当用户可以接受不对选项进行分类时,标准的 AssessmentFunction 结构是:
- AssessmentFunction[{patt1<|"Category"cat1|>,patt2<|"Category"cat2|>,…},<|"ListAssessment""SeparatelyScoreElements"|>]
范例
打开所有单元 关闭所有单元基本范例 (3)
QuestionObject[QuestionInterface["DragCategorize", "Categorize the primates"], AssessmentFunction[{
"Chimpanzee" -> <|"Category" -> "Ape"|>, "Gibbon" -> <|"Category" -> "Ape"|>,
"Baboon" -> <|"Category" -> "Monkey"|>,
"Sifaka" -> <|"Category" -> "Lemur"|>}, <|"ListAssessment" -> "SeparatelyScoreElements"|>]]对每个元素单独进行评估,并允许不对元素进行分类的拖放-分类问题:
QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Categorize as many exercises as you can:"|>], AssessmentFunction[{"Running" -> <|"Category" -> "Aerobic"|>, "Swimming" -> <|"Category" -> "Aerobic"|>, "Weightlifting" -> <|"Category" -> "Anaerobic"|>, "Interval Training" -> <|"Category" -> "Anaerobic"|>}, <|"ListAssessment" -> "SeparatelyScoreElements"|>]]QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Classify the following musical genres according to your preferences", "Choices" -> {"Rock", "Pop", "Jazz", "Metal"}, "Categories" -> {"😁", "🙂", "🫤", "😔", "🤢"}|>]]范围 (1)
QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Classify the animals into their corresponding categories", "Labels" -> (ImageResize[#, 80]& /@ {Entity["TaxonomicSpecies", "Strigiformes::5v684"][EntityProperty["TaxonomicSpecies", "Image"]], Entity["TaxonomicSpecies", "FelisCatus::ddvt3"][EntityProperty["TaxonomicSpecies", "Image"]],
Entity["TaxonomicSpecies", "Elasmobranchii::yd8b7"][EntityProperty["TaxonomicSpecies", "Image"]],
Entity["TaxonomicSpecies", "Passeridae::f75y5"][EntityProperty["TaxonomicSpecies", "Image"]]})|>], AssessmentFunction[{"owl" -> <|"Category" -> "Bird"|>, "cat" -> <|"Category" -> "Mammal"|>, "shark" -> <|"Category" -> "Fish"|>,
"sparrow" -> <|"Category" -> "Bird"|>}, <|"ListAssessment" -> "SeparatelyScoreElements"|>]]应用 (2)
gen = QuestionGenerator[{"ints" :> RandomInteger[100, 10]}, QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Classify the numbers:"|>], AssessmentFunction[Table[(i -> <|"Category" -> If[PrimeQ[i], "Prime", "Composite"]|>), {i, #ints}], <|"ListAssessment" -> "SeparatelyScoreElements"|>]]&]gen[]为化学测验创建 QuestionGenerator:
chemtest = QuestionGenerator[{"elements" :> RandomSample[EntityList@EntityClass["Element", "Nonmetal"], 5]}, QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Classify the chemical elements in their corresponding groups"|>], AssessmentFunction[MapThread[#1 -> <|"Category" -> #2|>&, {EntityList@#elements, EntityValue[#elements, "Series"]}], <|"ListAssessment" -> "SeparatelyScoreElements"|>]]&]chemtest[]可能存在的问题 (1)
默认情况下,AssessmentFunction 不接受项的列表:
QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Which of these exercises are aerobic/anaerobic?"|>], AssessmentFunction[{"Running" -> <|"Category" -> "Aerobic"|>, "Swimming" -> <|"Category" -> "Aerobic"|>, "Weightlifting" -> <|"Category" -> "Anaerobic"|>, "Interval Training" -> <|"Category" -> "Anaerobic"|>}]]设置 "ListAssessment""SeparatelyScoreElements" 处理评估时有多个项的情况:
QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Which of these exercises are aerobic/anaerobic?"|>], AssessmentFunction[{"Running" -> <|"Category" -> "Aerobic"|>, "Swimming" -> <|"Category" -> "Aerobic"|>, "Weightlifting" -> <|"Category" -> "Anaerobic"|>, "Interval Training" -> <|"Category" -> "Anaerobic"|>}, <|"ListAssessment" -> "SeparatelyScoreElements"|>]]巧妙范例 (1)
englishtest = QuestionGenerator[{"words" :> RandomWord[8]}, QuestionObject[QuestionInterface["DragCategorize", <|"Prompt" -> "Categorize the words based on their respective parts of speech.", FontSize -> 15|>],
AssessmentFunction[
Flatten[Thread[# -> Table[<|"Category" -> part|>, {part, PartOfSpeech[#]}]]& /@ #words], <|"ListAssessment" -> "SeparatelyScoreElements"|>]]&]englishtest[]相关指南
-
▪
- 问题与评估