From 4626cb9a3e1b8c0aa0a60324eb9dd40306abfa1b Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 25 Nov 2022 22:32:06 +0100 Subject: [PATCH] =?UTF-8?q?Bulletin=20JSON=20classique:=20ajoute=20mati?= =?UTF-8?q?=C3=A8res.=20Closes=20#535?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/modules.py | 2 +- app/scodoc/sco_bulletins_json.py | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/models/modules.py b/app/models/modules.py index e309db1c..c73d82fd 100644 --- a/app/models/modules.py +++ b/app/models/modules.py @@ -6,7 +6,7 @@ from app.models import APO_CODE_STR_LEN from app.models.but_refcomp import ApcParcours, app_critiques_modules, parcours_modules from app.scodoc import sco_utils as scu from app.scodoc.sco_codes_parcours import UE_SPORT -from app.scodoc.sco_utils import ModuleType, abbrev_prenom +from app.scodoc.sco_utils import ModuleType class Module(db.Model): diff --git a/app/scodoc/sco_bulletins_json.py b/app/scodoc/sco_bulletins_json.py index fb0be065..e0cf1044 100644 --- a/app/scodoc/sco_bulletins_json.py +++ b/app/scodoc/sco_bulletins_json.py @@ -250,6 +250,7 @@ def formsemestre_bulletinetud_published_dict( # ects=ects, ects des modules maintenant inutilisés note=dict(value=mod_moy), code_apogee=quote_xml_attr(mod["code_apogee"]), + matiere_id=mod["matiere_id"], ) m["note"].update(modstat) for k in ("min", "max", "moy"): # formatte toutes les notes @@ -344,6 +345,15 @@ def formsemestre_bulletinetud_published_dict( ) ) + # --- Matières: + # for matiere_id in nt.moyennes_matieres: + d["matiere"] = [ + { + "matiere_id": matiere_id, + "note": scu.fmt_note(nt.get_etud_mat_moy(matiere_id, etudid)), + } + for matiere_id in nt.moyennes_matieres + ] # --- Absences if prefs["bul_show_abs"]: nbabs, nbabsjust = sco_abs.get_abs_count(etudid, sem)