Update app.py
Browse files
app.py
CHANGED
@@ -255,12 +255,17 @@ class EvaluationGymnique:
|
|
255 |
run.italic = True
|
256 |
run.font.size = Pt(8)
|
257 |
|
|
|
258 |
def ajouter_zone_note(self):
|
259 |
zone_note = self.document.add_table(rows=1, cols=2)
|
260 |
zone_note.style = 'Table Grid'
|
261 |
zone_note.alignment = WD_TABLE_ALIGNMENT.RIGHT
|
262 |
|
|
|
|
|
|
|
263 |
cell_libelle = zone_note.cell(0, 0)
|
|
|
264 |
cell_libelle.text = "Note finale"
|
265 |
cell_libelle.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.RIGHT
|
266 |
run = cell_libelle.paragraphs[0].runs[0]
|
@@ -268,10 +273,9 @@ class EvaluationGymnique:
|
|
268 |
run.font.size = Pt(12)
|
269 |
run.font.color.rgb = RGBColor(0, 32, 96)
|
270 |
|
271 |
-
# Réduire la largeur pour que la cellule soit plus carrée
|
272 |
cell_saisie = zone_note.cell(0, 1)
|
273 |
-
cell_saisie.width =
|
274 |
-
zone_note.rows[0].height =
|
275 |
shading_elm = parse_xml(f'<w:shd {nsdecls("w")} w:fill="F2F2F2"/>')
|
276 |
cell_saisie._tc.get_or_add_tcPr().append(shading_elm)
|
277 |
cell_saisie.text = "/20"
|
@@ -280,20 +284,28 @@ class EvaluationGymnique:
|
|
280 |
run.bold = True
|
281 |
run.font.size = Pt(12)
|
282 |
|
283 |
-
# Ajouter
|
284 |
-
self.document.add_paragraph()
|
285 |
-
self.document.add_paragraph() # Un deuxième paragraphe
|
286 |
-
|
|
|
|
|
|
|
|
|
287 |
def ajouter_lignes_correcteurs(self):
|
288 |
-
#
|
|
|
|
|
|
|
|
|
289 |
for role in ["Projet", "principal", "ROV"]:
|
290 |
para = self.document.add_paragraph()
|
291 |
-
para.space_before = Pt(
|
292 |
-
para.space_after = Pt(
|
293 |
run = para.add_run(f"Correcteur {role} : ")
|
294 |
run.bold = True
|
295 |
para.add_run(".................................................................")
|
296 |
-
|
297 |
# Méthodes de modification des données
|
298 |
def modifier_centre_examen(self, nom):
|
299 |
self.centre_examen = nom
|
|
|
255 |
run.italic = True
|
256 |
run.font.size = Pt(8)
|
257 |
|
258 |
+
|
259 |
def ajouter_zone_note(self):
|
260 |
zone_note = self.document.add_table(rows=1, cols=2)
|
261 |
zone_note.style = 'Table Grid'
|
262 |
zone_note.alignment = WD_TABLE_ALIGNMENT.RIGHT
|
263 |
|
264 |
+
# Définir une largeur fixe pour les deux cellules
|
265 |
+
cell_width = Cm(1.5)
|
266 |
+
|
267 |
cell_libelle = zone_note.cell(0, 0)
|
268 |
+
cell_libelle.width = cell_width # Même largeur que la cellule de note
|
269 |
cell_libelle.text = "Note finale"
|
270 |
cell_libelle.paragraphs[0].alignment = WD_ALIGN_PARAGRAPH.RIGHT
|
271 |
run = cell_libelle.paragraphs[0].runs[0]
|
|
|
273 |
run.font.size = Pt(12)
|
274 |
run.font.color.rgb = RGBColor(0, 32, 96)
|
275 |
|
|
|
276 |
cell_saisie = zone_note.cell(0, 1)
|
277 |
+
cell_saisie.width = cell_width # Largeur fixe
|
278 |
+
zone_note.rows[0].height = cell_width # Hauteur identique à la largeur pour être carré
|
279 |
shading_elm = parse_xml(f'<w:shd {nsdecls("w")} w:fill="F2F2F2"/>')
|
280 |
cell_saisie._tc.get_or_add_tcPr().append(shading_elm)
|
281 |
cell_saisie.text = "/20"
|
|
|
284 |
run.bold = True
|
285 |
run.font.size = Pt(12)
|
286 |
|
287 |
+
# Ajouter plus d'espace avant la liste des correcteurs
|
288 |
+
self.document.add_paragraph().space_after = Pt(12)
|
289 |
+
self.document.add_paragraph().space_after = Pt(12) # Un deuxième paragraphe pour plus d'espace
|
290 |
+
|
291 |
+
|
292 |
+
# Modification 2: Modification de la méthode ajouter_lignes_correcteurs()
|
293 |
+
# pour ajuster l'espacement est optionnelle, mais recommandée pour cohérence:
|
294 |
+
|
295 |
def ajouter_lignes_correcteurs(self):
|
296 |
+
# Commencer avec un peu d'espace
|
297 |
+
para_intro = self.document.add_paragraph()
|
298 |
+
para_intro.space_before = Pt(6)
|
299 |
+
|
300 |
+
# Ajouter les lignes des correcteurs
|
301 |
for role in ["Projet", "principal", "ROV"]:
|
302 |
para = self.document.add_paragraph()
|
303 |
+
para.space_before = Pt(4)
|
304 |
+
para.space_after = Pt(4)
|
305 |
run = para.add_run(f"Correcteur {role} : ")
|
306 |
run.bold = True
|
307 |
para.add_run(".................................................................")
|
308 |
+
|
309 |
# Méthodes de modification des données
|
310 |
def modifier_centre_examen(self, nom):
|
311 |
self.centre_examen = nom
|