Commit 5644d081 by Victor Shnayder

Merge pull request #1625 from MITx/hotfix/dave/missing_npoints

Hotfix/dave/missing npoints
parents c1846134 5f44b2de
...@@ -111,15 +111,14 @@ class CorrectMap(object): ...@@ -111,15 +111,14 @@ class CorrectMap(object):
return None return None
def get_npoints(self, answer_id): def get_npoints(self, answer_id):
""" Return the number of points for an answer: """Return the number of points for an answer, used for partial credit."""
If the answer is correct, return the assigned npoints = self.get_property(answer_id, 'npoints')
number of points (default: 1 point) if npoints is not None:
Otherwise, return 0 points """ return npoints
if self.is_correct(answer_id): elif self.is_correct(answer_id):
npoints = self.get_property(answer_id, 'npoints') return 1
return npoints if npoints is not None else 1 # if not correct and no points have been assigned, return 0
else: return 0
return 0
def set_property(self, answer_id, property, value): def set_property(self, answer_id, property, value):
if answer_id in self.cmap: if answer_id in self.cmap:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment