From 6a342245bc2d8520b2933db211eeb4aaab8ff529 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Thu, 27 Jun 2024 07:23:27 +0200 Subject: [PATCH] =?UTF-8?q?Am=C3=A9liore=20affichage=20moyenne=20=C3=A9val?= =?UTF-8?q?uation=20sur=20tableau=20bord=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_evaluations.py | 16 ++++++---------- app/scodoc/sco_moduleimpl_status.py | 4 ++-- sco_version.py | 2 +- 3 files changed, 9 insertions(+), 13 deletions(-) diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py index e932ef98a..3fdef7e00 100644 --- a/app/scodoc/sco_evaluations.py +++ b/app/scodoc/sco_evaluations.py @@ -72,16 +72,12 @@ def notes_moyenne_median_mini_maxi(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 + # si elles sont toutes du même type, renvoie ce type (ABS, EXC, ATT) + for type_note in (scu.NOTES_NEUTRALISE, scu.NOTES_ATTENTE, None): + if all(x == type_note for x in notes): + return (type_note, type_note, type_note, type_note) + # sinon renvoie "???" + return "???", None, None, None moy = sum(notes_num) / n median = list_median(notes_num) mini = min(notes_num) diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py index 019000cbd..87e8fc438 100644 --- a/app/scodoc/sco_moduleimpl_status.py +++ b/app/scodoc/sco_moduleimpl_status.py @@ -801,7 +801,7 @@ def _ligne_evaluation( """ % etat ) - if etat["moy"]: + if etat["nb_notes"]: H.append( f"""{etat["moy"]} / 20   (incomplet]""" + }">incomplet : terminer saisie]""" ) else: H.append("""incomplet]""") diff --git a/sco_version.py b/sco_version.py index 5e4aa92a9..e719e9815 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.6.982" +SCOVERSION = "9.6.983" SCONAME = "ScoDoc"