forked from ScoDoc/DocScoDoc
Merge branch 'master' of https://scodoc.org/git/ScoDoc/ScoDoc into entreprises
This commit is contained in:
commit
9073983162
@ -260,6 +260,8 @@ class ApoEtud(dict):
|
|||||||
self["naissance"] = naissance
|
self["naissance"] = naissance
|
||||||
self.cols = cols
|
self.cols = cols
|
||||||
"{ col_id : value } colid = 'apoL_c0001'"
|
"{ col_id : value } colid = 'apoL_c0001'"
|
||||||
|
self.is_apc = None
|
||||||
|
"Vrai si BUT"
|
||||||
self.col_elts = {}
|
self.col_elts = {}
|
||||||
"{'V1RT': {'R': 'ADM', 'J': '', 'B': 20, 'N': '12.14'}}"
|
"{'V1RT': {'R': 'ADM', 'J': '', 'B': 20, 'N': '12.14'}}"
|
||||||
self.new_cols = {} # { col_id : value to record in csv }
|
self.new_cols = {} # { col_id : value to record in csv }
|
||||||
@ -431,6 +433,8 @@ class ApoEtud(dict):
|
|||||||
return VOID_APO_RES
|
return VOID_APO_RES
|
||||||
|
|
||||||
# Elements UE
|
# Elements UE
|
||||||
|
# if etudid == 3661 and nt.formsemestre.semestre_id == 2: # XXX XXX XXX
|
||||||
|
# breakpoint()
|
||||||
decisions_ue = nt.get_etud_decision_ues(etudid)
|
decisions_ue = nt.get_etud_decision_ues(etudid)
|
||||||
for ue in nt.get_ues_stat_dict():
|
for ue in nt.get_ues_stat_dict():
|
||||||
if ue["code_apogee"] and code in {
|
if ue["code_apogee"] and code in {
|
||||||
@ -472,6 +476,9 @@ class ApoEtud(dict):
|
|||||||
|
|
||||||
def comp_elt_semestre(self, nt, decision, etudid):
|
def comp_elt_semestre(self, nt, decision, etudid):
|
||||||
"""Calcul résultat apo semestre"""
|
"""Calcul résultat apo semestre"""
|
||||||
|
if self.is_apc:
|
||||||
|
# pas de code semestre en APC !
|
||||||
|
return dict(N="", B=20, J="", R="", M="")
|
||||||
if decision is None:
|
if decision is None:
|
||||||
etud = Identite.query.get(etudid)
|
etud = Identite.query.get(etudid)
|
||||||
nomprenom = etud.nomprenom if etud else "(inconnu)"
|
nomprenom = etud.nomprenom if etud else "(inconnu)"
|
||||||
@ -565,7 +572,8 @@ class ApoEtud(dict):
|
|||||||
il faut considérer les deux semestres ((S1,S2) ou (S3,S4)) pour calculer
|
il faut considérer les deux semestres ((S1,S2) ou (S3,S4)) pour calculer
|
||||||
le code annuel (VET ou VRT1A (voir elt_annee_apo)).
|
le code annuel (VET ou VRT1A (voir elt_annee_apo)).
|
||||||
|
|
||||||
Pour les jurys intermediaires (janvier, S1 ou S3): (S2 ou S4) de la même étape lors d'une année précédente ?
|
Pour les jurys intermediaires (janvier, S1 ou S3): (S2 ou S4) de la même
|
||||||
|
étape lors d'une année précédente ?
|
||||||
|
|
||||||
Renvoie le semestre "courant" et l'autre semestre, ou None s'il n'y en a pas.
|
Renvoie le semestre "courant" et l'autre semestre, ou None s'il n'y en a pas.
|
||||||
"""
|
"""
|
||||||
@ -687,6 +695,8 @@ class ApoData(object):
|
|||||||
self.export_res_rat = export_res_rat
|
self.export_res_rat = export_res_rat
|
||||||
self.orig_filename = orig_filename
|
self.orig_filename = orig_filename
|
||||||
self.periode = periode #
|
self.periode = periode #
|
||||||
|
self.is_apc = None
|
||||||
|
"Vrai si BUT"
|
||||||
try:
|
try:
|
||||||
self.read_csv(data)
|
self.read_csv(data)
|
||||||
except ScoFormatError as e:
|
except ScoFormatError as e:
|
||||||
@ -722,8 +732,19 @@ class ApoData(object):
|
|||||||
def setup(self):
|
def setup(self):
|
||||||
"""Recherche semestres ScoDoc concernés"""
|
"""Recherche semestres ScoDoc concernés"""
|
||||||
self.sems_etape = comp_apo_sems(self.etape_apogee, self.annee_scolaire)
|
self.sems_etape = comp_apo_sems(self.etape_apogee, self.annee_scolaire)
|
||||||
|
self.formsemestres_etape = [
|
||||||
|
FormSemestre.query.get_or_404(s["formsemestre_id"]) for s in self.sems_etape
|
||||||
|
]
|
||||||
|
apcs = {
|
||||||
|
formsemestre.formation.is_apc() for formsemestre in self.formsemestres_etape
|
||||||
|
}
|
||||||
|
if len(apcs) != 1:
|
||||||
|
raise ScoValueError(
|
||||||
|
"l'ensemble mixe des semestres BUT (APC) et des semestres classiques !"
|
||||||
|
)
|
||||||
|
self.is_apc = apcs.pop()
|
||||||
self.etape_formsemestre_ids = {s["formsemestre_id"] for s in self.sems_etape}
|
self.etape_formsemestre_ids = {s["formsemestre_id"] for s in self.sems_etape}
|
||||||
if self.periode != None:
|
if self.periode is not None:
|
||||||
self.sems_periode = [
|
self.sems_periode = [
|
||||||
s
|
s
|
||||||
for s in self.sems_etape
|
for s in self.sems_etape
|
||||||
@ -1126,7 +1147,7 @@ def _apo_skip_section(f):
|
|||||||
# -------------------------------------
|
# -------------------------------------
|
||||||
|
|
||||||
|
|
||||||
def comp_apo_sems(etape_apogee, annee_scolaire):
|
def comp_apo_sems(etape_apogee, annee_scolaire: int) -> list[dict]:
|
||||||
"""
|
"""
|
||||||
:param etape_apogee: etape (string or ApoEtapeVDI)
|
:param etape_apogee: etape (string or ApoEtapeVDI)
|
||||||
:param annee_scolaire: annee (int)
|
:param annee_scolaire: annee (int)
|
||||||
@ -1224,6 +1245,7 @@ def export_csv_to_apogee(
|
|||||||
apo_data.setup() # -> .sems_etape
|
apo_data.setup() # -> .sems_etape
|
||||||
|
|
||||||
for e in apo_data.etuds:
|
for e in apo_data.etuds:
|
||||||
|
e.is_apc = apo_data.is_apc
|
||||||
e.lookup_scodoc(apo_data.etape_formsemestre_ids)
|
e.lookup_scodoc(apo_data.etape_formsemestre_ids)
|
||||||
e.associate_sco(apo_data)
|
e.associate_sco(apo_data)
|
||||||
|
|
||||||
|
@ -148,12 +148,15 @@ def formsemestre_bulletinetud_dict(formsemestre_id, etudid, version="long"):
|
|||||||
I["server_name"] = request.url_root
|
I["server_name"] = request.url_root
|
||||||
|
|
||||||
# Formation et parcours
|
# Formation et parcours
|
||||||
|
formation_dict = None
|
||||||
if I["sem"]["formation_id"]:
|
if I["sem"]["formation_id"]:
|
||||||
I["formation"] = sco_formations.formation_list(
|
formation_dicts = sco_formations.formation_list(
|
||||||
args={"formation_id": I["sem"]["formation_id"]}
|
args={"formation_id": I["sem"]["formation_id"]}
|
||||||
)[0]
|
)
|
||||||
else: # what's the fuck ?
|
if formation_dicts:
|
||||||
I["formation"] = {
|
formation_dict = formation_dicts[0]
|
||||||
|
if formation_dict is None: # what's the fuck ?
|
||||||
|
formation_dict = {
|
||||||
"acronyme": "?",
|
"acronyme": "?",
|
||||||
"code_specialite": "",
|
"code_specialite": "",
|
||||||
"dept_id": 1,
|
"dept_id": 1,
|
||||||
@ -166,6 +169,7 @@ def formsemestre_bulletinetud_dict(formsemestre_id, etudid, version="long"):
|
|||||||
"type_parcours": 0,
|
"type_parcours": 0,
|
||||||
"version": 0,
|
"version": 0,
|
||||||
}
|
}
|
||||||
|
I["formation"] = formation_dict
|
||||||
I["parcours"] = sco_codes_parcours.get_parcours_from_code(
|
I["parcours"] = sco_codes_parcours.get_parcours_from_code(
|
||||||
I["formation"]["type_parcours"]
|
I["formation"]["type_parcours"]
|
||||||
)
|
)
|
||||||
|
@ -236,6 +236,7 @@ def do_module_edit(vals: dict) -> None:
|
|||||||
mod = module_list({"module_id": vals["module_id"]})[0]
|
mod = module_list({"module_id": vals["module_id"]})[0]
|
||||||
if module_is_locked(mod["module_id"]):
|
if module_is_locked(mod["module_id"]):
|
||||||
# formation verrouillée: empeche de modifier certains champs:
|
# formation verrouillée: empeche de modifier certains champs:
|
||||||
|
vals = vals.copy()
|
||||||
protected_fields = ("coefficient", "ue_id", "matiere_id", "semestre_id")
|
protected_fields = ("coefficient", "ue_id", "matiere_id", "semestre_id")
|
||||||
for f in protected_fields:
|
for f in protected_fields:
|
||||||
if f in vals:
|
if f in vals:
|
||||||
|
@ -89,6 +89,8 @@ def formation_list(formation_id=None, args={}):
|
|||||||
def formation_has_locked_sems(formation_id): # XXX to remove
|
def formation_has_locked_sems(formation_id): # XXX to remove
|
||||||
"backward compat: True if there is a locked formsemestre in this formation"
|
"backward compat: True if there is a locked formsemestre in this formation"
|
||||||
formation = Formation.query.get(formation_id)
|
formation = Formation.query.get(formation_id)
|
||||||
|
if formation is None:
|
||||||
|
return False
|
||||||
return formation.has_locked_sems()
|
return formation.has_locked_sems()
|
||||||
|
|
||||||
|
|
||||||
|
@ -419,7 +419,7 @@ def do_formsemestre_createwithmodules(edit=False):
|
|||||||
{
|
{
|
||||||
"size": 32,
|
"size": 32,
|
||||||
"title": "Element(s) Apogée:",
|
"title": "Element(s) Apogée:",
|
||||||
"explanation": "du semestre (ex: VRTW1). Séparés par des virgules.",
|
"explanation": "associé(s) au résultat du semestre (ex: VRTW1). Inutile en BUT. Séparés par des virgules.",
|
||||||
"allow_null": not sco_preferences.get_preference(
|
"allow_null": not sco_preferences.get_preference(
|
||||||
"always_require_apo_sem_codes"
|
"always_require_apo_sem_codes"
|
||||||
),
|
),
|
||||||
@ -432,7 +432,7 @@ def do_formsemestre_createwithmodules(edit=False):
|
|||||||
{
|
{
|
||||||
"size": 32,
|
"size": 32,
|
||||||
"title": "Element(s) Apogée:",
|
"title": "Element(s) Apogée:",
|
||||||
"explanation": "de l'année (ex: VRT1A). Séparés par des virgules.",
|
"explanation": "associé(s) au résultat de l'année (ex: VRT1A). Séparés par des virgules.",
|
||||||
"allow_null": not sco_preferences.get_preference(
|
"allow_null": not sco_preferences.get_preference(
|
||||||
"always_require_apo_sem_codes"
|
"always_require_apo_sem_codes"
|
||||||
),
|
),
|
||||||
@ -1785,7 +1785,7 @@ def get_formsemestre_session_id(sem, F, parcours):
|
|||||||
"ImputationDept", sem["formsemestre_id"]
|
"ImputationDept", sem["formsemestre_id"]
|
||||||
)
|
)
|
||||||
if not imputation_dept:
|
if not imputation_dept:
|
||||||
imputation_dept = sco_preferences.get_preference("DeptName")
|
imputation_dept = sco_preferences.get_preference("DeptName") or ""
|
||||||
imputation_dept = imputation_dept.upper()
|
imputation_dept = imputation_dept.upper()
|
||||||
parcours_type = parcours.NAME
|
parcours_type = parcours.NAME
|
||||||
modalite = sem["modalite"]
|
modalite = sem["modalite"]
|
||||||
|
@ -236,8 +236,8 @@ def dict_pvjury(
|
|||||||
has_prev = False # vrai si au moins un etudiant a un code prev
|
has_prev = False # vrai si au moins un etudiant a un code prev
|
||||||
semestre_non_terminal = False # True si au moins un etudiant a un devenir
|
semestre_non_terminal = False # True si au moins un etudiant a un devenir
|
||||||
|
|
||||||
L = []
|
decisions = []
|
||||||
D = {} # même chose que L, mais { etudid : dec }
|
D = {} # même chose que decisions, mais { etudid : dec }
|
||||||
for etudid in etudids:
|
for etudid in etudids:
|
||||||
# etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
|
# etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
|
||||||
etud: Identite = Identite.query.get(etudid)
|
etud: Identite = Identite.query.get(etudid)
|
||||||
@ -353,7 +353,7 @@ def dict_pvjury(
|
|||||||
d["prev_code_descr"] = ""
|
d["prev_code_descr"] = ""
|
||||||
d["Se"] = Se
|
d["Se"] = Se
|
||||||
|
|
||||||
L.append(d)
|
decisions.append(d)
|
||||||
D[etudid] = d
|
D[etudid] = d
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@ -364,7 +364,7 @@ def dict_pvjury(
|
|||||||
"formation": sco_formations.formation_list(
|
"formation": sco_formations.formation_list(
|
||||||
args={"formation_id": sem["formation_id"]}
|
args={"formation_id": sem["formation_id"]}
|
||||||
)[0],
|
)[0],
|
||||||
"decisions": L,
|
"decisions": decisions,
|
||||||
"decisions_dict": D,
|
"decisions_dict": D,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -631,12 +631,17 @@ def add_apc_infos(formsemestre: FormSemestre, params: dict, decision: dict):
|
|||||||
"""Ajoute les champs pour les formations APC (BUT), donc avec codes RCUE et année"""
|
"""Ajoute les champs pour les formations APC (BUT), donc avec codes RCUE et année"""
|
||||||
annee_but = (formsemestre.semestre_id + 1) // 2
|
annee_but = (formsemestre.semestre_id + 1) // 2
|
||||||
params["decision_orig"] = f"année BUT{annee_but}"
|
params["decision_orig"] = f"année BUT{annee_but}"
|
||||||
params["decision_sem_descr"] = decision.get("decision_annee", {}).get("code", "")
|
if decision is None:
|
||||||
params[
|
params["decision_sem_descr"] = ""
|
||||||
"decision_ue_txt"
|
params["decision_ue_txt"] = ""
|
||||||
] = f"""{params["decision_ue_txt"]}<br/>
|
else:
|
||||||
<b>Niveaux de compétences:</b><br/> {decision.get("descr_decisions_rcue", "")}
|
decision_annee = decision.get("decision_annee") or {}
|
||||||
"""
|
params["decision_sem_descr"] = decision_annee.get("code") or ""
|
||||||
|
params[
|
||||||
|
"decision_ue_txt"
|
||||||
|
] = f"""{params["decision_ue_txt"]}<br/>
|
||||||
|
<b>Niveaux de compétences:</b><br/> {decision.get("descr_decisions_rcue") or ""}
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
# ----------------------------------------------
|
# ----------------------------------------------
|
||||||
|
@ -51,8 +51,12 @@
|
|||||||
else '<span class="missing_ue_ects">aucun</span>'|safe
|
else '<span class="missing_ue_ects">aucun</span>'|safe
|
||||||
}} ECTS
|
}} ECTS
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
{%- if ue.code_apogee -%}
|
||||||
|
{{ virg() }} Apo {{ue.code_apogee}}
|
||||||
|
{%- endif -%}
|
||||||
)
|
)
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
{% if editable and not ue.is_locked() %}
|
{% if editable and not ue.is_locked() %}
|
||||||
|
@ -299,21 +299,21 @@ def formsemestre_bulletinetud(
|
|||||||
raise ScoInvalidIdType(
|
raise ScoInvalidIdType(
|
||||||
"formsemestre_bulletinetud: formsemestre_id must be an integer !"
|
"formsemestre_bulletinetud: formsemestre_id must be an integer !"
|
||||||
)
|
)
|
||||||
formsemestre = FormSemestre.query.get_or_404(formsemestre_id)
|
formsemestre = FormSemestre.query.filter_by(
|
||||||
|
formsemestre_id=formsemestre_id, dept_id=g.scodoc_dept_id
|
||||||
|
).first_or_404()
|
||||||
if etudid:
|
if etudid:
|
||||||
etud = models.Identite.query.get_or_404(etudid)
|
etud = models.Identite.query.filter_by(
|
||||||
|
etudid=etudid, dept_id=formsemestre.dept_id
|
||||||
|
).first_or_404()
|
||||||
elif code_nip:
|
elif code_nip:
|
||||||
etud = (
|
etud = models.Identite.query.filter_by(
|
||||||
models.Identite.query.filter_by(code_nip=str(code_nip))
|
code_nip=str(code_nip), dept_id=formsemestre.dept_id
|
||||||
.filter_by(dept_id=formsemestre.dept_id)
|
).first_or_404()
|
||||||
.first_or_404()
|
|
||||||
)
|
|
||||||
elif code_ine:
|
elif code_ine:
|
||||||
etud = (
|
etud = models.Identite.query.filter_by(
|
||||||
models.Identite.query.filter_by(code_ine=str(code_ine))
|
code_ine=str(code_ine), dept_id=formsemestre.dept_id
|
||||||
.filter_by(dept_id=formsemestre.dept_id)
|
).first_or_404()
|
||||||
.first_or_404()
|
|
||||||
)
|
|
||||||
else:
|
else:
|
||||||
raise ScoValueError(
|
raise ScoValueError(
|
||||||
"Paramètre manquant: spécifier etudid, code_nip ou code_ine"
|
"Paramètre manquant: spécifier etudid, code_nip ou code_ine"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.3.19"
|
SCOVERSION = "9.3.20"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user