Skip to content

[bug] MATH grader: absolute-value bars |-x| never peel — boxed |-3| ≠ 3 #490

Description

@marktech0813

Problem

Absolute-value notation with ASCII bars is left intact by normalize_math_answer, and the unboxed extract path reads the signed interior:

extract_last_number("|-3|")  # "-3"
normalize_math_answer("|-3|")  # "|-3|"
score_text("math500", "|-3|", "-3")  # 1.0  FALSE POSITIVE vs signed gold
score_text("math500", "|-3|", "3")   # 0.0  FALSE NEGATIVE
score_text("math500", r"\boxed{|-3|}", "3")  # 0.0

Expected

|-3| / \boxed{|-3|} grades equal to 3 (and not to -3).

Environment

  • origin/main

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:infraCI, workflows, and repository automationbugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions