From 1a0055ae77d3f967f648af0435efe8edae819ab4 Mon Sep 17 00:00:00 2001 From: Renzo Lucioni Date: Wed, 24 Jul 2013 16:44:22 -0400 Subject: [PATCH] Blank common and advanced problems now display an inline score of '0 points' upon creation. --- common/lib/xmodule/xmodule/progress.py | 4 ++-- common/lib/xmodule/xmodule/tests/test_progress.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/common/lib/xmodule/xmodule/progress.py b/common/lib/xmodule/xmodule/progress.py index bad5105fd0f4..4e3a8bc93edf 100644 --- a/common/lib/xmodule/xmodule/progress.py +++ b/common/lib/xmodule/xmodule/progress.py @@ -146,7 +146,7 @@ def to_js_status_str(progress): sending Progress objects to js to limit dependencies. ''' if progress is None: - return "NA" + return "0" return progress.ternary_str() @staticmethod @@ -157,5 +157,5 @@ def to_js_detail_str(progress): passing Progress objects to js to limit dependencies. ''' if progress is None: - return "NA" + return "0" return str(progress) diff --git a/common/lib/xmodule/xmodule/tests/test_progress.py b/common/lib/xmodule/xmodule/tests/test_progress.py index d1a32d5de585..e7af7a0c0981 100644 --- a/common/lib/xmodule/xmodule/tests/test_progress.py +++ b/common/lib/xmodule/xmodule/tests/test_progress.py @@ -90,15 +90,15 @@ def test_to_js_status(self): self.assertEqual(Progress.to_js_status_str(self.not_started), "none") self.assertEqual(Progress.to_js_status_str(self.half_done), "in_progress") self.assertEqual(Progress.to_js_status_str(self.done), "done") - self.assertEqual(Progress.to_js_status_str(None), "NA") + self.assertEqual(Progress.to_js_status_str(None), "0") def test_to_js_detail_str(self): '''Test the Progress.to_js_detail_str() method''' f = Progress.to_js_detail_str for p in (self.not_started, self.half_done, self.done): self.assertEqual(f(p), str(p)) - # But None should be encoded as NA - self.assertEqual(f(None), "NA") + # But None should be encoded as 0 + self.assertEqual(f(None), "0") def test_add(self): '''Test the Progress.add_counts() method'''