From 720ca7222c0ddaf2a79a9c34c45ecdc36f3cea0e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 31 Jul 2023 20:37:58 +0200 Subject: [PATCH] Fix #666: affichage malus sur tableau bord modimpl. --- app/scodoc/sco_evaluations.py | 19 +++++++++---------- app/scodoc/sco_moduleimpl_status.py | 5 ++++- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/app/scodoc/sco_evaluations.py b/app/scodoc/sco_evaluations.py index 4a9dfb6d4..12440d112 100644 --- a/app/scodoc/sco_evaluations.py +++ b/app/scodoc/sco_evaluations.py @@ -40,7 +40,6 @@ from flask import request from app.comp import res_sem from app.comp.res_compat import NotesTableCompat from app.models import FormSemestre -from app.models import ScolarNews import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType @@ -217,19 +216,19 @@ def do_evaluation_etat( (TotalNbMissing > 0) and (E["evaluation_type"] != scu.EVALUATION_RATTRAPAGE) and (E["evaluation_type"] != scu.EVALUATION_SESSION2) - and not is_malus ): complete = False else: complete = True - if ( - TotalNbMissing > 0 - and ((TotalNbMissing == TotalNbAtt) or E["publish_incomplete"]) - and not is_malus - ): - evalattente = True - else: - evalattente = False + + complete = ( + (TotalNbMissing == 0) + or (E["evaluation_type"] == scu.EVALUATION_RATTRAPAGE) + or (E["evaluation_type"] == scu.EVALUATION_SESSION2) + ) + evalattente = (TotalNbMissing > 0) and ( + (TotalNbMissing == TotalNbAtt) or E["publish_incomplete"] + ) # mais ne met pas en attente les evals immediates sans aucune notes: if E["publish_incomplete"] and nb_notes == 0: evalattente = False diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py index 170bfdcae..84e5766ae 100644 --- a/app/scodoc/sco_moduleimpl_status.py +++ b/app/scodoc/sco_moduleimpl_status.py @@ -564,7 +564,10 @@ def _ligne_evaluation( if modimpl.module.ue.type != UE_SPORT: # Avertissement si coefs x poids nuls if coef < scu.NOTES_PRECISION: - H.append("""coef. nul !""") + if modimpl.module.module_type == scu.ModuleType.MALUS: + H.append("""malus""") + else: + H.append("""coef. nul !""") elif is_apc: # visualisation des poids (Hinton map) H.append(_evaluation_poids_html(evaluation, max_poids))