parent
8df133dc0b
commit
2ed6d967fb
|
|
@ -4,9 +4,12 @@
|
|||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="27/05/2026 - 18h00">
|
||||
<list default="true" id="c6d0259a-16e1-410d-91a1-830590ee2a08" name="Changes" comment="27/05/2026 - 22h00">
|
||||
<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$/base_class_calcul_note.py" beforeDir="false" afterPath="$PROJECT_DIR$/base_class_calcul_note.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/class_mgt.py" beforeDir="false" afterPath="$PROJECT_DIR$/class_mgt.py" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
|
|
@ -450,7 +453,7 @@
|
|||
<option name="project" value="LOCAL" />
|
||||
<updated>1747251650255</updated>
|
||||
</task>
|
||||
<option name="localTasksCounter" value="591" />
|
||||
<option name="localTasksCounter" value="592" />
|
||||
<servers />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
|
|
@ -492,7 +495,6 @@
|
|||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<MESSAGE value="24/04/26 - 19h" />
|
||||
<MESSAGE value="26/04/26 - 19h" />
|
||||
<MESSAGE value="27/04/26 - 19h" />
|
||||
<MESSAGE value="28/04/26 - 19h" />
|
||||
|
|
@ -517,6 +519,7 @@
|
|||
<MESSAGE value="24/05/2026 - 18h00" />
|
||||
<MESSAGE value="26/05/2026 - 18h00" />
|
||||
<MESSAGE value="27/05/2026 - 18h00" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="27/05/2026 - 18h00" />
|
||||
<MESSAGE value="27/05/2026 - 22h00" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value="27/05/2026 - 22h00" />
|
||||
</component>
|
||||
</project>
|
||||
3343
Log/log_file.log
3343
Log/log_file.log
File diff suppressed because it is too large
Load Diff
|
|
@ -3647,8 +3647,8 @@ def Create_work_evaluation_participant_note(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['partner_owner_recid', 'semestre', 'diplome_id', 'domaine_competence_id', 'inscrit_id', 'class_id', 'session_id',
|
||||
'rattrapage']
|
||||
field_list = ['partner_owner_recid', 'semestre', 'diplome_id', 'tab_domaine_competence_ids', 'inscrit_id', 'class_id', 'session_id',
|
||||
'rattrapage', ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -3661,9 +3661,15 @@ def Create_work_evaluation_participant_note(diction):
|
|||
if ("diplome_id" in diction.keys() and diction['diplome_id']):
|
||||
filt_diplome_id = {'tab_diplome_ids': str(diction['diplome_id']) }
|
||||
|
||||
|
||||
tab_domaine_competence_ids = []
|
||||
tab_domaine_competence_ids_work = str(diction['tab_domaine_competence_ids']).strip().split(",")
|
||||
for tmp in tab_domaine_competence_ids_work:
|
||||
tab_domaine_competence_ids.append(str(tmp))
|
||||
|
||||
filt_domaine_competence_id = {}
|
||||
if ("domaine_competence_id" in diction.keys() and diction['domaine_competence_id']):
|
||||
filt_domaine_competence_id = {'domaine_competence_id': str(diction['domaine_competence_id'])}
|
||||
if ("tab_domaine_competence_ids" in diction.keys() and diction['tab_domaine_competence_ids']):
|
||||
filt_domaine_competence_id = {'domaine_competence_id': {'$in':tab_domaine_competence_ids}}
|
||||
|
||||
filt_class_id = {}
|
||||
if ("class_id" in diction.keys() and diction['class_id']):
|
||||
|
|
@ -3679,9 +3685,6 @@ def Create_work_evaluation_participant_note(diction):
|
|||
else:
|
||||
filt_rattrapage = {'rattrapage':{'$ne':'1'}}
|
||||
|
||||
"""
|
||||
Creation d'un token pour identifier les lignes qui viennes d'etre insérées
|
||||
"""
|
||||
code_action = mycommon.create_token_urlsafe()
|
||||
|
||||
local_qry = {
|
||||
|
|
@ -3831,8 +3834,8 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'session_id', 'semestre', 'diplome_id', 'domaine_competence_id', 'inscrit_id',
|
||||
'class_id', 'rattrapage']
|
||||
field_list = ['token', 'session_id', 'semestre', 'diplome_id', 'tab_domaine_competence_ids', 'inscrit_id',
|
||||
'class_id', 'rattrapage',]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -3844,7 +3847,7 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
"""
|
||||
Verification des champs obligatoires
|
||||
"""
|
||||
field_list_obligatoire = ['token', 'session_id', 'semestre', 'diplome_id', 'domaine_competence_id',]
|
||||
field_list_obligatoire = ['token', 'session_id', 'semestre', 'diplome_id', 'tab_domaine_competence_ids',]
|
||||
for val in field_list_obligatoire:
|
||||
if val not in diction:
|
||||
mycommon.myprint(
|
||||
|
|
@ -3880,6 +3883,35 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
'valide': '1',
|
||||
'partner_owner_recid': str(my_partner['recid'])})
|
||||
|
||||
|
||||
session_class_id = str(is_session_valide_data['class_id'])
|
||||
|
||||
tab_domaine_competence_ids = []
|
||||
tab_domaine_competence_ids_work = []
|
||||
tab_domaine_competence_ids_ObjectId = []
|
||||
if( "tab_domaine_competence_ids" in diction.keys()):
|
||||
tab_domaine_competence_ids_work = str(diction['tab_domaine_competence_ids']).strip().split(",")
|
||||
for tmp in tab_domaine_competence_ids_work :
|
||||
if( tmp ):
|
||||
is_valide_domaine_competence_id = MYSY_GV.dbname['domaine_competence_pedagogique'].count_documents({'_id':ObjectId(str(tmp)),
|
||||
'valide': '1',
|
||||
'locked':'0',
|
||||
'partner_owner_recid': str(
|
||||
my_partner[
|
||||
'recid'])
|
||||
})
|
||||
|
||||
if( is_valide_domaine_competence_id != 1):
|
||||
mycommon.myprint(
|
||||
str(inspect.stack()[0][3]) + " Le domaine de compétence "+str(tmp) +" est invalide ")
|
||||
return False, " Le domaine de compétence "+str(tmp) +" est invalide ",
|
||||
|
||||
|
||||
tab_domaine_competence_ids.append(str(tmp))
|
||||
tab_domaine_competence_ids_ObjectId.append(ObjectId(str(tmp)))
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Etape 0 : On met à jours (vider et recharger) la table temporaire de travail :work_evaluation_participant_note
|
||||
"""
|
||||
|
|
@ -3889,7 +3921,7 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
work_collection_diction['session_id'] = str(is_session_valide_data['_id'])
|
||||
work_collection_diction['semestre'] = str(diction['semestre'])
|
||||
work_collection_diction['diplome_id'] = str(diction['diplome_id'])
|
||||
work_collection_diction['domaine_competence_id'] = str(diction['domaine_competence_id'])
|
||||
work_collection_diction['tab_domaine_competence_ids'] = str(diction['tab_domaine_competence_ids'])
|
||||
|
||||
if ("rattrapage" in diction.keys() and diction['rattrapage'] == "1"):
|
||||
work_collection_diction['rattrapage'] = '1'
|
||||
|
|
@ -3903,78 +3935,90 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
|
||||
print(" ### code action = ", str(code_action))
|
||||
|
||||
tab_inscrit_id = []
|
||||
for inscrit in MYSY_GV.dbname['inscription'].find({'valide': '1', 'status': '1',
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'session_id': str(is_session_valide_data['_id'])}):
|
||||
tab_inscrit_id.append(str(inscrit['_id']))
|
||||
for domaine_competence_id in tab_domaine_competence_ids:
|
||||
tab_inscrit_id = []
|
||||
for inscrit in MYSY_GV.dbname['inscription'].find({'valide': '1', 'status': '1',
|
||||
'partner_owner_recid': str(my_partner['recid']),
|
||||
'session_id': str(is_session_valide_data['_id'])}):
|
||||
tab_inscrit_id.append(str(inscrit['_id']))
|
||||
|
||||
|
||||
|
||||
filt_class_id = {}
|
||||
if ("class_id" in diction.keys() and diction['class_id']):
|
||||
filt_class_id = {'class_id': str(diction['class_id'])}
|
||||
filt_class_id = {}
|
||||
if ("class_id" in diction.keys() and diction['class_id']):
|
||||
filt_class_id = {'class_id': str(diction['class_id'])}
|
||||
|
||||
|
||||
# On recupere la liste des ue_id de la promotion
|
||||
tab_ue_id = []
|
||||
tab_ue_id_with_compet_diplome = []
|
||||
pipeline = [
|
||||
{
|
||||
"$match": {
|
||||
"_id": ObjectId(str(diction['session_id'])),
|
||||
"partner_owner_recid": "43598820dd270936c3d2fd822717d0f18f194b1a1b894aaf89",
|
||||
"valide": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$project": {
|
||||
"_id": 0,
|
||||
"list_unite_enseignement": {
|
||||
"$filter": {
|
||||
"input": "$list_unite_enseignement",
|
||||
"as": "ue",
|
||||
"cond": {
|
||||
"$and": [
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.semestre",
|
||||
str(diction['semestre'])
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.diplome_id",
|
||||
str(diction['diplome_id'])
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.domaine_competence_id",
|
||||
str(diction['domaine_competence_id'])
|
||||
]
|
||||
},
|
||||
{"$ne": ["$$ue.archived", "1"]}
|
||||
]
|
||||
# On recupere la liste des ue_id de la promotion
|
||||
tab_ue_id = []
|
||||
tab_ue_id_with_compet_diplome = []
|
||||
pipeline = [
|
||||
{
|
||||
"$match": {
|
||||
"_id": ObjectId(str(diction['session_id'])),
|
||||
"partner_owner_recid": "43598820dd270936c3d2fd822717d0f18f194b1a1b894aaf89",
|
||||
"valide": "1"
|
||||
}
|
||||
},
|
||||
{
|
||||
"$project": {
|
||||
"_id": 0,
|
||||
"list_unite_enseignement": {
|
||||
"$filter": {
|
||||
"input": "$list_unite_enseignement",
|
||||
"as": "ue",
|
||||
"cond": {
|
||||
"$and": [
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.semestre",
|
||||
str(diction['semestre'])
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.diplome_id",
|
||||
str(diction['diplome_id'])
|
||||
]
|
||||
},
|
||||
{
|
||||
"$eq": [
|
||||
"$$ue.domaine_competence_id",
|
||||
str(domaine_competence_id)
|
||||
]
|
||||
},
|
||||
{"$ne": ["$$ue.archived", "1"]}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
]
|
||||
|
||||
session_list_ue = {}
|
||||
session_list_ue = {}
|
||||
|
||||
for tmp in MYSY_GV.dbname["session_formation"].aggregate(pipeline):
|
||||
if( "list_unite_enseignement" in tmp.keys() ):
|
||||
session_list_ue = tmp["list_unite_enseignement"]
|
||||
for tmp in MYSY_GV.dbname["session_formation"].aggregate(pipeline):
|
||||
if( "list_unite_enseignement" in tmp.keys() ):
|
||||
session_list_ue = tmp["list_unite_enseignement"]
|
||||
|
||||
|
||||
|
||||
if ("semestre" in diction.keys() and diction['semestre']):
|
||||
for class_class_ue_data in session_list_ue :
|
||||
if ("semestre" in diction.keys() and diction['semestre']):
|
||||
for class_class_ue_data in session_list_ue :
|
||||
|
||||
if( "semestre" in class_class_ue_data.keys() and class_class_ue_data['semestre'] == str(diction['semestre'])):
|
||||
if( "semestre" in class_class_ue_data.keys() and class_class_ue_data['semestre'] == str(diction['semestre'])):
|
||||
local_node = {}
|
||||
local_node['ue_id'] = class_class_ue_data['_id']
|
||||
local_node['domaine_competence_id'] = class_class_ue_data['domaine_competence_id']
|
||||
local_node['diplome_id'] = class_class_ue_data['diplome_id']
|
||||
local_node['semestre'] = class_class_ue_data['semestre']
|
||||
|
||||
tab_ue_id_with_compet_diplome.append(local_node)
|
||||
tab_ue_id.append( str(class_class_ue_data['_id']))
|
||||
|
||||
else:
|
||||
for class_class_ue_data in session_list_ue:
|
||||
local_node = {}
|
||||
local_node['ue_id'] = class_class_ue_data['_id']
|
||||
local_node['domaine_competence_id'] = class_class_ue_data['domaine_competence_id']
|
||||
|
|
@ -3982,47 +4026,34 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
local_node['semestre'] = class_class_ue_data['semestre']
|
||||
|
||||
tab_ue_id_with_compet_diplome.append(local_node)
|
||||
tab_ue_id.append( str(class_class_ue_data['_id']))
|
||||
|
||||
else:
|
||||
for class_class_ue_data in session_list_ue:
|
||||
local_node = {}
|
||||
local_node['ue_id'] = class_class_ue_data['_id']
|
||||
local_node['domaine_competence_id'] = class_class_ue_data['domaine_competence_id']
|
||||
local_node['diplome_id'] = class_class_ue_data['diplome_id']
|
||||
local_node['semestre'] = class_class_ue_data['semestre']
|
||||
|
||||
tab_ue_id_with_compet_diplome.append(local_node)
|
||||
tab_ue_id.append(str(class_class_ue_data['_id']))
|
||||
tab_ue_id.append(str(class_class_ue_data['_id']))
|
||||
|
||||
|
||||
#print(" ### ooooo zz tab_ue_id_with_compet_diplome = ", tab_ue_id_with_compet_diplome)
|
||||
#print(" ### ooooo zz tab_ue_id_with_compet_diplome = ", tab_ue_id_with_compet_diplome)
|
||||
|
||||
"""
|
||||
Etape 2 : On va aller chercher toutes lignes concernées par : tab_ue_id_with_compet_diplome
|
||||
"""
|
||||
filt_diplome_id = {}
|
||||
if ("diplome_id" in diction.keys() and diction['diplome_id']):
|
||||
filt_diplome_id = {'tab_diplome_ids': str(diction['diplome_id'])}
|
||||
|
||||
filt_domaine_competence_id = {}
|
||||
if ("domaine_competence_id" in diction.keys() and diction['domaine_competence_id']):
|
||||
filt_domaine_competence_id = {'domaine_competence_id': str(diction['domaine_competence_id'])}
|
||||
|
||||
filt_rattrapage = {}
|
||||
if ("rattrapage" in diction.keys() and diction['rattrapage'] == "1"):
|
||||
filt_rattrapage = {'rattrapage': '1'}
|
||||
else:
|
||||
filt_rattrapage = {'rattrapage':{'$ne':'1'}}
|
||||
"""
|
||||
Etape 2 : On va aller chercher toutes lignes concernées par : tab_ue_id_with_compet_diplome
|
||||
"""
|
||||
filt_diplome_id = {}
|
||||
if ("diplome_id" in diction.keys() and diction['diplome_id']):
|
||||
filt_diplome_id = {'tab_diplome_ids': str(diction['diplome_id'])}
|
||||
|
||||
|
||||
"""
|
||||
Etape 3 :
|
||||
Aller recuperer les types d'evaluation
|
||||
pour calculer les moyennes par UE
|
||||
"""
|
||||
for inscrit_id in tab_inscrit_id:
|
||||
if( inscrit_id in ['69d0bdcbb4469130284c79a8', '69d38f85b4469130284c79bc'] ):
|
||||
filt_domaine_competence_id = {'domaine_competence_id': str(domaine_competence_id)}
|
||||
|
||||
filt_rattrapage = {}
|
||||
if ("rattrapage" in diction.keys() and diction['rattrapage'] == "1"):
|
||||
filt_rattrapage = {'rattrapage': '1'}
|
||||
else:
|
||||
filt_rattrapage = {'rattrapage':{'$ne':'1'}}
|
||||
|
||||
|
||||
"""
|
||||
Etape 3 :
|
||||
Aller recuperer les types d'evaluation
|
||||
pour calculer les moyennes par UE
|
||||
"""
|
||||
for inscrit_id in tab_inscrit_id:
|
||||
"""
|
||||
Aller chercher la liste des note concernées par :
|
||||
- ce type d'evaluation (ex : les td, tp, exam)
|
||||
|
|
@ -4122,10 +4153,23 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
]
|
||||
|
||||
class_ue_coefficient = 1
|
||||
class_ue_seuil_validation = 1
|
||||
class_ue_credit_ects = 0
|
||||
|
||||
for class_list_ue in MYSY_GV.dbname["myclass"].aggregate(pipeline) :
|
||||
if( "coefficient" in class_list_ue['list_unite_enseignement'][0].keys() and class_list_ue['list_unite_enseignement'][0]['coefficient']):
|
||||
class_ue_coefficient = mycommon.tryFloat(class_list_ue['list_unite_enseignement'][0]['coefficient'])
|
||||
|
||||
if ("seuil_validation" in class_list_ue['list_unite_enseignement'][0].keys() and
|
||||
class_list_ue['list_unite_enseignement'][0]['seuil_validation']):
|
||||
class_ue_seuil_validation = mycommon.tryFloat(
|
||||
class_list_ue['list_unite_enseignement'][0]['seuil_validation'])
|
||||
|
||||
if ("credit" in class_list_ue['list_unite_enseignement'][0].keys() and
|
||||
class_list_ue['list_unite_enseignement'][0]['credit']):
|
||||
class_ue_credit_ects = mycommon.tryFloat(
|
||||
class_list_ue['list_unite_enseignement'][0]['credit'])
|
||||
|
||||
|
||||
|
||||
print(" ## POUR SESSION _ UE _ DIPLOME _ BC _ COEFF = ", str(ue_id_code), " / ", str(diplome_id_code), " / ", str(domaine_competence_id_code), " / ", str(ue_id_with_compet_diplome['semestre']), " / "+str(class_ue_coefficient))
|
||||
|
|
@ -4205,12 +4249,24 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
|
||||
somme_ue_ponderation = somme_ue_ponderation + mycommon.tryFloat(ue_ponderation)
|
||||
|
||||
print(" ### pour cette UE somme_ue = ", str(somme_ue), " class_ue_coefficient = ", str(class_ue_coefficient), " Pondération = ", str(somme_ue_ponderation))
|
||||
print(" ### pour cette UE somme_ue = ", str(somme_ue), " class_ue_coefficient = ", str(class_ue_coefficient), " Pondération = ", str(somme_ue_ponderation),
|
||||
" Seuil validaion UE = ", str(class_ue_seuil_validation), " UE CREDIT ECTS = ", str(class_ue_credit_ects))
|
||||
|
||||
is_eu_validated = '0'
|
||||
moyenne_avant_coef = 0
|
||||
if (somme_ue_ponderation > 0):
|
||||
moyenne_ue = mycommon.tryFloat(round( (somme_ue / somme_ue_ponderation)*class_ue_coefficient, 2))
|
||||
moyenne_avant_coef = mycommon.tryFloat(round((somme_ue / somme_ue_ponderation), 2))
|
||||
|
||||
if( moyenne_avant_coef >= mycommon.tryFloat(class_ue_seuil_validation)):
|
||||
print( str(moyenne_avant_coef) ," >>>>== ", str(class_ue_seuil_validation), " ==> VALIDEEEEEEEEEEEE UEEEEEEEEE ")
|
||||
is_eu_validated = '1'
|
||||
else:
|
||||
class_ue_credit_ects = 0
|
||||
print(str(moyenne_avant_coef), " <<<<< ",str(class_ue_seuil_validation), " ==> NOOOO VALIDEEEEEEEEEEEE UEEEEEEEEE ")
|
||||
|
||||
|
||||
|
||||
print(" Fin calcul note UE : Moyenne_UE = ", str(moyenne_ue))
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre = {}
|
||||
|
|
@ -4233,14 +4289,28 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['ue_id_code'] = str(ue_id_code)
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['moyenne_avant_coef'] = str(moyenne_avant_coef)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['is_eu_validated'] = str(is_eu_validated)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['ue_credit_ects'] = str(
|
||||
class_ue_credit_ects)
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['ue_seuil_validation'] = str(class_ue_seuil_validation)
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['coef'] = str(class_ue_coefficient)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['moyenne_apres_coef'] = str(moyenne_ue)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['total_ponderation'] =str(somme_ue_ponderation)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['moyenne'] = str(moyenne_ue)
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['create_date'] = str(datetime.now())
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['creation_by'] = str(my_partner['_id'])
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['class_id'] = str(session_class_id)
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['valide'] = "1"
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['locked'] = "0"
|
||||
local_node_moyenne_par_promo_diplome_bc_ue_semestre['calculation_date'] = str(datetime.now())
|
||||
|
||||
|
||||
|
||||
data_key = {}
|
||||
data_key['inscrit_id'] = str(inscrit_data['_id'])
|
||||
data_key['session_id'] = diction['session_id']
|
||||
|
|
@ -4250,6 +4320,7 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
data_key['ue_id'] = ue_id_with_compet_diplome['ue_id']
|
||||
data_key['partner_owner_recid'] = str(my_partner['recid'])
|
||||
|
||||
|
||||
result = MYSY_GV.dbname['work_calcul_moyenne_by_ue_bc_diplome_session_semestre'].find_one_and_update(
|
||||
data_key,
|
||||
{"$set": local_node_moyenne_par_promo_diplome_bc_ue_semestre},
|
||||
|
|
@ -4259,7 +4330,7 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
|
||||
|
||||
|
||||
print(" ======================================================== ")
|
||||
print(" ======================================================== ")
|
||||
|
||||
return True, "Ok creation de la table des notes de travail"
|
||||
|
||||
|
|
@ -4267,3 +4338,179 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE(diction):
|
|||
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 créer la collection : Create_work_evaluation_participant_note"
|
||||
|
||||
"""
|
||||
Recuperation des notes et le classement par unité d'enseignement (UE)
|
||||
"""
|
||||
def Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter(diction):
|
||||
try:
|
||||
diction = mycommon.strip_dictionary(diction)
|
||||
|
||||
"""
|
||||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token','class_external_code', 'tab_ue_id', 'tab_session_id', 'tab_inscrit_id',
|
||||
'jury_apprenant_agenda_id', 'tab_domaine_competence_id', 'tab_diplome_id', 'rattrapage',
|
||||
'semestre']
|
||||
|
||||
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', ]
|
||||
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 la liste des arguments ")
|
||||
return False, " Les informations fournies sont incorrectes",
|
||||
|
||||
"""
|
||||
Verification de l'identité et autorisation de l'entité qui
|
||||
appelle cette API
|
||||
"""
|
||||
token = ""
|
||||
if ("token" in diction.keys()):
|
||||
if diction['token']:
|
||||
token = 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
|
||||
|
||||
filt_session_id = {}
|
||||
if( "tab_session_id" in diction.keys() ):
|
||||
tab_session_id = str(diction['tab_session_id']).split(",")
|
||||
if(len(tab_session_id) > 0 ):
|
||||
filt_session_id = {'session_id':{'$in': tab_session_id }}
|
||||
|
||||
|
||||
filt_ue_id = {}
|
||||
if ("tab_ue_id" in diction.keys()):
|
||||
tab_ue_id = str(diction['tab_ue_id']).split(",")
|
||||
if (len(tab_ue_id) > 0):
|
||||
filt_ue_id = {'ue_id': {'$in': tab_ue_id}}
|
||||
|
||||
filt_tab_diplome_id = {}
|
||||
if ("tab_diplome_id" in diction.keys()):
|
||||
tab_diplome_id = str(diction['tab_diplome_id']).split(",")
|
||||
if (len(tab_diplome_id) > 0):
|
||||
filt_tab_diplome_id = {'diplome_id': {'$in': tab_diplome_id}}
|
||||
|
||||
|
||||
filt_tab_domaine_competence_id = {}
|
||||
if ("tab_domaine_competence_id" in diction.keys()):
|
||||
tab_domaine_competence_id = str(diction['tab_domaine_competence_id']).split(",")
|
||||
if (len(tab_domaine_competence_id) > 0):
|
||||
filt_tab_domaine_competence_id = {'domaine_competence_id': {'$in': tab_domaine_competence_id}}
|
||||
|
||||
filt_rattrapage = {'rattrapage': {"$ne":"1"} }
|
||||
if ("rattrapage" in diction.keys() and diction['rattrapage'] == "1"):
|
||||
filt_rattrapage = {'rattrapage': "1"}
|
||||
|
||||
|
||||
filt_inscrit_id = {}
|
||||
if ("tab_inscrit_id" in diction.keys()):
|
||||
tab_inscrit_id = str(diction['tab_inscrit_id']).split(",")
|
||||
if (len(tab_inscrit_id) > 0):
|
||||
filt_inscrit_id = {'inscrit_id': {'$in': tab_inscrit_id}}
|
||||
|
||||
|
||||
|
||||
"""
|
||||
Clés de mise à jour
|
||||
"""
|
||||
data_cle = {}
|
||||
data_cle['partner_owner_recid'] = str(my_partner['recid'])
|
||||
data_cle['valide'] = "1"
|
||||
data_cle['locked'] = "0"
|
||||
|
||||
query = {"$and": [filt_session_id, filt_ue_id, data_cle, filt_inscrit_id, filt_rattrapage, filt_tab_domaine_competence_id, filt_tab_diplome_id]}
|
||||
|
||||
print(" ### Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter query = ", query)
|
||||
|
||||
RetObject = []
|
||||
val_tmp = 0
|
||||
|
||||
for retval in MYSY_GV.dbname['work_calcul_moyenne_by_ue_bc_diplome_session_semestre'].find(query).sort([("ue_id", pymongo.DESCENDING),("inscription_id", pymongo.DESCENDING),
|
||||
("type_eval_id", pymongo.DESCENDING), ]):
|
||||
user = retval
|
||||
user['id'] = str(val_tmp)
|
||||
val_tmp = val_tmp + 1
|
||||
|
||||
if ("jury_note" not in retval.keys()):
|
||||
user['jury_note'] = ""
|
||||
|
||||
if ("jury_observation" not in retval.keys()):
|
||||
user['jury_observation'] = ""
|
||||
|
||||
if ("jury_validation" not in retval.keys()):
|
||||
user['jury_validation'] = ""
|
||||
|
||||
if ("jury_validation_champ_technique" not in retval.keys()):
|
||||
user['jury_validation_champ_technique'] = ""
|
||||
|
||||
|
||||
ue_id_code = ""
|
||||
if( "ue_id" in retval.keys() ):
|
||||
ue_id_data = MYSY_GV.dbname['unite_enseignement'].find_one({'_id':ObjectId(str(retval['ue_id'])),
|
||||
'partner_owner_recid':my_partner['recid'],
|
||||
'valide':'1',
|
||||
'locked':'0'},
|
||||
{'code':1})
|
||||
if( ue_id_data and "code" in ue_id_data.keys() ):
|
||||
ue_id_code = ue_id_data['code']
|
||||
|
||||
user['ue_id_code'] = ue_id_code
|
||||
|
||||
class_id_external_code = ""
|
||||
if ("class_id" in retval.keys()):
|
||||
class_id_data = MYSY_GV.dbname['myclass'].find_one({'_id': ObjectId(str(retval['ue_id'])),
|
||||
'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',
|
||||
'locked': '0'},
|
||||
{'external_code': 1})
|
||||
if (class_id_data and "external_code" in class_id_data.keys()):
|
||||
class_id_external_code = class_id_data['external_code']
|
||||
|
||||
user['class_id_external_code'] = class_id_external_code
|
||||
|
||||
inscription_id_nom = ""
|
||||
inscription_id_prenom = ""
|
||||
inscription_id_mail = ""
|
||||
if ("inscrit_id" in retval.keys()):
|
||||
inscription_id_data = MYSY_GV.dbname['inscription'].find_one({'_id': ObjectId(str(retval['inscrit_id'])),
|
||||
'partner_owner_recid': my_partner['recid'],
|
||||
'valide': '1',},
|
||||
{'email': 1, 'nom':1, 'prenom':1})
|
||||
|
||||
if (inscription_id_data and "email" in inscription_id_data.keys()):
|
||||
inscription_id_mail = inscription_id_data['email']
|
||||
|
||||
if (inscription_id_data and "nom" in inscription_id_data.keys()):
|
||||
inscription_id_nom = inscription_id_data['nom']
|
||||
|
||||
if (inscription_id_data and "prenom" in inscription_id_data.keys()):
|
||||
inscription_id_prenom = inscription_id_data['prenom']
|
||||
|
||||
|
||||
user['inscription_id_mail'] = inscription_id_mail
|
||||
user['inscription_id_nom'] = inscription_id_nom
|
||||
user['inscription_id_prenom'] = inscription_id_prenom
|
||||
|
||||
#print(" ## useruser = ", user)
|
||||
RetObject.append(mycommon.JSONEncoder().encode(user))
|
||||
|
||||
|
||||
return True, RetObject
|
||||
|
||||
|
||||
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 de récupérer la liste des évaluations "
|
||||
|
|
|
|||
31
class_mgt.py
31
class_mgt.py
|
|
@ -7971,7 +7971,7 @@ def Add_Update_UE_To_Class(diction):
|
|||
Verification des input acceptés
|
||||
"""
|
||||
field_list = ['token', 'class_id', 'ue_id', 'credit', 'pres_dist_hyp', 'is_noted',
|
||||
'coefficient', 'seuil_validation', ]
|
||||
'coefficient', 'seuil_validation', 'diplome_id', 'domaine_competence_id' ]
|
||||
|
||||
incom_keys = diction.keys()
|
||||
for val in incom_keys:
|
||||
|
|
@ -8088,12 +8088,21 @@ def Add_Update_UE_To_Class(diction):
|
|||
"""
|
||||
is_ue_id_existe_class = 0
|
||||
if( "list_unite_enseignement" in is_class_exist_data.keys()):
|
||||
is_ue_id_existe_class = MYSY_GV.dbname['myclass'].count_documents({'list_unite_enseignement._id':str(diction['ue_id']),
|
||||
is_ue_id_existe_class = MYSY_GV.dbname['myclass'].count_documents({
|
||||
'_id': ObjectId(str(diction['class_id'])),
|
||||
'partner_owner_recid': my_partner[
|
||||
'recid'],
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'list_unite_enseignement': {
|
||||
'$elemMatch': {
|
||||
'_id': str(diction['ue_id']),
|
||||
'diplome_id': str(
|
||||
diction['diplome_id']),
|
||||
'domaine_competence_id': str(
|
||||
diction['domaine_competence_id'])
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -8107,8 +8116,16 @@ def Add_Update_UE_To_Class(diction):
|
|||
my_partner['recid']),
|
||||
'valide': '1',
|
||||
'locked': '0',
|
||||
'list_unite_enseignement._id': str(
|
||||
diction['ue_id'])},
|
||||
'list_unite_enseignement': {
|
||||
'$elemMatch': {
|
||||
'_id': str(diction['ue_id']),
|
||||
'diplome_id': str(
|
||||
diction['diplome_id']),
|
||||
'domaine_competence_id': str(
|
||||
diction['domaine_competence_id'])
|
||||
}
|
||||
}
|
||||
},
|
||||
{'$set':
|
||||
{
|
||||
'list_unite_enseignement.$[xxx].credit': str(
|
||||
|
|
@ -8129,7 +8146,11 @@ def Add_Update_UE_To_Class(diction):
|
|||
},
|
||||
upsert=False,
|
||||
array_filters=[
|
||||
{"xxx._id": str(diction['ue_id'])}
|
||||
{
|
||||
"xxx._id": str(diction['ue_id']),
|
||||
'xxx.diplome_id': str(diction['diplome_id']),
|
||||
'xxx.domaine_competence_id': str(diction['domaine_competence_id'])
|
||||
}
|
||||
]
|
||||
|
||||
)
|
||||
|
|
|
|||
15
main.py
15
main.py
|
|
@ -18154,7 +18154,7 @@ def Create_work_evaluation_participant_note():
|
|||
|
||||
|
||||
"""
|
||||
API de test de calcul des moyennes en logique : Bloc Compétence / UE
|
||||
API de calcul des moyennes en logique : Bloc Compétence / UE / Diplome
|
||||
Avec des filtre sur la formation, le rattrapge
|
||||
"""
|
||||
@app.route('/myclass/api/Calcul_Moyen_evaluation_participant_note_BC_UE', methods=['POST','GET'])
|
||||
|
|
@ -18167,6 +18167,19 @@ def Calcul_Moyen_evaluation_participant_note_BC_UE():
|
|||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
"""
|
||||
API de recuperation de note calculé par Bloc Compétence / UE / Diplome
|
||||
"""
|
||||
@app.route('/myclass/api/Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter', methods=['POST','GET'])
|
||||
@crossdomain(origin='*')
|
||||
def Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter():
|
||||
# On recupere le corps (payload) de la requete
|
||||
payload = mycommon.strip_dictionary(request.form.to_dict())
|
||||
print(" ### Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter : payload = ",payload)
|
||||
localStatus, message= base_class_calcul_note.Get_List_Evaluation_by_ue_bc_diplome_session_semestre_With_Filter(payload)
|
||||
return jsonify(status=localStatus, message=message )
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
|
|||
Loading…
Reference in New Issue