Skip to content

[bug] MATH grader: \color/\textcolor/\underline wrappers survive normalize — \boxed{\color{red}{5}} ≠ 5 #497

Description

@marktech0813

Problem

Presentation-only color/underline wrappers are left intact by normalize_math_answer, so a correctly boxed answer scores 0:

normalize_math_answer(r"\color{red}{5}")      # "\color{red}{5}"
score_text("math500", r"\boxed{\color{red}{5}}", "5")           # 0.0
score_text("math500", r"\boxed{\textcolor{blue}{42}}", "42")     # 0.0
score_text("math500", r"\boxed{\underline{5}}", "5")             # 0.0

Same class as font-command unwrap (\mathbf{5}5).

Expected

\color{…}{N}, \textcolor{…}{N}, and \underline{N} normalize to N and grade equal to gold N.

Environment

  • origin/main

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions