Merge pull request #863 from MITx/bug/lyla/numerical-tolerance-default

fixed default tolerance on numericalresponse
This commit is contained in:
David Ormsbee
2012-10-11 09:51:29 -07:00
2 changed files with 2 additions and 2 deletions

View File

@@ -746,7 +746,7 @@ class NumericalResponse(LoncapaResponse):
id=xml.get('id'))[0]
self.tolerance = contextualize_text(self.tolerance_xml, context)
except Exception:
self.tolerance = 0
self.tolerance = '0'
try:
self.answer_id = xml.xpath('//*[@id=$id]//textline/@id',
id=xml.get('id'))[0]

View File

@@ -11,7 +11,7 @@ def compare_with_tolerance(v1, v2, tol):
- v1 : student result (number)
- v2 : instructor result (number)
- tol : tolerance (string or number)
- tol : tolerance (string representing a number)
'''
relative = tol.endswith('%')