09/04/2024 - 15h19
parent
428b1c1953
commit
e0bd128349
|
@ -3,9 +3,10 @@
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="07/04/2024 - 19h19">
|
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="07/04/2024 - 19h19">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/GlobalVariable.py" beforeDir="false" afterPath="$PROJECT_DIR$/GlobalVariable.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$/Log/log_file.log" beforeDir="false" afterPath="$PROJECT_DIR$/Log/log_file.log" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/formulaire_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/formulaire_mgt.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/ressources_humaines.py" beforeDir="false" afterPath="$PROJECT_DIR$/ressources_humaines.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/survey_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/survey_mgt.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|
|
@ -690,7 +690,7 @@ Formulaire : Type de question :
|
||||||
- note
|
- note
|
||||||
- entier
|
- entier
|
||||||
"""
|
"""
|
||||||
FORM_QUESTION_TYPE = ['qcm', 'text', 'note', 'entier', 'bool']
|
FORM_QUESTION_TYPE = ['qcm', 'text', 'note', 'entier', 'bool', 'checkbox']
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
1873
Log/log_file.log
1873
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
@ -147,7 +147,7 @@ def Add_Update_Question_Formulaire(diction):
|
||||||
"""
|
"""
|
||||||
Verification des input acceptés
|
Verification des input acceptés
|
||||||
"""
|
"""
|
||||||
field_list = ['token', 'form_id', 'question_id', 'question', 'type', 'commentaire', 'list_choix', 'max_note', 'list_qcm' ]
|
field_list = ['token', 'form_id', 'question_id', 'question', 'type', 'commentaire', 'list_choix', 'max_note', 'list_qcm', 'list_case_cocher' ]
|
||||||
|
|
||||||
incom_keys = diction.keys()
|
incom_keys = diction.keys()
|
||||||
for val in incom_keys:
|
for val in incom_keys:
|
||||||
|
@ -251,25 +251,48 @@ def Add_Update_Question_Formulaire(diction):
|
||||||
else:
|
else:
|
||||||
new_data['max_note'] = ""
|
new_data['max_note'] = ""
|
||||||
|
|
||||||
new_data['list_choix'] = []
|
|
||||||
|
|
||||||
|
tab_list_choix = []
|
||||||
|
if ("list_choix" in diction.keys() and str(diction['type']) == "qcm"):
|
||||||
|
|
||||||
if ("list_choix" in diction.keys()):
|
print(" diction[list_choix] = ", diction['list_choix'])
|
||||||
local_JSON = ast.literal_eval(diction['list_choix'])
|
local_JSON = ast.literal_eval(diction['list_choix'])
|
||||||
|
for local_val in local_JSON :
|
||||||
|
|
||||||
for local_val in local_JSON:
|
print(" local_val ", local_val)
|
||||||
reponse_qcm = {}
|
reponse_qcm = {}
|
||||||
if ("reponse" in local_val):
|
if( "reponse" in local_val):
|
||||||
reponse_qcm['reponse_qcm'] = local_val['reponse']
|
reponse_qcm['reponse_qcm'] = local_val['reponse']
|
||||||
else:
|
else:
|
||||||
reponse_qcm['reponse_qcm'] = ""
|
reponse_qcm['reponse_qcm'] = ""
|
||||||
|
|
||||||
if ("value" in local_val):
|
tab_list_choix.append(reponse_qcm)
|
||||||
reponse_qcm['value'] = local_val['value']
|
|
||||||
else:
|
|
||||||
reponse_qcm['value'] = ""
|
if (len(tab_list_choix) > 0 and str(diction['type']) == "qcm"):
|
||||||
|
new_data['list_choix'] = tab_list_choix
|
||||||
|
|
||||||
|
|
||||||
|
tab_list_case_cocher = []
|
||||||
|
if ("list_case_cocher" in diction.keys() and str(diction['type']) == "checkbox"):
|
||||||
|
|
||||||
|
print(" diction[list_case_cocher] = ", diction['list_case_cocher'])
|
||||||
|
local_JSON = ast.literal_eval(diction['list_case_cocher'])
|
||||||
|
for local_val in local_JSON :
|
||||||
|
|
||||||
|
print(" local_val ", local_val)
|
||||||
|
reponse_checkbox = {}
|
||||||
|
if( "reponse" in local_val):
|
||||||
|
reponse_checkbox['reponse_checkbox'] = local_val['reponse']
|
||||||
|
else:
|
||||||
|
reponse_checkbox['reponse_checkbox'] = ""
|
||||||
|
|
||||||
|
|
||||||
|
tab_list_case_cocher.append(reponse_checkbox)
|
||||||
|
|
||||||
|
if(len(tab_list_case_cocher) > 0 and str(diction['type']) == "checkbox" ):
|
||||||
|
new_data['list_case_cocher'] = tab_list_case_cocher
|
||||||
|
|
||||||
new_data['list_choix'].append(reponse_qcm)
|
|
||||||
|
|
||||||
update = MYSY_GV.dbname['formulaire'].update_one({'partner_owner_recid': str(my_partner['recid']),
|
update = MYSY_GV.dbname['formulaire'].update_one({'partner_owner_recid': str(my_partner['recid']),
|
||||||
'valide': '1', 'locked': '0',
|
'valide': '1', 'locked': '0',
|
||||||
|
@ -320,8 +343,9 @@ def Add_Update_Question_Formulaire(diction):
|
||||||
else:
|
else:
|
||||||
new_data['max_note'] = ""
|
new_data['max_note'] = ""
|
||||||
|
|
||||||
new_data['list_choix'] = []
|
|
||||||
if ("list_choix" in diction.keys()):
|
tab_list_choix = []
|
||||||
|
if ("list_choix" in diction.keys() and str(diction['type']) == "qcm"):
|
||||||
|
|
||||||
print(" diction[list_choix] = ", diction['list_choix'])
|
print(" diction[list_choix] = ", diction['list_choix'])
|
||||||
local_JSON = ast.literal_eval(diction['list_choix'])
|
local_JSON = ast.literal_eval(diction['list_choix'])
|
||||||
|
@ -334,8 +358,32 @@ def Add_Update_Question_Formulaire(diction):
|
||||||
else:
|
else:
|
||||||
reponse_qcm['reponse_qcm'] = ""
|
reponse_qcm['reponse_qcm'] = ""
|
||||||
|
|
||||||
|
tab_list_choix.append(reponse_qcm)
|
||||||
|
|
||||||
new_data['list_choix'].append(reponse_qcm)
|
|
||||||
|
if (len(tab_list_choix) > 0 and str(diction['type']) == "qcm"):
|
||||||
|
new_data['list_choix'] = tab_list_choix
|
||||||
|
|
||||||
|
|
||||||
|
tab_list_case_cocher = []
|
||||||
|
if ("list_case_cocher" in diction.keys() and str(diction['type']) == "checkbox"):
|
||||||
|
|
||||||
|
print(" diction[list_case_cocher] = ", diction['list_case_cocher'])
|
||||||
|
local_JSON = ast.literal_eval(diction['list_case_cocher'])
|
||||||
|
for local_val in local_JSON :
|
||||||
|
|
||||||
|
print(" local_val ", local_val)
|
||||||
|
reponse_checkbox = {}
|
||||||
|
if( "reponse" in local_val):
|
||||||
|
reponse_checkbox['reponse_checkbox'] = local_val['reponse']
|
||||||
|
else:
|
||||||
|
reponse_checkbox['reponse_checkbox'] = ""
|
||||||
|
|
||||||
|
|
||||||
|
tab_list_case_cocher.append(reponse_checkbox)
|
||||||
|
|
||||||
|
if(len(tab_list_case_cocher) > 0 and str(diction['type']) == "checkbox" ):
|
||||||
|
new_data['list_case_cocher'] = tab_list_case_cocher
|
||||||
|
|
||||||
update = MYSY_GV.dbname['formulaire'].update_one({'partner_owner_recid': str(my_partner['recid']),
|
update = MYSY_GV.dbname['formulaire'].update_one({'partner_owner_recid': str(my_partner['recid']),
|
||||||
'valide': '1', 'locked': '0',
|
'valide': '1', 'locked': '0',
|
||||||
|
@ -343,9 +391,8 @@ def Add_Update_Question_Formulaire(diction):
|
||||||
|
|
||||||
{
|
{
|
||||||
'$push': {
|
'$push': {
|
||||||
"list_questions": {
|
"list_questions": { '$each': [new_data] },
|
||||||
'$each': [new_data]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1212,15 +1212,18 @@ def Export_To_Excel_Survey_with_filter(diction):
|
||||||
question_num = 1
|
question_num = 1
|
||||||
for user_response in Survey_Data['user_response']:
|
for user_response in Survey_Data['user_response']:
|
||||||
|
|
||||||
worksheet.write(0, column, "question_"+str(question_num))
|
|
||||||
question = ""
|
question = ""
|
||||||
if ("question" in user_response.keys()):
|
if ("question" in user_response.keys()):
|
||||||
question = str(user_response['question'])
|
question = str(user_response['question'])
|
||||||
|
|
||||||
worksheet.write(row, column, question)
|
#worksheet.write(0, column, question)
|
||||||
|
#worksheet.write(row, column, question)
|
||||||
column += 1
|
column += 1
|
||||||
|
|
||||||
worksheet.write(0, column, "response_"+str(question_num))
|
#worksheet.write(0, column, "response_"+str(question_num))
|
||||||
|
worksheet.write(0, column, question)
|
||||||
|
|
||||||
response = ""
|
response = ""
|
||||||
if ("response" in user_response.keys()):
|
if ("response" in user_response.keys()):
|
||||||
response = str(user_response['response'])
|
response = str(user_response['response'])
|
||||||
|
@ -1231,8 +1234,8 @@ def Export_To_Excel_Survey_with_filter(diction):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
question = "---"
|
#question = "---"
|
||||||
worksheet.write(row, column, question)
|
#worksheet.write(row, column, question)
|
||||||
column += 1
|
column += 1
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue