From b1ea6b2012f517d006fcd41bffd7edeaf130f55e Mon Sep 17 00:00:00 2001 From: Vik Paruchuri Date: Tue, 16 Apr 2013 10:58:58 -0400 Subject: [PATCH] Add in comments about max score calculation --- .../open_ended_grading_classes/combined_open_ended_modulev1.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py index e79ab4c25e..f1f2f04c61 100644 --- a/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py +++ b/common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py @@ -739,10 +739,13 @@ class CombinedOpenEndedV1Module(): max_score = None score = None if self.check_if_done_and_scored(): + #Finds the maximum score of all student attempts and keeps it. scores = [] for i in xrange(0, self.current_task_number): last_response = self.get_last_response(i) try: + #This could fail if weight is not defined (is None), or if the last response does not have the needed data. + #Neither is a critical issue, and that particular task score can be skipped for computation. max_score = last_response['max_score'] * float(self.weight) score = last_response['score'] * float(self.weight) scores.append(score)