This commit is contained in:
Emmanuel Viennet 2022-03-15 22:24:52 +01:00
parent 7409ccce5a
commit 48d0d89ede
1 changed files with 19 additions and 14 deletions

View File

@ -9,6 +9,7 @@
import collections
import datetime
import numpy as np
from flask import url_for, g
from app.comp.res_but import ResultatsSemestreBUT
@ -295,20 +296,24 @@ class BulletinBUT:
sco_bulletins_json.dict_decision_jury(etud.id, formsemestre.id)
)
if etat_inscription == scu.INSCRIT:
semestre_infos.update(
{
"notes": { # moyenne des moyennes générales du semestre
"value": fmt_note(res.etud_moy_gen[etud.id]),
"min": fmt_note(res.etud_moy_gen.min()),
"moy": fmt_note(res.etud_moy_gen.mean()),
"max": fmt_note(res.etud_moy_gen.max()),
},
"rang": { # classement wrt moyenne général, indicatif
"value": res.etud_moy_gen_ranks[etud.id],
"total": nb_inscrits,
},
},
)
# moyenne des moyennes générales du semestre
semestre_infos["notes"] = {
"value": fmt_note(res.etud_moy_gen[etud.id]),
"min": fmt_note(res.etud_moy_gen.min()),
"moy": fmt_note(res.etud_moy_gen.mean()),
"max": fmt_note(res.etud_moy_gen.max()),
}
if self.prefs["bul_show_rangs"] and not np.isnan(res.etud_moy_gen[etud.id]):
# classement wrt moyenne général, indicatif
semestre_infos["rang"] = {
"value": res.etud_moy_gen_ranks[etud.id],
"total": nb_inscrits,
}
else:
semestre_infos["rang"] = {
"value": "-",
"total": nb_inscrits,
}
d.update(
{
"ressources": self.etud_mods_results(