From deaeb88cf9ae529f1589a99236e8a09812356380 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Sun, 27 Aug 2023 14:27:50 +0200 Subject: [PATCH] =?UTF-8?q?Fix:=20calcul=20moyenne=20g=C3=A9n=C3=A9rale=20?= =?UTF-8?q?classique=20avec=20coef.=20UEs=20non=20renseign=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/comp/moy_ue.py | 5 ++++- app/scodoc/sco_formsemestre_status.py | 10 ++++++---- app/static/css/scodoc.css | 6 ++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index 30d8466b4..071d72e81 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -394,7 +394,10 @@ def compute_ue_moys_classic( if sco_preferences.get_preference("use_ue_coefs", formsemestre.id): # Cas avec coefficients d'UE forcés: (on met à zéro l'UE bonus) etud_coef_ue_df = pd.DataFrame( - {ue.id: ue.coefficient if ue.type != UE_SPORT else 0.0 for ue in ues}, + { + ue.id: (ue.coefficient or 0.0) if ue.type != UE_SPORT else 0.0 + for ue in ues + }, index=modimpl_inscr_df.index, columns=[ue.id for ue in ues], ) diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 2e572ea30..d375a47d0 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -50,6 +50,7 @@ from app.models import ( ModuleImpl, NotesNotes, ) +from app.scodoc.codes_cursus import UE_SPORT import app.scodoc.sco_utils as scu from app.scodoc.sco_utils import ModuleType from app.scodoc.sco_permissions import Permission @@ -60,7 +61,6 @@ from app.scodoc.sco_exceptions import ( ) from app.scodoc import html_sco_header from app.scodoc import htmlutils -from app.scodoc import sco_abs from app.scodoc import sco_archives from app.scodoc import sco_bulletins from app.scodoc import codes_cursus @@ -660,9 +660,11 @@ def formsemestre_description_table( "Module": ue.titre, "_css_row_class": "table_row_ue", } - if use_ue_coefs: - ue_info["Coef."] = ue.coefficient - ue_info["Coef._class"] = "ue_coef" + if use_ue_coefs and ue.type != UE_SPORT: + ue_info["Coef."] = ue.coefficient or "0." + ue_info["_Coef._class"] = "ue_coef" + if not ue.coefficient: + ue_info["_Coef._class"] += " ue_coef_nul" if ue.color: for k in list(ue_info.keys()): if not k.startswith("_"): diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index df293cf7d..92d00c376 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -2472,6 +2472,12 @@ span.ue_type { margin-right: 1.5em; } +table.formsemestre_description td.ue_coef_nul { + background-color: yellow!important; + color: red; + font-weight: bold; +} + ul.notes_module_list span.ue_coefs_list { color: blue; font-size: 70%;