08/08/2024 - 20h32s

master
cherif 2024-08-09 13:18:16 +02:00
parent 0618fe1e91
commit b9e91258a5
3 changed files with 2622 additions and 14 deletions

View File

@ -1,8 +1,9 @@
<?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="08/08/2024 - 20h30">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="08/08/2024 - 20h32">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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$/groupe_inscrit_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/groupe_inscrit_mgt.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -458,7 +459,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="ww" />
<MESSAGE value="wws" />
<MESSAGE value="wwssd" />
<MESSAGE value="wwssdss" />
@ -483,6 +483,7 @@
<MESSAGE value="02/08/2024 - 17h" />
<MESSAGE value="03/08/2024 - 18h30" />
<MESSAGE value="08/08/2024 - 20h30" />
<option name="LAST_COMMIT_MESSAGE" value="08/08/2024 - 20h30" />
<MESSAGE value="08/08/2024 - 20h32" />
<option name="LAST_COMMIT_MESSAGE" value="08/08/2024 - 20h32" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -1526,7 +1526,7 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
if( split_type == "0"):
# On fait une repartition des participant par Ordre Alphabétique par nom d'inscrit
nb_inscrit_par_groupe = (nb_inscrit/nb_groupe)+1 # On met le +1 pour couvrir les eventuels modulo
nb_inscrit_par_groupe = (nb_inscrit/nb_groupe) # On met le +1 pour couvrir les eventuels modulo
while(len(tab_inscription_id) > 0 ):
i = 0
@ -1583,6 +1583,7 @@ def Automatic_Creation_Groupe_Member_Inscrit(diction):
new_data = {}
new_data['groupe_inscription_id'] = str(inserted_grp_id)
new_data['inscription_id'] = str(my_inscription)
new_data['type_groupe_code'] = str(diction['type_groupe_code'])
mytoday = datetime.today()
new_data['date_ajout_groupe'] = str(mytoday)
@ -1631,7 +1632,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'class_id', 'session_id', 'split_type', ]
field_list = ['token', 'class_id', 'session_id', 'split_type','type_groupe_code' ]
incom_keys = diction.keys()
for val in incom_keys:
@ -1643,7 +1644,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
"""
Verification des champs obligatoires
"""
field_list_obligatoire = ['token', 'class_id', 'session_id', 'split_type', ]
field_list_obligatoire = ['token', 'class_id', 'session_id', 'split_type', 'type_groupe_code']
for val in field_list_obligatoire:
if val not in diction:
@ -1663,12 +1664,15 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
local_status, my_partner = mycommon.Check_Connexion_And_Return_Partner_Data(diction)
if (local_status is not True):
return local_status, my_partner
# Recuperer le nombre de groupe
"""
# Recuperer le nombre de groupe en prenant en compte le type de groupe
/!\ : Il ne faut pas mélanger la gestion des types de groupe (TD, TP, PROJET, etc)
"""
nb_groupe = MYSY_GV.dbname['groupe_inscription'].count_documents({'class_id':str(diction['class_id']),
'session_id':str(diction['session_id']),
'valide':'1',
'locked':'0',
'type_groupe_code':str(diction['type_groupe_code']),
'partner_owner_recid':str(my_partner['recid'])})
if(nb_groupe <= 0 ):
@ -1726,6 +1730,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
{'$and':
[
{'$eq': ["$valide", "1"]},
{'$eq': ["$type_groupe_code", str(diction['type_groupe_code']),]},
{'$eq': ["$inscription_id", '$$inscription_id']},
{'$eq': ["$partner_owner_recid",
'$$groupe_inscription_membre_partner_owner_recid']},
@ -1747,12 +1752,12 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
])
print(" ### splited : pipe_qry = ", pipe_qry)
#print(" ### splited : pipe_qry = ", pipe_qry)
for retval in MYSY_GV.dbname['inscription'].aggregate(pipe_qry):
if( "collection_groupe_inscription_membre" in retval.keys() and "inscription_id" in retval['collection_groupe_inscription_membre'].keys() and retval['collection_groupe_inscription_membre']["inscription_id"]):
list_inscription_id_ObjectId_splited_in_grp.append(ObjectId(str(retval['collection_groupe_inscription_membre']["inscription_id"])))
print(" ### splited : list_inscription_id_ObjectId_splited_in_grp = ", list_inscription_id_ObjectId_splited_in_grp)
#print(" ### splited : list_inscription_id_ObjectId_splited_in_grp = ", list_inscription_id_ObjectId_splited_in_grp)
nb_inscrit = 0
@ -1786,7 +1791,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
print(" #### tab_inscription_id a spliter = ", tab_inscription_id)
#print(" #### nouvelle tab_inscription_id a spliter = ", tab_inscription_id)
"""
@ -1816,21 +1821,28 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
global_tab_groupe.append(local_node)
"""
"""
print({'class_id': str(diction['class_id']),
'session_id': str(diction['session_id']),
'valide': '1',
'locked': '0',
'type_groupe_code': str(diction['type_groupe_code']),
'partner_owner_recid': str(
my_partner['recid'])}
)
"""
global_tab_groupe_tmp = MYSY_GV.dbname['groupe_inscription'].find({'class_id': str(diction['class_id']),
'session_id': str(diction['session_id']),
'valide': '1',
'locked': '0',
'type_groupe_code': str(
diction['type_groupe_code']),
'partner_owner_recid': str(
my_partner['recid'])})
global_tab_groupe = []
for tmp in global_tab_groupe_tmp:
@ -1838,11 +1850,14 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
local_tmp['liste_inscrit'] = []
global_tab_groupe.append(local_tmp)
#print(" Liste des groupe pour le spli ", global_tab_groupe_tmp)
#print(" nb_inscrit ", nb_inscrit)
#print(" nb_groupe ", nb_groupe)
if( split_type == "0"):
# On fait une repartition des participant par Ordre Alphabétique par nom d'inscrit
nb_inscrit_par_groupe = (nb_inscrit/nb_groupe)+1 # On met le +1 pour couvrir les eventuels modulo
nb_inscrit_par_groupe = (nb_inscrit/nb_groupe) # On met le +1 pour couvrir les eventuels modulo
while(len(tab_inscription_id) > 0 ):
i = 0
@ -1858,7 +1873,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
elif( split_type == "1"):
# On fait une repartition des participant Aleatoire
nb_inscrit_par_groupe = (nb_inscrit / nb_groupe) + 1 # On met le +1 pour couvrir les eventuels modulo
nb_inscrit_par_groupe = (nb_inscrit / nb_groupe) # On met le +1 pour couvrir les eventuels modulo
while (len(tab_inscription_id) > 0):
i = 0
@ -1899,6 +1914,7 @@ def Automatic_Split_Member_Inscrit_To_Grps(diction):
new_data = {}
new_data['groupe_inscription_id'] = str(val['_id'])
new_data['inscription_id'] = str(my_inscription)
new_data['type_groupe_code'] = str(diction['type_groupe_code'])
mytoday = datetime.today()
new_data['date_ajout_groupe'] = str(mytoday)