forked from ScoDoc/DocScoDoc
json: formatte notes en txt
This commit is contained in:
parent
20470484d1
commit
177f23b48c
@ -15,7 +15,7 @@ from app.scodoc import sco_utils as scu
|
|||||||
from app.scodoc.sco_cache import ResultatsSemestreBUTCache
|
from app.scodoc.sco_cache import ResultatsSemestreBUTCache
|
||||||
from app.scodoc.sco_exceptions import ScoFormatError
|
from app.scodoc.sco_exceptions import ScoFormatError
|
||||||
from app.scodoc import sco_preferences
|
from app.scodoc import sco_preferences
|
||||||
from app.scodoc.sco_utils import jsnan
|
from app.scodoc.sco_utils import jsnan, fmt_note
|
||||||
|
|
||||||
|
|
||||||
class ResultatsSemestreBUT:
|
class ResultatsSemestreBUT:
|
||||||
@ -102,7 +102,7 @@ class ResultatsSemestreBUT:
|
|||||||
d[mi.module.code] = {
|
d[mi.module.code] = {
|
||||||
"id": mi.id,
|
"id": mi.id,
|
||||||
"coef": coef,
|
"coef": coef,
|
||||||
"moyenne": jsnan(
|
"moyenne": fmt_note(
|
||||||
etud_moy_module[self.modimpl_coefs_df.columns.get_loc(mi.id)][
|
etud_moy_module[self.modimpl_coefs_df.columns.get_loc(mi.id)][
|
||||||
ue_idx
|
ue_idx
|
||||||
]
|
]
|
||||||
@ -119,7 +119,7 @@ class ResultatsSemestreBUT:
|
|||||||
"total": ue.ects,
|
"total": ue.ects,
|
||||||
},
|
},
|
||||||
"competence": None, # XXX TODO lien avec référentiel
|
"competence": None, # XXX TODO lien avec référentiel
|
||||||
"moyenne": jsnan(self.etud_moy_ue[ue.id].mean()),
|
"moyenne": fmt_note(self.etud_moy_ue[ue.id].mean()),
|
||||||
"bonus": None, # XXX TODO
|
"bonus": None, # XXX TODO
|
||||||
"malus": None, # XXX TODO voir ce qui est ici
|
"malus": None, # XXX TODO voir ce qui est ici
|
||||||
"capitalise": None, # "AAAA-MM-JJ" TODO
|
"capitalise": None, # "AAAA-MM-JJ" TODO
|
||||||
@ -145,10 +145,10 @@ class ResultatsSemestreBUT:
|
|||||||
"titre": mi.module.titre,
|
"titre": mi.module.titre,
|
||||||
"code_apogee": mi.module.code_apogee,
|
"code_apogee": mi.module.code_apogee,
|
||||||
"moyenne": {
|
"moyenne": {
|
||||||
"value": jsnan(self.sem_cube[etud_idx, mod_idx].mean()),
|
"value": fmt_note(self.sem_cube[etud_idx, mod_idx].mean()),
|
||||||
"min": jsnan(moyennes_etuds.min()),
|
"min": fmt_note(moyennes_etuds.min()),
|
||||||
"max": jsnan(moyennes_etuds.max()),
|
"max": fmt_note(moyennes_etuds.max()),
|
||||||
"moy": jsnan(moyennes_etuds.mean()),
|
"moy": fmt_note(moyennes_etuds.mean()),
|
||||||
},
|
},
|
||||||
"evaluations": [
|
"evaluations": [
|
||||||
self.etud_eval_results(etud, e)
|
self.etud_eval_results(etud, e)
|
||||||
@ -171,12 +171,12 @@ class ResultatsSemestreBUT:
|
|||||||
"coef": e.coefficient,
|
"coef": e.coefficient,
|
||||||
"poids": {p.ue.acronyme: p.poids for p in e.ue_poids},
|
"poids": {p.ue.acronyme: p.poids for p in e.ue_poids},
|
||||||
"note": {
|
"note": {
|
||||||
"value": jsnan(
|
"value": fmt_note(
|
||||||
self.modimpls_evals_notes[e.moduleimpl_id][str(e.id)][etud.id]
|
self.modimpls_evals_notes[e.moduleimpl_id][str(e.id)][etud.id]
|
||||||
),
|
),
|
||||||
"min": jsnan(notes_ok.min()),
|
"min": fmt_note(notes_ok.min()),
|
||||||
"max": jsnan(notes_ok.max()),
|
"max": fmt_note(notes_ok.max()),
|
||||||
"moy": jsnan(notes_ok.mean()),
|
"moy": fmt_note(notes_ok.mean()),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
return d
|
return d
|
||||||
@ -200,10 +200,10 @@ class ResultatsSemestreBUT:
|
|||||||
"ues": {ue.acronyme: self.etud_ue_results(etud, ue) for ue in self.ues},
|
"ues": {ue.acronyme: self.etud_ue_results(etud, ue) for ue in self.ues},
|
||||||
"semestre": {
|
"semestre": {
|
||||||
"notes": { # moyenne des moyennes générales du semestre
|
"notes": { # moyenne des moyennes générales du semestre
|
||||||
"value": jsnan("xxx"), # XXX TODO
|
"value": fmt_note("xxx"), # XXX TODO
|
||||||
"min": jsnan("0."),
|
"min": fmt_note("0."),
|
||||||
"moy": jsnan("10.0"),
|
"moy": fmt_note("10.0"),
|
||||||
"max": jsnan("20.00"),
|
"max": fmt_note("20.00"),
|
||||||
},
|
},
|
||||||
"rang": { # classement wrt moyenne général, indicatif
|
"rang": { # classement wrt moyenne général, indicatif
|
||||||
"value": None, # XXX TODO
|
"value": None, # XXX TODO
|
||||||
|
@ -170,7 +170,7 @@ def fmt_note(val, note_max=None, keep_numeric=False):
|
|||||||
return "ATT" # attente, note neutralisee
|
return "ATT" # attente, note neutralisee
|
||||||
if isinstance(val, float) or isinstance(val, int):
|
if isinstance(val, float) or isinstance(val, int):
|
||||||
if np.isnan(val):
|
if np.isnan(val):
|
||||||
return "/"
|
return "~"
|
||||||
if note_max != None and note_max > 0:
|
if note_max != None and note_max > 0:
|
||||||
val = val * 20.0 / note_max
|
val = val * 20.0 / note_max
|
||||||
if keep_numeric:
|
if keep_numeric:
|
||||||
|
Loading…
Reference in New Issue
Block a user