Commit aecf13dd authored by Leo Gao's avatar Leo Gao
Browse files

fix hendrycksMath for \fixed without curly braces

parent 9bbf2406
......@@ -107,16 +107,23 @@ class Math(Task):
return str1 == str2
def remove_boxed(self, s):
left = "\\boxed{"
try:
if "\\boxed " in s:
left = "\\boxed "
assert s[:len(left)] == left
assert s[-1] == "}"
return s[len(left):-1]
except AssertionError:
return None
return s[len(left):]
left = "\\boxed{"
assert s[:len(left)] == left
assert s[-1] == "}"
return s[len(left):-1]
def last_boxed_only_string(self, string):
idx = string.rfind("\\boxed")
if "\\boxed " in string:
return "\\boxed " + string.split("\\boxed ")[-1].split("$")[0]
if idx < 0:
idx = string.rfind("\\fbox")
if idx < 0:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment