diff --git a/app/pe/pe_avislatex.py b/app/pe/pe_avislatex.py index fc64253ca..df2f89d2f 100644 --- a/app/pe/pe_avislatex.py +++ b/app/pe/pe_avislatex.py @@ -225,6 +225,10 @@ def get_annotation_PE(etudid, tag_annotation_pe): (cf. .get_preferences -> pe_tag_annotation_avis_latex). Result: chaine unicode + Modif JMP retourne un dictionnaire { + None : annotation de base + : annotation spécifique pour l'école + } """ if tag_annotation_pe: cnx = ndb.GetDBConnexion() @@ -255,7 +259,16 @@ def get_annotation_PE(etudid, tag_annotation_pe): annotationPE = annotationPE.replace( "
", "\n\n" ) # Interprète les retours chariots html - return annotationPE + + # Patch JMP build dictionnary of annotations + annotations = {} + split = annotationPE.split("@") + annotations[None] = split[0] + for specifique in split[1:]: + ecole, annotation = specifique.split(":", 1) + annotations[ecole] = specifique + + return annotations return "" # pas d'annotations @@ -406,10 +419,10 @@ def get_avis_poursuite_par_etudiant( "%% ---- Etudiant: " + civilite_str + " " + nom + " " + prenom + "\n" ) - # les annnotations - annotationPE = get_annotation_PE(etudid, tag_annotation_pe=tag_annotation_pe) + # les annotations + annotations = get_annotation_PE(etudid, tag_annotation_pe=tag_annotation_pe) if pe_tools.PE_DEBUG: - pe_tools.pe_print(annotationPE, type(annotationPE)) + pe_tools.pe_print(annotations, type(annotations)) # le LaTeX avis = get_code_latex_avis_etudiant( @@ -502,8 +515,8 @@ def table_syntheseAnnotationPE(syntheseJury, tag_annotation_pe): n += 1 # L'annotation PE - annotationPE = get_annotation_PE(etudid, tag_annotation_pe=tag_annotation_pe) - row["Annotation PE"] = annotationPE if annotationPE else "" + annotationPE = get_annotation_PE(etudid, tag_annotation_pe=tag_annotation_pe)[None] + row["Annotation PE"] = annotationPE + f" + {len(annotationPE)} specifiques" if annotationPE else "" rows.append(row) T = GenTable(