Fixed a bug in symmath_check(): one of the if statements
evaluated bool(ans), which is False when ans=0. This led to an error message "[symmath_check] failed to get MathML for input; dynamath=[None]" when the function reached a later condition. The check that evaluated bool(ans) was redundant, so I removed it.
This commit is contained in:
@@ -215,7 +215,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
|
||||
fans = None
|
||||
|
||||
# do a numerical comparison if both expected and answer are numbers
|
||||
if (hasattr(fexpect, 'is_number') and fexpect.is_number and fans
|
||||
if (hasattr(fexpect, 'is_number') and fexpect.is_number
|
||||
and hasattr(fans, 'is_number') and fans.is_number):
|
||||
if abs(abs(fans - fexpect) / fexpect) < threshold:
|
||||
return {'ok': True, 'msg': msg}
|
||||
|
||||
Reference in New Issue
Block a user