master
cherif 2024-07-05 15:06:13 +02:00
parent 4fc6463e3c
commit 0cb6f91408
4 changed files with 3515 additions and 17 deletions

View File

@ -1,12 +1,10 @@
<?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="ww">
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="wws">
<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$/emargement.py" beforeDir="false" afterPath="$PROJECT_DIR$/emargement.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
@ -77,13 +75,6 @@
<option name="presentableId" value="Default" />
<updated>1680804787304</updated>
</task>
<task id="LOCAL-00294" summary="dd">
<created>1715448610311</created>
<option name="number" value="00294" />
<option name="presentableId" value="LOCAL-00294" />
<option name="project" value="LOCAL" />
<updated>1715448610313</updated>
</task>
<task id="LOCAL-00295" summary="ddsdfsd">
<created>1715528112769</created>
<option name="number" value="00295" />
@ -420,7 +411,14 @@
<option name="project" value="LOCAL" />
<updated>1719675793618</updated>
</task>
<option name="localTasksCounter" value="343" />
<task id="LOCAL-00343" summary="wws">
<created>1720114279292</created>
<option name="number" value="00343" />
<option name="presentableId" value="LOCAL-00343" />
<option name="project" value="LOCAL" />
<updated>1720114279293</updated>
</task>
<option name="localTasksCounter" value="344" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
@ -462,7 +460,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="gdfgdf" />
<MESSAGE value="26/05/2024 - 20h30" />
<MESSAGE value="qsdsqqsdsq" />
<MESSAGE value="sd" />
@ -487,6 +484,7 @@
<MESSAGE value="qsds" />
<MESSAGE value="26/06/2024 - 19h30" />
<MESSAGE value="ww" />
<option name="LAST_COMMIT_MESSAGE" value="ww" />
<MESSAGE value="wws" />
<option name="LAST_COMMIT_MESSAGE" value="wws" />
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -147,7 +147,8 @@ def Add_Update_Question_Formulaire(diction):
"""
Verification des input acceptés
"""
field_list = ['token', 'form_id', 'question_id', 'question', 'type', 'commentaire', 'list_choix', 'max_note', 'list_qcm', 'list_case_cocher' ]
field_list = ['token', 'form_id', 'question_id', 'question', 'type', 'commentaire', 'list_choix', 'max_note',
'list_qcm', 'list_case_cocher', 'is_statistic' ]
incom_keys = diction.keys()
for val in incom_keys:
@ -251,6 +252,11 @@ def Add_Update_Question_Formulaire(diction):
else:
new_data['max_note'] = ""
if ("is_statistic" in diction.keys() and str(diction['is_statistic']).strip() in ['0', '1'] ):
new_data['is_statistic'] = str(diction['is_statistic']).strip()
else:
new_data['is_statistic'] = "0"
tab_list_choix = []
if ("list_choix" in diction.keys() and str(diction['type']) == "qcm"):

View File

@ -244,6 +244,24 @@ def Record_Survey_Data_No_Token(diction):
"""
associated_question = [x for x in form_list_question if x['_id'] == question_id][0]['question']
node = {"question_id":question_id, "question":str(associated_question), "response":response}
"""
05/07/204 - On va aller recuperer l'info 'is_statistic' sur la question
"""
question_is_statistic = ""
question_type = ""
for local_question in form_list_question :
if( str(local_question['_id']) == str(question_id) and "is_statistic" in local_question.keys() ):
question_is_statistic = local_question['is_statistic']
if (str(local_question['_id']) == str(question_id) and "type" in local_question.keys()):
question_type = local_question['type']
node['is_statistic'] = question_is_statistic
node['type'] = question_type
global_response.append(node)
@ -518,8 +536,14 @@ def Init_Survey_Tab_For_All_Session_Inscrit(diction):
server_diction['survey_type'] = diction['survey_type']
server_diction['sending_date'] = diction['sending_date']
server_diction['related_collection'] = str(diction['related_collection'])
server_diction['related_collection_id'] = str(diction['related_collection_id'])
if( "related_collection" in diction.keys() and diction['related_collection']
and "related_collection_id" in diction.keys() and diction['related_collection_id'] ):
server_diction['related_collection'] = diction['related_collection']
server_diction['related_collection_id'] = diction['related_collection_id']
else:
server_diction['related_collection'] = "inscription"
server_diction['related_collection_id'] = str(local_Insc_retval['_id'])
local_status, local_retval = Create_One_Survey_To_Inscrit(server_diction)
@ -856,6 +880,7 @@ def Create_One_Survey_To_Inscrit(diction):
new_survey_data['update_by'] = str(my_partner['_id'])
new_survey_data['created_by'] = str(my_partner['_id'])
inserted_id = MYSY_GV.dbname['survey'].insert_one(new_survey_data).inserted_id
if (not inserted_id):
@ -1844,6 +1869,39 @@ def Get_List_Survey_with_filter(diction):
for New_retVal in MYSY_GV.dbname['survey'].aggregate(pipe_qry):
user = New_retVal
user['id'] = str(val_tmp)
# recuperer les données de la fromation
class_title = ""
class_external_code = ""
if( "class_id" in New_retVal.keys() ):
class_data = MYSY_GV.dbname['myclass'].find_one({'_id':ObjectId(New_retVal['class_id']),
'valide':'1',
'partner_owner_recid':my_partner['recid']},
{'title':1, 'external_code':1})
if( class_data and 'title' in class_data.keys() and 'external_code' in class_data.keys()):
class_title = class_data['title']
class_external_code = class_data['external_code']
user['class_title'] = class_title
user['class_external_code'] = class_external_code
# Recuperer les données de la session
session_title = ""
session_code = ""
if ("session_id" in New_retVal.keys()):
session_data = MYSY_GV.dbname['session_formation'].find_one({'_id': ObjectId(New_retVal['session_id']),
'valide': '1',
'partner_owner_recid': my_partner['recid']},
{'titre': 1, 'code_session': 1})
if (session_data and 'titre' in session_data.keys() and 'code_session' in session_data.keys()):
session_title = session_data['titre']
session_code = session_data['code_session']
user['session_title'] = session_title
user['session_code'] = session_code
val_tmp = val_tmp + 1
RetObject.append(mycommon.JSONEncoder().encode(user))
@ -2151,3 +2209,4 @@ def Export_To_Excel_Survey_with_filter(diction):
mycommon.myprint(str(inspect.stack()[0][3]) + " -" + str(e) + " - Line : " + str(exc_tb.tb_lineno))
return False, " Impossible de générer l'export "