forked from ScoDoc/ScoDoc
Calcul des etuds d'un modimpl avec notes en ATT. Affichage sur tableau bord. Fix tri liste etuds (#595).
This commit is contained in:
parent
6809f24cee
commit
5d77d415a2
@ -190,9 +190,14 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
if not isinstance(moduleimpl_id, int):
|
if not isinstance(moduleimpl_id, int):
|
||||||
raise ScoInvalidIdType("moduleimpl_id must be an integer !")
|
raise ScoInvalidIdType("moduleimpl_id must be an integer !")
|
||||||
modimpl: ModuleImpl = ModuleImpl.query.get_or_404(moduleimpl_id)
|
modimpl: ModuleImpl = ModuleImpl.query.get_or_404(moduleimpl_id)
|
||||||
module: Module = modimpl.module
|
mi_dict = modimpl.to_dict()
|
||||||
formsemestre_id = modimpl.formsemestre_id
|
formsemestre_id = modimpl.formsemestre_id
|
||||||
formsemestre: FormSemestre = modimpl.formsemestre
|
formsemestre: FormSemestre = modimpl.formsemestre
|
||||||
|
mod_dict = sco_edit_module.module_list(args={"module_id": modimpl.module_id})[0]
|
||||||
|
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||||
|
formation_dict = sco_formations.formation_list(
|
||||||
|
args={"formation_id": sem["formation_id"]}
|
||||||
|
)[0]
|
||||||
mod_inscrits = sco_moduleimpl.do_moduleimpl_inscription_list(
|
mod_inscrits = sco_moduleimpl.do_moduleimpl_inscription_list(
|
||||||
moduleimpl_id=moduleimpl_id
|
moduleimpl_id=moduleimpl_id
|
||||||
)
|
)
|
||||||
@ -227,22 +232,22 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
arrow_up, arrow_down, arrow_none = sco_groups.get_arrow_icons_tags()
|
arrow_up, arrow_down, arrow_none = sco_groups.get_arrow_icons_tags()
|
||||||
#
|
#
|
||||||
module_resp = User.query.get(modimpl.responsable_id)
|
module_resp = User.query.get(modimpl.responsable_id)
|
||||||
mod_type_name = scu.MODULE_TYPE_NAMES[module.module_type]
|
mod_type_name = scu.MODULE_TYPE_NAMES[mod_dict["module_type"]]
|
||||||
H = [
|
H = [
|
||||||
html_sco_header.sco_header(
|
html_sco_header.sco_header(
|
||||||
page_title=f"{mod_type_name} {module.code} {module.titre}",
|
page_title=f"{mod_type_name} {mod_dict['code']} {mod_dict['titre']}",
|
||||||
javascripts=["js/etud_info.js"],
|
javascripts=["js/etud_info.js"],
|
||||||
init_qtip=True,
|
init_qtip=True,
|
||||||
),
|
),
|
||||||
f"""<h2 class="formsemestre">{mod_type_name}
|
f"""<h2 class="formsemestre">{mod_type_name}
|
||||||
<tt>{module.code}</tt> {module.titre}
|
<tt>{mod_dict['code']}</tt> {mod_dict['titre']}
|
||||||
{"dans l'UE " + modimpl.module.ue.acronyme
|
{"dans l'UE " + modimpl.module.ue.acronyme
|
||||||
if modimpl.module.module_type == scu.ModuleType.MALUS
|
if modimpl.module.module_type == scu.ModuleType.MALUS
|
||||||
else ""
|
else ""
|
||||||
}
|
}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="moduleimpl_tableaubord moduleimpl_type_{
|
<div class="moduleimpl_tableaubord moduleimpl_type_{
|
||||||
scu.ModuleType(module.module_type).name.lower()}">
|
scu.ModuleType(mod_dict['module_type']).name.lower()}">
|
||||||
<table>
|
<table>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="fichetitre2">Responsable: </td><td class="redboldtext">
|
<td class="fichetitre2">Responsable: </td><td class="redboldtext">
|
||||||
@ -289,10 +294,8 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
H.append("""</td><td></td></tr>""")
|
H.append("""</td><td></td></tr>""")
|
||||||
# 3ieme ligne: Formation
|
# 3ieme ligne: Formation
|
||||||
H.append(
|
H.append(
|
||||||
f"""<tr>
|
"""<tr><td class="fichetitre2">Formation: </td><td>%(titre)s</td></tr>"""
|
||||||
<td class="fichetitre2">Formation: </td><td>{formsemestre.formation.titre}</td>
|
% formation_dict
|
||||||
</tr>
|
|
||||||
"""
|
|
||||||
)
|
)
|
||||||
# Ligne: Inscrits
|
# Ligne: Inscrits
|
||||||
H.append(
|
H.append(
|
||||||
@ -300,17 +303,18 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
)
|
)
|
||||||
if current_user.has_permission(Permission.ScoEtudInscrit):
|
if current_user.has_permission(Permission.ScoEtudInscrit):
|
||||||
H.append(
|
H.append(
|
||||||
f"""<a class="stdlink" style="margin-left:2em;" href="moduleimpl_inscriptions_edit?moduleimpl_id={modimpl.id}">modifier</a>"""
|
"""<a class="stdlink" style="margin-left:2em;" href="moduleimpl_inscriptions_edit?moduleimpl_id=%s">modifier</a>"""
|
||||||
|
% mi_dict["moduleimpl_id"]
|
||||||
)
|
)
|
||||||
H.append("</td></tr>")
|
H.append("</td></tr>")
|
||||||
# Ligne: règle de calcul
|
# Ligne: règle de calcul
|
||||||
has_expression = sco_compute_moy.moduleimpl_has_expression(modimpl)
|
has_expression = sco_compute_moy.moduleimpl_has_expression(mi_dict)
|
||||||
if has_expression:
|
if has_expression:
|
||||||
H.append(
|
H.append(
|
||||||
f"""<tr>
|
f"""<tr>
|
||||||
<td class="fichetitre2" colspan="4">Règle de calcul:
|
<td class="fichetitre2" colspan="4">Règle de calcul:
|
||||||
<span class="formula" title="mode de calcul de la moyenne du module"
|
<span class="formula" title="mode de calcul de la moyenne du module"
|
||||||
>moyenne=<tt>{modimpl.computation_expr}</tt>
|
>moyenne=<tt>{mi_dict["computation_expr"]}</tt>
|
||||||
</span>"""
|
</span>"""
|
||||||
)
|
)
|
||||||
H.append("""<span class="warning">inutilisée dans cette version de ScoDoc""")
|
H.append("""<span class="warning">inutilisée dans cette version de ScoDoc""")
|
||||||
@ -417,20 +421,21 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
</form>
|
</form>
|
||||||
</p>
|
</p>
|
||||||
"""
|
"""
|
||||||
|
% mi_dict
|
||||||
)
|
)
|
||||||
|
|
||||||
# -------- Tableau des evaluations
|
# -------- Tableau des evaluations
|
||||||
top_table_links = ""
|
top_table_links = ""
|
||||||
if can_edit_evals:
|
if can_edit_evals:
|
||||||
top_table_links = f"""<a class="stdlink" href="{
|
top_table_links = f"""<a class="stdlink" href="{
|
||||||
url_for("notes.evaluation_create", scodoc_dept=g.scodoc_dept, moduleimpl_id=modimpl.id)
|
url_for("notes.evaluation_create", scodoc_dept=g.scodoc_dept, moduleimpl_id=mi_dict['moduleimpl_id'])
|
||||||
}">Créer nouvelle évaluation</a>
|
}">Créer nouvelle évaluation</a>
|
||||||
"""
|
"""
|
||||||
if nb_evaluations > 0:
|
if nb_evaluations > 0:
|
||||||
top_table_links += f"""
|
top_table_links += f"""
|
||||||
<a class="stdlink" style="margin-left:2em;" href="{
|
<a class="stdlink" style="margin-left:2em;" href="{
|
||||||
url_for("notes.moduleimpl_evaluation_renumber",
|
url_for("notes.moduleimpl_evaluation_renumber",
|
||||||
scodoc_dept=g.scodoc_dept, moduleimpl_id=modimpl.id,
|
scodoc_dept=g.scodoc_dept, moduleimpl_id=mi_dict['moduleimpl_id'],
|
||||||
redirect=1)
|
redirect=1)
|
||||||
}">Trier par date</a>
|
}">Trier par date</a>
|
||||||
"""
|
"""
|
||||||
|
@ -649,7 +649,7 @@ table.dataTable.gt_table {
|
|||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Tables non centrées (inutile) */
|
/* Tables non centrées */
|
||||||
table.dataTable.gt_table.gt_left {
|
table.dataTable.gt_table.gt_left {
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
# -*- mode: python -*-
|
# -*- mode: python -*-
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
SCOVERSION = "9.4.37"
|
SCOVERSION = "9.4.40"
|
||||||
|
|
||||||
SCONAME = "ScoDoc"
|
SCONAME = "ScoDoc"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user