{"record":{"id":"d7e9bee777bbb156","repo":"HKUDS/DeepTutor","slug":"mastery-quiz-options-cannot-be-used-with-question","errorCode":null,"errorMessage":"mastery_quiz.options cannot be used with question_type={question_type!r}; omit options or use question_type='choice'.","messagePattern":"mastery_quiz\\.options cannot be used with question_type=(.+?); omit options or use question_type='choice'\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/mastery/tools.py","lineNumber":173,"sourceCode":"    \"\"\"\n    if raw_options is None:\n        options: list[str] = []\n    elif not isinstance(raw_options, list):\n        raise ValueError(\"mastery_quiz.options must be an array of non-empty strings.\")\n    elif any(not isinstance(option, str) or not option.strip() for option in raw_options):\n        raise ValueError(\"mastery_quiz.options must contain only non-empty strings.\")\n    else:\n        options = [option.strip() for option in raw_options]\n\n    supplied_type = str(raw_question_type or \"\").strip().lower()\n    if supplied_type and supplied_type not in _QUESTION_TYPES:\n        allowed = \", \".join(_QUESTION_TYPES)\n        raise ValueError(f\"mastery_quiz.question_type must be one of: {allowed}.\")\n\n    question_type = supplied_type or (\"choice\" if options else \"short\")\n    if question_type != \"choice\":\n        if options:\n            raise ValueError(\n                f\"mastery_quiz.options cannot be used with question_type={question_type!r}; \"\n                \"omit options or use question_type='choice'.\"\n            )\n        return question_type, [], expected_answer\n\n    intended_labels = option_label_intent(options)\n    if intended_labels is not None and set(intended_labels) != canonical_labels(\n        len(intended_labels)\n    ):\n        raise ValueError(\n            f\"Choice option labels must run A, B, C… with one option each; got \"\n            f\"{intended_labels}. Retry mastery_quiz with one full body per label.\"\n        )\n\n    choice_options = parse_options(options)\n    duplicate = _duplicate_option_body(choice_options)\n    if duplicate:\n        raise ValueError(","sourceCodeStart":155,"sourceCodeEnd":191,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/mastery/tools.py#L155-L191","documentation":"Error \"mastery_quiz.options cannot be used with question_type={question_type!r}; omit options or use question_type='choice'.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/mastery/tools.py:173 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3e82f130422a813cdd73c10b21a44e9325f5821a","analyzedAt":"2026-08-27T06:57:25.364Z","schemaVersion":2},"datasetVersion":"2026-08-27T08:17:20.692Z"}