2022-04-26 15:28:53 +02:00
|
|
|
|
# @bp.route("/etudiants", methods=["GET"])
|
|
|
|
|
# @token_permission_required(Permission.APIView)
|
|
|
|
|
# def etudiants():
|
|
|
|
|
# """
|
|
|
|
|
# Retourne la liste de tous les étudiants
|
|
|
|
|
#
|
|
|
|
|
# Exemple de résultat :
|
|
|
|
|
# {
|
|
|
|
|
# "civilite": "X",
|
|
|
|
|
# "code_ine": null,
|
|
|
|
|
# "code_nip": null,
|
|
|
|
|
# "date_naissance": null,
|
|
|
|
|
# "email": null,
|
|
|
|
|
# "emailperso": null,
|
|
|
|
|
# "etudid": 18,
|
|
|
|
|
# "nom": "MOREL",
|
|
|
|
|
# "prenom": "JACQUES"
|
|
|
|
|
# },
|
|
|
|
|
# {
|
|
|
|
|
# "civilite": "X",
|
|
|
|
|
# "code_ine": null,
|
|
|
|
|
# "code_nip": null,
|
|
|
|
|
# "date_naissance": null,
|
|
|
|
|
# "email": null,
|
|
|
|
|
# "emailperso": null,
|
|
|
|
|
# "etudid": 19,
|
|
|
|
|
# "nom": "FOURNIER",
|
|
|
|
|
# "prenom": "ANNE"
|
|
|
|
|
# },
|
|
|
|
|
# ...
|
|
|
|
|
# """
|
|
|
|
|
# # Récupération de tous les étudiants
|
|
|
|
|
# etu = models.Identite.query.all()
|
|
|
|
|
#
|
|
|
|
|
# # Mise en forme des données
|
|
|
|
|
# data = [d.to_dict_bul(include_urls=False) for d in etu]
|
|
|
|
|
#
|
|
|
|
|
# return jsonify(data)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/evaluations/eval_set_notes?eval_id=<int:eval_id>&etudid=<int:etudid>¬e=<float:note>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/evaluations/eval_set_notes?eval_id=<int:eval_id>&nip=<int:nip>¬e=<float:note>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/evaluations/eval_set_notes?eval_id=<int:eval_id>&ine=<int:ine>¬e=<float:note>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @token_permission_required(Permission.APIEditAllNotes)
|
|
|
|
|
# def evaluation_set_notes(
|
|
|
|
|
# eval_id: int, note: float, etudid: int = None, nip: int = None, ine: int = None
|
|
|
|
|
# ):
|
|
|
|
|
# """
|
|
|
|
|
# Set les notes d'une évaluation pour un étudiant donnée
|
|
|
|
|
#
|
|
|
|
|
# eval_id : l'id d'une évaluation
|
|
|
|
|
# note : la note à attribuer
|
|
|
|
|
# etudid : l'etudid d'un étudiant
|
|
|
|
|
# nip : le code nip d'un étudiant
|
|
|
|
|
# ine : le code ine d'un étudiant
|
|
|
|
|
# """
|
|
|
|
|
# # Fonction utilisée : app.scodoc.sco_saisie_notes.notes_add()
|
|
|
|
|
#
|
|
|
|
|
# # Qu'est ce qu'un user ???
|
|
|
|
|
# # notes_add()
|
2022-04-26 17:12:30 +02:00
|
|
|
|
# return error_response(501, message="Not implemented")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# ### Inutil en définitif ###
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_signale?etudid=<int:etudid>&date=<string:date>&matin=<string:matin>&justif=<string:justif>"
|
|
|
|
|
# "&description=<string:description>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_signale?nip=<int:nip>&date=<string:date>&matin=<string:matin>&justif=<string:justif>"
|
|
|
|
|
# "&description=<string:description>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_signale?ine=<int:ine>&date=<string:date>&matin=<string:matin>&justif=<string:justif>"
|
|
|
|
|
# "&description=<string:description>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_signale?ine=<int:ine>&date=<string:date>&matin=<string:matin>&justif=<string:justif>"
|
|
|
|
|
# "&description=<string:description>&moduleimpl_id=<int:moduleimpl_id>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @token_permission_required(Permission.APIAbsChange)
|
|
|
|
|
# def abs_signale(
|
|
|
|
|
# date: datetime,
|
|
|
|
|
# matin: bool,
|
|
|
|
|
# justif: bool,
|
|
|
|
|
# etudid: int = None,
|
|
|
|
|
# nip: int = None,
|
|
|
|
|
# ine: int = None, ### Inutil en définitif
|
|
|
|
|
# description: str = None,
|
|
|
|
|
# moduleimpl_id: int = None,
|
|
|
|
|
# ):
|
|
|
|
|
# """
|
|
|
|
|
# Permet d'ajouter une absence en base
|
|
|
|
|
#
|
|
|
|
|
# date : la date de l'absence
|
|
|
|
|
# matin : True ou False
|
|
|
|
|
# justif : True ou False
|
|
|
|
|
# etudid : l'etudid d'un étudiant
|
|
|
|
|
# nip: le code nip d'un étudiant
|
|
|
|
|
# ine : le code ine d'un étudiant
|
|
|
|
|
# description : description possible à ajouter sur l'absence
|
|
|
|
|
# moduleimpl_id : l'id d'un moduleimpl
|
|
|
|
|
# """
|
|
|
|
|
# # Fonctions utilisées : app.scodoc.sco_abs.add_absence() et app.scodoc.sco_abs.add_justif()
|
|
|
|
|
#
|
|
|
|
|
# if etudid is None:
|
|
|
|
|
# # Récupération de l'étudiant
|
|
|
|
|
# try:
|
|
|
|
|
# etu = get_etu_from_request(etudid, nip, ine)
|
|
|
|
|
# etudid = etu.etudid
|
|
|
|
|
# except AttributeError:
|
|
|
|
|
# return error_response(
|
|
|
|
|
# 409,
|
|
|
|
|
# message="La requête ne peut être traitée en l’état actuel.\n "
|
|
|
|
|
# "Veilliez vérifier que l'id de l'étudiant (etudid, nip, ine) est valide",
|
|
|
|
|
# )
|
|
|
|
|
# try:
|
|
|
|
|
# # Utilisation de la fonction add_absence
|
|
|
|
|
# add_absence(etudid, date, matin, justif, description, moduleimpl_id)
|
|
|
|
|
# if justif == True:
|
|
|
|
|
# # Utilisation de la fonction add_justif
|
|
|
|
|
# add_justif(etudid, date, matin, description)
|
|
|
|
|
# except ValueError:
|
|
|
|
|
# return error_response(
|
|
|
|
|
# 409, message="La requête ne peut être traitée en l’état actuel"
|
|
|
|
|
# )
|
2022-04-27 14:11:06 +02:00
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_annule_justif?etudid=<int:etudid>&jour=<string:jour>&matin=<string:matin>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_annule_justif?nip=<int:nip>&jour=<string:jour>&matin=<string:matin>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @bp.route(
|
|
|
|
|
# "/absences/abs_annule_justif?ine=<int:ine>&jour=<string:jour>&matin=<string:matin>",
|
|
|
|
|
# methods=["POST"],
|
|
|
|
|
# )
|
|
|
|
|
# @token_permission_required(Permission.APIAbsChange)
|
|
|
|
|
# def abs_annule_justif(
|
|
|
|
|
# jour: datetime, matin: str, etudid: int = None, nip: int = None, ine: int = None
|
|
|
|
|
# ):
|
|
|
|
|
# """
|
|
|
|
|
# Retourne un html
|
|
|
|
|
|
|
|
|
|
# jour : la date de l'absence a annulé
|
|
|
|
|
# matin : True ou False
|
|
|
|
|
# etudid : l'etudid d'un étudiant
|
|
|
|
|
# nip: le code nip d'un étudiant
|
|
|
|
|
# ine : le code ine d'un étudiant
|
|
|
|
|
# """
|
|
|
|
|
# # Fonction utilisée : app.scodoc.sco_abs.annule_justif()
|
|
|
|
|
|
|
|
|
|
# if etudid is None:
|
|
|
|
|
# # Récupération de l'étudiant
|
|
|
|
|
# try:
|
|
|
|
|
# etu = get_etu_from_etudid_or_nip_or_ine(etudid, nip, ine)
|
|
|
|
|
# etudid = etu.etudid
|
|
|
|
|
# except AttributeError:
|
|
|
|
|
# return error_response(
|
|
|
|
|
# 409,
|
|
|
|
|
# message="La requête ne peut être traitée en l’état actuel.\n "
|
|
|
|
|
# "Veilliez vérifier que l'id de l'étudiant (etudid, nip, ine) est valide",
|
|
|
|
|
# )
|
|
|
|
|
# try:
|
|
|
|
|
# # Utilisation de la fonction annule_justif
|
|
|
|
|
# annule_justif(etudid, jour, matin)
|
|
|
|
|
# except ValueError:
|
|
|
|
|
# return error_response(
|
|
|
|
|
# 409,
|
|
|
|
|
# message="La requête ne peut être traitée en l’état actuel.\n "
|
|
|
|
|
# "Veilliez vérifier que le 'jour' et le 'matin' sont valides",
|
|
|
|
|
# )
|
|
|
|
|
|
|
|
|
|
# return error_response(200, message="OK")
|
2022-04-27 15:29:09 +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,
|
|
|
|
|
# ):
|
|
|
|
|
# """
|
|
|
|
|
# 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")
|