You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
is_equiv rates different equations as equivalent: _strip_string drops any left-hand side of two characters or fewer #35
It applies to every equation with a short left side, not just stray prefixes. x=7 and y=7 both become 7, so is_equiv treats them as the same answer. For problems whose answer is an equation, the right-hand side alone decides the grade.
A real case is test/precalculus/323: the problem asks for the image of the line y = 2x + 1 in the form "y = mx + b", and the gold answer is y = 2x + 3. A completion ending in \boxed{x=2x+3} (a different equation) is graded correct. I checked that with a one-problem run using the public problem and gold text; that run gave a score of 1/1 where 0/1 is expected.
Reproduction
Standard library only. Run with SRC set to a checkout of the repo.
importos, sys, importlib.utilp=os.path.join(os.environ["SRC"], "modeling", "math_equivalence.py")
s=importlib.util.spec_from_file_location("me", p)
m=importlib.util.module_from_spec(s)
s.loader.exec_module(m)
# The last pair is test/precalculus/323: gold "y = 2x + 3", model answer "x=2x+3".pairs= [("x=7", "y=7"), ("z=2x+3", "y=2x+3"), ("x=2x+3", "y = 2x + 3")]
bad=0forpred, goldinpairs:
r=m.is_equiv(pred, gold)
print(f"is_equiv({pred!r},{gold!r}) observed={r} expected=False")
bad+=rifbad:
print("REPRODUCED")
sys.exit(1)
Expected: observed=False for all three pairs.
Actual on main:
Activity