HKUDS/DeepTutor · error · ValueError

Choice expected_answer must be an option label such as A/B/C

Error message

Choice expected_answer must be an option label such as A/B/C/D, or uniquely match one full option body. Retry mastery_quiz with the correct label.

What it means

Error "Choice expected_answer must be an option label such as A/B/C/D, or uniquely match one full option body. Retry mastery_quiz with the correct label." thrown in HKUDS/DeepTutor.

Source

Thrown at deeptutor/capabilities/mastery/tools.py:211

            "learner would be shown identical choices. Retry mastery_quiz with one "
            "distinct body per option."
        )
    if not has_option_bodies(choice_options):
        raise ValueError(
            "Choice questions need full option bodies in mastery_quiz.options "
            "(for example ['A: first answer', 'B: second answer']), not only "
            "the labels A/B/C/D. Retry mastery_quiz with the exact option "
            "descriptions you will show through ask_user."
        )
    normalized_bodies = {" ".join(body.split()).casefold() for body in choice_options.values()}
    if len(normalized_bodies) != len(choice_options):
        raise ValueError(
            "Choice option bodies must be unique; retry mastery_quiz with "
            "distinct answer text for every option."
        )
    resolved_expected = resolve_answer(expected_answer, choice_options)
    if not resolved_expected:
        raise ValueError(
            "Choice expected_answer must be an option label such as A/B/C/D, "
            "or uniquely match one full option body. Retry mastery_quiz with "
            "the correct label."
        )
    return question_type, format_options(choice_options), resolved_expected


async def _resolve_pending_choice(
    pending: PendingQuestion, turn_id: str
) -> tuple[dict[str, str], str]:
    """Resolve a pending choice question's ``({label: body}, expected_label)``.

    The persisted options are authoritative. For legacy paths that stored only
    ``["A", "B", ...]`` it recovers the real bodies from the turn's
    ``ask_user`` event. The expected answer is normalised to a stable label
    when it resolves, else left as registered.
    """
    options = parse_options(list(pending.options or []))

View on GitHub (pinned to 3e82f13042)

When it happens

Trigger: Thrown at deeptutor/capabilities/mastery/tools.py:211 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of HKUDS/DeepTutor@3e82f13042 (2026-08-27). Data as JSON: /api/errors/04f708e9f741f592. Report an issue: GitHub.