Bulletin JSON classique: ajoute matières. Closes #535

This commit is contained in:
Emmanuel Viennet 2022-11-25 22:32:06 +01:00 committed by iziram
parent 0a58437fa9
commit 4626cb9a3e
2 changed files with 11 additions and 1 deletions

View File

@ -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):

View File

@ -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)