From 331f35145fe80cdd7fcde4da66813e2298c1e985 Mon Sep 17 00:00:00 2001 From: Lyla Fischer Date: Thu, 11 Oct 2012 11:59:27 -0400 Subject: [PATCH 1/2] fixed default tolerance on numericalresponse --- common/lib/capa/capa/responsetypes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/capa/capa/responsetypes.py b/common/lib/capa/capa/responsetypes.py index ab5eaf950c..df98f62fc5 100644 --- a/common/lib/capa/capa/responsetypes.py +++ b/common/lib/capa/capa/responsetypes.py @@ -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] From 0cdbd170c2c9992bab457347256af52f1e6498d2 Mon Sep 17 00:00:00 2001 From: Lyla Fischer Date: Thu, 11 Oct 2012 12:23:06 -0400 Subject: [PATCH 2/2] fixed documentation --- common/lib/capa/capa/util.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/lib/capa/capa/util.py b/common/lib/capa/capa/util.py index 75acf657e8..75bd9fb5bc 100644 --- a/common/lib/capa/capa/util.py +++ b/common/lib/capa/capa/util.py @@ -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('%')