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 8e8d33ad08..5c0a3b16ff 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 @@ -259,7 +259,11 @@ class CombinedOpenEndedV1Module(): return (0, 0, state_values[self.INITITIAL], idx) final_child_state = json.loads(task_states[-1]) - best_score = max(attempt.get('score', 0) for attempt in final_child_state.get('child_history', [])) + scores = [attempt.get('score', 0) for attempt in final_child_state.get('child_history', [])] + if scores: + best_score = max(scores) + else: + best_score = 0 return ( len(task_states), best_score,