Skip to content

Commit

Permalink
Merge pull request #494 from edx/renzo/blank-problem-score
Browse files Browse the repository at this point in the history
Blank common and advanced problems now display an inline score of "0 points" upon creation
  • Loading branch information
rlucioni committed Jul 25, 2013
2 parents 6923687 + 1a0055a commit 30baebd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions common/lib/xmodule/xmodule/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
6 changes: 3 additions & 3 deletions common/lib/xmodule/xmodule/tests/test_progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'''
Expand Down

0 comments on commit 30baebd

Please sign in to comment.