Fix: bug calcul année but

This commit is contained in:
Emmanuel Viennet 2022-07-03 08:38:12 +02:00
parent 835234779f
commit 962015563a
4 changed files with 9 additions and 5 deletions

View File

@ -220,9 +220,9 @@ class DecisionsProposeesAnnee(DecisionsProposees):
self.formsemestre_pair = formsemestre_pair self.formsemestre_pair = formsemestre_pair
"le second formsemestre de la même année scolaire (S2, S4, S6)" "le second formsemestre de la même année scolaire (S2, S4, S6)"
self.annee_but = ( self.annee_but = (
formsemestre_impair.semestre_id // 2 + 1 (formsemestre_impair.semestre_id + 1) // 2
if formsemestre_impair if formsemestre_impair
else formsemestre_pair.semestre_id // 2 else (formsemestre_pair.semestre_id + 1) // 2
) )
"le rang de l'année dans le BUT: 1, 2, 3" "le rang de l'année dans le BUT: 1, 2, 3"
assert self.annee_but in (1, 2, 3) assert self.annee_but in (1, 2, 3)

View File

@ -683,7 +683,7 @@ def module_edit(
] ]
# Choix des Apprentissages Critiques # Choix des Apprentissages Critiques
if ue is not None: if ue is not None:
annee = f"BUT{orig_semestre_idx//2 + 1}" annee = f"BUT{(orig_semestre_idx+1)//2}"
app_critiques = ApcAppCritique.app_critiques_ref_comp(ref_comp, annee) app_critiques = ApcAppCritique.app_critiques_ref_comp(ref_comp, annee)
descr += ( descr += (
[ [

View File

@ -113,6 +113,10 @@ def SituationEtudParcours(etud: dict, formsemestre_id: int):
"""renvoie une instance de SituationEtudParcours (ou sous-classe spécialisée)""" """renvoie une instance de SituationEtudParcours (ou sous-classe spécialisée)"""
formsemestre = FormSemestre.query.get_or_404(formsemestre_id) formsemestre = FormSemestre.query.get_or_404(formsemestre_id)
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre) nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
# if formsemestre.formation.is_apc():
# return SituationEtudParcoursBUT(etud, formsemestre_id, nt)
parcours = nt.parcours parcours = nt.parcours
# #
if parcours.ECTS_ONLY: if parcours.ECTS_ONLY:
@ -121,7 +125,7 @@ def SituationEtudParcours(etud: dict, formsemestre_id: int):
return SituationEtudParcoursGeneric(etud, formsemestre_id, nt) return SituationEtudParcoursGeneric(etud, formsemestre_id, nt)
class SituationEtudParcoursGeneric(object): class SituationEtudParcoursGeneric:
"Semestre dans un parcours" "Semestre dans un parcours"
def __init__(self, etud: dict, formsemestre_id: int, nt: NotesTableCompat): def __init__(self, etud: dict, formsemestre_id: int, nt: NotesTableCompat):

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.3.12" SCOVERSION = "9.3.13"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"