From 0e42df55c927bde01949984d4c20a741db03e834 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 22 Feb 2022 18:44:53 +0100 Subject: [PATCH 1/5] =?UTF-8?q?Option=20pour=20afficher=20coef.=20UE=20s?= =?UTF-8?q?=C3=A9par=C3=A9e=20de=20celle=20pour=20les=20coefs=20modules=20?= =?UTF-8?q?(et=20=C3=A9vals).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_bulletins_standard.py | 10 ++++++---- app/scodoc/sco_preferences.py | 12 +++++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py index 60c6f2a00..25111f7e6 100644 --- a/app/scodoc/sco_bulletins_standard.py +++ b/app/scodoc/sco_bulletins_standard.py @@ -284,7 +284,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): ) with_col_moypromo = prefs["bul_show_moypromo"] with_col_rang = prefs["bul_show_rangs"] - with_col_coef = prefs["bul_show_coef"] + with_col_coef = prefs["bul_show_coef"] or prefs["bul_show_ue_coef"] with_col_ects = prefs["bul_show_ects"] colkeys = ["titre", "module"] # noms des colonnes à afficher @@ -409,7 +409,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): # Chaque UE: for ue in I["ues"]: ue_type = None - coef_ue = ue["coef_ue_txt"] + coef_ue = ue["coef_ue_txt"] if prefs["bul_show_ue_coef"] else "" ue_descr = ue["ue_descr_txt"] rowstyle = "" plusminus = minuslink # @@ -592,7 +592,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): "_titre_colspan": 2, "rang": mod["mod_rang_txt"], # vide si pas option rang "note": mod["mod_moy_txt"], - "coef": mod["mod_coef_txt"], + "coef": mod["mod_coef_txt"] if prefs["bul_show_coef"] else "", "abs": mod.get( "mod_abs_txt", "" ), # absent si pas option show abs module @@ -656,7 +656,9 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator): eval_style = "" t = { "module": ' ' + e["name"], - "coef": "" + e["coef_txt"] + "", + "coef": ("" + e["coef_txt"] + "") + if prefs["bul_show_coef"] + else "", "_hidden": hidden, "_module_target": e["target_html"], # '_module_help' : , diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index b639d5ee4..aab148e70 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -1296,11 +1296,21 @@ class BasePreferences(object): "labels": ["non", "oui"], }, ), + ( + "bul_show_ue_coef", + { + "initvalue": 1, + "title": "Afficher coefficient des UE sur les bulletins", + "input_type": "boolcheckbox", + "category": "bul", + "labels": ["non", "oui"], + }, + ), ( "bul_show_coef", { "initvalue": 1, - "title": "Afficher coefficient des ue/modules sur les bulletins", + "title": "Afficher coefficient des modules sur les bulletins", "input_type": "boolcheckbox", "category": "bul", "labels": ["non", "oui"], From 276d7977a79e9167df9a66d1b8d6f7bfa3f0460c Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 22 Feb 2022 18:45:43 +0100 Subject: [PATCH 2/5] Ajout UE bonus aux parcours ILEPS --- app/scodoc/sco_codes_parcours.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/scodoc/sco_codes_parcours.py b/app/scodoc/sco_codes_parcours.py index 59372b8d6..f6ca2ff29 100644 --- a/app/scodoc/sco_codes_parcours.py +++ b/app/scodoc/sco_codes_parcours.py @@ -587,7 +587,7 @@ class ParcoursILEPS(TypeParcours): # SESSION_ABBRV = 'A' # A1, A2, ... COMPENSATION_UE = False UNUSED_CODES = set((ADC, ATT, ATB, ATJ)) - ALLOWED_UE_TYPES = [UE_STANDARD, UE_OPTIONNELLE] + ALLOWED_UE_TYPES = [UE_STANDARD, UE_OPTIONNELLE, UE_SPORT] # Barre moy gen. pour validation semestre: BARRE_MOY = 10.0 # Barre pour UE ILEPS: 8/20 pour UE standards ("fondamentales") From e7b980bff7d3be0a9021091509a65c7bcba905e6 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Tue, 22 Feb 2022 18:46:47 +0100 Subject: [PATCH 3/5] =?UTF-8?q?Fix:=20acc=C3=A8s=20moyennes=5Fmatieres?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/comp/res_common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 5f652ec5c..92b0ee5ff 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -518,11 +518,11 @@ class NotesTableCompat(ResultatsSemestre): return "" return ins.etat - def get_etud_mat_moy(self, matiere_id, etudid): + def get_etud_mat_moy(self, matiere_id: int, etudid: int) -> str: """moyenne d'un étudiant dans une matière (ou NA si pas de notes)""" if not self.moyennes_matieres: return "nd" - return self.moyennes_matieres[matiere_id][etudid] + return self.moyennes_matieres[matiere_id].get(etudid, "-") def get_etud_mod_moy(self, moduleimpl_id: int, etudid: int) -> float: """La moyenne de l'étudiant dans le moduleimpl From 875c12d703ea2e888d0cc09591caeed3ff15754b Mon Sep 17 00:00:00 2001 From: Jean-Marie PLACE Date: Tue, 22 Feb 2022 19:25:49 +0100 Subject: [PATCH 4/5] soften error when logo not found --- app/scodoc/sco_logos.py | 2 +- app/views/scodoc.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/scodoc/sco_logos.py b/app/scodoc/sco_logos.py index c489510b5..46e0c066a 100644 --- a/app/scodoc/sco_logos.py +++ b/app/scodoc/sco_logos.py @@ -276,7 +276,7 @@ class Logo: if self.mm is None: return f'' else: - return f'' + return f'' def last_modified(self): path = Path(self.filepath) diff --git a/app/views/scodoc.py b/app/views/scodoc.py index 809d8e463..d1c842dd4 100644 --- a/app/views/scodoc.py +++ b/app/views/scodoc.py @@ -304,8 +304,9 @@ def _return_logo(name="header", dept_id="", small=False, strict: bool = True): # stockée dans /opt/scodoc-data/config/logos donc servie manuellement ici # from app.scodoc.sco_photos import _http_jpeg_file - logo = sco_logos.find_logo(name, dept_id, strict).select() + logo = sco_logos.find_logo(name, dept_id, strict) if logo is not None: + logo.select() suffix = logo.suffix if small: with PILImage.open(logo.filepath) as im: From e9ad417f1f5abcc9eec5390959b2df005cc84dc9 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Wed, 23 Feb 2022 09:42:41 +0100 Subject: [PATCH 5/5] check matieres --- app/comp/res_common.py | 6 +++++- sco_version.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/comp/res_common.py b/app/comp/res_common.py index 92b0ee5ff..f13201262 100644 --- a/app/comp/res_common.py +++ b/app/comp/res_common.py @@ -522,7 +522,11 @@ class NotesTableCompat(ResultatsSemestre): """moyenne d'un étudiant dans une matière (ou NA si pas de notes)""" if not self.moyennes_matieres: return "nd" - return self.moyennes_matieres[matiere_id].get(etudid, "-") + return ( + self.moyennes_matieres[matiere_id].get(etudid, "-") + if matiere_id in self.moyennes_matieres + else "-" + ) def get_etud_mod_moy(self, moduleimpl_id: int, etudid: int) -> float: """La moyenne de l'étudiant dans le moduleimpl diff --git a/sco_version.py b/sco_version.py index 4ac94b210..5c1b87f2e 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.1.62" +SCOVERSION = "9.1.63" SCONAME = "ScoDoc"