forked from ScoDoc/ScoDoc
Fix affichage moyennes groupes sur moduleimpl_status si tous EXC
This commit is contained in:
parent
9be3c9105f
commit
ab65ae375f
@ -64,18 +64,28 @@ import sco_version
|
||||
# --------------------------------------------------------------------
|
||||
def notes_moyenne_median_mini_maxi(notes):
|
||||
"calcule moyenne et mediane d'une liste de valeurs (floats)"
|
||||
notes = [
|
||||
notes_num = [
|
||||
x
|
||||
for x in notes
|
||||
if (x != None) and (x != scu.NOTES_NEUTRALISE) and (x != scu.NOTES_ATTENTE)
|
||||
if (x is not None) and (x != scu.NOTES_NEUTRALISE) and (x != scu.NOTES_ATTENTE)
|
||||
]
|
||||
n = len(notes)
|
||||
n = len(notes_num)
|
||||
if not n:
|
||||
# Aucune note numérique
|
||||
# si elles sont toutes EXC, renvoie EXC
|
||||
if all(x == scu.NOTES_NEUTRALISE for x in notes):
|
||||
return (
|
||||
scu.NOTES_NEUTRALISE,
|
||||
scu.NOTES_NEUTRALISE,
|
||||
scu.NOTES_NEUTRALISE,
|
||||
scu.NOTES_NEUTRALISE,
|
||||
)
|
||||
# sinon renvoie ABS
|
||||
return None, None, None, None
|
||||
moy = sum(notes) / n
|
||||
median = list_median(notes)
|
||||
mini = min(notes)
|
||||
maxi = max(notes)
|
||||
moy = sum(notes_num) / n
|
||||
median = list_median(notes_num)
|
||||
mini = min(notes_num)
|
||||
maxi = max(notes_num)
|
||||
return moy, median, mini, maxi
|
||||
|
||||
|
||||
|
@ -851,7 +851,7 @@ def _ligne_evaluation(
|
||||
)
|
||||
if gr_moyenne["gr_nb_notes"] > 0:
|
||||
H.append(
|
||||
f"""{gr_moyenne["gr_moy"]} (<a href="{
|
||||
f"""{gr_moyenne["gr_moy"]} (<a class="stdlink" href="{
|
||||
url_for('notes.evaluation_listenotes',
|
||||
scodoc_dept=g.scodoc_dept, evaluation_id=evaluation.id,
|
||||
tf_submitted=1, **{'group_ids:list': gr_moyenne["group_id"]})
|
||||
|
Loading…
Reference in New Issue
Block a user