forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -524,11 +524,11 @@ def table_suivi_cohorte(
|
|||||||
# 3-- Regroupe les semestres par date de debut
|
# 3-- Regroupe les semestres par date de debut
|
||||||
P = [] # liste de periodsem
|
P = [] # liste de periodsem
|
||||||
|
|
||||||
class periodsem(object):
|
class PeriodSem:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
# semestre de depart:
|
# semestre de depart:
|
||||||
porigin = periodsem()
|
porigin = PeriodSem()
|
||||||
d, m, y = [int(x) for x in sem["date_debut"].split("/")]
|
d, m, y = [int(x) for x in sem["date_debut"].split("/")]
|
||||||
porigin.datedebut = datetime.datetime(y, m, d)
|
porigin.datedebut = datetime.datetime(y, m, d)
|
||||||
porigin.sems = [sem]
|
porigin.sems = [sem]
|
||||||
@ -543,7 +543,7 @@ def table_suivi_cohorte(
|
|||||||
merged = True
|
merged = True
|
||||||
break
|
break
|
||||||
if not merged:
|
if not merged:
|
||||||
p = periodsem()
|
p = PeriodSem()
|
||||||
p.datedebut = s["date_debut_dt"]
|
p.datedebut = s["date_debut_dt"]
|
||||||
p.sems = [s]
|
p.sems = [s]
|
||||||
P.append(p)
|
P.append(p)
|
||||||
@ -743,7 +743,7 @@ def formsemestre_suivi_cohorte(
|
|||||||
civilite=None,
|
civilite=None,
|
||||||
statut="",
|
statut="",
|
||||||
only_primo=False,
|
only_primo=False,
|
||||||
):
|
) -> str:
|
||||||
"""Affiche suivi cohortes par numero de semestre"""
|
"""Affiche suivi cohortes par numero de semestre"""
|
||||||
annee_bac = str(annee_bac or "")
|
annee_bac = str(annee_bac or "")
|
||||||
annee_admission = str(annee_admission or "")
|
annee_admission = str(annee_admission or "")
|
||||||
@ -794,14 +794,6 @@ def formsemestre_suivi_cohorte(
|
|||||||
'<p><a href="%s&percent=1">Afficher les résultats en pourcentages</a></p>'
|
'<p><a href="%s&percent=1">Afficher les résultats en pourcentages</a></p>'
|
||||||
% burl
|
% burl
|
||||||
)
|
)
|
||||||
help = (
|
|
||||||
pplink
|
|
||||||
+ """
|
|
||||||
<p class="help">Nombre d'étudiants dans chaque semestre. Les dates indiquées sont les dates approximatives de <b>début</b> des semestres (les semestres commençant à des dates proches sont groupés). Le nombre de diplômés est celui à la <b>fin</b> du semestre correspondant. Lorsqu'il y a moins de %s étudiants dans une case, vous pouvez afficher leurs noms en passant le curseur sur le chiffre.</p>
|
|
||||||
<p class="help">Les menus permettent de n'étudier que certaines catégories d'étudiants (titulaires d'un type de bac, garçons ou filles). La case "restreindre aux primo-entrants" permet de ne considérer que les étudiants qui n'ont jamais été inscrits dans ScoDoc avant le semestre considéré.</p>
|
|
||||||
"""
|
|
||||||
% (MAX_ETUD_IN_DESCR,)
|
|
||||||
)
|
|
||||||
|
|
||||||
H = [
|
H = [
|
||||||
html_sco_header.sco_header(page_title=tab.page_title),
|
html_sco_header.sco_header(page_title=tab.page_title),
|
||||||
@ -824,7 +816,20 @@ def formsemestre_suivi_cohorte(
|
|||||||
percent=percent,
|
percent=percent,
|
||||||
),
|
),
|
||||||
t,
|
t,
|
||||||
help,
|
f"""{pplink}
|
||||||
|
<p class="help">Nombre d'étudiants dans chaque semestre.
|
||||||
|
Les dates indiquées sont les dates approximatives de <b>début</b> des semestres
|
||||||
|
(les semestres commençant à des dates proches sont groupés). Le nombre de diplômés
|
||||||
|
est celui à la <b>fin</b> du semestre correspondant.
|
||||||
|
Lorsqu'il y a moins de {MAX_ETUD_IN_DESCR} étudiants dans une case, vous pouvez
|
||||||
|
afficher leurs noms en passant le curseur sur le chiffre.
|
||||||
|
</p>
|
||||||
|
<p class="help">Les menus permettent de n'étudier que certaines catégories
|
||||||
|
d'étudiants (titulaires d'un type de bac, garçons ou filles).
|
||||||
|
La case "restreindre aux primo-entrants" permet de ne considérer que les étudiants
|
||||||
|
qui n'ont jamais été inscrits dans ScoDoc avant le semestre considéré.
|
||||||
|
</p>
|
||||||
|
""",
|
||||||
expl,
|
expl,
|
||||||
html_sco_header.sco_footer(),
|
html_sco_header.sco_footer(),
|
||||||
]
|
]
|
||||||
@ -870,35 +875,33 @@ def _gen_form_selectetuds(
|
|||||||
else:
|
else:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
F = [
|
F = [
|
||||||
"""<form id="f" method="get" action="%s">
|
f"""<form id="f" method="get" action="{request.base_url}">
|
||||||
<p>Bac: <select name="bac" onchange="javascript: submit(this);">
|
<p>Bac: <select name="bac" onchange="javascript: submit(this);">
|
||||||
<option value="" %s>tous</option>
|
<option value="" {selected}>tous</option>
|
||||||
"""
|
"""
|
||||||
% (request.base_url, selected)
|
|
||||||
]
|
]
|
||||||
for b in bacs:
|
for b in bacs:
|
||||||
if bac == b:
|
if bac == b:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
else:
|
else:
|
||||||
selected = ""
|
selected = ""
|
||||||
F.append('<option value="%s" %s>%s</option>' % (b, selected, b))
|
F.append(f'<option value="{b}" {selected}>{b}</option>')
|
||||||
F.append("</select>")
|
F.append("</select>")
|
||||||
if bacspecialite:
|
if bacspecialite:
|
||||||
selected = ""
|
selected = ""
|
||||||
else:
|
else:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
F.append(
|
F.append(
|
||||||
""" Bac/Specialité: <select name="bacspecialite" onchange="javascript: submit(this);">
|
f""" Bac/Specialité: <select name="bacspecialite" onchange="javascript: submit(this);">
|
||||||
<option value="" %s>tous</option>
|
<option value="" {selected}>tous</option>
|
||||||
"""
|
"""
|
||||||
% selected
|
|
||||||
)
|
)
|
||||||
for b in bacspecialites:
|
for b in bacspecialites:
|
||||||
if bacspecialite == b:
|
if bacspecialite == b:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
else:
|
else:
|
||||||
selected = ""
|
selected = ""
|
||||||
F.append('<option value="%s" %s>%s</option>' % (b, selected, b))
|
F.append(f'<option value="{b}" {selected}>{b}</option>')
|
||||||
F.append("</select>")
|
F.append("</select>")
|
||||||
#
|
#
|
||||||
F.append(
|
F.append(
|
||||||
@ -910,46 +913,44 @@ def _gen_form_selectetuds(
|
|||||||
)
|
)
|
||||||
#
|
#
|
||||||
F.append(
|
F.append(
|
||||||
""" Genre: <select name="civilite" onchange="javascript: submit(this);">
|
f""" Genre: <select name="civilite" onchange="javascript: submit(this);">
|
||||||
<option value="" %s>tous</option>
|
<option value="" {selected}>tous</option>
|
||||||
"""
|
"""
|
||||||
% selected
|
|
||||||
)
|
)
|
||||||
for b in civilites:
|
for b in civilites:
|
||||||
if civilite == b:
|
if civilite == b:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
else:
|
else:
|
||||||
selected = ""
|
selected = ""
|
||||||
F.append('<option value="%s" %s>%s</option>' % (b, selected, b))
|
F.append(f'<option value="{b}" {selected}>{b}</option>')
|
||||||
F.append("</select>")
|
F.append("</select>")
|
||||||
|
|
||||||
F.append(
|
F.append(
|
||||||
""" Statut: <select name="statut" onchange="javascript: submit(this);">
|
f""" Statut: <select name="statut" onchange="javascript: submit(this);">
|
||||||
<option value="" %s>tous</option>
|
<option value="" {selected}>tous</option>
|
||||||
"""
|
"""
|
||||||
% selected
|
|
||||||
)
|
)
|
||||||
for b in statuts:
|
for b in statuts:
|
||||||
if statut == b:
|
if statut == b:
|
||||||
selected = 'selected="selected"'
|
selected = 'selected="selected"'
|
||||||
else:
|
else:
|
||||||
selected = ""
|
selected = ""
|
||||||
F.append('<option value="%s" %s>%s</option>' % (b, selected, b))
|
F.append(f'<option value="{b}" {selected}>{b}</option>')
|
||||||
F.append("</select>")
|
F.append("</select>")
|
||||||
|
|
||||||
if only_primo:
|
|
||||||
checked = 'checked="1"'
|
|
||||||
else:
|
|
||||||
checked = ""
|
|
||||||
F.append(
|
F.append(
|
||||||
'<br><input type="checkbox" name="only_primo" onchange="javascript: submit(this);" %s/>Restreindre aux primo-entrants'
|
f"""<br>
|
||||||
% checked
|
<input type="checkbox" name="only_primo"
|
||||||
|
onchange="javascript: submit(this);"
|
||||||
|
{'checked="1"' if only_primo else ""}/>Restreindre aux primo-entrants
|
||||||
|
<input type="hidden" name="formsemestre_id" value="{formsemestre_id}"/>
|
||||||
|
<input type="hidden" name="percent" value="{percent}"/>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
</form>
|
||||||
|
"""
|
||||||
)
|
)
|
||||||
F.append(
|
|
||||||
'<input type="hidden" name="formsemestre_id" value="%s"/>' % formsemestre_id
|
|
||||||
)
|
|
||||||
F.append('<input type="hidden" name="percent" value="%s"/>' % percent)
|
|
||||||
F.append("</p></form>")
|
|
||||||
return "\n".join(F)
|
return "\n".join(F)
|
||||||
|
|
||||||
|
|
||||||
@ -964,7 +965,7 @@ def _gen_select_annee(field, values, value) -> str:
|
|||||||
return menu_html + "</select>"
|
return menu_html + "</select>"
|
||||||
|
|
||||||
|
|
||||||
def _descr_etud_set(etudids):
|
def _descr_etud_set(etudids) -> str:
|
||||||
"textual html description of a set of etudids"
|
"textual html description of a set of etudids"
|
||||||
etuds = []
|
etuds = []
|
||||||
for etudid in etudids:
|
for etudid in etudids:
|
||||||
@ -980,12 +981,19 @@ def _count_dem_reo(formsemestre_id, etudids):
|
|||||||
"count nb of demissions and reorientation in this etud set"
|
"count nb of demissions and reorientation in this etud set"
|
||||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||||
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||||
|
validations_annuelles = nt.get_validations_annee() if nt.is_apc else {}
|
||||||
dems = set()
|
dems = set()
|
||||||
reos = set()
|
reos = set()
|
||||||
for etudid in etudids:
|
for etudid in etudids:
|
||||||
if nt.get_etud_etat(etudid) == "D":
|
if nt.get_etud_etat(etudid) == "D":
|
||||||
dems.add(etudid)
|
dems.add(etudid)
|
||||||
|
if nt.is_apc:
|
||||||
|
# BUT: utilise les validations annuelles
|
||||||
|
validation = validations_annuelles.get(etudid)
|
||||||
|
if validation and validation.code in codes_cursus.CODES_SEM_REO:
|
||||||
|
reos.add(etudid)
|
||||||
|
else:
|
||||||
|
# Autres formations: validations de semestres
|
||||||
dec = nt.get_etud_decision_sem(etudid)
|
dec = nt.get_etud_decision_sem(etudid)
|
||||||
if dec and dec["code"] in codes_cursus.CODES_SEM_REO:
|
if dec and dec["code"] in codes_cursus.CODES_SEM_REO:
|
||||||
reos.add(etudid)
|
reos.add(etudid)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.6.37"
|
SCOVERSION = "9.6.38"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user