qsdsq
parent
b8f7f0733a
commit
e430b67d71
|
@ -1,12 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="26/05/2024 - 20h30">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="qsdsq">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Inscription_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/Inscription_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/Session_Formation_Sequence.py" beforeDir="false" afterPath="$PROJECT_DIR$/Session_Formation_Sequence.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/notes_apprenant_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/notes_apprenant_mgt.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
@ -76,13 +76,6 @@
|
|||
<option name="presentableId" value="Default" />
|
||||
<updated>1680804787304</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00266" summary="11/04/2024 - 17h02">
|
||||
<created>1712847771191</created>
|
||||
<option name="number" value="00266" />
|
||||
<option name="presentableId" value="LOCAL-00266" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1712847771191</updated>
|
||||
</task>
|
||||
<task id="LOCAL-00267" summary="12/04/2024 - 15h05">
|
||||
<created>1712927149481</created>
|
||||
<option name="number" value="00267" />
|
||||
|
@ -419,7 +412,14 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1716748087883</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="315" />
|
||||
<task id="LOCAL-00315" summary="qsdsq">
|
||||
<created>1716822032749</created>
|
||||
<option name="number" value="00315" />
|
||||
<option name="presentableId" value="LOCAL-00315" />
|
||||
<option name="project" value="LOCAL" />
|
||||
<updated>1716822032753</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="316" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
@ -461,7 +461,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="07/05/2024 - 17h30" />
|
||||
<MESSAGE value="08/05/2024 - 17h30" />
|
||||
<MESSAGE value="08/05/2024 - 21h30" />
|
||||
<MESSAGE value="0dfd" />
|
||||
|
@ -486,6 +485,7 @@
|
|||
<MESSAGE value="ss" />
|
||||
<MESSAGE value="gdfgdf" />
|
||||
<MESSAGE value="26/05/2024 - 20h30" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="26/05/2024 - 20h30" />
|
||||
<MESSAGE value="qsdsq" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="qsdsq" />
|
||||
</component>
|
||||
</project>
|
|
@ -5566,7 +5566,7 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
|
|||
clean_inscription_liste_ue = MYSY_GV.dbname['inscription_liste_ue'].delete_many({"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
|
||||
|
||||
clean_inscription_liste_ue_type_eval = MYSY_GV.dbname['inscription_liste_ue_type_eval'].delete_many(
|
||||
clean_inscription_liste_ue_type_eval = MYSY_GV.dbname['inscription_liste_ue_type_evalution'].delete_many(
|
||||
{"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
|
||||
|
||||
|
@ -5667,6 +5667,233 @@ def Init_AcceptAttendeeInscription_For_Initial_Formation(diction):
|
|||
|
||||
|
||||
|
||||
"""
|
||||
Mise à jour de la liste des evaluations et type d'evaluation
|
||||
auxquels sont inscrit un apprenant
|
||||
"""
|
||||
|
||||
|
||||
def Update_AcceptAttendeeInscription_For_Initial_Formation(diction):
|
||||
try:
|
||||
"""
|
||||
Verification de la liste des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'inscription_id', 'class_id', 'list_eu', 'list_eu_eval']
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - : La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Les informations fournies ne sont pas correctes"
|
||||
|
||||
mytoken = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
mytoken = diction['token']
|
||||
|
||||
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner
|
||||
|
||||
formation_initiale = "0"
|
||||
if ("formation_initiale" in my_partner.keys()):
|
||||
formation_initiale = my_partner['formation_initiale']
|
||||
|
||||
if (formation_initiale != "1"):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Il ne s'agit pas d'un formation initiale ")
|
||||
return True, " Il ne s'agit pas d'un formation initiale "
|
||||
|
||||
|
||||
"""
|
||||
Recuper la liste des UE
|
||||
"""
|
||||
list_eu_json = ast.literal_eval(diction['list_eu'])
|
||||
|
||||
"""
|
||||
Recuper la liste des evaluations UE
|
||||
"""
|
||||
list_eu_eval_json = ast.literal_eval(diction['list_eu_eval'])
|
||||
|
||||
print(" ### list_eu_json = ", list_eu_json)
|
||||
|
||||
print(" ### list_eu_eval_json = ", list_eu_eval_json)
|
||||
|
||||
# Verifier que la nouvelle liste des UE est valide et appartient bien à la formation.
|
||||
for local_val in list_eu_json:
|
||||
is_ue_include_in_class_count = MYSY_GV.dbname['myclass'].count_documents({'valide':'1','locked':'0',
|
||||
'partner_owner_recid':my_partner['recid'],
|
||||
'list_unite_enseignement._id':str(local_val['_id']),
|
||||
'_id':ObjectId(str(diction['class_id']))})
|
||||
|
||||
if( is_ue_include_in_class_count != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de l'UE "+str(local_val)+" n'est pas valide ")
|
||||
return True, " L'identifiant de l'UE "+str(local_val['_id'])+" n'est pas valide "
|
||||
|
||||
is_ue_valide = MYSY_GV.dbname['unite_enseignement'].count_documents({'_id':ObjectId(str(local_val['_id'])),
|
||||
'valide':'1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid':my_partner['recid']})
|
||||
|
||||
|
||||
if( is_ue_valide != 1 ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de l'UE " + str(local_val) + " n'est pas valide (2) ")
|
||||
return True, " L'identifiant de l'UE " + str(local_val['_id']) + " n'est pas valide (2)"
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Verifier que les types d'evaluations sont valides pour les ue
|
||||
"""
|
||||
for local_val in list_eu_eval_json:
|
||||
|
||||
is_evaluation_ok_for_class_and_ue = MYSY_GV.dbname['class_unite_enseignement_type_evaluation'].count_documents({'valide': '1', 'locked': '0',
|
||||
'partner_owner_recid': my_partner[ 'recid'],
|
||||
'class_id': str(diction['class_id']),
|
||||
'_id': ObjectId( str(local_val['_id']))})
|
||||
|
||||
if (is_evaluation_ok_for_class_and_ue != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant du type d'evaluation " + str(local_val) + " n'est pas valide ")
|
||||
return True, " L'identifiant du type d'evaluation " + str(local_val['_id']) + " n'est pas valide "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Verifier que l'inscription est valide
|
||||
"""
|
||||
is_valide_inscription_count = MYSY_GV.dbname['inscription'].count_documents(
|
||||
{'_id': ObjectId(diction['inscription_id']),
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1'})
|
||||
|
||||
if (is_valide_inscription_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de l'inscrit est invalide ")
|
||||
return False, " L'identifiant de l'inscrit est invalide "
|
||||
|
||||
"""
|
||||
Verifier la validité de la formation et créer le contenu de la collection
|
||||
"""
|
||||
is_valide_class_count = MYSY_GV.dbname['myclass'].count_documents(
|
||||
{'_id': ObjectId(diction['class_id']),
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'valide': '1',
|
||||
'locked': '0'})
|
||||
|
||||
if (is_valide_class_count != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " L'identifiant de la formation est invalide ")
|
||||
return False, " L'identifiant de la formation est invalide "
|
||||
|
||||
"""
|
||||
Suppression des données existe dans les collections : inscription_liste_ue et inscription_liste_ue_type_eval
|
||||
pour l'inscrit et la formation conernée
|
||||
"""
|
||||
|
||||
clean_inscription_liste_ue = MYSY_GV.dbname['inscription_liste_ue'].delete_many(
|
||||
{"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']), })
|
||||
|
||||
|
||||
qry_del = {"partner_owner_recid": str(my_partner['recid']),
|
||||
'class_id': str(diction['class_id']), 'inscription_id': str(diction['inscription_id']) }
|
||||
|
||||
#print(' qry_delete === ', qry_del)
|
||||
|
||||
clean_inscription_liste_ue_type_eval = MYSY_GV.dbname['inscription_liste_ue_type_evalution'].delete_many(qry_del)
|
||||
|
||||
#mycommon.myprint( " ela-Token - " + str(clean_inscription_liste_ue_type_eval.deleted_count) + " documents deleted. ")
|
||||
|
||||
"""
|
||||
Recuperer les UE de la formation
|
||||
"""
|
||||
tab_class_ue_id = []
|
||||
|
||||
qry = {"partner_owner_recid": str(my_partner['recid']), 'valide': '1', 'locked': '0',
|
||||
'_id': ObjectId(str(diction['class_id']))}
|
||||
|
||||
"""
|
||||
Remplissage de la collection : inscription_liste_ue
|
||||
"""
|
||||
|
||||
for New_retVal in list_eu_json:
|
||||
|
||||
tab_class_ue_id.append(str(local_val['_id']))
|
||||
|
||||
new_data = {}
|
||||
new_data['inscription_id'] = str(diction['inscription_id'])
|
||||
new_data['class_id'] = str(diction['class_id'])
|
||||
new_data['class_eu_id'] = str(New_retVal['_id'])
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
key_data = {}
|
||||
key_data['inscription_id'] = str(diction['inscription_id'])
|
||||
key_data['class_id'] = str(diction['class_id'])
|
||||
key_data['class_eu_id'] = str(New_retVal['_id'])
|
||||
key_data['valide'] = "1"
|
||||
key_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
result = MYSY_GV.dbname['inscription_liste_ue'].find_one_and_update(
|
||||
key_data,
|
||||
{"$set": new_data},
|
||||
upsert=True,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de mettre à jour la liste des UE de l'inscrit (2) ")
|
||||
return False, "Impossible de mettre à jour la liste des UE de l'inscrit (2) "
|
||||
|
||||
"""
|
||||
Remplissage de la collection : inscription_liste_ue_type_eval
|
||||
"""
|
||||
|
||||
for val in list_eu_eval_json:
|
||||
new_data = {}
|
||||
new_data['inscription_id'] = str(diction['inscription_id'])
|
||||
new_data['class_id'] = str(diction['class_id'])
|
||||
new_data['class_eu_id'] = str(val['class_ue_id'])
|
||||
new_data['type_evaluation_id'] = str(val['type_evaluation_id'])
|
||||
|
||||
new_data['date_update'] = str(datetime.now())
|
||||
new_data['update_by'] = str(my_partner['_id'])
|
||||
new_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
new_data['valide'] = "1"
|
||||
new_data['locked'] = "0"
|
||||
|
||||
key_data = {}
|
||||
key_data['inscription_id'] = str(diction['inscription_id'])
|
||||
key_data['class_id'] = str(diction['class_id'])
|
||||
key_data['class_eu_id'] = str(local_val['_id'])
|
||||
key_data['valide'] = "1"
|
||||
key_data['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
result = MYSY_GV.dbname['inscription_liste_ue_type_evalution'].find_one_and_update(
|
||||
key_data,
|
||||
{"$set": new_data},
|
||||
upsert=True,
|
||||
return_document=ReturnDocument.AFTER
|
||||
)
|
||||
if ("_id" not in result.keys()):
|
||||
mycommon.myprint(
|
||||
" Impossible de mettre à jour les UE et Evaluations de l'apprenant (2) ")
|
||||
return False, "Impossible de mettre à jour les UE et Evaluations de l'apprenant (2) "
|
||||
|
||||
return True, "La mise à jour a été correctement faite"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
print(str(inspect.stack()[0][3]) + " -" + str(e) + " - ERRORRRR AT Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible de mettre à jour les UE et Evaluations de l'apprenant "
|
||||
|
||||
|
||||
"""
|
||||
Fontion de validation / acceptation d'une inscription
|
||||
"""
|
||||
|
@ -11816,7 +12043,7 @@ def Get_Inscrit_List_EU_Type_Evaluation(diction):
|
|||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
print(" ### Get_Inscrit_List_EU_Type_Evaluation RetObject = ", RetObject)
|
||||
#print(" ### Get_Inscrit_List_EU_Type_Evaluation RetObject = ", RetObject)
|
||||
return True, RetObject
|
||||
|
||||
except Exception as e:
|
||||
|
|
5968
Log/log_file.log
5968
Log/log_file.log
File diff suppressed because one or more lines are too long
|
@ -1847,6 +1847,119 @@ def Update_Note_Evaluation_Affectation_Ressource_Poste(diction):
|
|||
|
||||
|
||||
|
||||
"""
|
||||
Affectation d'une ressource (humaine ou materielle) en masse à plusieurs sequence
|
||||
"""
|
||||
def Add_Sequence_Affectation_Ressource_Poste_Mass(diction):
|
||||
try:
|
||||
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', "tab_sequence_session_id", "poste", "comment", 'related_target_collection', 'related_target_collection_id']
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
if val not in field_list and val.startswith('my_') is False:
|
||||
mycommon.myprint(str(
|
||||
inspect.stack()[0][3]) + " Le champ '" + val + "' n'est pas autorisé")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
|
||||
field_list_obligatoire = ['token', 'tab_sequence_session_id', "poste", ]
|
||||
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][
|
||||
3]) + " La valeur '" + val + "' n'est pas presente dans liste ")
|
||||
return False, " Toutes le information obligatoires n'ont pas été fournies"
|
||||
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = diction['token']
|
||||
|
||||
|
||||
|
||||
# Recuperation du recid du partenaire
|
||||
partner_recid = mycommon.get_parnter_recid_from_token(str(token))
|
||||
if partner_recid is False:
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Impossible de récupérer le partner_recid")
|
||||
return False, " Les informations d'identification sont invalides"
|
||||
|
||||
local_status, my_partner_data = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
|
||||
if (local_status is not True):
|
||||
return local_status, my_partner_data
|
||||
|
||||
tab_sequence_session_id = ""
|
||||
if ("tab_sequence_session_id" in diction.keys()):
|
||||
if diction['tab_sequence_session_id']:
|
||||
tab_sequence_session_id = str(diction['tab_sequence_session_id']).split(",")
|
||||
|
||||
# Verifier que la sequence existe bien
|
||||
for sequence_session_id in tab_sequence_session_id :
|
||||
sequence_session_existe_count = MYSY_GV.dbname['session_formation_sequence'].count_documents({'_id':ObjectId(str(sequence_session_id)), 'partner_owner_recid':str(partner_recid),
|
||||
'valide':'1', 'locked':'0'})
|
||||
|
||||
if( sequence_session_existe_count <= 0 ) :
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - La sequence est invalide ")
|
||||
return False, " La sequence est invalide "
|
||||
|
||||
if (sequence_session_existe_count > 1):
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " - Sequence incohérente. il a plusieurs sequences avec le meme id ")
|
||||
return False, " Sequence incohérente. il a plusieurs sequences avec le meme id "
|
||||
|
||||
# Vu que toutes les sequences sont valides, on fait la mise à jour
|
||||
for sequence_session_id in tab_sequence_session_id:
|
||||
my_ressource_seq_data = {}
|
||||
|
||||
my_ressource_seq_data['token'] = diction['token']
|
||||
my_ressource_seq_data['sequence_session_id'] = sequence_session_id
|
||||
if( "poste" in diction.keys() ):
|
||||
my_ressource_seq_data['poste'] = diction['poste']
|
||||
else:
|
||||
my_ressource_seq_data['poste'] = ""
|
||||
|
||||
if ("comment" in diction.keys()):
|
||||
my_ressource_seq_data['comment'] = diction['comment']
|
||||
else:
|
||||
my_ressource_seq_data['comment'] = ""
|
||||
|
||||
if ("related_target_collection" in diction.keys()):
|
||||
my_ressource_seq_data['related_target_collection'] = diction['related_target_collection']
|
||||
else:
|
||||
my_ressource_seq_data['related_target_collection'] = ""
|
||||
|
||||
if ("related_target_collection_id" in diction.keys()):
|
||||
my_ressource_seq_data['related_target_collection_id'] = diction['related_target_collection_id']
|
||||
else:
|
||||
my_ressource_seq_data['related_target_collection_id'] = ""
|
||||
|
||||
|
||||
|
||||
local_status, local_retval = Add_Sequence_Affectation_Ressource_Poste(my_ressource_seq_data)
|
||||
if(local_status is False ):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " - WARNING . "+str(local_retval))
|
||||
|
||||
|
||||
|
||||
|
||||
return True, " Les ressources ont bien été ajoutées en masse"
|
||||
|
||||
except Exception as e:
|
||||
exc_type, exc_obj, exc_tb = sys.exc_info()
|
||||
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
|
||||
return False, " Impossible d'affecter la ressource à la sequence "
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Mettre à jour une affectation de ressource
|
||||
"""
|
||||
|
|
16
main.py
16
main.py
|
@ -3661,6 +3661,22 @@ def AcceptAttendeeInscription():
|
|||
|
||||
|
||||
|
||||
"""
|
||||
API pour mettre à jour la liste des UE et les evaluations
|
||||
que doivent passer un apprenant dans le cadre d'une formation initale
|
||||
"""
|
||||
@app.route('/myclass/api/Update_AcceptAttendeeInscription_For_Initial_Formation/', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Update_AcceptAttendeeInscription_For_Initial_Formation():
|
||||
# On CancelAttendeeInscription le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary (request.form.to_dict())
|
||||
print(" ### Update_AcceptAttendeeInscription_For_Initial_Formation : payload = ",payload)
|
||||
localStatus, message= inscription.Update_AcceptAttendeeInscription_For_Initial_Formation(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Cette API permet d'envoyer les identifiants de connexion à la plateforme de plateforme LMS
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue