forked from ScoDoc/ScoDoc
108 lines
3.5 KiB
Python
108 lines
3.5 KiB
Python
#################################################### Jury #############################################################
|
|
from flask import jsonify
|
|
|
|
from app import models
|
|
from app.api import bp
|
|
from app.api.errors import error_response
|
|
from app.api.auth import token_permission_required
|
|
from app.scodoc.sco_prepajury import feuille_preparation_jury
|
|
from app.scodoc.sco_pvjury import formsemestre_pvjury
|
|
|
|
|
|
@bp.route("/jury/formsemestre/<int:formsemestre_id>/preparation_jury", methods=["GET"])
|
|
# @token_permission_required(Permission.)
|
|
def jury_preparation(formsemestre_id: int):
|
|
"""
|
|
Retourne la feuille de préparation du jury
|
|
|
|
formsemestre_id : l'id d'un formsemestre
|
|
"""
|
|
# Fonction utilisée : app.scodoc.sco_prepajury.feuille_preparation_jury()
|
|
|
|
# Utilisation de la fonction feuille_preparation_jury
|
|
prepa_jury = feuille_preparation_jury(formsemestre_id)
|
|
|
|
return error_response(501, message="Not implemented")
|
|
|
|
|
|
@bp.route("/jury/formsemestre/<int:formsemestre_id>/decisions_jury", methods=["GET"])
|
|
# @token_permission_required(Permission.)
|
|
def jury_decisions(formsemestre_id: int):
|
|
"""
|
|
Retourne les décisions du jury suivant un formsemestre donné
|
|
|
|
formsemestre_id : l'id d'un formsemestre
|
|
"""
|
|
# Fonction utilisée : app.scodoc.sco_pvjury.formsemestre_pvjury()
|
|
|
|
# Utilisation de la fonction formsemestre_pvjury
|
|
decision_jury = formsemestre_pvjury(formsemestre_id)
|
|
|
|
return error_response(501, message="Not implemented")
|
|
|
|
|
|
@bp.route(
|
|
"/jury/set_decision/etudid?etudid=<int:etudid>&formsemestre_id=<int:formesemestre_id>"
|
|
"&jury=<string:decision_jury>&devenir=<string:devenir_jury>&assiduite=<bool>",
|
|
methods=["POST"],
|
|
)
|
|
@bp.route(
|
|
"/jury/set_decision/nip?etudid=<int:etudid>&formsemestre_id=<int:formesemestre_id>"
|
|
"&jury=<string:decision_jury>&devenir=<string:devenir_jury>&assiduite=<bool>",
|
|
methods=["POST"],
|
|
)
|
|
@bp.route(
|
|
"/jury/set_decision/ine?etudid=<int:etudid>&formsemestre_id=<int:formesemestre_id>"
|
|
"&jury=<string:decision_jury>&devenir=<string:devenir_jury>&assiduite=<bool>",
|
|
methods=["POST"],
|
|
)
|
|
# @token_permission_required(Permission.)
|
|
def set_decision_jury(
|
|
formsemestre_id: int,
|
|
decision_jury: str,
|
|
devenir_jury: str,
|
|
assiduite: bool,
|
|
etudid: int = None,
|
|
nip: int = None,
|
|
ine: int = None,
|
|
):
|
|
"""
|
|
Attribuer la décision du jury et le devenir à un etudiant
|
|
|
|
formsemestre_id : l'id d'un formsemestre
|
|
decision_jury : la décision du jury
|
|
devenir_jury : le devenir du jury
|
|
assiduite : True ou False
|
|
etudid : l'etudid d'un étudiant
|
|
nip: le code nip d'un étudiant
|
|
ine : le code ine d'un étudiant
|
|
"""
|
|
return error_response(501, message="Not implemented")
|
|
|
|
|
|
@bp.route(
|
|
"/jury/etudid/<int:etudid>/formsemestre/<int:formsemestre_id>/annule_decision",
|
|
methods=["DELETE"],
|
|
)
|
|
@bp.route(
|
|
"/jury/nip/<int:nip>/formsemestre/<int:formsemestre_id>/annule_decision",
|
|
methods=["DELETE"],
|
|
)
|
|
@bp.route(
|
|
"/jury/ine/<int:ine>/formsemestre/<int:formsemestre_id>/annule_decision",
|
|
methods=["DELETE"],
|
|
)
|
|
# @token_permission_required(Permission.)
|
|
def annule_decision_jury(
|
|
formsemestre_id: int, etudid: int = None, nip: int = None, ine: int = None
|
|
):
|
|
"""
|
|
Supprime la déciosion du jury pour un étudiant donné
|
|
|
|
formsemestre_id : l'id d'un formsemestre
|
|
etudid : l'etudid d'un étudiant
|
|
nip: le code nip d'un étudiant
|
|
ine : le code ine d'un étudiant
|
|
"""
|
|
return error_response(501, message="Not implemented")
|