Commit 16457845 by Tim Krones

Clean up: Compute score only once in get_score.

parent e5a75576
......@@ -1093,11 +1093,12 @@ class MentoringWithExplicitStepsBlock(BaseMentoringBlock, StudioContainerWithNes
@XBlock.json_handler
def get_score(self, data, suffix):
score = self.score
return {
'score': self.score.percentage,
'correct_answers': len(self.score.correct),
'incorrect_answers': len(self.score.incorrect),
'partially_correct_answers': len(self.score.partially_correct),
'score': score.percentage,
'correct_answers': len(score.correct),
'incorrect_answers': len(score.incorrect),
'partially_correct_answers': len(score.partially_correct),
'correct': self.correct_json(stringify=False),
'incorrect': self.incorrect_json(False),
'partial': self.partial_json(False),
......
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