forked from ScoDoc/ScoDoc
Fix: calcul des moyennes d'UE dispensées
This commit is contained in:
parent
7a59820558
commit
38037669dd
@ -302,10 +302,10 @@ def compute_ue_moys_apc(
|
||||
# Les "dispenses" sont très peu nombreuses et traitées en python:
|
||||
for dispense_ue in dispense_ues:
|
||||
if (
|
||||
dispense_ue[0] in etud_moy_ue_df.columns
|
||||
and dispense_ue[1] in etud_moy_ue_df.index
|
||||
dispense_ue[1] in etud_moy_ue_df.columns
|
||||
and dispense_ue[0] in etud_moy_ue_df.index
|
||||
):
|
||||
etud_moy_ue_df.at[dispense_ue[1], dispense_ue[0]] = 0.0
|
||||
etud_moy_ue_df.at[dispense_ue[0], dispense_ue[1]] = 0.0
|
||||
|
||||
return etud_moy_ue_df
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
|
||||
"Infos sur version ScoDoc"
|
||||
|
||||
SCOVERSION = "9.7.60"
|
||||
SCOVERSION = "9.7.61"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
@ -9,10 +9,12 @@ from app import db
|
||||
from app.comp import moy_ue
|
||||
from app.comp import inscr_mod
|
||||
from app.models import FormSemestre, Evaluation, ModuleImplInscription
|
||||
from app.comp.res_but import ResultatsSemestreBUT
|
||||
from app.scodoc import sco_saisie_notes
|
||||
from app.scodoc.codes_cursus import UE_SPORT
|
||||
from app.scodoc.sco_utils import NOTES_NEUTRALISE
|
||||
from app.scodoc import sco_exceptions
|
||||
from app.views import notes
|
||||
|
||||
|
||||
def test_ue_moy(test_client):
|
||||
@ -121,23 +123,19 @@ def test_ue_moy(test_client):
|
||||
exception_raised = True
|
||||
assert exception_raised
|
||||
# Recalcule les notes:
|
||||
modimpl_coefs_df, _, _ = moy_ue.df_load_modimpl_coefs(
|
||||
formsemestre, modimpls=formsemestre.modimpls_sorted
|
||||
)
|
||||
sem_cube, _, _ = moy_ue.notes_sem_load_cube(formsemestre, modimpl_coefs_df)
|
||||
etuds = formsemestre.etuds.all()
|
||||
modimpl_mask = [
|
||||
modimpl.module.ue.type != UE_SPORT for modimpl in formsemestre.modimpls_sorted
|
||||
]
|
||||
etud_moy_ue = moy_ue.compute_ue_moys_apc(
|
||||
sem_cube,
|
||||
etuds,
|
||||
modimpls,
|
||||
modimpl_inscr_df,
|
||||
modimpl_coefs_df,
|
||||
modimpl_mask,
|
||||
set(),
|
||||
)
|
||||
etud_moy_ue = _recompute(formsemestre)
|
||||
assert etud_moy_ue[ue1.id][etudid] == n1
|
||||
assert etud_moy_ue[ue2.id][etudid] == n1
|
||||
assert etud_moy_ue[ue3.id][etudid] == n1
|
||||
# Test avec une UE dispensée
|
||||
notes.etud_desinscrit_ue(etudid, formsemestre.id, ue3.id)
|
||||
etud_moy_ue = _recompute(formsemestre)
|
||||
assert etud_moy_ue[ue1.id][etudid] == n1
|
||||
assert etud_moy_ue[ue2.id][etudid] == n1
|
||||
assert etud_moy_ue[ue3.id][etudid] == 0.0 # plus inscrit à cette UE
|
||||
|
||||
|
||||
def _recompute(formsemestre: FormSemestre):
|
||||
"recalcule les notes, utilise ResultatsSemestreBUT"
|
||||
nt = ResultatsSemestreBUT(formsemestre)
|
||||
return nt.etud_moy_ue
|
||||
|
Loading…
x
Reference in New Issue
Block a user