forked from ScoDoc/ScoDoc
Tests Yaml: saisie notes non numériques (EXC, ABS, ...)
This commit is contained in:
parent
90e72fb717
commit
6967c54f89
@ -74,7 +74,7 @@ from app.scodoc import sco_etud
|
||||
|
||||
|
||||
def convert_note_from_string(
|
||||
note,
|
||||
note: str,
|
||||
note_max,
|
||||
note_min=scu.NOTES_MIN,
|
||||
etudid: int = None,
|
||||
@ -128,7 +128,8 @@ def _displayNote(val):
|
||||
return val
|
||||
|
||||
|
||||
def _check_notes(notes, evaluation, mod):
|
||||
def _check_notes(notes: list[(int, float)], evaluation: dict, mod: dict):
|
||||
# XXX typehint : float or str
|
||||
"""notes is a list of tuples (etudid, value)
|
||||
mod is the module (used to ckeck type, for malus)
|
||||
returns list of valid notes (etudid, float value)
|
||||
|
@ -1,6 +1,9 @@
|
||||
# Tests unitaires jury BUT - IUTLM GMP
|
||||
# Essais avec un BUT GMP, 4 UE + 1 bonus et deux parcours sur S3 S4
|
||||
# Contrib Martin M.
|
||||
#
|
||||
# Pour ne jouer que ce scénario:
|
||||
# pytest -m lemans tests/unit/test_but_jury.py
|
||||
|
||||
ReferentielCompetences:
|
||||
filename: but-GMP-05012022-081650.xml
|
||||
@ -115,7 +118,7 @@ FormSemestres:
|
||||
date_fin: 2024-01-12
|
||||
|
||||
Etudiants:
|
||||
gmp01:
|
||||
gmp01: # cursus S1, S2, S3
|
||||
prenom: etugmp01
|
||||
civilite: M
|
||||
formsemestres:
|
||||
@ -231,7 +234,7 @@ Etudiants:
|
||||
code_valide: ADM
|
||||
moy_ue: 12.5
|
||||
|
||||
gmp02:
|
||||
gmp02: # cursus S1, S2, S3
|
||||
prenom: etugmp02
|
||||
civilite: F
|
||||
formsemestres:
|
||||
@ -346,7 +349,7 @@ Etudiants:
|
||||
# code_valide: ADM
|
||||
# moy_ue: 14
|
||||
|
||||
gmp03:
|
||||
gmp03: # cursus S1, S2, S1-red
|
||||
prenom: etugmp03
|
||||
civilite: X
|
||||
formsemestres:
|
||||
@ -431,6 +434,7 @@ Etudiants:
|
||||
notes_modules: # on ne note ici que les UE à refaire
|
||||
"SAE1.1": 14. # il améliore son UE 1
|
||||
"SAE1.2": 12. # et cette fois reussi les autres
|
||||
"SAE1.3": EXC # pour que l'éval soit complete
|
||||
"SAE1.4": 13.
|
||||
attendu:
|
||||
nb_competences: 4
|
||||
@ -447,3 +451,19 @@ Etudiants:
|
||||
"UE1.4-C4":
|
||||
code_valide: ADM
|
||||
moy_ue: 13
|
||||
|
||||
gmp04: # cursus S1-red (primo-entrant)
|
||||
prenom: Primo
|
||||
civilite: M
|
||||
formsemestres:
|
||||
S1-red:
|
||||
notes_modules:
|
||||
"SAE1.1": 11.
|
||||
"SAE1.2": 12.
|
||||
"SAE1.3": 13.
|
||||
"SAE1.4": 9.
|
||||
attendu: # les codes jury que l'on doit vérifier
|
||||
deca:
|
||||
"UE1.4-C4":
|
||||
code_valide: "AJ"
|
||||
moy_ue: 9.
|
||||
|
@ -237,10 +237,21 @@ def note_les_modules(doc: dict):
|
||||
raise ValueError(f"module de code '{code_module}' introuvable")
|
||||
for evaluation in modimpl.evaluations:
|
||||
# s'il y a plusieurs evals, affecte la même note à chacune
|
||||
note_value, invalid = sco_saisie_notes.convert_note_from_string(
|
||||
str(note),
|
||||
20.0,
|
||||
note_min=scu.NOTES_MIN,
|
||||
etudid=etud.id,
|
||||
absents=[],
|
||||
tosuppress=[],
|
||||
invalids=[],
|
||||
)
|
||||
assert not invalid # valeur note invalide
|
||||
assert isinstance(note_value, float)
|
||||
sco_saisie_notes.notes_add(
|
||||
a_user,
|
||||
evaluation.id,
|
||||
[(etud.id, float(note))],
|
||||
[(etud.id, note_value)],
|
||||
comment="note_les_modules",
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user