diff --git a/parcoursup/api.js b/parcoursup/api.js index 20b2c65..8766324 100644 --- a/parcoursup/api.js +++ b/parcoursup/api.js @@ -1,34 +1,35 @@ -export function buildURL(query, limit = 20, offset = 0, filters = {}) { - let url = - "https://data.enseignementsup-recherche.gouv.fr/api/explore/v2.1/catalog/datasets/fr-esr-parcoursup/records?" +// Construire l'URL de requête vers l'API Parcoursup +export function construireURL(requete, limite = 20, decalage = 0, filtres = {}) { - url += "limit=" + limit - url += "&offset=" + offset + var url = "https://data.enseignementsup-recherche.gouv.fr/api/explore/v2.1/catalog/datasets/fr-esr-parcoursup/records?" + + url += "limit=" + limite + url += "&offset=" + decalage var conditions = [] - if (query && query.trim() !== "") { - conditions.push("search(lib_for_voe_ins, '" + query + "')") + if (requete && requete.trim() !== "") { + conditions.push("search(lib_for_voe_ins, '" + requete + "')") } - if (filters.filiere && filters.filiere !== "") { - conditions.push("fili='" + filters.filiere + "'") + if (filtres.filiere && filtres.filiere !== "") { + conditions.push("fili='" + filtres.filiere + "'") } - if (filters.selectivite && filters.selectivite !== "") { - conditions.push("select_form='" + filters.selectivite + "'") + if (filtres.selectivite && filtres.selectivite !== "") { + conditions.push("select_form='" + filtres.selectivite + "'") } - if (filters.region && filters.region !== "") { - conditions.push("region_etab_aff='" + filters.region + "'") + if (filtres.region && filtres.region !== "") { + conditions.push("region_etab_aff='" + filtres.region + "'") } - if (filters.tauxMin && filters.tauxMin > 0) { - conditions.push("taux_acces_ens>=" + filters.tauxMin) + if (filtres.tauxMin && filtres.tauxMin > 0) { + conditions.push("taux_acces_ens>=" + filtres.tauxMin) } - if (filters.tauxMax && filters.tauxMax < 100) { - conditions.push("taux_acces_ens<=" + filters.tauxMax) + if (filtres.tauxMax && filtres.tauxMax < 100) { + conditions.push("taux_acces_ens<=" + filtres.tauxMax) } if (conditions.length > 0) { @@ -38,19 +39,23 @@ export function buildURL(query, limit = 20, offset = 0, filters = {}) { return url } -export async function fetchFormations(query, limit = 20, offset = 0, filters = {}) { - const url = buildURL(query, limit, offset, filters) - const response = await fetch(url) +// Charger les formations depuis l'API Parcoursup +export async function chargerFormations(requete, limite = 20, decalage = 0, filtres = {}) { - if (!response.ok) { + var url = construireURL(requete, limite, decalage, filtres) + var reponse = await fetch(url) + + if (!reponse.ok) { throw new Error("Erreur HTTP") } - return await response.json() + return await reponse.json() } -export async function fetchFormationHistory(codUai, nomFormation) { - var datasets = { +// Charger l'historique d'une formation sur plusieurs années +export async function chargerHistoriqueFormation(codUai, nomFormation) { + + var jeuDeDonnees = { 2020: "fr-esr-parcoursup_2020", 2021: "fr-esr-parcoursup_2021", 2022: "fr-esr-parcoursup_2022", @@ -59,54 +64,59 @@ export async function fetchFormationHistory(codUai, nomFormation) { 2025: "fr-esr-parcoursup" } - var history = [] - var searchName = nomFormation.substring(0, 40).replace(/'/g, "\\'") - var years = [2020, 2021, 2022, 2023, 2024, 2025] + var historique = [] + var nomCourt = nomFormation.substring(0, 40).replace(/'/g, "\\'") + var annees = [2020, 2021, 2022, 2023, 2024, 2025] - for (var i = 0; i < years.length; i++) { - var year = years[i] - var dataset = datasets[year] + for (var i = 0; i < annees.length; i++) { + + var annee = annees[i] + var dataset = jeuDeDonnees[annee] try { + var url = "https://data.enseignementsup-recherche.gouv.fr/api/explore/v2.1/catalog/datasets/" + dataset + "/records?" + "limit=5" - + "&where=cod_uai%3D'" + codUai + "' AND search(lib_for_voe_ins, '" + searchName + "')" + + "&where=cod_uai%3D'" + codUai + "' AND search(lib_for_voe_ins, '" + nomCourt + "')" + "&select=cod_uai,lib_for_voe_ins,voe_tot,acc_tot,pct_sansmention,pct_ab,pct_b,pct_tb,pct_tbf,pct_bg,pct_bt,pct_bp" - var response = await fetch(url) + var reponse = await fetch(url) - if (response.ok) { - var data = await response.json() + if (reponse.ok) { - if (data.results && data.results.length > 0) { - var r = data.results[0] - var taux = 0 + var donnees = await reponse.json() - if (r.voe_tot && r.voe_tot > 0) { - taux = Math.round((r.acc_tot / r.voe_tot) * 100) + if (donnees.results && donnees.results.length > 0) { + + var ligne = donnees.results[0] + var taux = 0 + + if (ligne.voe_tot && ligne.voe_tot > 0) { + taux = Math.round((ligne.acc_tot / ligne.voe_tot) * 100) } - history.push({ - annee: year, - tauxAcces: taux, - candidats: r.voe_tot || 0, - admis: r.acc_tot || 0, - pctSansMention: r.pct_sansmention || 0, - pctAB: r.pct_ab || 0, - pctB: r.pct_b || 0, - pctTB: r.pct_tb || 0, - pctTBF: r.pct_tbf || 0, - pctGeneral: r.pct_bg || 0, - pctTechno: r.pct_bt || 0, - pctPro: r.pct_bp || 0 + historique.push({ + annee: annee, + tauxAcces: taux, + candidats: ligne.voe_tot || 0, + admis: ligne.acc_tot || 0, + pctSansMention: ligne.pct_sansmention || 0, + pctAB: ligne.pct_ab || 0, + pctB: ligne.pct_b || 0, + pctTB: ligne.pct_tb || 0, + pctTBF: ligne.pct_tbf || 0, + pctGeneral: ligne.pct_bg || 0, + pctTechno: ligne.pct_bt || 0, + pctPro: ligne.pct_bp || 0 }) } } + } catch (e) { - console.warn("Erreur pour " + year + ":", e) + console.warn("Erreur pour l'année " + annee + " :", e) } } - return history + return historique } diff --git a/parcoursup/app.riot b/parcoursup/app.riot index 34d8e93..6072d0b 100644 --- a/parcoursup/app.riot +++ b/parcoursup/app.riot @@ -9,7 +9,7 @@ 0 }> { state.selectedFormations.length } sélection(s) - + @@ -18,7 +18,7 @@
- +

{ state.query } — { state.total } résultat(s) @@ -32,16 +32,16 @@ results={ state.results } hasSearched={ state.hasSearched } loading={ state.loading } - ondetail={ showDetail } - onselect={ addToSelection }> + ondetail={ afficherDetail } + onselect={ ajouterSelection }>

@@ -53,7 +53,7 @@
+ onback={ retourRecherche }>
@@ -64,7 +64,7 @@
- +
0 }>

Comparateur de formations

@@ -80,13 +80,13 @@ max="20" step="0.1" value={ state.note } - oninput={ updateNote } + oninput={ mettreAJourNote } />

- @@ -95,7 +95,7 @@

- @@ -104,11 +104,11 @@
- +
-
+

{ f.nom }

Établissement : { f.etablissement }

@@ -125,13 +125,13 @@

- - { estimateFormation(f) } + + { estimerFormation(f) } - { getEstimateDetail(f) } + { detailEstimation(f) }

-
@@ -167,7 +167,7 @@ onMounted() { var saved = localStorage.getItem('selectionFormations') - var self = this + var soi = this // Charger la sélection locale si elle existe if (saved) { @@ -181,15 +181,15 @@ // Écouter les changements de connexion Firebase window.firebaseServices.onUserChanged(function(user) { - self.update({ user: user }) + soi.update({ user: user }) // Si un utilisateur vient de se connecter, charger sa sélection depuis Firestore if (user) { window.firebaseServices.loadUserData(user.uid) - .then(function(data) { - if (data && data.selection) { - self.update({ selectedFormations: data.selection }) - localStorage.setItem('selectionFormations', JSON.stringify(data.selection)) + .then(function(donnees) { + if (donnees && donnees.selection) { + soi.update({ selectedFormations: donnees.selection }) + localStorage.setItem('selectionFormations', JSON.stringify(donnees.selection)) } }) .catch(function(err) { @@ -200,26 +200,26 @@ }) window.addEventListener('hashchange', function() { - self.handleRoute() + soi.gererRoute() }) - this.handleRoute() + this.gererRoute() }, // Appelée après une connexion ou inscription réussie - onUserAuth() { + surConnexion() { // L'écouteur onUserChanged dans onMounted gère automatiquement le reste }, // Appelée après une déconnexion - onUserLogout() { + surDeconnexion() { // On vide la sélection : l'utilisateur doit se reconnecter pour retrouver ses formations this.update({ selectedFormations: [] }) localStorage.removeItem('selectionFormations') }, // Sauvegarder la sélection en local ET dans Firestore si connecté - async saveSelection(selection) { + async sauvegarderSelection(selection) { localStorage.setItem('selectionFormations', JSON.stringify(selection)) @@ -233,22 +233,22 @@ }, - handleRoute() { - var hash = window.location.hash || '#/' - var path = hash.slice(1) || '/' + gererRoute() { + var ancre = window.location.hash || '#/' + var chemin = ancre.slice(1) || '/' - if (path.startsWith('/formation/')) { - var id = decodeURIComponent(path.replace('/formation/', '')) + if (chemin.startsWith('/formation/')) { + var id = decodeURIComponent(chemin.replace('/formation/', '')) this.update({ view: 'detail' }) - this.loadFormationById(id) - } else if (path === '/comparateur') { + this.chargerFormationParId(id) + } else if (chemin === '/comparateur') { this.update({ view: 'comparateur', selected: null }) } else { this.update({ view: 'search', selected: null }) } }, - async loadFormationById(id) { + async chargerFormationParId(id) { var i for (i = 0; i < this.state.results.length; i++) { @@ -266,168 +266,173 @@ } try { - var parts = id.split('-') - var searchTerm = parts.slice(1).join(' ').substring(0, 30) + var parties = id.split('-') + var motCle = parties.slice(1).join(' ').substring(0, 30) - if (searchTerm) { - var data = await window.fetchFormations(searchTerm, 10, 0) + if (motCle) { + var donnees = await window.chargerFormations(motCle, 10, 0) - if (data.results && data.results.length > 0) { - for (i = 0; i < data.results.length; i++) { - var f = window.createFormation(data.results[i]) - if (f.id === id) { - this.update({ selected: f }) + if (donnees.results && donnees.results.length > 0) { + for (i = 0; i < donnees.results.length; i++) { + var formation = window.creerFormation(donnees.results[i]) + if (formation.id === id) { + this.update({ selected: formation }) return } } - this.update({ selected: window.createFormation(data.results[0]) }) + this.update({ selected: window.creerFormation(donnees.results[0]) }) } } - } catch (error) { - console.error('Erreur chargement formation:', error) + } catch (erreur) { + console.error('Erreur chargement formation :', erreur) } }, - showDetail(index) { + afficherDetail(index) { var formation = this.state.results[index] this.update({ selected: formation, view: 'detail' }) window.location.hash = '#/formation/' + encodeURIComponent(formation.id) }, - goToSearch() { + retourRecherche() { window.location.hash = '#/' }, - async launchSearch(query, filters) { + async lancerRecherche(requete, filtres) { this.update({ loading: true, hasSearched: true, selected: null, view: 'search', - query: query, - filters: filters || {}, + query: requete, + filters: filtres || {}, page: 1 }) window.location.hash = '#/' - await this.loadPage(1) + await this.chargerPage(1) }, - async loadPage(page) { + async chargerPage(page) { this.update({ loading: true }) try { - var offset = (page - 1) * this.state.limit + var decalage = (page - 1) * this.state.limit - var data = await window.fetchFormations( + var donnees = await window.chargerFormations( this.state.query, this.state.limit, - offset, + decalage, this.state.filters ) var formations = [] - if (data.results) { - for (var i = 0; i < data.results.length; i++) { - var raw = data.results[i] - formations.push(window.createFormation(raw)) + if (donnees.results) { + for (var i = 0; i < donnees.results.length; i++) { + var brut = donnees.results[i] + formations.push(window.creerFormation(brut)) } } + var total = 0 + + if (donnees.total_count) { + total = donnees.total_count + } + this.update({ results: formations, - total: data.total_count ? data.total_count : 0, - page: page, + total: total, + page: page, loading: false }) - } catch (error) { - console.error(error) + } catch (erreur) { + console.error(erreur) this.update({ results: [], - total: 0, + total: 0, loading: false }) } }, - getTotalPages() { + nombreTotalPages() { return Math.ceil(this.state.total / this.state.limit) }, - async nextPage() { - if (this.state.page < this.getTotalPages()) { - await this.loadPage(this.state.page + 1) + async pageSuivante() { + if (this.state.page < this.nombreTotalPages()) { + await this.chargerPage(this.state.page + 1) } }, - async previousPage() { + async pagePrecedente() { if (this.state.page > 1) { - await this.loadPage(this.state.page - 1) + await this.chargerPage(this.state.page - 1) } }, - addToSelection(index) { - var formation = this.state.results[index] - var selection = this.state.selectedFormations.slice() - - var exists = false + ajouterSelection(index) { + var formation = this.state.results[index] + var selection = this.state.selectedFormations.slice() + var dejaAjout = false for (var i = 0; i < selection.length; i++) { if (selection[i].id === formation.id) { - exists = true + dejaAjout = true } } - if (!exists) { + if (!dejaAjout) { selection.push(formation) this.update({ selectedFormations: selection }) - this.saveSelection(selection) + this.sauvegarderSelection(selection) } }, - removeFromSelection(id) { - var newSelection = [] + retirerSelection(id) { + var nouvelleSelection = [] for (var i = 0; i < this.state.selectedFormations.length; i++) { var f = this.state.selectedFormations[i] if (f.id !== id) { - newSelection.push(f) + nouvelleSelection.push(f) } } - this.update({ selectedFormations: newSelection }) - this.saveSelection(newSelection) + this.update({ selectedFormations: nouvelleSelection }) + this.sauvegarderSelection(nouvelleSelection) }, - clearSelection() { + viderSelection() { this.update({ selectedFormations: [] }) - this.saveSelection([]) + this.sauvegarderSelection([]) }, - updateNote(e) { + mettreAJourNote(e) { this.update({ note: Number(e.target.value) }) }, - updateSerie(e) { + mettreAJourSerie(e) { this.update({ serie: e.target.value }) }, - updateSort(e) { + mettreAJourTri(e) { this.update({ sortBy: e.target.value }) }, - getSortedSelection() { + obtenirSelectionTriee() { var selection = this.state.selectedFormations.slice() + var soi = this if (this.state.sortBy === 'taux') { selection.sort(function(a, b) { return b.tauxAcces - a.tauxAcces }) } else if (this.state.sortBy === 'ville') { selection.sort(function(a, b) { return a.ville.localeCompare(b.ville) }) } else if (this.state.sortBy === 'estimation') { - var self = this - selection.sort(function(a, b) { return self.getScore(b) - self.getScore(a) }) + selection.sort(function(a, b) { return soi.calculerScore(b) - soi.calculerScore(a) }) } else { selection.sort(function(a, b) { return a.nom.localeCompare(b.nom) }) } @@ -435,77 +440,134 @@ return selection }, - getSeriePercent(f) { - if (this.state.serie === 'general') return f.pctGeneral || 0 - if (this.state.serie === 'techno') return f.pctTechno || 0 - if (this.state.serie === 'pro') return f.pctPro || 0 + pourcentageSerie(f) { + if (this.state.serie === 'general') { + return f.pctGeneral || 0 + } + if (this.state.serie === 'techno') { + return f.pctTechno || 0 + } + if (this.state.serie === 'pro') { + return f.pctPro || 0 + } return 0 }, - getScore(f) { - var score = 0 - var note = this.state.note + calculerScore(f) { + var score = 0 + var note = this.state.note var tauxAcces = f.tauxAcces || 0 - var seriePct = this.getSeriePercent(f) + var pctSerie = this.pourcentageSerie(f) - if (tauxAcces >= 80) score += 30 - else if (tauxAcces >= 50) score += 24 - else if (tauxAcces >= 30) score += 16 - else if (tauxAcces >= 15) score += 8 - else score += 2 + if (tauxAcces >= 80) { + score += 30 + } else if (tauxAcces >= 50) { + score += 24 + } else if (tauxAcces >= 30) { + score += 16 + } else if (tauxAcces >= 15) { + score += 8 + } else { + score += 2 + } - if (note >= 17) score += 40 - else if (note >= 15) score += 32 - else if (note >= 13) score += 22 - else if (note >= 11) score += 14 - else if (note >= 9) score += 6 - else score += 0 + if (note >= 17) { + score += 40 + } else if (note >= 15) { + score += 32 + } else if (note >= 13) { + score += 22 + } else if (note >= 11) { + score += 14 + } else if (note >= 9) { + score += 6 + } else { + score += 0 + } - if (seriePct >= 60) score += 30 - else if (seriePct >= 40) score += 24 - else if (seriePct >= 20) score += 16 - else if (seriePct >= 5) score += 8 - else score += 0 + if (pctSerie >= 60) { + score += 30 + } else if (pctSerie >= 40) { + score += 24 + } else if (pctSerie >= 20) { + score += 16 + } else if (pctSerie >= 5) { + score += 8 + } else { + score += 0 + } return score }, - estimateFormation(f) { - var score = this.getScore(f) + estimerFormation(f) { + var score = this.calculerScore(f) - if (score >= 85) return 'Très favorable' - if (score >= 65) return 'Favorable' - if (score >= 45) return 'Possible' - if (score >= 25) return 'Difficile' + if (score >= 85) { + return 'Très favorable' + } + if (score >= 65) { + return 'Favorable' + } + if (score >= 45) { + return 'Possible' + } + if (score >= 25) { + return 'Difficile' + } return 'Très difficile' }, - getEstimateClass(f) { - var result = this.estimateFormation(f) + classeEstimation(f) { + var resultat = this.estimerFormation(f) - if (result === 'Très favorable') return 'estimate tres-favorable' - if (result === 'Favorable') return 'estimate favorable' - if (result === 'Possible') return 'estimate possible' - if (result === 'Difficile') return 'estimate difficile' + if (resultat === 'Très favorable') { + return 'estimate tres-favorable' + } + if (resultat === 'Favorable') { + return 'estimate favorable' + } + if (resultat === 'Possible') { + return 'estimate possible' + } + if (resultat === 'Difficile') { + return 'estimate difficile' + } return 'estimate tres-difficile' }, - getCardClass(f) { - var result = this.estimateFormation(f) + classeCarte(f) { + var resultat = this.estimerFormation(f) - if (result === 'Très favorable') return 'card card-tres-favorable' - if (result === 'Favorable') return 'card card-favorable' - if (result === 'Possible') return 'card card-possible' - if (result === 'Difficile') return 'card card-difficile' + if (resultat === 'Très favorable') { + return 'card card-tres-favorable' + } + if (resultat === 'Favorable') { + return 'card card-favorable' + } + if (resultat === 'Possible') { + return 'card card-possible' + } + if (resultat === 'Difficile') { + return 'card card-difficile' + } return 'card card-tres-difficile' }, - getEstimateDetail(f) { - var tauxAcces = f.tauxAcces || 0 - var seriePct = this.getSeriePercent(f) - var serieName = this.state.serie === 'general' ? 'Gén' : (this.state.serie === 'techno' ? 'Techno' : 'Pro') + detailEstimation(f) { + var tauxAcces = f.tauxAcces || 0 + var pctSerie = this.pourcentageSerie(f) + var nomSerie = '' - return 'Taux ' + tauxAcces + '% · ' + serieName + ' ' + seriePct + '% · Note ' + this.state.note + '/20' + if (this.state.serie === 'general') { + nomSerie = 'Gén' + } else if (this.state.serie === 'techno') { + nomSerie = 'Techno' + } else { + nomSerie = 'Pro' + } + + return 'Taux ' + tauxAcces + '% · ' + nomSerie + ' ' + pctSerie + '% · Note ' + this.state.note + '/20' } } diff --git a/parcoursup/components/auth-panel.riot b/parcoursup/components/auth-panel.riot index 5baf79d..4fa0727 100644 --- a/parcoursup/components/auth-panel.riot +++ b/parcoursup/components/auth-panel.riot @@ -2,37 +2,37 @@
-
-
+
- +

{ state.titre }

- -
-
+
@@ -56,11 +56,11 @@
-
- { state.error } +
+ { state.erreur }
- @@ -72,93 +72,94 @@ export default { state: { - open: false, - mode: 'login', - loading: false, - error: null, - titre: 'Connexion', - labelBouton: 'Se connecter', - classBtnLogin: 'auth-tab active', - classBtnRegister: 'auth-tab' + visible: false, + mode: 'connexion', + chargement: false, + erreur: null, + titre: 'Connexion', + labelBouton: 'Se connecter', + classBtnConnexion: 'auth-tab active', + classBtnInscription: 'auth-tab' }, - openModal() { - this.update({ open: true, error: null }) + ouvrirModale() { + this.update({ visible: true, erreur: null }) }, - closeModal() { - this.update({ open: false, error: null }) + fermerModale() { + this.update({ visible: false, erreur: null }) }, - closeOnOverlay(e) { + // Fermer si l'utilisateur clique en dehors de la modale + cliquerFond(e) { if (e.target === e.currentTarget) { - this.closeModal() + this.fermerModale() } }, - switchToLogin() { + afficherConnexion() { this.update({ - mode: 'login', - error: null, - titre: 'Connexion', - labelBouton: 'Se connecter', - classBtnLogin: 'auth-tab active', - classBtnRegister: 'auth-tab' + mode: 'connexion', + erreur: null, + titre: 'Connexion', + labelBouton: 'Se connecter', + classBtnConnexion: 'auth-tab active', + classBtnInscription: 'auth-tab' }) }, - switchToRegister() { + afficherInscription() { this.update({ - mode: 'register', - error: null, - titre: 'Créer un compte', - labelBouton: 'Créer le compte', - classBtnLogin: 'auth-tab', - classBtnRegister: 'auth-tab active' + mode: 'inscription', + erreur: null, + titre: 'Créer un compte', + labelBouton: 'Créer le compte', + classBtnConnexion: 'auth-tab', + classBtnInscription: 'auth-tab active' }) }, - async handleSubmit(e) { + async validerFormulaire(e) { e.preventDefault() - var email = e.target.email.value.trim() - var password = e.target.password.value - var services = window.firebaseServices + var email = e.target.email.value.trim() + var password = e.target.password.value + var services = window.firebaseServices - this.update({ loading: true, error: null }) + this.update({ chargement: true, erreur: null }) try { - if (this.state.mode === 'register') { + if (this.state.mode === 'inscription') { await services.createAccount(email, password) } else { await services.login(email, password) } - this.update({ open: false, loading: false }) + this.update({ visible: false, chargement: false }) this.props.onauth && this.props.onauth() } catch (err) { - var message = 'Une erreur est survenue.' + var messageErreur = 'Une erreur est survenue.' if (err.code === 'auth/email-already-in-use') { - message = 'Cet e-mail est déjà utilisé.' + messageErreur = 'Cet e-mail est déjà utilisé.' } else if (err.code === 'auth/invalid-email') { - message = 'Adresse e-mail invalide.' + messageErreur = 'Adresse e-mail invalide.' } else if (err.code === 'auth/wrong-password' || err.code === 'auth/invalid-credential') { - message = 'E-mail ou mot de passe incorrect.' + messageErreur = 'E-mail ou mot de passe incorrect.' } else if (err.code === 'auth/weak-password') { - message = 'Le mot de passe doit faire au moins 6 caractères.' + messageErreur = 'Le mot de passe doit faire au moins 6 caractères.' } else if (err.code === 'auth/user-not-found') { - message = 'Aucun compte trouvé avec cet e-mail.' + messageErreur = 'Aucun compte trouvé avec cet e-mail.' } - this.update({ loading: false, error: message }) + this.update({ chargement: false, erreur: messageErreur }) } }, - async handleLogout() { + async seDeconnecter() { try { await window.firebaseServices.logout() this.props.onlogout && this.props.onlogout() diff --git a/parcoursup/components/detail-view.riot b/parcoursup/components/detail-view.riot index 57a513a..bdaefc6 100644 --- a/parcoursup/components/detail-view.riot +++ b/parcoursup/components/detail-view.riot @@ -141,257 +141,288 @@ - +

Profil des admis

Répartition par type de bac

-
+

Mentions au bac des admis

-
+

Profil sociologique

-
+
- +

Évolution depuis 2020

-
+
Chargement de l'historique...
-
+
Aucune donnée historique disponible pour cette formation.
-
0 }> +
0 }>

Taux d'accès par année

-
+

Nombre de candidats et admis

-
+

Évolution des mentions au bac

-
+
- +
+ diff --git a/parcoursup/components/map-view.riot b/parcoursup/components/map-view.riot index ded32ae..e3a9805 100644 --- a/parcoursup/components/map-view.riot +++ b/parcoursup/components/map-view.riot @@ -1,112 +1,120 @@

Carte des formations

-
+
+
diff --git a/parcoursup/components/result-list.riot b/parcoursup/components/result-list.riot index e84a631..5fa57f8 100644 --- a/parcoursup/components/result-list.riot +++ b/parcoursup/components/result-list.riot @@ -1,5 +1,6 @@
+
Aucun résultat trouvé
@@ -8,26 +9,41 @@ Chargement...
-
-

{ f.nom }

-

Établissement : { f.etablissement }

-

Ville : { f.ville } ({ f.departement })

-

Filière : { f.filiere }

-

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

+
+

{ formation.nom }

+

Établissement : { formation.etablissement }

+

Ville : { formation.ville } ({ formation.departement })

+

Filière : { formation.filiere }

+

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

- - - + + +
+
+
diff --git a/parcoursup/formation.js b/parcoursup/formation.js index 517af8d..eedec42 100644 --- a/parcoursup/formation.js +++ b/parcoursup/formation.js @@ -1,95 +1,97 @@ -export function createFormation(raw) { +// Créer un objet formation à partir des données brutes de l'API +export function creerFormation(brut) { + var taux = 0 var latitude = null var longitude = null - if (raw.voe_tot && raw.voe_tot > 0) { - taux = Math.round((raw.acc_tot / raw.voe_tot) * 100) + if (brut.voe_tot && brut.voe_tot > 0) { + taux = Math.round((brut.acc_tot / brut.voe_tot) * 100) } - if (raw.g_olocalisation_des_formations) { - latitude = raw.g_olocalisation_des_formations.lat - longitude = raw.g_olocalisation_des_formations.lon + if (brut.g_olocalisation_des_formations) { + latitude = brut.g_olocalisation_des_formations.lat + longitude = brut.g_olocalisation_des_formations.lon } return { - id: raw.cod_uai + "-" + raw.lib_for_voe_ins, + id: brut.cod_uai + "-" + brut.lib_for_voe_ins, - nom: raw.lib_for_voe_ins, - etablissement: raw.g_ea_lib_vx, - ville: raw.ville_etab, - departement: raw.dep, - departementLib: raw.dep_lib, - region: raw.region_etab_aff, - academie: raw.acad_mies, - contrat: raw.contrat_etab, + nom: brut.lib_for_voe_ins, + etablissement: brut.g_ea_lib_vx, + ville: brut.ville_etab, + departement: brut.dep, + departementLib: brut.dep_lib, + region: brut.region_etab_aff, + academie: brut.acad_mies, + contrat: brut.contrat_etab, - filiere: raw.fili, - selectivite: raw.select_form, + filiere: brut.fili, + selectivite: brut.select_form, - capacite: raw.capa_fin, - candidats: raw.voe_tot, - admis: raw.acc_tot, - tauxAcces: taux, + capacite: brut.capa_fin, + candidats: brut.voe_tot, + admis: brut.acc_tot, + tauxAcces: taux, - latitude: latitude, - longitude: longitude, + latitude: latitude, + longitude: longitude, - pctFemmes: raw.pct_f, - pctBoursiers: raw.pct_bours, - pctNeoBac: raw.pct_neobac, + pctFemmes: brut.pct_f, + pctBoursiers: brut.pct_bours, + pctNeoBac: brut.pct_neobac, - pctGeneral: raw.pct_bg, - pctTechno: raw.pct_bt, - pctPro: raw.pct_bp, + pctGeneral: brut.pct_bg, + pctTechno: brut.pct_bt, + pctPro: brut.pct_bp, - pctSansMention: raw.pct_sansmention, - pctAB: raw.pct_ab, - pctB: raw.pct_b, - pctTB: raw.pct_tb, - pctTBF: raw.pct_tbf, + pctSansMention: brut.pct_sansmention, + pctAB: brut.pct_ab, + pctB: brut.pct_b, + pctTB: brut.pct_tb, + pctTBF: brut.pct_tbf, - pctDebutPhase: raw.pct_acc_debutpp, - pctDateBac: raw.pct_acc_datebac, - pctFinPhase: raw.pct_acc_finpp, + pctDebutPhase: brut.pct_acc_debutpp, + pctDateBac: brut.pct_acc_datebac, + pctFinPhase: brut.pct_acc_finpp, - admisDebutPhase: raw.acc_debutpp, - admisDateBac: raw.acc_datebac, - admisFinPhase: raw.acc_finpp, + admisDebutPhase: brut.acc_debutpp, + admisDateBac: brut.acc_datebac, + admisFinPhase: brut.acc_finpp, - // phase principale - voePPGeneral: raw.nb_voe_pp_bg, - voePPTechno: raw.nb_voe_pp_bt, - voePPPro: raw.nb_voe_pp_bp, - voePPAutres: raw.nb_voe_pp_at, - voePPTotal: raw.nb_voe_pp, + // Phase principale + voePPGeneral: brut.nb_voe_pp_bg, + voePPTechno: brut.nb_voe_pp_bt, + voePPPro: brut.nb_voe_pp_bp, + voePPAutres: brut.nb_voe_pp_at, + voePPTotal: brut.nb_voe_pp, - classesPPGeneral: raw.nb_cla_pp_bg, - classesPPTechno: raw.nb_cla_pp_bt, - classesPPPro: raw.nb_cla_pp_bp, - classesPPAutres: raw.nb_cla_pp_at, - classesPPTotal: raw.nb_cla_pp, + classesPPGeneral: brut.nb_cla_pp_bg, + classesPPTechno: brut.nb_cla_pp_bt, + classesPPPro: brut.nb_cla_pp_bp, + classesPPAutres: brut.nb_cla_pp_at, + classesPPTotal: brut.nb_cla_pp, - propositionsPPGeneral: raw.prop_tot_bg, - propositionsPPTechno: raw.prop_tot_bt, - propositionsPPPro: raw.prop_tot_bp, - propositionsPPAutres: raw.prop_tot_at, - propositionsPPTotal: raw.prop_tot, + propositionsPPGeneral: brut.prop_tot_bg, + propositionsPPTechno: brut.prop_tot_bt, + propositionsPPPro: brut.prop_tot_bp, + propositionsPPAutres: brut.prop_tot_at, + propositionsPPTotal: brut.prop_tot, - acceptesPPGeneral: raw.acc_bg, - acceptesPPTechno: raw.acc_bt, - acceptesPPPro: raw.acc_bp, - acceptesPPAutres: raw.acc_at, - acceptesPPTotal: raw.acc_pp, + acceptesPPGeneral: brut.acc_bg, + acceptesPPTechno: brut.acc_bt, + acceptesPPPro: brut.acc_bp, + acceptesPPAutres: brut.acc_at, + acceptesPPTotal: brut.acc_pp, - // phase complémentaire - voePCGeneral: raw.nb_voe_pc_bg, - voePCTechno: raw.nb_voe_pc_bt, - voePCPro: raw.nb_voe_pc_bp, - voePCAutres: raw.nb_voe_pc_at, - voePCTotal: raw.nb_voe_pc, + // Phase complémentaire + voePCGeneral: brut.nb_voe_pc_bg, + voePCTechno: brut.nb_voe_pc_bt, + voePCPro: brut.nb_voe_pc_bp, + voePCAutres: brut.nb_voe_pc_at, + voePCTotal: brut.nb_voe_pc, - classesPCTotal: raw.nb_cla_pc, - acceptesPCTotal: raw.acc_pc + classesPCTotal: brut.nb_cla_pc, + acceptesPCTotal: brut.acc_pc } } \ No newline at end of file diff --git a/parcoursup/index.html b/parcoursup/index.html index dd62f89..da008b8 100644 --- a/parcoursup/index.html +++ b/parcoursup/index.html @@ -23,8 +23,8 @@