This commit is contained in:
Emmanuel Viennet 2022-06-02 11:37:13 +02:00
parent 3240d625b0
commit be92c86baf
3 changed files with 16 additions and 8 deletions

View File

@ -606,12 +606,10 @@ def formsemestre_evaluations_delai_correction(formsemestre_id, format="html"):
# -------------- VIEWS # -------------- VIEWS
def evaluation_describe(evaluation_id="", edit_in_place=True): def evaluation_describe(evaluation_id="", edit_in_place=True, link_saisie=True):
"""HTML description of evaluation, for page headers """HTML description of evaluation, for page headers
edit_in_place: allow in-place editing when permitted (not implemented) edit_in_place: allow in-place editing when permitted (not implemented)
""" """
from app.scodoc import sco_saisie_notes
E = sco_evaluation_db.do_evaluation_list({"evaluation_id": evaluation_id})[0] E = sco_evaluation_db.do_evaluation_list({"evaluation_id": evaluation_id})[0]
moduleimpl_id = E["moduleimpl_id"] moduleimpl_id = E["moduleimpl_id"]
M = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)[0] M = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)[0]
@ -646,7 +644,7 @@ def evaluation_describe(evaluation_id="", edit_in_place=True):
if Mod["module_type"] == ModuleType.MALUS: if Mod["module_type"] == ModuleType.MALUS:
etit += ' <span class="eval_malus">(points de malus)</span>' etit += ' <span class="eval_malus">(points de malus)</span>'
H = [ H = [
'<span class="eval_title">Evaluation%s</span><p><b>Module : %s</b></p>' '<span class="eval_title">Évaluation%s</span><p><b>Module : %s</b></p>'
% (etit, mod_descr) % (etit, mod_descr)
] ]
if Mod["module_type"] == ModuleType.MALUS: if Mod["module_type"] == ModuleType.MALUS:
@ -689,12 +687,16 @@ def evaluation_describe(evaluation_id="", edit_in_place=True):
<a class="stdlink" href="{url_for( <a class="stdlink" href="{url_for(
"notes.evaluation_edit", scodoc_dept=g.scodoc_dept, evaluation_id=evaluation_id) "notes.evaluation_edit", scodoc_dept=g.scodoc_dept, evaluation_id=evaluation_id)
}">modifier l'évaluation</a> }">modifier l'évaluation</a>
"""
)
if link_saisie:
H.append(
f"""
<a class="stdlink" href="{url_for( <a class="stdlink" href="{url_for(
"notes.saisie_notes", scodoc_dept=g.scodoc_dept, evaluation_id=evaluation_id) "notes.saisie_notes", scodoc_dept=g.scodoc_dept, evaluation_id=evaluation_id)
}">saisie des notes</a> }">saisie des notes</a>
""" """
) )
H.append("</p>") H.append("</p>")
return '<div class="eval_description">' + "\n".join(H) + "</div>" return '<div class="eval_description">' + "\n".join(H) + "</div>"

View File

@ -277,7 +277,11 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
if modimpl.module.is_apc(): if modimpl.module.is_apc():
H.append(_ue_coefs_html(modimpl.module.ue_coefs_list())) H.append(_ue_coefs_html(modimpl.module.ue_coefs_list()))
else: else:
H.append(f"Coef. dans le semestre: {modimpl.module.coefficient}") H.append(
f"""Coef. dans le semestre: {
"non défini" if modimpl.module.coefficient is None else modimpl.module.coefficient
}"""
)
H.append("""</td><td></td></tr>""") H.append("""</td><td></td></tr>""")
# 3ieme ligne: Formation # 3ieme ligne: Formation
H.append( H.append(

View File

@ -943,7 +943,9 @@ def saisie_notes(evaluation_id, group_ids=[]):
cssstyles=sco_groups_view.CSSSTYLES, cssstyles=sco_groups_view.CSSSTYLES,
init_qtip=True, init_qtip=True,
), ),
sco_evaluations.evaluation_describe(evaluation_id=evaluation_id), sco_evaluations.evaluation_describe(
evaluation_id=evaluation_id, link_saisie=False
),
'<div id="saisie_notes"><span class="eval_title">Saisie des notes</span>', '<div id="saisie_notes"><span class="eval_title">Saisie des notes</span>',
] ]
H.append("""<div id="group-tabs"><table><tr><td>""") H.append("""<div id="group-tabs"><table><tr><td>""")