2022-03-02 16:45:47 +01:00
|
|
|
#################################################### Jury #############################################################
|
|
|
|
from flask import jsonify
|
|
|
|
|
|
|
|
from app import models
|
|
|
|
from app.api import bp
|
|
|
|
from app.api.errors import error_response
|
2022-04-25 15:25:45 +02:00
|
|
|
from app.api.auth import token_permission_required
|
2022-03-02 16:45:47 +01:00
|
|
|
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"])
|
2022-04-25 15:25:45 +02:00
|
|
|
# @token_permission_required(Permission.)
|
|
|
|
def jury_preparation(formsemestre_id: int):
|
2022-03-02 16:45:47 +01:00
|
|
|
"""
|
|
|
|
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"])
|
2022-04-25 15:25:45 +02:00
|
|
|
# @token_permission_required(Permission.)
|
|
|
|
def jury_decisions(formsemestre_id: int):
|
2022-03-02 16:45:47 +01:00
|
|
|
"""
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
2022-04-25 15:25:45 +02:00
|
|
|
@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,
|
|
|
|
):
|
2022-03-02 16:45:47 +01:00
|
|
|
"""
|
|
|
|
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")
|
|
|
|
|
|
|
|
|
2022-04-25 15:25:45 +02:00
|
|
|
@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
|
|
|
|
):
|
2022-03-02 16:45:47 +01:00
|
|
|
"""
|
|
|
|
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
|
|
|
|
"""
|
2022-04-25 15:25:45 +02:00
|
|
|
return error_response(501, message="Not implemented")
|