diff --git a/app/comp/moy_ue.py b/app/comp/moy_ue.py index 9a722f25..06d0b2c5 100644 --- a/app/comp/moy_ue.py +++ b/app/comp/moy_ue.py @@ -123,11 +123,15 @@ def notes_sem_load_cube(formsemestre): """Calcule le cube des notes du semestre (charge toutes les notes, calcule les moyenne des modules et assemble le cube) - Resultat: ndarray (etuds x modimpls x UEs) + Resultat: + sem_cube : ndarray (etuds x modimpls x UEs) + modimpls_evals_poids dict { modimpl.id : evals_poids } + modimpls_evals_notes dict { modimpl.id : evals_notes } + modimpls_evaluations dict { modimpl.id : liste des évaluations } """ - modimpls_evals_poids = {} # modimpl.id : evals_poids - modimpls_evals_notes = {} # modimpl.id : evals_notes - modimpls_evaluations = {} # modimpl.id : liste des évaluations + modimpls_evals_poids = {} + modimpls_evals_notes = {} + modimpls_evaluations = {} modimpls_notes = [] for modimpl in formsemestre.modimpls: evals_notes, evaluations, evaluations_completes = moy_mod.df_load_modimpl_notes( diff --git a/app/models/moduleimpls.py b/app/models/moduleimpls.py index 05bd592a..2da7cb01 100644 --- a/app/models/moduleimpls.py +++ b/app/models/moduleimpls.py @@ -1,8 +1,6 @@ # -*- coding: UTF-8 -* - """ScoDoc models: moduleimpls """ - import pandas as pd from app import db diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 48af5949..995d9f87 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -1172,6 +1172,8 @@ def formsemestre_tableau_modules( fontorange = "" etat = sco_evaluations.do_evaluation_etat_in_mod(nt, modimpl["moduleimpl_id"]) + # if nt.parcours.APC_SAE: + # tbd style si module non conforme if ( etat["nb_evals_completes"] > 0 and etat["nb_evals_en_cours"] == 0 diff --git a/app/scodoc/sco_liste_notes.py b/app/scodoc/sco_liste_notes.py index dd465fc0..70a0fb94 100644 --- a/app/scodoc/sco_liste_notes.py +++ b/app/scodoc/sco_liste_notes.py @@ -32,6 +32,7 @@ import flask from flask import url_for, g, request from app import models +from app.models.moduleimpls import ModuleImpl import app.scodoc.sco_utils as scu import app.scodoc.notesdb as ndb from app import log @@ -227,16 +228,19 @@ def _make_table_notes( return "
Aucune évaluation !
" E = evals[0] moduleimpl_id = E["moduleimpl_id"] - modimpl = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)[0] - module = models.Module.query.get(modimpl["module_id"]) + modimpl_o = sco_moduleimpl.moduleimpl_list(moduleimpl_id=moduleimpl_id)[0] + module = models.Module.query.get(modimpl_o["module_id"]) is_apc = module.formation.get_parcours().APC_SAE if is_apc: + modimpl = ModuleImpl.query.get(moduleimpl_id) + is_conforme = modimpl.check_apc_conformity() evals_poids, ues = moy_mod.df_load_evaluations_poids(moduleimpl_id) if not ues: is_apc = False else: evals_poids, ues = None, None - sem = sco_formsemestre.get_formsemestre(modimpl["formsemestre_id"]) + is_conforme = True + sem = sco_formsemestre.get_formsemestre(modimpl_o["formsemestre_id"]) # (debug) check that all evals are in same module: for e in evals: if e["moduleimpl_id"] != moduleimpl_id: @@ -248,7 +252,7 @@ def _make_table_notes( keep_numeric = False # Si pas de groupe, affiche tout if not group_ids: - group_ids = [sco_groups.get_default_group(modimpl["formsemestre_id"])] + group_ids = [sco_groups.get_default_group(modimpl_o["formsemestre_id"])] groups = sco_groups.listgroups(group_ids) gr_title = sco_groups.listgroups_abbrev(groups) @@ -326,7 +330,7 @@ def _make_table_notes( "etudid": etudid, "nom": etud["nom"].upper(), "_nomprenom_target": "formsemestre_bulletinetud?formsemestre_id=%s&etudid=%s" - % (modimpl["formsemestre_id"], etudid), + % (modimpl_o["formsemestre_id"], etudid), "_nomprenom_td_attrs": 'id="%s" class="etudinfo"' % (etud["etudid"]), "prenom": etud["prenom"].lower().capitalize(), "nomprenom": etud["nomprenom"], @@ -426,6 +430,7 @@ def _make_table_notes( rows, columns_ids, titles, + is_conforme, row_coefs, row_poids, row_note_max, @@ -536,6 +541,10 @@ def _make_table_notes( scodoc_dept=g.scodoc_dept, moduleimpl_id=moduleimpl_id) }">{module.code} {module.titre} """ + if not is_conforme: + html_title += ( + """