diff --git a/participation/forms.py b/participation/forms.py index 5691971..0a3f0f9 100644 --- a/participation/forms.py +++ b/participation/forms.py @@ -288,7 +288,7 @@ class UploadNotesForm(forms.Form): continue name = line[0] - if name in ["Rôle", "Juré", "moyenne", "coefficient", "sous-total", "Equipe"]: + if name.lower() in ["rôle", "juré", "moyenne", "coefficient", "sous-total", "équipe", "equipe"]: continue notes = line[1:line_length] if not all(s.isnumeric() or s[0] == '-' and s[1:].isnumeric() for s in notes): diff --git a/participation/models.py b/participation/models.py index 41113ef..88434c0 100644 --- a/participation/models.py +++ b/participation/models.py @@ -534,6 +534,17 @@ class Passage(models.Model): def average_observer(self) -> float: return self.avg(note.observer_oral for note in self.notes.all()) + @property + def averages(self): + yield self.average_defender_writing + yield self.average_defender_oral + yield self.average_opponent_writing + yield self.average_opponent_oral + yield self.average_reporter_writing + yield self.average_reporter_oral + if self.observer: + yield self.average_observer + def average(self, participation): return self.average_defender if participation == self.defender else self.average_opponent \ if participation == self.opponent else self.average_reporter if participation == self.reporter \ @@ -740,6 +751,16 @@ class Note(models.Model): default=0, ) + def get_all(self): + yield self.defender_writing + yield self.defender_oral + yield self.opponent_writing + yield self.opponent_oral + yield self.reporter_writing + yield self.reporter_oral + if self.passage.observer: + yield self.observer_oral + def set_all(self, defender_writing: int, defender_oral: int, opponent_writing: int, opponent_oral: int, reporter_writing: int, reporter_oral: int, observer_oral: int = 0): self.defender_writing = defender_writing diff --git a/participation/static/Fiche notations - 3 équipes.ods b/participation/static/Fiche notations - 3 équipes.ods deleted file mode 100644 index 11afeb9..0000000 Binary files a/participation/static/Fiche notations - 3 équipes.ods and /dev/null differ diff --git a/participation/static/Fiche notations - 4 équipes.ods b/participation/static/Fiche notations - 4 équipes.ods deleted file mode 100644 index acd1367..0000000 Binary files a/participation/static/Fiche notations - 4 équipes.ods and /dev/null differ diff --git a/participation/static/Fiche notations - 5 équipes.ods b/participation/static/Fiche notations - 5 équipes.ods deleted file mode 100644 index 3bfd357..0000000 Binary files a/participation/static/Fiche notations - 5 équipes.ods and /dev/null differ diff --git a/participation/templates/participation/upload_notes.html b/participation/templates/participation/upload_notes.html index 8a0e3f6..a38c0b0 100644 --- a/participation/templates/participation/upload_notes.html +++ b/participation/templates/participation/upload_notes.html @@ -2,20 +2,13 @@ {% load crispy_forms_tags %} {% load i18n %} -{% load static %} {% block content %}