From fe69aec8d6a1023d57c57af03fe43e0283872efb Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 5 Apr 2022 12:19:52 +0200 Subject: [PATCH] =?UTF-8?q?Liste=20notes:=20mise=20en=20=C3=A9vidence=20?= =?UTF-8?q?=C3=A9vals=20incompl=C3=A8tes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_liste_notes.py | 35 +++++++++++++++++++---------------- app/static/css/scodoc.css | 9 ++++++++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/app/scodoc/sco_liste_notes.py b/app/scodoc/sco_liste_notes.py index cedd390f..fd9b7e59 100644 --- a/app/scodoc/sco_liste_notes.py +++ b/app/scodoc/sco_liste_notes.py @@ -575,9 +575,7 @@ def _make_table_notes( html_sortable=True, base_url=base_url, filename=filename, - origin="Généré par %s le " % sco_version.SCONAME - + scu.timedate_human_repr() - + "", + origin=f"Généré par {sco_version.SCONAME} le {scu.timedate_human_repr()}", caption=caption, html_next_section=html_next_section, page_title="Notes de " + sem["titremois"], @@ -674,6 +672,21 @@ def _add_eval_columns( e_o = Evaluation.query.get(evaluation_id) # XXX en attendant ré-écriture inscrits = e_o.moduleimpl.formsemestre.etudids_actifs # set d'etudids notes_db = sco_evaluation_db.do_evaluation_get_all_notes(evaluation_id) + + if len(e["jour"]) > 0: + titles[evaluation_id] = "%(description)s (%(jour)s)" % e + else: + titles[evaluation_id] = "%(description)s " % e + + if e["eval_state"]["evalcomplete"]: + klass = "eval_complete" + elif e["eval_state"]["evalattente"]: + klass = "eval_attente" + else: + klass = "eval_incomplete" + titles[evaluation_id] += " (non prise en compte)" + titles[f"_{evaluation_id}_td_attrs"] = f'class="{klass}"' + for row in rows: etudid = row["etudid"] if etudid in notes_db: @@ -713,9 +726,11 @@ def _add_eval_columns( val = None if val is None: - row["_" + str(evaluation_id) + "_td_attrs"] = 'class="etudabs" ' + row[f"_{evaluation_id}_td_attrs"] = f'class="etudabs {klass}" ' if not row.get("_css_row_class", ""): row["_css_row_class"] = "etudabs" + else: + row[f"_{evaluation_id}_td_attrs"] = f'class="{klass}" ' # regroupe les commentaires if explanation: if explanation in K: @@ -768,18 +783,6 @@ def _add_eval_columns( else: row_moys[evaluation_id] = "" - if len(e["jour"]) > 0: - titles[evaluation_id] = "%(description)s (%(jour)s)" % e - else: - titles[evaluation_id] = "%(description)s " % e - - if e["eval_state"]["evalcomplete"]: - titles["_" + str(evaluation_id) + "_td_attrs"] = 'class="eval_complete"' - elif e["eval_state"]["evalattente"]: - titles["_" + str(evaluation_id) + "_td_attrs"] = 'class="eval_attente"' - else: - titles["_" + str(evaluation_id) + "_td_attrs"] = 'class="eval_incomplete"' - return notes, nb_abs, nb_att # pour histogramme diff --git a/app/static/css/scodoc.css b/app/static/css/scodoc.css index 88cc9ba6..e9712ba7 100644 --- a/app/static/css/scodoc.css +++ b/app/static/css/scodoc.css @@ -1089,11 +1089,18 @@ table.notes_evaluation th.eval_complete { table.notes_evaluation th.eval_incomplete { color: red; + width: 80px; + font-size: 80%; +} + +table.notes_evaluation td.eval_incomplete>a { + font-size: 80%; + color: rgb(166, 50, 159); } table.notes_evaluation th.eval_attente { color: rgb(215, 90, 0); - ; + width: 80px; } table.notes_evaluation tr td a.discretelink:hover {