This commit is contained in:
Emmanuel Viennet 2021-02-13 21:28:59 +01:00
parent 2f4edc48dc
commit 91bb62587a
1 changed files with 17 additions and 3 deletions

View File

@ -33,6 +33,7 @@ import jaxml
import sco_utils as scu import sco_utils as scu
from notes_log import log from notes_log import log
import scolars
import sco_bulletins, sco_excel import sco_bulletins, sco_excel
import sco_groups import sco_groups
import sco_evaluations import sco_evaluations
@ -234,6 +235,7 @@ def make_formsemestre_recapcomplet(
pour tous les étudiants, les moyennes par UE et générale, pour tous les étudiants, les moyennes par UE et générale,
trié par moyenne générale décroissante. trié par moyenne générale décroissante.
""" """
civ_nom_prenom = False # 3 colonnes différentes ou une seule avec prénom abrégé ?
if format == "xml": if format == "xml":
return _formsemestre_recapcomplet_xml( return _formsemestre_recapcomplet_xml(
context, context,
@ -251,6 +253,7 @@ def make_formsemestre_recapcomplet(
force_publishing=force_publishing, force_publishing=force_publishing,
) )
if format[:3] == "xls": if format[:3] == "xls":
civ_nom_prenom = True # 3 cols: civilite, nom, prenom
keep_numeric = True # pas de conversion des notes en strings keep_numeric = True # pas de conversion des notes en strings
else: else:
keep_numeric = False keep_numeric = False
@ -292,7 +295,11 @@ def make_formsemestre_recapcomplet(
# Construit une liste de listes de chaines: le champs du tableau resultat (HTML ou CSV) # Construit une liste de listes de chaines: le champs du tableau resultat (HTML ou CSV)
F = [] F = []
h = [rank_label, "Nom"] h = [rank_label]
if civ_nom_prenom:
h += ["Civilité", "Nom", "Prénom"]
else:
h += ["Nom"]
if not hidebac: if not hidebac:
h.append("Bac") h.append("Bac")
@ -370,7 +377,7 @@ def make_formsemestre_recapcomplet(
gr_name = group["group_name"] or "" gr_name = group["group_name"] or ""
is_dem[etudid] = False is_dem[etudid] = False
if rank_partition_id: if rank_partition_id:
rang_gr, ninscrits_gr, rank_gr_name = sco_bulletins.get_etud_rangs_groups( rang_gr, _, rank_gr_name = sco_bulletins.get_etud_rangs_groups(
context, etudid, formsemestre_id, partitions, partitions_etud_groups, nt context, etudid, formsemestre_id, partitions, partitions_etud_groups, nt
) )
if rank_gr_name[rank_partition_id]: if rank_gr_name[rank_partition_id]:
@ -383,8 +390,13 @@ def make_formsemestre_recapcomplet(
else: else:
rank = nt.get_etud_rang(etudid) rank = nt.get_etud_rang(etudid)
l = [rank, nt.get_nom_short(etudid)] # rang, nom,
e = nt.identdict[etudid] e = nt.identdict[etudid]
if civ_nom_prenom:
scolars.format_etud_ident(e)
l = [rank, e["civilite_str"], e["nom_disp"], e["prenom"]] # civ, nom prenom
else:
l = [rank, nt.get_nom_short(etudid)] # rang, nom,
if not hidebac: if not hidebac:
bac = sco_bac.Baccalaureat(e["bac"], e["specialite"]) bac = sco_bac.Baccalaureat(e["bac"], e["specialite"])
l.append(bac.abbrev()) l.append(bac.abbrev())
@ -457,6 +469,8 @@ def make_formsemestre_recapcomplet(
def add_bottom_stat(key, title, corner_value=""): def add_bottom_stat(key, title, corner_value=""):
l = ["", title] l = ["", title]
if civ_nom_prenom:
l += ["", ""]
if not hidebac: if not hidebac:
l.append("") l.append("")
if format[:3] == "xls" or format == "csv": if format[:3] == "xls" or format == "csv":