forked from ScoDoc/DocScoDoc
rangs dans les UEs
This commit is contained in:
parent
e6bd6cf28a
commit
39fa7f2487
@ -77,11 +77,14 @@ class BulletinBUT(ResultatsSemestreBUT):
|
||||
"saes": self.etud_ue_mod_results(etud, ue, self.saes),
|
||||
}
|
||||
if ue.type != UE_SPORT:
|
||||
rangs, effectif = self.ue_rangs[ue.id]
|
||||
d["moyenne"] = {
|
||||
"value": fmt_note(self.etud_moy_ue[ue.id][etud.id]),
|
||||
"min": fmt_note(self.etud_moy_ue[ue.id].min()),
|
||||
"max": fmt_note(self.etud_moy_ue[ue.id].max()),
|
||||
"moy": fmt_note(self.etud_moy_ue[ue.id].mean()),
|
||||
"rang": rangs[etud.id],
|
||||
"total": effectif, # nb etud avec note dans cette UE
|
||||
}
|
||||
else:
|
||||
# ceci suppose que l'on a une seule UE bonus,
|
||||
|
@ -98,7 +98,8 @@ class ResultatsSemestreBUT(NotesTableCompat):
|
||||
self.etud_moy_gen = moy_sem.compute_sem_moys_apc(
|
||||
self.etud_moy_ue, self.modimpl_coefs_df
|
||||
)
|
||||
self.etud_moy_gen_ranks = moy_sem.comp_ranks_series(self.etud_moy_gen)
|
||||
# --- Classements:
|
||||
self.compute_rangs()
|
||||
|
||||
def get_etud_mod_moy(self, moduleimpl_id: int, etudid: int) -> float:
|
||||
"""La moyenne de l'étudiant dans le moduleimpl
|
||||
|
@ -9,7 +9,7 @@
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
|
||||
from app.comp import moy_mod, moy_ue, moy_sem, inscr_mod
|
||||
from app.comp import moy_mod, moy_ue, inscr_mod
|
||||
from app.comp.res_common import NotesTableCompat
|
||||
from app.comp.bonus_spo import BonusSport
|
||||
from app.models import ScoDocSiteConfig
|
||||
@ -105,7 +105,7 @@ class ResultatsSemestreClassic(NotesTableCompat):
|
||||
bonus_mg # compat nt, utilisé pour l'afficher sur les bulletins
|
||||
)
|
||||
# --- Classements:
|
||||
self.etud_moy_gen_ranks = moy_sem.comp_ranks_series(self.etud_moy_gen)
|
||||
self.compute_rangs()
|
||||
|
||||
def get_etud_mod_moy(self, moduleimpl_id: int, etudid: int) -> float:
|
||||
"""La moyenne de l'étudiant dans le moduleimpl
|
||||
|
@ -9,6 +9,7 @@ from functools import cached_property
|
||||
import numpy as np
|
||||
import pandas as pd
|
||||
from app.comp.aux_stats import StatsMoyenne
|
||||
from app.comp import moy_sem
|
||||
from app.comp.res_cache import ResultatsCache
|
||||
from app.comp import res_sem
|
||||
from app.comp.moy_mod import ModuleImplResults
|
||||
@ -169,6 +170,8 @@ class NotesTableCompat(ResultatsSemestre):
|
||||
"bonus",
|
||||
"bonus_ues",
|
||||
"malus",
|
||||
"etud_moy_gen_ranks",
|
||||
"ue_rangs",
|
||||
)
|
||||
|
||||
def __init__(self, formsemestre: FormSemestre):
|
||||
@ -250,6 +253,20 @@ class NotesTableCompat(ResultatsSemestre):
|
||||
modimpls_dict.append(d)
|
||||
return modimpls_dict
|
||||
|
||||
def compute_rangs(self):
|
||||
"""Calcule les classements
|
||||
Moyenne générale: etud_moy_gen_ranks
|
||||
Par UE:
|
||||
"""
|
||||
self.etud_moy_gen_ranks = moy_sem.comp_ranks_series(self.etud_moy_gen)
|
||||
for ue in self.formsemestre.query_ues():
|
||||
moy_ue = self.etud_moy_ue[ue.id]
|
||||
self.ue_rangs[ue.id] = (
|
||||
moy_sem.comp_ranks_series(moy_ue),
|
||||
int(moy_ue.count()),
|
||||
)
|
||||
# .count() -> nb of non NaN values
|
||||
|
||||
def get_etud_decision_ues(self, etudid: int) -> dict:
|
||||
"""Decisions du jury pour les UE de cet etudiant, ou None s'il n'y en pas eu.
|
||||
Ne tient pas compte des UE capitalisées.
|
||||
|
@ -53,6 +53,7 @@ from reportlab.lib import styles
|
||||
|
||||
import flask
|
||||
from flask import url_for, g, request
|
||||
from app.models.ues import UniteEns
|
||||
|
||||
import app.scodoc.sco_utils as scu
|
||||
import app.scodoc.notesdb as ndb
|
||||
@ -145,16 +146,14 @@ def _comp_ects_by_ue_code(nt, decision_ues):
|
||||
decision_ues est le resultat de nt.get_etud_decision_ues
|
||||
Chaque resultat est un dict: { ue_code : ects }
|
||||
"""
|
||||
raise NotImplementedError() # XXX #sco92
|
||||
# ré-écrire en utilisant
|
||||
if not decision_ues:
|
||||
return {}
|
||||
|
||||
ects_by_ue_code = {}
|
||||
for ue_id in decision_ues:
|
||||
d = decision_ues[ue_id]
|
||||
ue = nt.uedict[ue_id]
|
||||
ects_by_ue_code[ue["ue_code"]] = d["ects"]
|
||||
ue = UniteEns.query.get(ue_id)
|
||||
ects_by_ue_code[ue.ue_code] = d["ects"]
|
||||
|
||||
return ects_by_ue_code
|
||||
|
||||
|
@ -645,12 +645,12 @@ def make_formsemestre_recapcomplet(
|
||||
): # Rang: force tri numerique pour sortable
|
||||
cls = cls + " sortnumeric"
|
||||
if F[0][i] in cod2mod: # lien vers etat module
|
||||
mod = cod2mod[F[0][i]]
|
||||
modimpl = cod2mod[F[0][i]]
|
||||
cells += '<td class="%s"><a href="moduleimpl_status?moduleimpl_id=%s" title="%s (%s)">%s</a></td>' % (
|
||||
cls,
|
||||
mod["moduleimpl_id"],
|
||||
mod["module"]["titre"],
|
||||
sco_users.user_info(mod["responsable_id"])["nomcomplet"],
|
||||
modimpl.id,
|
||||
modimpl.module.titre,
|
||||
sco_users.user_info(modimpl.responsable_id)["nomcomplet"],
|
||||
F[0][i],
|
||||
)
|
||||
else:
|
||||
|
Loading…
Reference in New Issue
Block a user