From 730899c99e055a37c432b0c608a1816928a63fea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Valentin=20Mogu=C3=A9rou?= Date: Wed, 19 Jul 2023 02:18:32 +0200 Subject: [PATCH] Correction bug --- res/calcul.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/res/calcul.js b/res/calcul.js index c52413e..d192bf9 100644 --- a/res/calcul.js +++ b/res/calcul.js @@ -28,9 +28,12 @@ function calcul_section(data) { epreuve.entries.forEach(entry => { let field = document.getElementById(entry + "-note"); - if (field.valid) caduque = false; - if (field.valid || field.required) { - points_epreuve += epreuve.coef * arrondi_dixieme(parseFloat((field.value) ? field.value : 0)); + if (field.value && field.checkValidity()) { + console.log(field.id); + points_epreuve += epreuve.coef * arrondi_dixieme(parseFloat(field.value)); + coefficients += epreuve.coef; + caduque = false; + } else if (field.required) { coefficients += epreuve.coef; } });