Make type check for self.code a little more robust, give default val for mmlans so it's never undefined
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user