add option to exclude exercise
authorJan Szejko <janek37@gmail.com>
Tue, 27 Nov 2018 12:32:05 +0000 (13:32 +0100)
committerJan Szejko <janek37@gmail.com>
Tue, 27 Nov 2018 12:32:05 +0000 (13:32 +0100)
wtem/models.py

index 1146770..e3b0656 100644 (file)
@@ -169,6 +169,8 @@ class Submission(models.Model):
 
     def get_final_exercise_mark(self, exercise_id):
         exercise = get_exercise_by_id(exercise_id)
+        if exercise.get('excluded'):
+            return 0
         if exercise_checked_manually(exercise):
             marks_by_examiner = self.get_exercise_marks_by_examiner(exercise_id)
             if len(marks_by_examiner):