forked from ScoDoc/ScoDoc
fixe du format de retour de etudiant_formsemestre et formsemestre
This commit is contained in:
parent
aba6330065
commit
bac99da726
@ -112,15 +112,11 @@ def etudiant_formsemestres(etudid: int = None, nip: int = None, ine: int = None)
|
||||
Exemple de résultat :
|
||||
[
|
||||
{
|
||||
"titre": "master machine info",
|
||||
"gestion_semestrielle": false,
|
||||
"date_debut": "01/09/2021",
|
||||
"bul_bgcolor": null,
|
||||
"date_fin": "15/12/2022",
|
||||
"date_fin": "31/08/2022",
|
||||
"resp_can_edit": false,
|
||||
"dept_id": 1,
|
||||
"etat": true,
|
||||
"resp_can_change_ens": false,
|
||||
"resp_can_change_ens": true,
|
||||
"id": 1,
|
||||
"modalite": "FI",
|
||||
"ens_can_edit_eval": false,
|
||||
@ -130,15 +126,17 @@ def etudiant_formsemestres(etudid: int = None, nip: int = None, ine: int = None)
|
||||
"semestre_id": 1,
|
||||
"bul_hide_xml": false,
|
||||
"elt_annee_apo": null,
|
||||
"titre": "Semestre test",
|
||||
"block_moyennes": false,
|
||||
"scodoc7_id": null,
|
||||
"date_debut": "01/09/2021",
|
||||
"gestion_semestrielle": false,
|
||||
"bul_bgcolor": "white",
|
||||
"formsemestre_id": 1,
|
||||
"titre_num": "master machine info semestre 1",
|
||||
"titre_num": "Semestre test semestre 1",
|
||||
"date_debut_iso": "2021-09-01",
|
||||
"date_fin_iso": "2022-12-15",
|
||||
"responsables": [
|
||||
3,
|
||||
2
|
||||
]
|
||||
"date_fin_iso": "2022-08-31",
|
||||
"responsables": []
|
||||
},
|
||||
...
|
||||
]
|
||||
|
@ -107,21 +107,21 @@ def formsemestre_apo(etape_apo: str):
|
||||
|
||||
|
||||
@bp.route(
|
||||
"/formsemestre/<int:formsemestre_id>/departements/<string:dept>/etudiant/etudid/<int:etudid>/bulletin",
|
||||
methods=["GET"],
|
||||
)
|
||||
@bp.route(
|
||||
"/formsemestre/<int:formsemestre_id>/departements/<string:dept>/etudiant/nip/<int:nip>/bulletin",
|
||||
methods=["GET"],
|
||||
)
|
||||
@bp.route(
|
||||
"/formsemestre/<int:formsemestre_id>/departements/<string:dept>/etudiant/ine/<int:ine>/bulletin",
|
||||
"/formsemestre/<int:formsemestre_id>/etudiant/etudid/<int:etudid>/bulletin",
|
||||
methods=["GET"],
|
||||
)
|
||||
# @bp.route(
|
||||
# "/formsemestre/<int:formsemestre_id>/departements/<string:dept>/etudiant/nip/<int:nip>/bulletin",
|
||||
# methods=["GET"],
|
||||
# )
|
||||
# @bp.route(
|
||||
# "/formsemestre/<int:formsemestre_id>/departements/<string:dept>/etudiant/ine/<int:ine>/bulletin",
|
||||
# methods=["GET"],
|
||||
# )
|
||||
@token_permission_required(Permission.APIView)
|
||||
def etudiant_bulletin(
|
||||
formsemestre_id,
|
||||
dept,
|
||||
# dept,
|
||||
etudid: int = None,
|
||||
nip: int = None,
|
||||
ine: int = None,
|
||||
@ -241,7 +241,15 @@ def etudiant_bulletin(
|
||||
# Fonction utilisée : app.scodoc.sco_bulletins_json.make_json_formsemestre_bulletinetud()
|
||||
|
||||
try:
|
||||
app.set_sco_dept(dept)
|
||||
formsemestre = models.FormSemestre.query.filter_by(
|
||||
id=formsemestre_id
|
||||
).first_or_404()
|
||||
|
||||
dept = models.Departement.query.filter_by(
|
||||
id=formsemestre.dept_id
|
||||
).first_or_404()
|
||||
|
||||
app.set_sco_dept(dept.acronym)
|
||||
except:
|
||||
return error_response(
|
||||
409,
|
||||
@ -499,3 +507,115 @@ def jury(formsemestre_id: int):
|
||||
# )
|
||||
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
@bp.route(
|
||||
"/formsemestre/<int:formsemestre_id>/programme",
|
||||
methods=["GET"],
|
||||
)
|
||||
@token_permission_required(Permission.APIView)
|
||||
def semestre_index(formsemestre_id: int):
|
||||
"""
|
||||
Retourne la liste des Ues, ressources et SAE d'un semestre
|
||||
|
||||
dept : l'acronym d'un département
|
||||
formsemestre_id : l'id d'un formesemestre
|
||||
|
||||
Exemple de résultat :
|
||||
{
|
||||
"ues": [
|
||||
{
|
||||
"type": 0,
|
||||
"formation_id": 1,
|
||||
"ue_code": "UCOD11",
|
||||
"id": 1,
|
||||
"ects": 12.0,
|
||||
"acronyme": "RT1.1",
|
||||
"is_external": false,
|
||||
"numero": 1,
|
||||
"code_apogee": "",
|
||||
"titre": "Administrer les r\u00e9seaux et l\u2019Internet",
|
||||
"coefficient": 0.0,
|
||||
"semestre_idx": 1,
|
||||
"color": "#B80004",
|
||||
"ue_id": 1
|
||||
},
|
||||
...
|
||||
],
|
||||
"ressources": [
|
||||
{
|
||||
"titre": "Fondamentaux de la programmation",
|
||||
"coefficient": 1.0,
|
||||
"module_type": 2,
|
||||
"id": 17,
|
||||
"ects": null,
|
||||
"abbrev": null,
|
||||
"ue_id": 3,
|
||||
"code": "R107",
|
||||
"formation_id": 1,
|
||||
"heures_cours": 0.0,
|
||||
"matiere_id": 3,
|
||||
"heures_td": 0.0,
|
||||
"semestre_id": 1,
|
||||
"heures_tp": 0.0,
|
||||
"numero": 70,
|
||||
"code_apogee": "",
|
||||
"module_id": 17
|
||||
},
|
||||
...
|
||||
],
|
||||
"saes": [
|
||||
{
|
||||
"titre": "Se pr\u00e9senter sur Internet",
|
||||
"coefficient": 1.0,
|
||||
"module_type": 3,
|
||||
"id": 14,
|
||||
"ects": null,
|
||||
"abbrev": null,
|
||||
"ue_id": 3,
|
||||
"code": "SAE14",
|
||||
"formation_id": 1,
|
||||
"heures_cours": 0.0,
|
||||
"matiere_id": 3,
|
||||
"heures_td": 0.0,
|
||||
"semestre_id": 1,
|
||||
"heures_tp": 0.0,
|
||||
"numero": 40,
|
||||
"code_apogee": "",
|
||||
"module_id": 14
|
||||
},
|
||||
...
|
||||
]
|
||||
}
|
||||
"""
|
||||
|
||||
formsemestre = models.FormSemestre.query.filter_by(
|
||||
id=formsemestre_id
|
||||
).first_or_404()
|
||||
|
||||
ues = formsemestre.query_ues()
|
||||
|
||||
ues_dict = []
|
||||
ressources = []
|
||||
saes = []
|
||||
|
||||
for ue in ues:
|
||||
ues_dict.append(ue.to_dict())
|
||||
ressources = ue.get_ressources()
|
||||
saes = ue.get_saes()
|
||||
|
||||
data_ressources = []
|
||||
for ressource in ressources:
|
||||
data_ressources.append(ressource.to_dict())
|
||||
|
||||
data_saes = []
|
||||
for sae in saes:
|
||||
data_saes.append(sae.to_dict())
|
||||
|
||||
data = {
|
||||
"ues": ues_dict,
|
||||
"ressources": data_ressources,
|
||||
"saes": data_saes,
|
||||
}
|
||||
|
||||
return data
|
||||
|
Loading…
Reference in New Issue
Block a user