diff --git a/app/scodoc/notes_table.py b/app/scodoc/notes_table.py index fb18d050d6..e3d6e4193a 100644 --- a/app/scodoc/notes_table.py +++ b/app/scodoc/notes_table.py @@ -630,7 +630,8 @@ class NotesTable(object): matiere_sum_notes += val * coef matiere_sum_coefs += coef matiere_id_last = matiere_id - except: + except: # val == "NI" "NA" + assert val == "NI" or val == "NA" nb_missing = nb_missing + 1 coefs.append(0) coefs_mask.append(0) @@ -728,9 +729,7 @@ class NotesTable(object): Prend toujours en compte les UE capitalisées. """ - # log('comp_etud_moy_gen(etudid=%s)' % etudid) - - # Si l'étudiant a Demissionné ou est DEFaillant, on n'enregistre pas ses moyennes + # Si l'étudiant a Démissionné ou est DEFaillant, on n'enregistre pas ses moyennes block_computation = ( self.inscrdict[etudid]["etat"] == "D" or self.inscrdict[etudid]["etat"] == DEF diff --git a/app/scodoc/sco_compute_moy.py b/app/scodoc/sco_compute_moy.py index 4d46f065c3..3e50590125 100644 --- a/app/scodoc/sco_compute_moy.py +++ b/app/scodoc/sco_compute_moy.py @@ -160,7 +160,7 @@ def compute_user_formula( # log('expression : %s\nvariables=%s\n' % (formula, variables)) # debug user_moy = sco_formulas.eval_user_expression(formula, variables) # log('user_moy=%s' % user_moy) - if user_moy != "NA0" and user_moy != "NA": + if user_moy != "NA": user_moy = float(user_moy) if (user_moy > 20) or (user_moy < 0): etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] @@ -295,15 +295,17 @@ def compute_moduleimpl_moyennes(nt, modimpl): # il manque une note ! (si publish_incomplete, cela peut arriver, on ignore) if e["coefficient"] > 0 and not e["publish_incomplete"]: nb_missing += 1 + # ne devrait pas arriver ? + log("\nXXX SCM298\n") if nb_missing == 0 and sum_coefs > 0: if sum_coefs > 0: R[etudid] = sum_notes / sum_coefs moy_valid = True else: - R[etudid] = "na" + R[etudid] = "NA" moy_valid = False else: - R[etudid] = "NA%d" % nb_missing + R[etudid] = "NA" moy_valid = False if user_expr: @@ -361,7 +363,7 @@ def compute_moduleimpl_moyennes(nt, modimpl): if eval_rattr["evaluation_type"] == EVALUATION_RATTRAPAGE: # rattrapage classique: prend la meilleure note entre moyenne # module et note eval rattrapage - if (R[etudid] == "NA0") or (note_sur_20 > R[etudid]): + if (R[etudid] == "NA") or (note_sur_20 > R[etudid]): # log('note_sur_20=%s' % note_sur_20) R[etudid] = note_sur_20 elif eval_rattr["evaluation_type"] == EVALUATION_SESSION2: diff --git a/app/scodoc/sco_recapcomplet.py b/app/scodoc/sco_recapcomplet.py index 06f7b95eb2..325aec530e 100644 --- a/app/scodoc/sco_recapcomplet.py +++ b/app/scodoc/sco_recapcomplet.py @@ -669,11 +669,11 @@ def make_formsemestre_recapcomplet( else: cells = '' % etudid ir += 1 - # XXX nsn = [ x.replace('NA0', '-') for x in l[:-2] ] - # notes sans le NA0: + # XXX nsn = [ x.replace('NA', '-') for x in l[:-2] ] + # notes sans le NA: nsn = l[:-2] # copy for i in range(len(nsn)): - if nsn[i] == "NA0": + if nsn[i] == "NA": nsn[i] = "-" cells += '%s' % nsn[0] # rang cells += '%s' % el # nom etud (lien) diff --git a/app/scodoc/sco_tag_module.py b/app/scodoc/sco_tag_module.py index b106a754e2..50ec8f01cc 100644 --- a/app/scodoc/sco_tag_module.py +++ b/app/scodoc/sco_tag_module.py @@ -280,7 +280,7 @@ def get_etud_tagged_modules(etudid, tagname): R.append( { "sem": sem, - "moy": moy, # valeur réelle, ou NI (non inscrit au module ou NA0 (pas de note) + "moy": moy, # valeur réelle, ou NI (non inscrit au module ou NA (pas de note) "moduleimpl": modimpl, "tags": tags, } diff --git a/app/scodoc/sco_utils.py b/app/scodoc/sco_utils.py index e5dec56b8e..68321aba15 100644 --- a/app/scodoc/sco_utils.py +++ b/app/scodoc/sco_utils.py @@ -132,7 +132,7 @@ def fmt_note(val, note_max=None, keep_numeric=False): s = "0" * (5 - len(s)) + s # padding: 0 à gauche pour longueur 5: "12.34" return s else: - return val.replace("NA0", "-") # notes sans le NA0 + return val.replace("NA", "-") def fmt_coef(val):