From 5ed4cf20019ff34a35b2b0c219495a4f1c582658 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ha=C3=AFssous?= Date: Tue, 28 Mar 2023 16:54:41 +0200 Subject: [PATCH] fix coquille --- components/school.riot | 21 +++++++++++---------- javascript/parcoursup-link.js | 2 +- javascript/school.js | 29 ++++++++++++++--------------- javascript/search.js | 1 - 4 files changed, 26 insertions(+), 27 deletions(-) diff --git a/components/school.riot b/components/school.riot index 2110d5d..a647513 100644 --- a/components/school.riot +++ b/components/school.riot @@ -53,16 +53,17 @@ }) console.log(this.state.items) this.state.items.forEach(etablissement => { - // calcul la moyenne - let pct_sansmention = etablissement.fields.pct_sansmention - let pct_AB = etablissement.fields.pct_ab - let pct_B = etablissement.fields.pct_b - let pct_TB = etablissement.fields.pct_tb - let pct_TBF = etablissement.fields.pct_tbf - - let moyenne = ((pct_TBF*18)+(pct_TB*16)+(pct_B*14)+(pct_AB*12)+(pct_sansmention*10))/100 - - etablissement.fields['list_com']=moyenne + // calcul la moyenne + let pct_sansmention = etablissement.fields.pct_sansmention + let pct_AB = etablissement.fields.pct_ab + let pct_B = etablissement.fields.pct_b + let pct_TB = etablissement.fields.pct_tb + let pct_TBF = etablissement.fields.pct_tbf + + let moyenne = ((pct_TBF*18)+(pct_TB*16)+(pct_B*14)+(pct_AB*12)+(pct_sansmention*10))/100 + + etablissement.fields['list_com']=moyenne + }) }) } } diff --git a/javascript/parcoursup-link.js b/javascript/parcoursup-link.js index bfb5e8b..9a86dc2 100644 --- a/javascript/parcoursup-link.js +++ b/javascript/parcoursup-link.js @@ -33,7 +33,7 @@ class PAPI { static async fetchEtablissement(filiere, sousfiliere, soussousfiliere) { let request = await fetch(`${PAPI.searchURL}&refine.fil_lib_voe_acc=${soussousfiliere}&refine.form_lib_voe_acc=${sousfiliere}&refine.fili=${filiere}`) let result = await request.json() - console.log(result["records"]) + return result["records"] } } diff --git a/javascript/school.js b/javascript/school.js index 6dbc3c4..98afd3d 100644 --- a/javascript/school.js +++ b/javascript/school.js @@ -25,7 +25,6 @@ class PAPI { static async fetchEtablissement(filiere, sousfiliere, soussousfiliere) { let request = await fetch(`${PAPI.searchURL}&refine.fil_lib_voe_acc=${soussousfiliere}&refine.form_lib_voe_acc=${sousfiliere}&refine.fili=${filiere}`); let result = await request.json(); - console.log(result["records"]); return result["records"]; } } @@ -63,53 +62,53 @@ var school = { } }; }, - template: (template, expressionTypes, bindingTypes, getComponent) => template('
NomVilleDptMoyenneSélectivité
', [{ + template: (template, expressionTypes, bindingTypes, getComponent) => template('
NomVilleDptMoyenneSélectivité
', [{ type: bindingTypes.EACH, getKey: null, condition: null, - template: template(' ', [{ - redundantAttribute: 'expr91', - selector: '[expr91]', + template: template(' ', [{ + redundantAttribute: 'expr103', + selector: '[expr103]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => _scope.etablissement.g_ea_lib_vx }] }, { - redundantAttribute: 'expr92', - selector: '[expr92]', + redundantAttribute: 'expr104', + selector: '[expr104]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => _scope.etablissement.ville_etab }] }, { - redundantAttribute: 'expr93', - selector: '[expr93]', + redundantAttribute: 'expr105', + selector: '[expr105]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => _scope.etablissement.dep }] }, { - redundantAttribute: 'expr94', - selector: '[expr94]', + redundantAttribute: 'expr106', + selector: '[expr106]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => _scope.etablissement.list_com }] }, { - redundantAttribute: 'expr95', - selector: '[expr95]', + redundantAttribute: 'expr107', + selector: '[expr107]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, evaluate: _scope => _scope.etablissement.taux_acces_ens }] }]), - redundantAttribute: 'expr90', - selector: '[expr90]', + redundantAttribute: 'expr102', + selector: '[expr102]', itemName: 'etablissement', indexName: null, evaluate: _scope => _scope.state.items diff --git a/javascript/search.js b/javascript/search.js index 5b96d43..0e58cb0 100644 --- a/javascript/search.js +++ b/javascript/search.js @@ -25,7 +25,6 @@ class PAPI { static async fetchEtablissement(filiere, sousfiliere, soussousfiliere) { let request = await fetch(`${PAPI.searchURL}&refine.fil_lib_voe_acc=${soussousfiliere}&refine.form_lib_voe_acc=${sousfiliere}&refine.fili=${filiere}`); let result = await request.json(); - console.log(result["records"]); return result["records"]; } }