Fix: calcul moyenne générale classique avec coef. UEs non renseignés

This commit is contained in:
Emmanuel Viennet 2023-08-27 14:27:50 +02:00
parent a82589a362
commit deaeb88cf9
3 changed files with 16 additions and 5 deletions

View File

@ -394,7 +394,10 @@ def compute_ue_moys_classic(
if sco_preferences.get_preference("use_ue_coefs", formsemestre.id): if sco_preferences.get_preference("use_ue_coefs", formsemestre.id):
# Cas avec coefficients d'UE forcés: (on met à zéro l'UE bonus) # Cas avec coefficients d'UE forcés: (on met à zéro l'UE bonus)
etud_coef_ue_df = pd.DataFrame( 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, index=modimpl_inscr_df.index,
columns=[ue.id for ue in ues], columns=[ue.id for ue in ues],
) )

View File

@ -50,6 +50,7 @@ from app.models import (
ModuleImpl, ModuleImpl,
NotesNotes, NotesNotes,
) )
from app.scodoc.codes_cursus import UE_SPORT
import app.scodoc.sco_utils as scu import app.scodoc.sco_utils as scu
from app.scodoc.sco_utils import ModuleType from app.scodoc.sco_utils import ModuleType
from app.scodoc.sco_permissions import Permission 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 html_sco_header
from app.scodoc import htmlutils from app.scodoc import htmlutils
from app.scodoc import sco_abs
from app.scodoc import sco_archives from app.scodoc import sco_archives
from app.scodoc import sco_bulletins from app.scodoc import sco_bulletins
from app.scodoc import codes_cursus from app.scodoc import codes_cursus
@ -660,9 +660,11 @@ def formsemestre_description_table(
"Module": ue.titre, "Module": ue.titre,
"_css_row_class": "table_row_ue", "_css_row_class": "table_row_ue",
} }
if use_ue_coefs: if use_ue_coefs and ue.type != UE_SPORT:
ue_info["Coef."] = ue.coefficient ue_info["Coef."] = ue.coefficient or "0."
ue_info["Coef._class"] = "ue_coef" ue_info["_Coef._class"] = "ue_coef"
if not ue.coefficient:
ue_info["_Coef._class"] += " ue_coef_nul"
if ue.color: if ue.color:
for k in list(ue_info.keys()): for k in list(ue_info.keys()):
if not k.startswith("_"): if not k.startswith("_"):

View File

@ -2472,6 +2472,12 @@ span.ue_type {
margin-right: 1.5em; 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 { ul.notes_module_list span.ue_coefs_list {
color: blue; color: blue;
font-size: 70%; font-size: 70%;