1
0
forked from ScoDoc/ScoDoc

Modification bulletins BUT: plus de moyennes indicatives de module

This commit is contained in:
Emmanuel Viennet 2021-12-16 00:03:24 +01:00
parent 1b2573d130
commit e06cf82db8
2 changed files with 18 additions and 25 deletions

View File

@ -152,18 +152,18 @@ class ResultatsSemestreBUT:
etud_idx = self.etud_index[etud.id] etud_idx = self.etud_index[etud.id]
for mi in modimpls: for mi in modimpls:
mod_idx = self.modimpl_coefs_df.columns.get_loc(mi.id) mod_idx = self.modimpl_coefs_df.columns.get_loc(mi.id)
# moyennes indicatives (moyennes de moyennes d'UE) # # moyennes indicatives (moyennes de moyennes d'UE)
try: # try:
moyennes_etuds = np.nan_to_num( # moyennes_etuds = np.nan_to_num(
np.nanmean(self.sem_cube[:, mod_idx, :], axis=1), # np.nanmean(self.sem_cube[:, mod_idx, :], axis=1),
copy=False, # copy=False,
) # )
except RuntimeWarning: # all nans in np.nanmean (sur certains etuds sans notes valides) # except RuntimeWarning: # all nans in np.nanmean (sur certains etuds sans notes valides)
pass # pass
try: # try:
moy_indicative_mod = np.nanmean(self.sem_cube[etud_idx, mod_idx]) # moy_indicative_mod = np.nanmean(self.sem_cube[etud_idx, mod_idx])
except RuntimeWarning: # all nans in np.nanmean # except RuntimeWarning: # all nans in np.nanmean
pass # pass
d[mi.module.code] = { d[mi.module.code] = {
"id": mi.id, "id": mi.id,
"titre": mi.module.titre, "titre": mi.module.titre,
@ -174,11 +174,11 @@ class ResultatsSemestreBUT:
moduleimpl_id=mi.id, moduleimpl_id=mi.id,
), ),
"moyenne": { "moyenne": {
# moyenne indicative de module: moyenne des UE, ignorant celles sans notes (nan) # # moyenne indicative de module: moyenne des UE, ignorant celles sans notes (nan)
"value": fmt_note(moy_indicative_mod), # "value": fmt_note(moy_indicative_mod),
"min": fmt_note(moyennes_etuds.min()), # "min": fmt_note(moyennes_etuds.min()),
"max": fmt_note(moyennes_etuds.max()), # "max": fmt_note(moyennes_etuds.max()),
"moy": fmt_note(moyennes_etuds.mean()), # "moy": fmt_note(moyennes_etuds.mean()),
}, },
"evaluations": [ "evaluations": [
self.etud_eval_results(etud, e) self.etud_eval_results(etud, e)

View File

@ -172,14 +172,7 @@ function showEvaluations(data) {
<div> <div>
<div class=module> <div class=module>
<h3><a href="${content.url}">${numero} - ${content.titre}</a></h3> <h3><a href="${content.url}">${numero} - ${content.titre}</a></h3>
<div>
<div class=moyenne>Moyenne&nbsp;indicative&nbsp;:&nbsp;${content.moyenne.value}</div>
<div class=info>
Classe&nbsp;:&nbsp;${content.moyenne.moy}&nbsp;-
Max&nbsp;:&nbsp;${content.moyenne.max}&nbsp;-
Min&nbsp;:&nbsp;${content.moyenne.min}
</div>
</div>
<div class=absences> <div class=absences>
<div>Abs&nbsp;inj.</div><div>${content.absences?.injustifie || 0}</div> <div>Abs&nbsp;inj.</div><div>${content.absences?.injustifie || 0}</div>
<div>Total</div><div>${content.absences?.total || 0}</div> <div>Total</div><div>${content.absences?.total || 0}</div>