diff --git a/components/school.riot b/components/school.riot index 2110d5d..61ee3b2 100644 --- a/components/school.riot +++ b/components/school.riot @@ -21,11 +21,11 @@ - {etablissement.g_ea_lib_vx} - {etablissement.ville_etab} - {etablissement.dep} - {etablissement.list_com} - {etablissement.taux_acces_ens} + {etablissement.fields.g_ea_lib_vx} + {etablissement.fields.ville_etab} + {etablissement.fields.dep} + {etablissement.fields.list_com} + {etablissement.fields.taux_acces_ens} @@ -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..57b8f9c 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: 'expr109', + selector: '[expr109]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, - evaluate: _scope => _scope.etablissement.g_ea_lib_vx + evaluate: _scope => _scope.etablissement.fields.g_ea_lib_vx }] }, { - redundantAttribute: 'expr92', - selector: '[expr92]', + redundantAttribute: 'expr110', + selector: '[expr110]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, - evaluate: _scope => _scope.etablissement.ville_etab + evaluate: _scope => _scope.etablissement.fields.ville_etab }] }, { - redundantAttribute: 'expr93', - selector: '[expr93]', + redundantAttribute: 'expr111', + selector: '[expr111]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, - evaluate: _scope => _scope.etablissement.dep + evaluate: _scope => _scope.etablissement.fields.dep }] }, { - redundantAttribute: 'expr94', - selector: '[expr94]', + redundantAttribute: 'expr112', + selector: '[expr112]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, - evaluate: _scope => _scope.etablissement.list_com + evaluate: _scope => _scope.etablissement.fields.list_com }] }, { - redundantAttribute: 'expr95', - selector: '[expr95]', + redundantAttribute: 'expr113', + selector: '[expr113]', expressions: [{ type: expressionTypes.TEXT, childNodeIndex: 0, - evaluate: _scope => _scope.etablissement.taux_acces_ens + evaluate: _scope => _scope.etablissement.fields.taux_acces_ens }] }]), - redundantAttribute: 'expr90', - selector: '[expr90]', + redundantAttribute: 'expr108', + selector: '[expr108]', itemName: 'etablissement', indexName: null, evaluate: _scope => _scope.state.items diff --git a/javascript/search.js b/javascript/search.js index 2bc31e5..3a22305 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"]; } }