From a8367a84fbefaedd3c19b2caffe52b734f605d2e Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 2 Feb 2022 22:22:56 +0100 Subject: [PATCH] =?UTF-8?q?Fiche=20=C3=A9tudiant:=20utilise=20res=5Fsem,?= =?UTF-8?q?=20affiche=20moyennes=20BUT?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/but/bulletin_but.py | 1 + app/comp/aux_stats.py | 2 +- app/comp/res_common.py | 5 +++-- app/scodoc/sco_formsemestre_validation.py | 18 ++++++++++++------ 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/but/bulletin_but.py b/app/but/bulletin_but.py index 81a7e19963..db05abfd4c 100644 --- a/app/but/bulletin_but.py +++ b/app/but/bulletin_but.py @@ -228,6 +228,7 @@ class BulletinBUT(ResultatsSemestreBUT): "date_fin": formsemestre.date_fin.isoformat(), "annee_universitaire": self.formsemestre.annee_scolaire_str(), "numero": formsemestre.semestre_id, + "inscription": "", # inutilisé mais nécessaire pour le js de Seb. "groupes": [], # XXX TODO "absences": { "injustifie": nbabsjust, diff --git a/app/comp/aux_stats.py b/app/comp/aux_stats.py index 07517f3622..3337c2b814 100644 --- a/app/comp/aux_stats.py +++ b/app/comp/aux_stats.py @@ -21,7 +21,7 @@ class StatsMoyenne: Les valeurs NAN ou non numériques sont toujours enlevées. Si vals is None, renvoie des zéros (utilisé pour UE bonus) """ - if vals is None: + if vals is None or len(vals) == 0: self.moy = self.min = self.max = self.size = self.nb_vals = 0 else: self.moy = np.nanmean(vals) diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 47caaa03a1..601f76a99b 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -293,10 +293,11 @@ class NotesTableCompat(ResultatsSemestre): def get_etud_ue_status(self, etudid: int, ue_id: int): coef_ue = self.etud_coef_ue_df[ue_id][etudid] return { + "is_capitalized": False, # XXX TODO + "is_external": False, # XXX TODO + "coef_ue": coef_ue, # XXX TODO "cur_moy_ue": self.etud_moy_ue[ue_id][etudid], "moy": self.etud_moy_ue[ue_id][etudid], - "is_capitalized": False, # XXX TODO - "coef_ue": coef_ue, # XXX TODO } def get_etud_rang(self, etudid: int): diff --git a/app/scodoc/sco_formsemestre_validation.py b/app/scodoc/sco_formsemestre_validation.py index baee42f3cf..ed5325ce89 100644 --- a/app/scodoc/sco_formsemestre_validation.py +++ b/app/scodoc/sco_formsemestre_validation.py @@ -31,15 +31,21 @@ import time import flask from flask import url_for, g, request +from app.api.sco_api import formsemestre import app.scodoc.notesdb as ndb import app.scodoc.sco_utils as scu from app import log -from app.scodoc.scolog import logdb -from app.scodoc.TrivialFormulator import TrivialFormulator, tf_error_message -from app.scodoc.sco_exceptions import ScoValueError +from app.comp import res_sem +from app.comp.res_common import NotesTableCompat +from app.models import FormSemestre + +from app.scodoc.sco_exceptions import ScoValueError +from app.scodoc.scolog import logdb from app.scodoc.sco_codes_parcours import * +from app.scodoc.TrivialFormulator import TrivialFormulator, tf_error_message + from app.scodoc import html_sco_header from app.scodoc import sco_abs from app.scodoc import sco_codes_parcours @@ -542,9 +548,9 @@ def formsemestre_recap_parcours_table( else: ass = "" - nt = sco_cache.NotesTableCache.get( - sem["formsemestre_id"] - ) # > get_ues_stat_dict, get_etud_moy_gen, get_etud_ue_status + formsemestre = FormSemestre.query.get(sem["formsemestre_id"]) + nt: NotesTableCompat = res_sem.load_formsemestre_result(formsemestre) + # nt = sco_cache.NotesTableCache.get(sem["formsemestre_id"]) if is_cur: type_sem = "*" # now unused class_sem = "sem_courant"