Type de style
"; //* -// if(code.equals("style:display-name")) code="OptionnelNom du style affiché
"; //* -// if(code.equals("style:class")) code="OptionnelClasse
"; //* -// if(code.equals("style:default-outline-level")) code="Plan & numérotationNiveau de plan
"; //* -// if(code.equals("style:name")) code="OptionnelNom du style xml
"; //* -// if(code.equals("style:font-family-generic-complex")) code="OptionnelPolice de caractères générique
"; //* -// //* -// if(code.equals("style:justify-single-word")) code="OptionnelJustifier un seul mot
"; -// if(code.equals("loext:contextual-spacing")) code="OptionnelEspacement contextuel
"; -// -// // style paragraphe gestionnaire -// if(code.equals("style:next-style-name")) code="GestionnaireStyle de suite
"; -// if(code.equals("style:parent-style-name")) code="GestionnaireHétité de
"; -// -// // style paragraphe enchaînements -// String colorEn ="#CD5C5C"; -// if(code.equals("fo:keep-together")) code="EnchaînementsNe pas scinder le paragraphe
"; -// if(code.equals("fo:keep-with-next")) code="EnchaînementsConserver avec le paragraphe suivant
"; -// if(code.equals("fo:orphans")) code="EnchaînementsTraitement des orphelines
"; -// if(code.equals("fo:widows")) code="EnchaînementsTraitement des veuves
"; -// if(code.equals("fo:break-after")) code="EnchaînementsSaut après
"; -// if(code.equals("fo:break-before")) code="EnchaînementsSaut avant
"; -// -// -// -// if(code.equals("style:master-page-name")) code="EnchaînementsSaut de page
"; -// if(code.equals("style:page-number")) code="EnchaînementsNumérotation de la page
"; -// -// // style paragraphe alignement -// if(code.equals("fo:text-align")) code="AlignementAlignement du paragraphe
"; -// -// // style paragraphe police -// String colorPo = "#FF8C00"; -// if(code.equals("style:font-name")) code="PoliceNom de la police de caractères
"; -// if(code.equals("fo:font-size")) code="PoliceTaille des caractères
"; -// if(code.equals("style:font-style-name")) code="PoliceStyle de la police
"; -// if(code.equals("fo:font-family")) code="PoliceFamille de police de caractères
"; -// if(code.equals("fo:font-weight")) code="PoliceStyle \"Gras\"
"; -// if(code.equals("fo:font-style")) code="PoliceStyle de la font
"; -// if(code.equals("style:font-size-asian")) code="PoliceTaille des caractères
"; -// -// -// //style paragraphe effets de caractère -// String colorEc = "#FF1493"; -// if(code.equals("fo:text-shadow")) code="Effets de caractèreOmbré
"; -// if(code.equals("fo:font-variant")) code="Effets de caractèrePetites majuscule
"; -// if(code.equals("style:text-underline-style")) code="Effets de caractèreSoulignement
"; -// if(code.equals("style:text-underline-color")) code="Effets de caractèreCouleur du soulignement
"; -// if(code.equals("fo:text-transform")) code="Effets de caractère...
"; -// if(code.equals("style:text-underline-type")) code="Effets de caractèreType de soulignement
"; -// if(code.equals("style:text-underline-width")) code="Effets de caractèreÉpaisseur du soulignement
"; -// -// -// -// // style paragraphe bordures -// String colorB = "#1099FA"; -// if(code.equals("fo:border")) code="BorduresBordure tout autour
"; -// if(code.equals("fo:border-bottom")) code="BorduresBordure du bas
"; -// if(code.equals("fo:border-right")) code="BorduresBordure de droite
"; -// if(code.equals("fo:border-top")) code="BorduresBordure du haut
"; -// if(code.equals("fo:border-left")) code="BorduresBordure de gauche
"; -// -// if(code.equals("fo:padding")) code="BorduresRemplissage synchronisé
"; -// if(code.equals("fo:padding-top")) code="BorduresRemplissage haut
"; -// if(code.equals("fo:padding-bottom")) code="BorduresRemplissage bas
"; -// if(code.equals("fo:padding-left")) code="BorduresRemplissage gauche
"; -// if(code.equals("fo:padding-right")) code="BorduresRemplissage droite
"; -// -// if(code.equals("style:shadow")) code="BorduresOmbrage
"; -// -// -// -// -// -// // style paragraphe retraits et espacement -// if(code.equals("fo:margin-right")) code="Retraits et espacementRetrait à droite
"; -// if(code.equals("fo:margin-left")) code="Retraits et espacementRetrait à gauche
"; -// if(code.equals("fo:margin-top")) code="Retraits et espacementEspacement au-dessus
"; -// if(code.equals("fo:margin-bottom")) code="Retraits et espacementEspacement sous le paragraphe
"; -// if(code.equals("fo:line-height")) code="Retraits et espacementInterligne
"; -// if(code.equals("fo:text-indent")) code="Retraits et espacementRetait de première ligne
"; -// if(code.equals("style:auto-text-indent")) code="Retraits et espacementRetait de première ligne automatique
"; -// -// -// -// //************************************************************** -// //** PAGE -// //************************************************************** -// -// if(code.equals("Right_20_page")) code="Page \"Page droite\" (page recto)"; -// if(code.equals("Left_20_page")) code="Page \"Page gauche\" (page verso)"; -// if(code.equals("Sommaire_20__26__20_Remerciements")) code="Page \"Sommaire & Remerciements\""; -// if(code.equals("First_20_Page")) code="Page \"Première page\""; -// if(code.equals("Dernière_20_page")) code="Page \"Dernière page\""; -// if(code.equals("Tables_20__26__20_Index")) code="Page \"Tables & Index\""; -// -// -// // page -// String colorP = "#A010FA"; -// if(code.equals("layout_properties_fo:margin-left")) code="PageMarge gauche
"; -// if(code.equals("layout_properties_fo:margin-top")) code="PageMarge haute
"; -// if(code.equals("layout_properties_fo:margin-right")) code="PageMarge droite
"; -// if(code.equals("layout_properties_fo:margin-bottom")) code="PageMarge basse
"; -// -// if(code.equals("layout_properties_style:print-orientation")) code="PageOrientation page
"; -// if(code.equals("layout_style:page-usage")) code="PageMise en page
"; -// if(code.equals("layout_fo:page-height")) code="PageHauteur de la page
"; -// if(code.equals("layout_properties_fo:page-width")) code="PageLargeur de la page
"; -// if(code.equals("layout_properties_fo:page-height")) code="PageHauteur de la page
"; -// if(code.equals("layout_properties_style:num-format")) code="PageFormat de la numérotation de la page
"; -// -// -// //Bordure de page -// if(code.equals("layout_fo:border-top")) code="Bordures de pageBordure haute
"; -// if(code.equals("layout_fo:border-left")) code="Bordures de pageBordure gauche
"; -// if(code.equals("layout_fo:border-right")) code="Bordures de pageBordure droite
"; -// if(code.equals("layout_fo:border-bottom")) code="Bordures de pageBordure basse
"; -// if(code.equals("layout_properties_fo:padding")) code="Bordures de pageRemplissage synchronisé
"; -// if(code.equals("layout_properties_fo:border")) code="Bordures de pageBordures de page
"; -// -// //Arrière-plan de la page -// String colorAr = "#DAA520"; -// if(code.equals("layout_properties_draw:fill-image-name")) code="Arrière plan de la pageImage
"; -// if(code.equals("layout_properties_draw:fill")) code="Arrière plan de la pageType d'arrière plan de la page
"; -// -// -// // Entête -// String colorE = "#4B0082"; -// if(code.equals("2-header-properties_fo:border-bottom")) code="EntêteBordure basse
"; -// if(code.equals("2-header-properties_fo:border-left")) code="EntêteBordure gauche
"; -// if(code.equals("2-header-properties_fo:border-right")) code="EntêteBordure droite
"; -// if(code.equals("2-header-properties_fo:border-top")) code="EntêteBordure haute
"; -// if(code.equals("2-header-properties_fo:border")) code="EntêteBordures tout autour
"; -// -// -// -// -// if(code.equals("2-header-properties_fo:margin-bottom")) code="EntêteMarge basse
"; -// if(code.equals("2-header-properties_fo:margin-left")) code="EntêteMarge gauche
"; -// if(code.equals("2-header-properties_fo:margin-right")) code="EntêteMarge droite
"; -// -// if(code.equals("2-header-properties_fo:min-height")) code="EntêteHauteur minimale de l'entête
"; -// if(code.equals("2-header-properties_fo:padding")) code="EntêteRemplissage synchronisé
"; -// -// // Pied de page -// String colorPied = "#FF69B4"; -// if(code.equals("4-footer-style_fo:border-bottom")) code="Pied de pageBordure basse
"; -// if(code.equals("4-footer-style_fo:border-left")) code="Pied de pageBordure gauche
"; -// if(code.equals("4-footer-style_fo:border-right")) code="Pied de pageBordure droite
"; -// if(code.equals("4-footer-style_fo:border-top")) code="Pied de pageBordure haute
"; -// if(code.equals("4-footer-style_fo:border")) code="Pied de pageBordures tout autour
"; -// -// -// -// -// if(code.equals("4-footer-style_fo:margin-top")) code="Pied de pageMarge haute
"; -// if(code.equals("4-footer-style_fo:margin-left")) code="Pied de pageMarge gauche
"; -// if(code.equals("4-footer-style_fo:margin-right")) code="Pied de pageMarge droite
"; -// if(code.equals("4-footer-style_fo:margin-bottom")) code="Pied de pageMarge basse
"; -// -// if(code.equals("4-footer-style_fo:min-height")) code="Pied de pageHauteur minimale de l'entête
"; -// if(code.equals("4-footer-style_fo:padding")) code="Pied de pageRemplissage synchronisé
"; -// -// -// // Champs pied de page -// String colorC = "#FF7F50"; -// if(code.equals("footer_text:bookmark-ref_text:ref-name")) code="Champ dans le pied de pageChamp \"Marque page\"
"; -// if(code.equals("footer_text:bookmark-ref_text:bookmark-ref_name")) code="Champ dans le pied de pageRéférence du marque page
"; -// if(code.equals("footer_text:bookmark-ref_text:reference-format")) code="Champ dans le pied de pageType de référence du marque page
"; -// if(code.equals("footer_text:bookmark-ref_text:bookmark-ref_content")) code="Champ dans le pied de pageValeur du champ marque page
"; -// -// if(code.equals("footer_text:page-number_text:page-number_content")) code="Champ dans le pied de pageValeur du champ numéro de page
"; -// if(code.equals("footer_text:page-number_text:page-number_name")) code="Champ dans le pied de pageChamp \"Numéro de page\"
"; -// if(code.equals("footer_text:page-number_text:select-page")) code="Champ dans le pied de pageValeur du champ sélectionné
"; -// if(code.equals("footer_text:date_text:date_name")) code="Champ dans le pied de pageChamp \"Date\"
"; -// if(code.equals("footer_text:page-count_text:page-count_name")) code="Champ dans le pied de pageChamp \"Nombre de page\"
"; -// if(code.equals("footer_text:title_text:title_name")) code="Champ dans le pied de pageChamp \"Titre\"
"; -// if(code.equals("footer_text:initial-creator_text:initial-creator_name")) code="Champ dans le pied de pageChamp \"Auteur\"
"; -// -// -// // Champs entête -// String colorEnt= "#8B0000"; -// if(code.equals("header_text:chapter_text:chapter_content")) code="Champ dans l'entêteValeur du champ chapitre sélectionné
"; -// if(code.equals("header_text:chapter_text:chapter_name")) code="Champ dans l'entêteChamp \"Chapitre\"
"; -// if(code.equals("header_text:chapter_text:display")) code="Champ dans l'entêteType d'affichage du champ chapitre
"; -// if(code.equals("header_text:chapter_text:outline-level")) code="Champ dans l'entêteNiveau du plan du chapitre
"; -// -// if(code.equals("header_text:title_text:title_content")) code="Champ dans l'entêteValeur du champ titre sélectionné
"; -// if(code.equals("header_text:title_text:title_name")) code="Champ dans l'entêteChamp \"Titre\"
"; -// if(code.equals("header_text:title_text:display")) code="Champ dans l'entêteType d'affichage du champ titre
"; -// if(code.equals("header_text:title_text:outline-level")) code="Champ dans l'entêteNiveau du plan du titre
"; -// -// if(code.equals("header_text:page-number_text:page-number_name")) code="Champ dans l'entêteChamp \"Numéro de page\"
"; -// if(code.equals("header_text:page-count_text:page-count_name")) code="Champ dans l'entêteChamp \"Nombre de page\"
"; -// if(code.equals("header_text:initial-creator_text:initial-creator_name")) code="Champ dans l'entêteChamp \"Auteur\"
"; -// if(code.equals("header_text:date_text:date_name")) code="Champ dans l'entêteChamp \"Date\"
"; -// -// String colorCol= "#FF4040"; -// if(code.equals("column_fo:column-count")) code="ColonnesNombre de colonne
"; -// if(code.equals("column_fo:column-gap")) code="ColonnesGouttière : distance entre deux colonnes
"; -// -// -// // traduction style de page -// if(code.equals("Sommaire_20__26__20_Remerciements")) code="Sommaire & Remerciements"; -// if(code.equals("First_20_Page")) code="Première page"; -// if(code.equals("Tables_20__26__20_Index")) code="Tables & Index"; -// if(code.equals("Right_20_Page")) code="Page droite"; -// if(code.equals("Left_20_Page")) code="Page gauche"; -// if(code.equals("Dernière_20_page")) code="Dernière page"; -// -// //style page -// if(code.equals("layout_fo:page-width")) code="PageLargeur de la page
"; -// -// if(code.equals("layout_draw:fill-image-name")) code="OptionnelImage d'arrière-plan
"; //* -// if(code.equals("layout_fo:margin-bottom")) code="PageEspacement sous l'en-tête
"; -// if(code.equals("layout_fo:margin-top")) code="PageMarge en haut
"; -// if(code.equals("layout_fo:margin-right")) code="PageMarge à droite
"; -// if(code.equals("layout_fo:margin-left")) code="PageMarge à gauche
"; -// -// -// -// //************************************************************** -// //** CADRE & IMAGE -// //************************************************************** -// -// -// String colorT = "#4B0082"; // type -// String colorBc = "#8A2BE2"; // bordure cadre -// String colorAc = "#6495ED"; // adaptatioin cadre -// String colorPc = "#D2691E"; //position cadre -// String colorLc = "#FF5080"; //légende -// -// // optionnelle -// if(code.equals("draw:style-name")) code="OptionnelNom du style du cadre ou de l'image
"; -// if(code.equals("style-style:name")) code="OptionnelNom du style du cadre ou de l'image
"; -// if(code.equals("style-style:protect")) code="OptionsProtections
"; -// -// // type -// if(code.equals("draw:name")) code="TypeNom de l'objet
"; -// if(code.equals("text:anchor-type")) code="TypeType d'ancrage
"; -// if(code.equals("text:anchor-page-number")) code="TypeAncrage dans la page numéro
"; -// if(code.equals("svg:width")) code="TypeLargeur
"; -// if(code.equals("fo:min-height")) code="TypeHauteur minimale
"; -// -// if(code.equals("style:rel-width")) code="TypeLargeur par rapport à
"; -// if(code.equals("style:rel-height")) code="TypeHauteur par rapport à
"; -// if(code.equals("svg:height")) code="TypeHauteur
"; -// -// //adapter -// if(code.equals("style-fo:margin-bottom")) code="AdapterEspacement en bas
"; -// if(code.equals("style-fo:margin-right")) code="AdapterEspacement à droite
"; -// if(code.equals("style-fo:margin-top")) code="AdapterEspacement en haut
"; -// if(code.equals("style-fo:margin-left")) code="AdapterEspacement à gauche
"; -// -// if(code.equals("style-style:wrap")) code="AdapterAdaptation du texte
"; -// if(code.equals("style-style:number-wrapped-paragraphs")) code="AdapterNombre de ligne adaptée
"; -// if(code.equals("style-style:wrap-contour")) code="AdapterContour
"; -// -// -// -// -// //position -// if(code.equals("style-style:horizontal-pos")) code="PositionHorizontale
"; -// if(code.equals("style-style:horizontal-rel")) code="PositionHorizontalement par rapport à
"; -// if(code.equals("style-style:vertical-pos")) code="PositionVerticale
"; -// if(code.equals("style-style:vertical-rel")) code="PositionVerticalement par rapport à
"; -// if(code.equals("svg:y")) code="PositionPosition Y verticale
"; -// if(code.equals("svg:x")) code="PositionPosition X horizontale
"; -// -// -// -// //légende -// if(code.equals("Contenu")) code="Légende"; -// if(code.equals("ContenuSequence")) code="LégendeValeur de la variable de séquence
"; -// if(code.equals("text:style-name")) code="LégendeNom de variable de séquence
"; -// if(code.equals("text:name")) code="LégendeNom2 de variable de séquence
"; -// -// -// -// -// if(code.equals("style-fo:padding")) code="BorduresRemplissage
"; -// if(code.equals("style-fo:border")) code="BorduresBordures
"; -// -// -// // index -// if(code.equals("text:protected")) code="ProtectionProtection contre les modifications manuelles
"; -// -// -// -// -// -// return code; -// } -// +// private int pointsClass = 0; +// private int pointTotal=0; +// private int pointEnJeu = 0; /** @@ -345,260 +26,139 @@ public class outils { * @return une String contenant "Correct" , "Erreur" ou "Optionnel". * @throws UnsupportedEncodingException */ - public String Compare1(String A, String Sujet ) throws UnsupportedEncodingException { - String pointString = "" ; - this.pointEnJeu=0; - if(Sujet!=null) if(Sujet.contains("‽")) { - - if(Sujet.contains("⌂")) { // suppression des dollars $ - Sujet = SupprimeDollar(Sujet); - A = SupprimeDollar(A); - } - - if(Sujet.contains("¬")) { // suppression des dollars $ - Sujet = SupprimeEpaces(Sujet); - A = SupprimeEpaces(A); - } - - - pointString = TraitePoint(Sujet); - Sujet=Sujet.substring(0, Sujet.indexOf("‽")); - } + public node Compare(String nomNode, String key , String ValeurSujet , String ValeurEtudiant){ + resultatNotationParComparaison resultat = new resultatNotationParComparaison(false, false, nomNode, key, ValeurSujet, ValeurEtudiant, 0, 0); - if(this.pointEnJeu==0) return "Optionnel"; + if (ValeurSujet != null && ValeurSujet.contains("‽")) { + TraitePoint(ValeurSujet, resultat); + ValeurSujet = ValeurSujet.substring(0, ValeurSujet.indexOf("‽")); + } + + if(resultat.isOptionnel()) { + return resultat.getResultat(); + } //intervalles de valeurs avec le symbole → - if(Sujet.contains("→") && A!=null && !Sujet.contains("#") && !Sujet.contains("¦")) { - if (TraitementIntervalle(A,Sujet).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } + if(ValeurSujet.contains("→")) { + return Intervalle(ValeurEtudiant,ValeurSujet, resultat).getResultat(); } - //intervalles de valeurs avec le symbole → et OU strict - if(Sujet.contains("→") && A!=null && !Sujet.contains("#") && Sujet.contains("¦")) { - if (TraitementIntervalleOUExact(A,Sujet).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } - } - - - // bordures - if(Sujet.contains("#") && Sujet.contains("pt") && A!=null) { - if(TraitementBordure(Sujet,A).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } - } - - // Couleur - if(Sujet.contains("#") && !Sujet.contains("pt") && Sujet.length()==7 && A!=null) { - String reponse = TraitementCouleur(Sujet,A); - if(reponse.contains("Correct")) { - IncrementPointClass(this.pointEnJeu); - return reponse + pointString; - }else { - return reponse + pointString; - } - } - - - - - // Condition OU exacte la valeur null est prise en compte dans la fonction TraitementOUExact - if(Sujet.contains("¦") && (A!=null || (A==null && Sujet.contains("null")))) { - if(TraitementOUExact(A,Sujet).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } - } - - - //Opérateur OU avec néttoyage ponctuation, case, espace, retour à la ligne, tabulation - if(Sujet.contains("↕")) { - if(TraitementOU(A,Sujet).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } - } - - //Opérateur OU avec nettoyage des chiffres - if(Sujet.contains("↑")) { - if(TraitementOUSupprimeChiffreEtsansCase(A,Sujet).equals("Correct : ")) { - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString; - }else { - return "Erreur : -" + pointString; - } - } - - - - if(A!=null)if(A.equals("auto")) A=null; - if(Sujet!=null)if(Sujet.equals("auto")) Sujet=null; - - if(A!=null) if(A.equals("0cm")) A=null; - if(Sujet!=null) if(Sujet.equals("0cm")) Sujet=null; - - if(A!=null) if(A.equals("none")) A=null; - if(Sujet!=null) if(Sujet.equals("none")) Sujet=null; - - if(A!=null) if(A.isEmpty()) A=null; - if(Sujet!=null) if(Sujet.isEmpty()) Sujet=null; - - if(A!=null) if(A.equals("0")) A=null; - if(Sujet!=null) if(Sujet.equals("0")) Sujet=null; - - if(A!=null) if(A.equals("null")) A=null; - if(Sujet!=null) if(Sujet.equals("null")) Sujet=null; - - if(A!=null) if(A.equals("false")) A=null; - if(Sujet!=null) if(Sujet.equals("false")) Sujet=null; - - - if(A!=null) if(Sujet==null) if(!pointString.isEmpty()) { return "Erreur : -" + pointString;} - if(A!=null) if(Sujet==null) if(pointString.isEmpty()) {return "Erreur";} - if(A==null) if(Sujet==null) if(!pointString.isEmpty()){IncrementPointClass(this.pointEnJeu); return "Correct : +" + pointString;} - if(A==null) if(Sujet==null) if(pointString.isEmpty()) {IncrementPointClass(this.pointEnJeu); return "Correct";} - - if(A==null) if(Sujet!=null) if(!pointString.isEmpty()) return "Erreur : -" + pointString; - if(A==null) if(Sujet!=null) if(pointString.isEmpty()) return "Erreur"; - - - - if(!pointString.isEmpty()) { - if(A.equals(Sujet)){ - IncrementPointClass(this.pointEnJeu); - return "Correct : +" + pointString;} - else { - return "Erreur : -" + pointString; - } + // Egalité entre les deux valeurs + if (ValeurEtudiant.equals(ValeurSujet)) { + resultat.setCorrect(true); + resultat.setPoint(resultat.getTotal()); + return resultat.getResultat(); }else { - if(A.equals(Sujet)){ - IncrementPointClass(this.pointEnJeu); - return "Correct";} - else { - return "Erreur"; - } + resultat.setCorrect(false); + resultat.setPoint(0); + return resultat.getResultat(); } + + } - - - - - - - /** * Compare les String A et B. - * La String B contient le poids de la note après le symbole ‽ - * Les String sont nettoyées avant comparaisons avec nettoyage des digites 0 à 20 en fin de chaîne. + * La String B contient le point de la note après le symbole ‽ + * Les String sont nettoyées avant comparaisons avec nettoyage des digits 0 à 20 en fin de chaîne. * - * @param A : String du fichier remis - * @param B : string du fichier consigne (sujet) avec le symbole ‽ pour la notation - * @return une String contenant "Correct" , "Erreur" ou "Optionnel". + * @param B : String du fichier consigne (sujet) avec le symbole ‽ pour la notation + * @return une String contenant "Correct", "Erreur" ou "Optionnel". */ - public String TraitePoint(String B) { - int point = 0; - this.pointEnJeu=0; - String pointString =""; - if(B!=null) if(B.contains("‽")) if(B.length()>1) { - String p = B.substring(B.indexOf("‽")+1,B.length()); - if(!p.isEmpty()) { point = Integer.valueOf(p);} else {point=0;} - - } + public resultatNotationParComparaison TraitePoint(String B, resultatNotationParComparaison resultat) { + int point = 0; + resultat.setTotal(0); + resultat.setOptionnel(true); + + if (B != null && B.contains("‽") && B.length() > 1) { + try { + String pointStr = B.substring(B.indexOf("‽") + 1).trim(); + point = pointStr.isEmpty() ? 0 : Integer.parseInt(pointStr); + } catch (NumberFormatException e) { + System.err.println("Erreur de conversion de la note : " + e.getMessage()); + } + } - pointString=""; - if(point==1) {pointString="1 pt"; IncrementPointTotal(1);this.pointEnJeu=1;} - if(point==2) {pointString="2 pt"; IncrementPointTotal(2); this.pointEnJeu=2;} - if(point==3) {pointString="3 pt"; IncrementPointTotal(3); this.pointEnJeu=3;} - if(point==4) {pointString="4 pt"; IncrementPointTotal(4); this.pointEnJeu=4;} - if(point==5) {pointString="5 pt"; IncrementPointTotal(5); this.pointEnJeu=5;} - if(point==6) {pointString="6 pt"; IncrementPointTotal(6); this.pointEnJeu=6;} - if(point==7) {pointString="7 pt"; IncrementPointTotal(7); this.pointEnJeu=7;} - if(point==8) {pointString="8 pt"; IncrementPointTotal(8); this.pointEnJeu=8;} - if(point==9) {pointString="9 pt"; IncrementPointTotal(9); this.pointEnJeu=9;} - if(point==10) {pointString="10 pt"; IncrementPointTotal(10); this.pointEnJeu=10;} - if(point==11) {pointString="11 pt"; IncrementPointTotal(11); this.pointEnJeu=11;} - if(point==12) {pointString="12 pt"; IncrementPointTotal(12); this.pointEnJeu=12;} - if(point==13) {pointString="13 pt"; IncrementPointTotal(13); this.pointEnJeu=13;} - if(point==14) {pointString="14 pt"; IncrementPointTotal(14); this.pointEnJeu=14;} - if(point==15) {pointString="15 pt"; IncrementPointTotal(15); this.pointEnJeu=15;} - if(point==16) {pointString="16 pt"; IncrementPointTotal(16); this.pointEnJeu=16;} - if(point==17) {pointString="17 pt"; IncrementPointTotal(17); this.pointEnJeu=17;} - if(point==18) {pointString="18 pt"; IncrementPointTotal(18); this.pointEnJeu=18;} - if(point==19) {pointString="19 pt"; IncrementPointTotal(19); this.pointEnJeu=19;} - if(point==20) {pointString="20 pt"; IncrementPointTotal(20); this.pointEnJeu=20;} - if(point==21) {pointString="21 pt"; IncrementPointTotal(21); this.pointEnJeu=21;} - if(point==22) {pointString="22 pt"; IncrementPointTotal(22); this.pointEnJeu=22;} - if(point==23) {pointString="23 pt"; IncrementPointTotal(23); this.pointEnJeu=23;} - if(point==24) {pointString="24 pt"; IncrementPointTotal(24); this.pointEnJeu=24;} - if(point==25) {pointString="25 pt"; IncrementPointTotal(25); this.pointEnJeu=25;} - if(point==26) {pointString="26 pt"; IncrementPointTotal(26); this.pointEnJeu=26;} - if(point==27) {pointString="27 pt"; IncrementPointTotal(27); this.pointEnJeu=27;} - if(point==28) {pointString="28 pt"; IncrementPointTotal(28); this.pointEnJeu=28;} - if(point==29) {pointString="29 pt"; IncrementPointTotal(29); this.pointEnJeu=29;} - if(point==30) {pointString="30 pt"; IncrementPointTotal(30); this.pointEnJeu=30;} - if(point==31) {pointString="31 pt"; IncrementPointTotal(31); this.pointEnJeu=31;} - if(point==32) {pointString="32 pt"; IncrementPointTotal(32); this.pointEnJeu=32;} - if(point==33) {pointString="33 pt"; IncrementPointTotal(33); this.pointEnJeu=33;} - if(point==34) {pointString="34 pt"; IncrementPointTotal(34); this.pointEnJeu=34;} - if(point==35) {pointString="35 pt"; IncrementPointTotal(35); this.pointEnJeu=35;} - if(point==36) {pointString="36 pt"; IncrementPointTotal(36); this.pointEnJeu=36;} - if(point==37) {pointString="37 pt"; IncrementPointTotal(37); this.pointEnJeu=37;} - if(point==38) {pointString="38 pt"; IncrementPointTotal(38); this.pointEnJeu=38;} - if(point==39) {pointString="39 pt"; IncrementPointTotal(39); this.pointEnJeu=39;} - if(point==40) {pointString="40 pt"; IncrementPointTotal(40); this.pointEnJeu=40;} - if(point==41) {pointString="41 pt"; IncrementPointTotal(41); this.pointEnJeu=41;} - if(point==42) {pointString="42 pt"; IncrementPointTotal(42); this.pointEnJeu=42;} - if(point==43) {pointString="43 pt"; IncrementPointTotal(43); this.pointEnJeu=43;} - if(point==44) {pointString="44 pt"; IncrementPointTotal(44); this.pointEnJeu=44;} - if(point==45) {pointString="45 pt"; IncrementPointTotal(45); this.pointEnJeu=45;} - if(point==46) {pointString="46 pt"; IncrementPointTotal(46); this.pointEnJeu=46;} - if(point==47) {pointString="47 pt"; IncrementPointTotal(47); this.pointEnJeu=47;} - if(point==48) {pointString="48 pt"; IncrementPointTotal(48); this.pointEnJeu=48;} - if(point==49) {pointString="49 pt"; IncrementPointTotal(49); this.pointEnJeu=49;} - if(point==50) {pointString="50 pt"; IncrementPointTotal(50); this.pointEnJeu=50;} - if(point==51) {pointString="51 pt"; IncrementPointTotal(51); this.pointEnJeu=51;} - if(point==52) {pointString="52 pt"; IncrementPointTotal(52); this.pointEnJeu=52;} - if(point==53) {pointString="53 pt"; IncrementPointTotal(53); this.pointEnJeu=53;} - if(point==54) {pointString="54 pt"; IncrementPointTotal(54); this.pointEnJeu=54;} - if(point==55) {pointString="55 pt"; IncrementPointTotal(55); this.pointEnJeu=55;} - if(point==56) {pointString="56 pt"; IncrementPointTotal(56); this.pointEnJeu=56;} - if(point==57) {pointString="57 pt"; IncrementPointTotal(57); this.pointEnJeu=57;} - if(point==58) {pointString="58 pt"; IncrementPointTotal(58); this.pointEnJeu=58;} - if(point==59) {pointString="59 pt"; IncrementPointTotal(59); this.pointEnJeu=59;} - if(point==60) {pointString="60 pt"; IncrementPointTotal(60); this.pointEnJeu=60;} - if(point==61) {pointString="61 pt"; IncrementPointTotal(61); this.pointEnJeu=61;} - if(point==62) {pointString="62 pt"; IncrementPointTotal(62); this.pointEnJeu=62;} - if(point==63) {pointString="63 pt"; IncrementPointTotal(63); this.pointEnJeu=63;} - if(point==64) {pointString="64 pt"; IncrementPointTotal(64); this.pointEnJeu=64;} - if(point==65) {pointString="65 pt"; IncrementPointTotal(65); this.pointEnJeu=65;} - if(point==66) {pointString="66 pt"; IncrementPointTotal(66); this.pointEnJeu=66;} - if(point==67) {pointString="67 pt"; IncrementPointTotal(67); this.pointEnJeu=67;} - if(point==68) {pointString="68 pt"; IncrementPointTotal(68); this.pointEnJeu=68;} - if(point==69) {pointString="69 pt"; IncrementPointTotal(69); this.pointEnJeu=69;} - if(point==70) {pointString="70 pt"; IncrementPointTotal(70); this.pointEnJeu=70;} - if(point==71) {pointString="71 pt"; IncrementPointTotal(71); this.pointEnJeu=71;} - - return pointString; + if (point > 0 && point <= 1000) { + resultat.setOptionnel(false); + resultat.setTotal(point); + return resultat; + } + return resultat; } + + + + + + + + + private resultatNotationParComparaison Intervalle(String A, String Sujet, resultatNotationParComparaison resultat) { + if (A == null || A.isEmpty() || Sujet == null || Sujet.isEmpty()) { + resultat.setCorrect(false); + resultat.setPoint(0); + return resultat; + } + + try { + // 1️ **Nettoyage des parties numériques** + Pattern nonDigitPattern = Pattern.compile("[^0-9\\.]"); + + // Sépare les bornes de l'intervalle + String[] boundaries = Sujet.split("→"); + if (boundaries.length != 2) { + String key = resultat.getDescription(); + resultat.setDescription(key + " - Erreur : Intervalle incorrect"); + resultat.setCorrect(false); + resultat.setOptionnel(true); + resultat.setPoint(0); + resultat.setTotal(0); + return resultat; + } + + // Nettoyer les bornes et la valeur A + String cleanedLowerBound = nonDigitPattern.matcher(boundaries[0]).replaceAll(""); + String cleanedUpperBound = nonDigitPattern.matcher(boundaries[1]).replaceAll(""); + String cleanedA = nonDigitPattern.matcher(A).replaceAll(""); + + // 2️ **Conversion en double** + double lowerBound = Double.parseDouble(cleanedLowerBound); + double upperBound = Double.parseDouble(cleanedUpperBound); + double valueA = Double.parseDouble(cleanedA); + + // 3️ **Vérification de l'intervalle** + if (valueA >= lowerBound && valueA <= upperBound) { + resultat.setCorrect(true); + resultat.setPoint(resultat.getTotal()); + return resultat; + } + } catch (NumberFormatException e) { + String key = resultat.getDescription(); + resultat.setDescription(key + "Erreur : Format de nombre incorrect"); + resultat.setCorrect(false); + resultat.setOptionnel(true); + resultat.setPoint(0); + resultat.setTotal(0); + return resultat; + } catch (Exception e) { + + } + + String key = resultat.getDescription(); + resultat.setDescription(key + "Erreur : Hors de l'intervalle"); + resultat.setCorrect(false); + resultat.setOptionnel(true); + resultat.setPoint(0); + resultat.setTotal(0); + return resultat; + } + + /** - * Traitement des intervalles simple + * Traitement des intervalles simple.