Commit 6ab6beaa by Filippo Valsorda

Once completed, lock score by checking self.completed

parent d9423680
...@@ -148,11 +148,13 @@ class MentoringBlock(XBlockWithLightChildren): ...@@ -148,11 +148,13 @@ class MentoringBlock(XBlockWithLightChildren):
elif completed and self.next_step == self.url_name: elif completed and self.next_step == self.url_name:
self.next_step = self.followed_by self.next_step = self.followed_by
score = sum(r[1]['score'] for r in submit_results) / float(len(submit_results)) # Once it was completed, lock score
self.runtime.publish(self, 'grade', { if not self.completed:
'value': score, score = sum(r[1]['score'] for r in submit_results) / float(len(submit_results))
'max_value': 1, self.runtime.publish(self, 'grade', {
}) 'value': score,
'max_value': 1,
})
if not self.completed and self.max_attempts > 0: if not self.completed and self.max_attempts > 0:
self.num_attempts += 1 self.num_attempts += 1
......
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