function update() {
/* ------------- Contrôle continu ------------- */
let total_CC = 0;
// EMC
let note_emc_1re = document.getElementById("note-emc-1re").value;
let points_emc_1re = 1 * note_emc_1re
document.getElementById("points-emc-1re").innerHTML = points_emc_1re.toLocaleString("fr");
total_CC += points_emc_1re;
let note_emc_tle = document.getElementById("note-emc-tle").value;
let points_emc_tle = 1 * note_emc_tle
document.getElementById("points-emc-tle").innerHTML = points_emc_tle.toLocaleString("fr");
total_CC += points_emc_tle;
// HG
let note_hg_1re = document.getElementById("note-hg-1re").value;
let points_hg_1re = 3 * note_hg_1re
document.getElementById("points-hg-1re").innerHTML = points_hg_1re.toLocaleString("fr");
total_CC += points_hg_1re;
let note_hg_tle = document.getElementById("note-hg-tle").value;
let points_hg_tle = 3 * note_hg_tle
document.getElementById("points-hg-tle").innerHTML = points_hg_tle.toLocaleString("fr");
total_CC += points_hg_tle;
// LVA
let note_lva_1re = document.getElementById("note-lva-1re").value;
let points_lva_1re = 3 * note_lva_1re
document.getElementById("points-lva-1re").innerHTML = points_lva_1re.toLocaleString("fr");
total_CC += points_lva_1re;
let note_lva_tle = document.getElementById("note-lva-tle").value;
let points_lva_tle = 3 * note_lva_tle
document.getElementById("points-lva-tle").innerHTML = points_lva_tle.toLocaleString("fr");
total_CC += points_lva_tle;
// LVB
let note_lvb_1re = document.getElementById("note-lvb-1re").value;
let points_lvb_1re = 3 * note_lvb_1re
document.getElementById("points-lvb-1re").innerHTML = points_lvb_1re.toLocaleString("fr");
total_CC += points_lvb_1re;
let note_lvb_tle = document.getElementById("note-lvb-tle").value;
let points_lvb_tle = 3 * note_lvb_tle
document.getElementById("points-lvb-tle").innerHTML = points_lvb_tle.toLocaleString("fr");
total_CC += points_lvb_tle;
// Mathématiques
let note_mat_1re = document.getElementById("note-mat-1re").value;
let points_mat_1re = 3 * note_mat_1re
document.getElementById("points-mat-1re").innerHTML = points_mat_1re.toLocaleString("fr");
total_CC += points_mat_1re;
let note_mat_tle = document.getElementById("note-mat-tle").value;
let points_mat_tle = 3 * note_mat_tle
document.getElementById("points-mat-tle").innerHTML = points_mat_tle.toLocaleString("fr");
total_CC += points_mat_tle;
// EPS
let note_eps_tle = document.getElementById("note-eps-tle").value;
let points_eps_tle = 6 * note_eps_tle
document.getElementById("points-eps-tle").innerHTML = points_eps_tle.toLocaleString("fr");
total_CC += points_eps_tle;
// Spé 3
let note_spe3_1re = document.getElementById("note-spe3-1re").value;
let points_spe3_1re = 8 * note_spe3_1re
document.getElementById("points-spe3-1re").innerHTML = points_spe3_1re.toLocaleString("fr");
total_CC += points_spe3_1re;
document.getElementById("total-points-CC").innerHTML = total_CC.toLocaleString("fr")
/* ------------- Épreuves terminales ------------- */
let total_terminal = 0;
// Français écrit
let note_fr_ecrit = document.getElementById("note-fr-ecrit").value;
let points_fr_ecrit = 5 * note_fr_ecrit
document.getElementById("points-fr-ecrit").innerHTML = points_fr_ecrit.toLocaleString("fr");
total_terminal += points_fr_ecrit;
// Français oral
let note_fr_oral = document.getElementById("note-fr-oral").value;
let points_fr_oral = 5 * note_fr_oral
document.getElementById("points-fr-oral").innerHTML = points_fr_oral.toLocaleString("fr");
total_terminal += points_fr_oral;
// Philosophie
let note_philo = document.getElementById("note-philo").value;
let points_philo = 4 * note_philo
document.getElementById("points-philo").innerHTML = points_philo.toLocaleString("fr");
total_terminal += points_philo;
// Grand oral
let note_go = document.getElementById("note-go").value;
let points_go = 14 * note_go
document.getElementById("points-go").innerHTML = points_go.toLocaleString("fr");
total_terminal += points_go;
// Spé 1
let note_spe1 = document.getElementById("note-spe1").value;
let points_spe1 = 16 * note_spe1
document.getElementById("points-spe1").innerHTML = points_spe1.toLocaleString("fr");
total_terminal += points_spe1;
// Spé 2
let note_spe2 = document.getElementById("note-spe2").value;
let points_spe2 = 16 * note_spe2
document.getElementById("points-spe2").innerHTML = points_spe2.toLocaleString("fr");
total_terminal += points_spe2;
document.getElementById("total-points-terminal").innerHTML = total_terminal.toLocaleString("fr")
/* ------------- Options ------------- */
let total_options = 0;
let coef_options = 0;
if (document.getElementById("check-opt1-1re").checked) {
document.getElementById("coef-opt1-1re").innerHTML = "2";
coef_options += 2;
let points_opt1_1re = 2*document.getElementById("note-opt1-1re").value;
total_options += points_opt1_1re;
document.getElementById("points-opt1-1re").innerHTML = points_opt1_1re.toLocaleString("fr");
} else {
document.getElementById("coef-opt1-1re").innerHTML = "2";
document.getElementById("points-opt1-1re").innerHTML = "0";
}
if (document.getElementById("check-opt1-tle").checked) {
document.getElementById("coef-opt1-tle").innerHTML = "2";
coef_options += 2;
let points_opt1_tle = 2*document.getElementById("note-opt1-tle").value;
total_options += points_opt1_tle;
document.getElementById("points-opt1-tle").innerHTML = points_opt1_tle.toLocaleString("fr");
} else {
document.getElementById("coef-opt1-tle").innerHTML = "2";
document.getElementById("points-opt1-tle").innerHTML = "0";
}
if (document.getElementById("check-opt2-1re").checked) {
document.getElementById("coef-opt2-1re").innerHTML = "2";
coef_options += 2;
let points_opt2_1re = 2*document.getElementById("note-opt2-1re").value;
total_options += points_opt2_1re;
document.getElementById("points-opt2-1re").innerHTML = points_opt2_1re.toLocaleString("fr");
} else {
document.getElementById("coef-opt2-1re").innerHTML = "2";
document.getElementById("points-opt2-1re").innerHTML = "0";
}
if (document.getElementById("check-opt2-tle").checked) {
document.getElementById("coef-opt2-tle").innerHTML = "2";
coef_options += 2;
let points_opt2_tle = 2*document.getElementById("note-opt2-tle").value;
total_options += points_opt2_tle;
document.getElementById("points-opt2-tle").innerHTML = points_opt2_tle.toLocaleString("fr");
} else {
document.getElementById("coef-opt2-tle").innerHTML = "2";
document.getElementById("points-opt2-tle").innerHTML = "0";
}
document.getElementById("total-coef-options").innerHTML = coef_options.toLocaleString("fr");
document.getElementById("total-points-options").innerHTML = total_options.toLocaleString("fr");
// CALCUL
let total_points = total_CC + total_terminal + total_options;
document.getElementById("total-points").innerHTML = total_points.toLocaleString("fr");
let total_coef = 100 + coef_options;
document.getElementById("total-coef").innerHTML = total_coef.toLocaleString("fr");
let note_brute = total_points/total_coef;
let note_finale = Math.ceil(100*note_brute)/100;
document.getElementById("note-finale").innerHTML = note_finale.toLocaleString("fr");
let decision;
let sup_mention_actuelle;
if (note_finale < 8) {
decision = "Ajourné"
sup_mention_actuelle = 7.99*total_coef
} else if (note_finale < 10) {
decision = "Passe le second groupe";
sup_mention_actuelle = 9.99*total_coef
} else if (note_finale < 12) {
decision = "Admis";
sup_mention_actuelle = 11.99*total_coef
} else if (note_finale < 14) {
decision = "Admis Mention Assez Bien";
sup_mention_actuelle = 13.99*total_coef
} else if (note_finale < 16) {
decision = "Admis Mention Bien";
sup_mention_actuelle = 15.99*total_coef
} else if (note_finale < 18) {
decision = "Admis Mention Très Bien";
sup_mention_actuelle = 17.99*total_coef
} else {
decision = "Admis Mention Très Bien avec les félicitations du jury";
sup_mention_actuelle = NaN
}
if (note_finale < 18) {
let points_mention_suivante = Math.ceil(10*(sup_mention_actuelle - total_points + .01))/10
document.getElementById("points-manquants").innerHTML = points_mention_suivante.toLocaleString("fr");
} else {
document.getElementById("points-manquants").innerHTML = "-";
}
document.getElementById("decision-jury").innerHTML = decision;
}