Commit fb1e7f3d by David Ormsbee

Make type check for self.code a little more robust, give default val for mmlans…

Make type check for self.code a little more robust, give default val for mmlans so it's never undefined
parent f94df6e3
......@@ -999,7 +999,7 @@ def sympy_check2():
self.context['debug'] = self.system.DEBUG
# exec the check function
if type(self.code) == str:
if isinstance(self.code, basestring):
try:
exec self.code in self.context['global_context'], self.context
correct = self.context['correct']
......
......@@ -238,8 +238,7 @@ def symmath_check(expect, ans, dynamath=None, options=None, debug=None, xml=None
###### PMathML input ######
# convert mathml answer to formula
try:
if dynamath:
mmlans = dynamath[0]
mmlans = dynamath[0] if dynamath else None
except Exception, err:
mmlans = None
if not mmlans:
......
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