diff --git a/parcoursup/app.riot b/parcoursup/app.riot index 7ba92e0..0760a8a 100644 --- a/parcoursup/app.riot +++ b/parcoursup/app.riot @@ -21,12 +21,48 @@
0 }> +

Comparateur

+ +

Choisis ton profil pour comparer les formations sélectionnées.

+ +
+
+
+ +
+ +
+
+ +
+
+ +
+

Formations sélectionnées

-
+
+

{ f.nom }

+

Ville : { f.ville }

+

Filière : { f.filiere }

+

Taux d'accès : { f.tauxAcces }%

- { f.nom } — { f.ville } — taux : { f.tauxAcces }% + Profil admis : + Général { f.pctGeneral }% / Techno { f.pctTechno }% / Pro { f.pctPro }%

+

Estimation : { estimateFormation(f) }

@@ -46,7 +82,9 @@ hasSearched: false, results: [], selected: null, - selectedFormations: [] + selectedFormations: [], + note: 12, + serie: 'general' }, async launchSearch(query) { @@ -109,6 +147,56 @@ this.update({ selected: null }) + }, + + updateNote(event) { + this.update({ + note: Number(event.target.value) + }) + }, + + updateSerie(event) { + this.update({ + serie: event.target.value + }) + }, + + estimateFormation(formation) { + let score = 0 + + if (formation.tauxAcces >= 50) { + score += 2 + } else if (formation.tauxAcces >= 20) { + score += 1 + } + + if (this.state.note >= 15) { + score += 2 + } else if (this.state.note >= 12) { + score += 1 + } + + if (this.state.serie === 'general' && formation.pctGeneral >= 50) { + score += 2 + } + + if (this.state.serie === 'techno' && formation.pctTechno >= 20) { + score += 2 + } + + if (this.state.serie === 'pro' && formation.pctPro >= 15) { + score += 2 + } + + if (score >= 5) { + return 'Favorable' + } + + if (score >= 3) { + return 'Possible' + } + + return 'Difficile' } }