stockage wip

This commit is contained in:
Jean-Marie Place 2023-06-21 09:54:51 +02:00
parent 5ba720baee
commit 0335840d41

View File

@ -75,11 +75,9 @@ class ElementUE(Element):
class ElementNiveau(Element):
def __init__(self, etudiant, niveauDesc, semestres):
def __init__(self, etudiant):
super().__init__()
self.etudiant = etudiant
self.candidates = niveauDesc.get_ues(etudiant)
self.ues = collections.defaultdict(list)
def add_ue_status(self, semestre_idx, status):
ue_id = status["ue"]["id"]
@ -95,15 +93,6 @@ class ElementAnnee(Element):
self.niveaux = {}
class CompetenceEtudiantJury:
def __init__(self, etudiant, competenceDesc, semestres):
self.descr = competenceDesc
self.etudiant = etudiant
self.niveaux = {}
for niveau_id, niveauDesc in competenceDesc.niveaux.items():
self.niveaux[niveau_id] = ElementNiveau(etudiant, niveauDesc, semestres)
etudiant.niveaux[niveau_id] = self.niveaux[niveau_id]
def getNiveau(self, niveau_id):
return self.niveaux[niveau_id]
@ -146,7 +135,7 @@ class EtudiantJury:
self.history = []
#
self.formsemestre_par_semestre_idx = collections.defaultdict(lambda: ListeElements())
# self.niveau_par_annee_et_competence : list(ListeElements) = {}
self.niveau_par_annee_et_competence : ListeElements = None
self.ues_par_annee_et_competence : list(ListeElements) = {}
#
for inscription in sorted(
@ -166,6 +155,7 @@ class EtudiantJury:
def fill_in(self, parcourDescr, semestres):
# Remplissage des competences
self.competences = self.cursus.competences
# Remplissage des formsemestres
for formsemestre_id in self.formsemestres:
formsemestre_desc = self.contexte.get_element_formsemestre(formsemestre_id)
@ -178,10 +168,16 @@ class EtudiantJury:
ues = resultats.etud_ues(self.ident.etudid)
for ue in ues:
competence_id = ue.niveau_competence.competence_id
status = resultats.get_etud_ue_status(
self.ident.etudid, ue.id
)
self.ues_par_competence_et_annee[(semestre_idx, competence_id)] = status
if competence_id in self.competences:
status = resultats.get_etud_ue_status(self.ident.etudid, ue.id)
element_ue = ElementUE()
element_ue.set_note(status.moy)
self.ues_par_annee_et_competence[(semestre_idx, competence_id)] = element_ue
for competence_id, val_1 in self.cursus.validation_par_competence_et_annee.items():
for annee, validation in self.cursus.validation_par_competence_et_annee[competence_id].items():
element_niveau = ElementNiveau(self)
self.niveau_par_annee_et_competence[annee][competence_id] = element_niveau
element_niveau.set_res(validation.code)
pass
# deca = DecisionsProposeesAnnee(self.ident, formsemestre)