In previous commit, the get calls for the QuerySet objects self.students and self.exercises caused QuerySet evaluation on every loop iteration in the __collect_student_grades method. This was not the intended behaviour. Now the data of those QuerySets should be loaded in to memory all at once so there are not too much database query overhead. Note that the memory usage might get high.

Also filtered out submissions in self.best_submissions that were not bound to any submitters anymore.