QuestionSelector[{qo1,qo2,…}]
質問オブジェクト qoiがランダムに選択できる質問のリストを表す.
QuestionSelector[CloudObject[…]]
クラウドに配備された質問セレクタを表す.
QuestionSelector
QuestionSelector[{qo1,qo2,…}]
質問オブジェクト qoiがランダムに選択できる質問のリストを表す.
QuestionSelector[CloudObject[…]]
クラウドに配備された質問セレクタを表す.
詳細とオプション
- QuestionSelector[…][]は選択されたQuestionObjectを返す.
- QuestionSelector[…][n]は選択された n 個の質問のリストを返す.
- 通常,QuestionSelectorはCreateNotebook["QuestionNotebook"]を介して利用可能な質問ノートブックを使う.
- QuestionSelector[…][]はFirst@QuestionSelector[…][1]に等しい.
- QuestionSelectorは質問をローカルに,質問ノートブックから配備されている場合はクラウドから提供できる.
- クラウドに配備された質問プールは,1つのプールしか含まないクラウドオブジェクトに対してはQuestionSelector[CloudObject[…]],クラウドオブジェクトに複数のプール,生成器あるいは質問オブジェクトが含まれている場合はQuestionSelector[{CloudObject[…],"questionid"}]の形をしている.
- QuestionSelectorは質問バンクや質問プールの定義に便利なツールを提供する.
例題
すべて開く すべて閉じる例 (1)
selector = QuestionSelector[{
QuestionObject["In what year was Wolfram Mathematica launched?", MatchQ[1988]],
QuestionObject["In what year was Wolfram|Alpha launched?", AssessmentFunction[{1995, 2009 -> True, 2010, 2018}]],
QuestionObject["In what year was Wolfram Research founded?", MatchQ[1987]]
}]selector[]スコープ (3)
geometrypool = QuestionSelector[{
QuestionObject["What is the area of a circle with radius 2?", AssessmentFunction[{4 * Pi}, Tolerance -> 0.1]],
QuestionObject["What is the perimeter of square with side 3?", AssessmentFunction[{12}]],
QuestionObject["What is the radius of a cone with volume 25 and height 7?", AssessmentFunction[{Sqrt[30 / (7 * Pi)]}, Tolerance -> 0.1]]
}]geometrypool[]geometrypool[3]deployed = ResourceFunction["QuestionDeploy"][QuestionSelector[{
QuestionObject["In what year was Wolfram Mathematica launched?", MatchQ[1988]],
QuestionObject["In what year was Wolfram|Alpha launched?", AssessmentFunction[{1995, 2009 -> True, 2010, 2018}]],
QuestionObject["In what year was Wolfram Research founded?", MatchQ[1987]]
}]]selector = deployed["QuestionSelector"]question = selector[]InputForm[{selector, question}]moonquestions = QuestionObject["True or False: " <> CommonName[#] <> " has a moon.",
AssessmentFunction[#[EntityProperty["Planet", "MoonCount"]] > Quantity[0, IndependentUnit["moons"]]]]& /@ EntityList["Planet"]moonpool = QuestionSelector[moonquestions, 3]moonpool[]アプリケーション (2)
g7pool = QuestionSelector@KeyValueMap[QuestionObject[
QuestionInterface["NumericRange", <|"Prompt" -> Row[{"In millions, what is the approxmiate population of ", #1, "?"}], "Range" -> {5, 500}|>],
AssessmentFunction[{QuantityMagnitude@#2 / 10 ^ 6 -> 1}, Tolerance -> 20]
]&, EntityValue[EntityClass["Country", "GroupOf7"], "Population", "EntityAssociation"]]g7pool[]classquestion[class_] := QuestionObject[QuestionInterface["ShortAnswer", <|"Prompt" -> Row[{"Name a species from the ", class}], "Interpreter" -> "Animal"|>],
#["Class"] === class&]pool = QuestionSelector[classquestion /@ {Entity["Species", "Class:Mammalia"], Entity["Species", "Class:Reptilia"], Entity["Species", "Class:Aves"], Entity["Species", "Class:Actinopterygii"]}]pool[]特性と関係 (1)
QuestionSelectorは質問の定義済みの静的集合からの質問を提供する:
QuestionSelector[{QuestionObject["Is a hot dog a sandwich?", AssessmentFunction[{True}]],
QuestionObject["Is a taco a sandwich?", AssessmentFunction[{True}]],
QuestionObject["Is a poptart a sandwich?", AssessmentFunction[{True}]]}][]QuestionGeneratorにRandomChoiceを使うと同じように動作する:
QuestionGenerator[{"food" :> RandomChoice[{"hot dog", "taco", "poptart"}]},
QuestionObject["Is a " <> #food <> " a sandwich?",
AssessmentFunction[{True}]
]&][]QuestionGeneratorは新たな質問も生成できる:
QuestionGenerator[{"food" :> RandomEntity["Food"]["Name"]},
QuestionObject["Is a " <> #food <> " food?",
AssessmentFunction[{True}]
]&][]おもしろい例題 (1)
リソース関数のRandomEntityQuestionを使って画像が回答の選択肢になる犬種についてのランダムな多肢選択問題のプールが作成できる:
dogpool = QuestionSelector[Table[ResourceFunction["RandomEntityQuestion"]["DogBreed", "AnswerProperty" -> "Image"], {i, 5}]]dogpool[]関連するガイド
-
▪
- 質問と評価
テキスト
Wolfram Research (2022), QuestionSelector, Wolfram言語関数, https://reference.wolfram.com/language/ref/QuestionSelector.html.
CMS
Wolfram Language. 2022. "QuestionSelector." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/QuestionSelector.html.
APA
Wolfram Language. (2022). QuestionSelector. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuestionSelector.html
BibTeX
@misc{reference.wolfram_2026_questionselector, author="Wolfram Research", title="{QuestionSelector}", year="2022", howpublished="\url{https://reference.wolfram.com/language/ref/QuestionSelector.html}", note=[Accessed: 16-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_questionselector, organization={Wolfram Research}, title={QuestionSelector}, year={2022}, url={https://reference.wolfram.com/language/ref/QuestionSelector.html}, note=[Accessed: 16-November-2026]}