Merge branch 'refactor_nt' of https://scodoc.org/git/ScoDoc/ScoDoc into entreprises
This commit is contained in:
commit
c7bd3b19c8
@ -153,7 +153,12 @@ class BulletinBUT:
|
||||
self.etud_eval_results(etud, e)
|
||||
for e in modimpl.evaluations
|
||||
if e.visibulletin
|
||||
and modimpl_results.evaluations_etat[e.id].is_complete
|
||||
and (
|
||||
modimpl_results.evaluations_etat[e.id].is_complete
|
||||
or sco_preferences.get_preference(
|
||||
"bul_show_all_evals", res.formsemestre.id
|
||||
)
|
||||
)
|
||||
],
|
||||
}
|
||||
return d
|
||||
|
@ -119,9 +119,9 @@ class AddLogoForm(FlaskForm):
|
||||
label="Nom",
|
||||
validators=[
|
||||
validators.regexp(
|
||||
r"^[a-zA-Z0-9-]*$",
|
||||
r"^[a-zA-Z0-9-_]*$",
|
||||
re.IGNORECASE,
|
||||
"Ne doit comporter que lettres, chiffres ou -",
|
||||
"Ne doit comporter que lettres, chiffres, _ ou -",
|
||||
),
|
||||
validators.Length(
|
||||
max=20, message="Un nom ne doit pas dépasser 20 caractères"
|
||||
|
@ -171,7 +171,7 @@ class NotesTable:
|
||||
|
||||
def __init__(self, formsemestre_id):
|
||||
# log(f"NotesTable( formsemestre_id={formsemestre_id} )")
|
||||
raise NotImplementedError() # XXX
|
||||
# raise NotImplementedError() # XXX
|
||||
if not formsemestre_id:
|
||||
raise ValueError("invalid formsemestre_id (%s)" % formsemestre_id)
|
||||
self.formsemestre_id = formsemestre_id
|
||||
|
@ -139,6 +139,7 @@ def evaluation_create_form(
|
||||
initvalues["visibulletinlist"] = ["X"]
|
||||
else:
|
||||
initvalues["visibulletinlist"] = []
|
||||
initvalues["coefficient"] = initvalues.get("coefficient", 1.0)
|
||||
vals = scu.get_request_args()
|
||||
if vals.get("tf_submitted", False) and "visibulletinlist" not in vals:
|
||||
vals["visibulletinlist"] = []
|
||||
@ -158,7 +159,7 @@ def evaluation_create_form(
|
||||
else:
|
||||
coef_ue = ue_coef_dict.get(ue.id, 0.0) or 0.0
|
||||
if coef_ue > 0:
|
||||
poids = 1.0 # par defaut au départ
|
||||
poids = 1.0 # par défaut au départ
|
||||
else:
|
||||
poids = 0.0
|
||||
initvalues[f"poids_{ue.id}"] = poids
|
||||
@ -284,6 +285,7 @@ def evaluation_create_form(
|
||||
]
|
||||
# Liste des UE utilisées dans des modules de ce semestre:
|
||||
for ue in sem_ues:
|
||||
coef_ue = ue_coef_dict.get(ue.id, 0.0)
|
||||
form.append(
|
||||
(
|
||||
f"poids_{ue.id}",
|
||||
@ -292,10 +294,14 @@ def evaluation_create_form(
|
||||
"size": 2,
|
||||
"type": "float",
|
||||
"explanation": f"""
|
||||
<span class="eval_coef_ue" title="coef. du module dans cette UE">{ue_coef_dict.get(ue.id, 0.)}</span>
|
||||
<span class="eval_coef_ue" title="coef. du module dans cette UE">({"coef. mod.:" +str(coef_ue) if coef_ue else "ce module n'a pas de coef. dans cette UE"})</span>
|
||||
<span class="eval_coef_ue_titre">{ue.titre}</span>
|
||||
""",
|
||||
"allow_null": False,
|
||||
# ok si poids nul ou coef vers l'UE nul:
|
||||
"validator": lambda val, field: (not val)
|
||||
or ue_coef_dict.get(int(field[len("poids_") :]), 0.0) != 0,
|
||||
"enabled": coef_ue != 0 or initvalues[f"poids_{ue.id}"] != 0.0,
|
||||
},
|
||||
),
|
||||
)
|
||||
@ -331,7 +337,7 @@ def evaluation_create_form(
|
||||
if edit:
|
||||
sco_evaluation_db.do_evaluation_edit(tf[2])
|
||||
else:
|
||||
# creation d'une evaluation
|
||||
# création d'une evaluation
|
||||
evaluation_id = sco_evaluation_db.do_evaluation_create(**tf[2])
|
||||
if is_apc:
|
||||
# Set poids
|
||||
|
Loading…
Reference in New Issue
Block a user