{"record":{"id":"94806bb26b99048a","repo":"HKUDS/DeepTutor","slug":"choice-option-bodies-must-be-unique-retry-mastery","errorCode":null,"errorMessage":"Choice option bodies must be unique; retry mastery_quiz with distinct answer text for every option.","messagePattern":"Choice option bodies must be unique; retry mastery_quiz with distinct answer text for every option\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"deeptutor/capabilities/mastery/tools.py","lineNumber":205,"sourceCode":"\n    choice_options = parse_options(options)\n    duplicate = _duplicate_option_body(choice_options)\n    if duplicate:\n        raise ValueError(\n            f\"Two or more choice options have the same answer ({duplicate!r}), so the \"\n            \"learner would be shown identical choices. Retry mastery_quiz with one \"\n            \"distinct body per option.\"\n        )\n    if not has_option_bodies(choice_options):\n        raise ValueError(\n            \"Choice questions need full option bodies in mastery_quiz.options \"\n            \"(for example ['A: first answer', 'B: second answer']), not only \"\n            \"the labels A/B/C/D. Retry mastery_quiz with the exact option \"\n            \"descriptions you will show through ask_user.\"\n        )\n    normalized_bodies = {\" \".join(body.split()).casefold() for body in choice_options.values()}\n    if len(normalized_bodies) != len(choice_options):\n        raise ValueError(\n            \"Choice option bodies must be unique; retry mastery_quiz with \"\n            \"distinct answer text for every option.\"\n        )\n    resolved_expected = resolve_answer(expected_answer, choice_options)\n    if not resolved_expected:\n        raise ValueError(\n            \"Choice expected_answer must be an option label such as A/B/C/D, \"\n            \"or uniquely match one full option body. Retry mastery_quiz with \"\n            \"the correct label.\"\n        )\n    return question_type, format_options(choice_options), resolved_expected\n\n\nasync def _resolve_pending_choice(\n    pending: PendingQuestion, turn_id: str\n) -> tuple[dict[str, str], str]:\n    \"\"\"Resolve a pending choice question's ``({label: body}, expected_label)``.\n","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/HKUDS/DeepTutor/blob/3e82f130422a813cdd73c10b21a44e9325f5821a/deeptutor/capabilities/mastery/tools.py#L187-L223","documentation":"Error \"Choice option bodies must be unique; retry mastery_quiz with distinct answer text for every option.\" thrown in HKUDS/DeepTutor.","triggerScenarios":"Thrown at deeptutor/capabilities/mastery/tools.py:205 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"}