From 462c084bf40ac73fe13958ed949dd8c4b15ae7bb Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 10 Mar 2022 19:35:12 +0100 Subject: [PATCH] =?UTF-8?q?Bul.=20BUT:=20Poids=20des=20evals=20avec=20vale?= =?UTF-8?q?urs=20par=20d=C3=A9faut.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but.py | 8 ++++++-- app/comp/moy_ue.py | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 13af9dea5..cba3732b0 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -11,7 +11,7 @@ import datetime from flask import url_for, g from app.comp.res_but import ResultatsSemestreBUT -from app.models import FormSemestre, Identite, formsemestre +from app.models import FormSemestre, Identite from app.scodoc import sco_bulletins, sco_utils as scu from app.scodoc import sco_bulletins_json from app.scodoc import sco_bulletins_pdf @@ -171,6 +171,10 @@ class BulletinBUT: # eval_notes est une pd.Series avec toutes les notes des étudiants inscrits eval_notes = self.res.modimpls_results[e.moduleimpl_id].evals_notes[e.id] notes_ok = eval_notes.where(eval_notes > scu.NOTES_ABSENCE).dropna() + poids = { + ue.acronyme: self.res.modimpls_evals_poids[e.moduleimpl_id][ue.id][e.id] + for ue in self.res.ues + } d = { "id": e.id, "description": e.description, @@ -178,7 +182,7 @@ class BulletinBUT: "heure_debut": e.heure_debut.strftime("%H:%M") if e.heure_debut else None, "heure_fin": e.heure_fin.strftime("%H:%M") if e.heure_debut else None, "coef": fmt_note(e.coefficient), - "poids": {p.ue.acronyme: p.poids for p in e.ue_poids}, + "poids": poids, "note": { "value": fmt_note( eval_notes[etud.id], diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index efbe7cd34..6d80f0b7b 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -197,6 +197,7 @@ def notes_sem_load_cube(formsemestre: FormSemestre) -> tuple: evals_poids, _ = moy_mod.load_evaluations_poids(modimpl.id) etuds_moy_module = mod_results.compute_module_moy(evals_poids) modimpls_results[modimpl.id] = mod_results + modimpls_evals_poids[modimpl.id] = evals_poids modimpls_notes.append(etuds_moy_module) if len(modimpls_notes): cube = notes_sem_assemble_cube(modimpls_notes)