1
0
forked from ScoDoc/ScoDoc

ajout des états d'inscriptions pour les étudiants

This commit is contained in:
leonard_montalbano 2022-06-24 16:03:35 +02:00
parent a1e5c3afab
commit 23e2a5c427

View File

@ -38,7 +38,7 @@ from app.models import (
NotesNotes, NotesNotes,
ApcReferentielCompetences, ApcReferentielCompetences,
ApcCompetence, ApcCompetence,
Absence, Absence, FormSemestreEtape,
) )
from app import db from app import db
from app.models.but_refcomp import ( from app.models.but_refcomp import (
@ -180,13 +180,31 @@ def create_formsemestre(
def inscrit_etudiants(etuds: list, formsemestre: FormSemestre): def inscrit_etudiants(etuds: list, formsemestre: FormSemestre):
"""Inscrit les etudiants aux semestres et à tous ses modules""" """Inscrit les etudiants aux semestres et à tous ses modules"""
for etud in etuds: for etud in etuds:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules( aleatoire = random.randint(0, 10)
formsemestre.id, if aleatoire <= 3:
etud.id, sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
group_ids=[], formsemestre.id,
etat="I", etud.id,
method="init db test", group_ids=[],
) etat="I",
method="init db test",
)
elif 3 < aleatoire <= 6:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="D",
method="init db test",
)
else:
sco_formsemestre_inscriptions.do_formsemestre_inscription_with_modules(
formsemestre.id,
etud.id,
group_ids=[],
etat="DEF",
method="init db test",
)
def create_evaluations(formsemestre: FormSemestre): def create_evaluations(formsemestre: FormSemestre):
@ -480,6 +498,7 @@ def init_test_database():
saisie_notes_evaluations(formsemestre, user_lecteur) saisie_notes_evaluations(formsemestre, user_lecteur)
create_ref_comp(formation) create_ref_comp(formation)
add_absences(formsemestre) add_absences(formsemestre)
create_etape_apo(formsemestre)
# à compléter # à compléter
# - groupes # - groupes
# - absences # - absences