forked from ScoDoc/ScoDoc
/evaluation/<int:evaluation_id>/notes
This commit is contained in:
parent
58d84da254
commit
9413384a04
@ -17,8 +17,9 @@ from app.api import api_bp as bp, api_web_bp
|
|||||||
from app.decorators import scodoc, permission_required
|
from app.decorators import scodoc, permission_required
|
||||||
from app.api.errors import error_response
|
from app.api.errors import error_response
|
||||||
from app.models import Evaluation, ModuleImpl, FormSemestre
|
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
|
from app.scodoc.sco_permissions import Permission
|
||||||
|
import app.scodoc.sco_utils as scu
|
||||||
|
|
||||||
|
|
||||||
@bp.route("/moduleimpl/<int:moduleimpl_id>/evaluations")
|
@bp.route("/moduleimpl/<int:moduleimpl_id>/evaluations")
|
||||||
@ -113,12 +114,12 @@ def evaluation_notes(evaluation_id: int):
|
|||||||
dept = evaluation.moduleimpl.formsemestre.departement
|
dept = evaluation.moduleimpl.formsemestre.departement
|
||||||
app.set_sco_dept(dept.acronym)
|
app.set_sco_dept(dept.acronym)
|
||||||
|
|
||||||
try:
|
notes = sco_evaluation_db.do_evaluation_get_all_notes(evaluation_id)
|
||||||
data = do_evaluation_get_all_notes(evaluation_id)
|
for etudid in notes:
|
||||||
except AttributeError: # ???
|
# "ABS", "EXC", etc mais laisse les notes sur le barème de l'éval.
|
||||||
return error_response(
|
note = notes[etudid]
|
||||||
404,
|
note["value"] = scu.fmt_note(note["value"], keep_numeric=True)
|
||||||
message="La requête ne peut être traitée en l’état actuel.",
|
note["note_max"] = evaluation.note_max
|
||||||
)
|
del note["id"]
|
||||||
|
|
||||||
return jsonify(data)
|
return jsonify(notes)
|
||||||
|
@ -12,7 +12,6 @@ from flask_login import login_required
|
|||||||
|
|
||||||
import app
|
import app
|
||||||
from app import db, log
|
from app import db, log
|
||||||
from app import api
|
|
||||||
from app.api import api_bp as bp, api_web_bp
|
from app.api import api_bp as bp, api_web_bp
|
||||||
from app.decorators import scodoc, permission_required
|
from app.decorators import scodoc, permission_required
|
||||||
from app.api.errors import error_response
|
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>")
|
@bp.route("/partition/<int:partition_id>")
|
||||||
|
@api_web_bp.route("/partition/<int:partition_id>")
|
||||||
@login_required
|
@login_required
|
||||||
@scodoc
|
@scodoc
|
||||||
@permission_required(Permission.ScoView)
|
@permission_required(Permission.ScoView)
|
||||||
|
@ -484,12 +484,12 @@ def get_jury_but_etud_result(
|
|||||||
rcue_dict = {
|
rcue_dict = {
|
||||||
"ue_1": {
|
"ue_1": {
|
||||||
"ue_id": rcue.ue_1.id,
|
"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,
|
"code": dec_ue1.code_valide,
|
||||||
},
|
},
|
||||||
"ue_2": {
|
"ue_2": {
|
||||||
"ue_id": rcue.ue_2.id,
|
"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,
|
"code": dec_ue2.code_valide,
|
||||||
},
|
},
|
||||||
"moy": rcue.moy_rcue,
|
"moy": rcue.moy_rcue,
|
||||||
|
Loading…
Reference in New Issue
Block a user