Fixes #3314, #3331: Various minor fixes.
[edumed.git] / wtem / models.py
index 27e1912..4c3d0ee 100644 (file)
@@ -27,6 +27,7 @@ class Submission(models.Model):
     key_sent = models.BooleanField(default = False)
     marks = JSONField()
     examiners = models.ManyToManyField(User, null = True, blank = True)
     key_sent = models.BooleanField(default = False)
     marks = JSONField()
     examiners = models.ManyToManyField(User, null = True, blank = True)
+    end_time = models.CharField(max_length = 5, null = True, blank = True)
 
     def __unicode__(self):
         return ', '.join((self.last_name, self.first_name, self.email))
 
     def __unicode__(self):
         return ', '.join((self.last_name, self.first_name, self.email))
@@ -83,7 +84,7 @@ class Submission(models.Model):
         if exercise_checked_manually(exercise):
             marks_by_examiner = self.get_exercise_marks_by_examiner(exercise_id)
             if len(marks_by_examiner):
         if exercise_checked_manually(exercise):
             marks_by_examiner = self.get_exercise_marks_by_examiner(exercise_id)
             if len(marks_by_examiner):
-                return max(map(int, marks_by_examiner.values()))
+                return sum(map(int, marks_by_examiner.values())) / float(len(marks_by_examiner))
             else:
                 return None
         else:
             else:
                 return None
         else: