Assign a score of 0 to tasks with no attempts

This commit is contained in:
Calen Pennington
2013-11-16 10:30:05 -05:00
parent 347f0c7508
commit e47e60f68b

View File

@@ -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,