1
0
forked from ScoDoc/ScoDoc

/evaluation/<int:evaluation_id>/notes

This commit is contained in:
Emmanuel Viennet 2022-08-03 16:05:01 +02:00
parent 58d84da254
commit 9413384a04
3 changed files with 13 additions and 12 deletions

View File

@ -17,8 +17,9 @@ from app.api import api_bp as bp, api_web_bp
from app.decorators import scodoc, permission_required
from app.api.errors import error_response
from app.models import Evaluation, ModuleImpl, FormSemestre
from app.scodoc.sco_evaluation_db import do_evaluation_get_all_notes
from app.scodoc import sco_evaluation_db
from app.scodoc.sco_permissions import Permission
import app.scodoc.sco_utils as scu
@bp.route("/moduleimpl/<int:moduleimpl_id>/evaluations")
@ -113,12 +114,12 @@ def evaluation_notes(evaluation_id: int):
dept = evaluation.moduleimpl.formsemestre.departement
app.set_sco_dept(dept.acronym)
try:
data = do_evaluation_get_all_notes(evaluation_id)
except AttributeError: # ???
return error_response(
404,
message="La requête ne peut être traitée en létat actuel.",
)
notes = sco_evaluation_db.do_evaluation_get_all_notes(evaluation_id)
for etudid in notes:
# "ABS", "EXC", etc mais laisse les notes sur le barème de l'éval.
note = notes[etudid]
note["value"] = scu.fmt_note(note["value"], keep_numeric=True)
note["note_max"] = evaluation.note_max
del note["id"]
return jsonify(data)
return jsonify(notes)

View File

@ -12,7 +12,6 @@ from flask_login import login_required
import app
from app import db, log
from app import api
from app.api import api_bp as bp, api_web_bp
from app.decorators import scodoc, permission_required
from app.api.errors import error_response
@ -25,6 +24,7 @@ from app.scodoc import sco_utils as scu
@bp.route("/partition/<int:partition_id>")
@api_web_bp.route("/partition/<int:partition_id>")
@login_required
@scodoc
@permission_required(Permission.ScoView)

View File

@ -484,12 +484,12 @@ def get_jury_but_etud_result(
rcue_dict = {
"ue_1": {
"ue_id": rcue.ue_1.id,
"moy": dec_ue1.moy_ue,
"moy": None if np.isnan(dec_ue1.moy_ue) else dec_ue1.moy_ue,
"code": dec_ue1.code_valide,
},
"ue_2": {
"ue_id": rcue.ue_2.id,
"moy": dec_ue2.moy_ue,
"moy": None if np.isnan(dec_ue2.moy_ue) else dec_ue2.moy_ue,
"code": dec_ue2.code_valide,
},
"moy": rcue.moy_rcue,