@@ -82,7 +82,9 @@ def convert_notes_to_json(url_response, json_file):
8282 section_map = {
8383 "Projet" : "Projet" ,
8484 "Contrôle Continu" : "Contrôle Continu" ,
85+ "Contrôle continu" : "Contrôle Continu" ,
8586 "Contrôle Continu" : "Contrôle Continu" ,
87+ "Contrôle continu" : "Contrôle Continu" ,
8688 "Examen" : "Examen"
8789 }
8890
@@ -108,11 +110,19 @@ def convert_notes_to_json(url_response, json_file):
108110 for key in ["Pondération Weight" , "Pond�ration Weight" , "PondÁration Weight" ]:
109111 if key in sous_ligne :
110112 sous_ligne ["pondération - section" ] = sous_ligne .pop (key )
111- if "Notes Grades" in sous_ligne :
112- sous_ligne ["note" ] = sous_ligne .pop ("Notes Grades" )
113- # Séparation des notes et pondérations multiples
114- note_val = sous_ligne .pop ("note" , "" )
115- pond_val = sous_ligne .pop ("pondération" , "" )
113+ # Extraction robuste de la note et de la pondération
114+ note_val = ""
115+ pond_val = ""
116+ # Cherche la note dans toutes les colonnes possibles
117+ for key in ["Notes Grades" , "note" , "note item-ev1" ]:
118+ if key in sous_ligne and sous_ligne [key ]:
119+ note_val = sous_ligne .pop (key )
120+ break
121+ # Cherche la pondération dans toutes les colonnes possibles
122+ for key in ["Pondération Weight" , "Pond�ration Weight" , "PondÁration Weight" , "coefficient item-ev1" , "pondération" ]:
123+ if key in sous_ligne and sous_ligne [key ]:
124+ pond_val = sous_ligne .pop (key )
125+ break
116126 notes = []
117127 if note_val and ("(" in note_val and ")" in note_val ):
118128 notes = split_notes (note_val )
0 commit comments