mirror of
https://codeberg.org/Mo8it/AdvLabDB.git
synced 2024-11-08 21:21:06 +00:00
Fix updateFinalExperimentMark
This commit is contained in:
parent
6c84829c4d
commit
7a1c0e9d55
1 changed files with 6 additions and 5 deletions
|
@ -535,11 +535,12 @@ class ExperimentMark(db.Model):
|
|||
return ExperimentMark(part_student=part_student, group_experiment=group_experiment)
|
||||
|
||||
def updateFinalExperimentMark(self):
|
||||
semesterExperiment = self.group_experiment.semester_experiment
|
||||
self.final_experiment_mark = roundHalfUpToInt(
|
||||
semesterExperiment.oral_weighting * self.oral_mark
|
||||
+ semesterExperiment.protocol_weighting * self.protocol_mark
|
||||
)
|
||||
if None not in (self.oral_mark, self.protocol_mark):
|
||||
semesterExperiment = self.group_experiment.semester_experiment
|
||||
self.final_experiment_mark = roundHalfUpToInt(
|
||||
semesterExperiment.oral_weighting * self.oral_mark
|
||||
+ semesterExperiment.protocol_weighting * self.protocol_mark
|
||||
)
|
||||
|
||||
def repr(self):
|
||||
return f"Mark {self.final_experiment_mark}; Exp {self.group_experiment.semester_experiment.repr()}"
|
||||
|
|
Loading…
Reference in a new issue