Skip to content

[bug] MATH grader: unboxed 10^{3} extracts the exponent — grades as 3 not 1000 #499

Description

@marktech0813

Problem

Unboxed integer powers are common final answers. Extract reads only the exponent digit:

extract_last_number(r"$10^{3}$")  # "3"
score_text("math500", r"$10^{3}$", "3")     # 1.0  FALSE POSITIVE
score_text("math500", r"$10^{3}$", "1000")  # 0.0  FALSE NEGATIVE
score_text("math500", r"\boxed{10^{3}}", "1000")  # 1.0  (boxed path works)

Sibling of #436 (1e3) and #485 (3\times 10^{2}).

Expected

Unboxed 10^{3} / 10^3 extracts as one term and grades equal to 1000, not 3.

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