Missed one conversion to complex
This commit is contained in:
@@ -48,12 +48,12 @@ class numericalresponse(object):
|
||||
''' Display HTML for a numeric response '''
|
||||
student_answer = student_answers[self.answer_id]
|
||||
try:
|
||||
correct = compare_with_tolerance (evaluator(dict(),dict(),student_answer), self.correct_answer, self.tolerance)
|
||||
correct = compare_with_tolerance (evaluator(dict(),dict(),student_answer), complex(self.correct_answer), self.tolerance)
|
||||
# We should catch this explicitly.
|
||||
# I think this is just pyparsing.ParseException, calc.UndefinedVariable:
|
||||
# But we'd need to confirm
|
||||
except:
|
||||
raise StudentInputError('Invalid input -- please use a number only')
|
||||
raise #StudentInputError('Invalid input -- please use a number only')
|
||||
|
||||
if correct:
|
||||
return {self.answer_id:'correct'}
|
||||
|
||||
Reference in New Issue
Block a user