Fix: export excel des evaluations en attente

This commit is contained in:
viennet 2020-12-23 22:27:21 +01:00
parent 9b5f766500
commit 7794fff4a5
4 changed files with 22 additions and 8 deletions

View File

@ -337,7 +337,7 @@ def do_evaluation_list_in_sem(context, formsemestre_id):
'visibulletin': 1} ] 'visibulletin': 1} ]
""" """
req = "select E.* from notes_evaluation E, notes_moduleimpl MI where MI.formsemestre_id = %(formsemestre_id)s and MI.moduleimpl_id = E.moduleimpl_id" req = "select E.* from notes_evaluation E, notes_moduleimpl MI where MI.formsemestre_id = %(formsemestre_id)s and MI.moduleimpl_id = E.moduleimpl_id order by moduleimpl_id, numero desc, jour desc, heure_debut desc"
cnx = context.GetDBConnexion() cnx = context.GetDBConnexion()
cursor = cnx.cursor(cursor_factory=ScoDocCursor) cursor = cnx.cursor(cursor_factory=ScoDocCursor)
cursor.execute(req, {"formsemestre_id": formsemestre_id}) cursor.execute(req, {"formsemestre_id": formsemestre_id})

View File

@ -337,12 +337,11 @@ def moduleimpl_status(context, moduleimpl_id=None, partition_id=None, REQUEST=No
% etat["last_modif"].strftime("%d/%m/%Y à %Hh%M") % etat["last_modif"].strftime("%d/%m/%Y à %Hh%M")
) )
H.append('<span class="evalindex_cont">') H.append('<span class="evalindex_cont">')
if has_expression: if has_expression or True:
H.append( H.append(
"""<span class="evalindex" title="Indice dans les vecteurs (formules)">%02d</span>""" """<span class="evalindex" title="Indice dans les vecteurs (formules)">%2d</span>"""
% eval_index % eval_index
) )
# Fleches: # Fleches:
H.append('<span class="eval_arrows_chld">') H.append('<span class="eval_arrows_chld">')
if eval_index != (len(ModEvals) - 1) and caneditevals: if eval_index != (len(ModEvals) - 1) and caneditevals:

View File

@ -764,7 +764,11 @@ def _list_notes_evals(context, evals, etudid):
""" """
L = [] L = []
for e in evals: for e in evals:
if e["etat"]["evalcomplete"] or e["publish_incomplete"]: if (
e["etat"]["evalcomplete"]
or e["etat"]["evalattente"]
or e["publish_incomplete"]
):
NotesDB = context._notes_getall(e["evaluation_id"]) NotesDB = context._notes_getall(e["evaluation_id"])
if NotesDB.has_key(etudid): if NotesDB.has_key(etudid):
val = NotesDB[etudid]["value"] val = NotesDB[etudid]["value"]
@ -779,9 +783,15 @@ def _list_notes_evals(context, evals, etudid):
def _list_notes_evals_titles(context, codemodule, evals): def _list_notes_evals_titles(context, codemodule, evals):
"""Liste des titres des evals completes""" """Liste des titres des evals completes"""
L = [] L = []
eval_index = len(evals) - 1
for e in evals: for e in evals:
if e["etat"]["evalcomplete"] or e["publish_incomplete"]: if (
L.append(codemodule + "-" + str(e["numero"]) + "-" + e["jour"].isoformat()) e["etat"]["evalcomplete"]
or e["etat"]["evalattente"]
or e["publish_incomplete"]
):
L.append(codemodule + "-" + str(eval_index) + "-" + e["jour"].isoformat())
eval_index -= 1
return L return L
@ -789,7 +799,11 @@ def _list_notes_evals_stats(context, evals, key):
"""Liste des stats (moy, ou rien!) des evals completes""" """Liste des stats (moy, ou rien!) des evals completes"""
L = [] L = []
for e in evals: for e in evals:
if e["etat"]["evalcomplete"] or e["publish_incomplete"]: if (
e["etat"]["evalcomplete"]
or e["etat"]["evalattente"]
or e["publish_incomplete"]
):
if key == "moy": if key == "moy":
val = e["etat"]["moy_num"] val = e["etat"]["moy_num"]
L.append(fmt_note(val, keep_numeric=True)) L.append(fmt_note(val, keep_numeric=True))

View File

@ -1338,6 +1338,7 @@ span.evalindex_cont {
} }
span.evalindex { span.evalindex {
font-weight: normal; font-weight: normal;
font-size: 80%;
margin-right: 5px; margin-right: 5px;
} }
.eval_arrows_chld { .eval_arrows_chld {