1
0
forked from ScoDoc/ScoDoc

Fix: archive documents jury

This commit is contained in:
Emmanuel Viennet 2021-08-22 17:18:15 +02:00
parent cffcaa03ce
commit 1de8cf4056
4 changed files with 28 additions and 14 deletions

View File

@ -318,6 +318,7 @@ def do_formsemestre_archive(
html_sco_header.sco_footer(),
]
)
data = data.encode(scu.SCO_ENCODING)
PVArchive.store(archive_id, "Tableau_moyennes.html", data)
# Bulletins en XML (pour tous les etudiants, n'utilise pas les groupes)
@ -325,6 +326,7 @@ def do_formsemestre_archive(
formsemestre_id, format="xml", xml_with_decisions=True
)
if data:
data = data.encode(scu.SCO_ENCODING)
PVArchive.store(archive_id, "Bulletins.xml", data)
# Decisions de jury, en XLS
data = sco_pvjury.formsemestre_pvjury(

View File

@ -91,8 +91,8 @@ def make_xml_formsemestre_bulletinetud(
docdate = datetime.datetime.now().isoformat()
el = {
"etudid": etudid,
"formsemestre_id": formsemestre_id,
"etudid": str(etudid),
"formsemestre_id": str(formsemestre_id),
"date": docdate,
"publie": published,
}
@ -115,9 +115,9 @@ def make_xml_formsemestre_bulletinetud(
doc.append(
Element(
"etudiant",
etudid=etudid,
code_nip=etudinfo["code_nip"],
code_ine=etudinfo["code_ine"],
etudid=str(etudid),
code_nip=str(etudinfo["code_nip"]),
code_ine=str(etudinfo["code_ine"]),
nom=scu.quote_xml_attr(etudinfo["nom"]),
prenom=scu.quote_xml_attr(etudinfo["prenom"]),
civilite=scu.quote_xml_attr(etudinfo["civilite_str"]),
@ -188,7 +188,7 @@ def make_xml_formsemestre_bulletinetud(
ue_status = nt.get_etud_ue_status(etudid, ue["ue_id"])
x_ue = Element(
"ue",
id=ue["ue_id"],
id=str(ue["ue_id"]),
numero=scu.quote_xml_attr(ue["numero"]),
acronyme=scu.quote_xml_attr(ue["acronyme"]),
titre=scu.quote_xml_attr(ue["titre"]),
@ -229,8 +229,8 @@ def make_xml_formsemestre_bulletinetud(
# ects = str(mod['ects'])
x_mod = Element(
"module",
id=modimpl["moduleimpl_id"],
code=mod["code"],
id=str(modimpl["moduleimpl_id"]),
code=str(mod["code"]),
coefficient=str(mod["coefficient"]),
numero=str(mod["numero"]),
titre=scu.quote_xml_attr(mod["titre"]),
@ -322,7 +322,7 @@ def make_xml_formsemestre_bulletinetud(
ects_txt = ""
x_ue = Element(
"ue_capitalisee",
id=ue["ue_id"],
id=str(ue["ue_id"]),
numero=scu.quote_xml_attr(ue["numero"]),
acronyme=scu.quote_xml_attr(ue["acronyme"]),
titre=scu.quote_xml_attr(ue["titre"]),
@ -343,7 +343,7 @@ def make_xml_formsemestre_bulletinetud(
# --- Absences
if sco_preferences.get_preference("bul_show_abs", formsemestre_id):
nbabs, nbabsjust = sco_abs.get_abs_count(etudid, sem)
doc.append(Element("absences", nbabs=nbabs, nbabsjust=nbabsjust))
doc.append(Element("absences", nbabs=str(nbabs), nbabsjust=str(nbabsjust)))
# --- Decision Jury
if (
sco_preferences.get_preference("bul_show_decision", formsemestre_id)
@ -392,7 +392,7 @@ def make_xml_formsemestre_bulletinetud(
doc.append(
Element(
"decision_ue",
ue_id=ue["ue_id"],
ue_id=str(ue["ue_id"]),
numero=scu.quote_xml_attr(ue["numero"]),
acronyme=scu.quote_xml_attr(ue["acronyme"]),
titre=scu.quote_xml_attr(ue["titre"]),

View File

@ -211,7 +211,19 @@ def do_formsemestre_recapcomplet(
force_publishing=True,
):
"""Calcule et renvoie le tableau récapitulatif."""
data, filename, format = make_formsemestre_recapcomplet(**vars())
data, filename, format = make_formsemestre_recapcomplet(
formsemestre_id=formsemestre_id,
format=format,
hidemodules=hidemodules,
hidebac=hidebac,
xml_nodate=xml_nodate,
modejury=modejury,
sortcol=sortcol,
xml_with_decisions=xml_with_decisions,
disable_etudlink=disable_etudlink,
rank_partition_id=rank_partition_id,
force_publishing=force_publishing,
)
if format == "xml" or format == "html":
return data
elif format == "csv":
@ -225,7 +237,6 @@ def do_formsemestre_recapcomplet(
def make_formsemestre_recapcomplet(
REQUEST=None,
formsemestre_id=None,
format="html", # html, xml, xls, xlsall, json
hidemodules=False, # ne pas montrer les modules (ignoré en XML)
@ -870,7 +881,7 @@ def _formsemestre_recapcomplet_xml(
else:
docdate = datetime.datetime.now().isoformat()
doc = ElementTree.Element(
"recapsemestre", formsemestre_id=formsemestre_id, date=docdate
"recapsemestre", formsemestre_id=str(formsemestre_id), date=docdate
)
evals = sco_evaluations.do_evaluation_etat_in_sem(formsemestre_id)
doc.append(

View File

@ -2209,6 +2209,7 @@ sco_publish(
"/formsemestre_delete_archive",
sco_archives.formsemestre_delete_archive,
Permission.ScoView,
methods=["GET", "POST"],
)
sco_publish(
"/formsemestre_list_archives",