diff --git a/ana.xml b/ana.xml new file mode 100644 index 0000000..8c55e7f --- /dev/null +++ b/ana.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/base_evaluations_analyseCalc.xml b/base_evaluations_analyseCalc.xml index d1fd3cf..cc6ce78 100644 --- a/base_evaluations_analyseCalc.xml +++ b/base_evaluations_analyseCalc.xml @@ -1 +1 @@ - EJ - ???Page 1(???)???, 00/00/000000:00:00Page 1/ 99 EJ - ???Page 1(???)???, 00/00/000000:00:00Page 1/ 99 \ No newline at end of file + EJ - ???Page 1(???)???, 00/00/000000:00:00Page 1/ 99 EJ - ???Page 1(???)???, 00/00/000000:00:00Page 1/ 99 \ No newline at end of file diff --git a/bin/AnalyseCalc/AnalyseFeuille.class b/bin/AnalyseCalc/AnalyseFeuille.class index 5d93414..1b108ae 100644 Binary files a/bin/AnalyseCalc/AnalyseFeuille.class and b/bin/AnalyseCalc/AnalyseFeuille.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille$colonne.class b/bin/AnalyseCalc/Classeur2$feuille$colonne.class index 0ee0507..1eb2e1d 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille$colonne.class and b/bin/AnalyseCalc/Classeur2$feuille$colonne.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille$graphic.class b/bin/AnalyseCalc/Classeur2$feuille$graphic.class index 4095841..b1b872b 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille$graphic.class and b/bin/AnalyseCalc/Classeur2$feuille$graphic.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule$validation.class b/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule$validation.class index 35f4ef2..40d10ae 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule$validation.class and b/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule$validation.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule.class b/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule.class index 4e699e7..d8a811c 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule.class and b/bin/AnalyseCalc/Classeur2$feuille$ligne$cellule.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille$ligne.class b/bin/AnalyseCalc/Classeur2$feuille$ligne.class index b3e3842..ba1c870 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille$ligne.class and b/bin/AnalyseCalc/Classeur2$feuille$ligne.class differ diff --git a/bin/AnalyseCalc/Classeur2$feuille.class b/bin/AnalyseCalc/Classeur2$feuille.class index dda6ada..c39ef16 100644 Binary files a/bin/AnalyseCalc/Classeur2$feuille.class and b/bin/AnalyseCalc/Classeur2$feuille.class differ diff --git a/bin/AnalyseCalc/Classeur2$historique.class b/bin/AnalyseCalc/Classeur2$historique.class index c76090a..98fc390 100644 Binary files a/bin/AnalyseCalc/Classeur2$historique.class and b/bin/AnalyseCalc/Classeur2$historique.class differ diff --git a/bin/AnalyseCalc/Classeur2$modification.class b/bin/AnalyseCalc/Classeur2$modification.class index e12d5b5..8bfb0ac 100644 Binary files a/bin/AnalyseCalc/Classeur2$modification.class and b/bin/AnalyseCalc/Classeur2$modification.class differ diff --git a/bin/AnalyseCalc/Classeur2.class b/bin/AnalyseCalc/Classeur2.class index bfeb6b5..a1a0cc3 100644 Binary files a/bin/AnalyseCalc/Classeur2.class and b/bin/AnalyseCalc/Classeur2.class differ diff --git a/bin/outils/outils.class b/bin/outils/outils.class index 4f733cc..7dc7790 100644 Binary files a/bin/outils/outils.class and b/bin/outils/outils.class differ diff --git a/src/AnalyseCalc/Classeur2.java b/src/AnalyseCalc/Classeur2.java index ec9a118..146d697 100644 --- a/src/AnalyseCalc/Classeur2.java +++ b/src/AnalyseCalc/Classeur2.java @@ -16,7 +16,6 @@ import AnalyseCalc.Classeur2.feuille.graphic; import AnalyseCalc.Classeur2.feuille.ligne; import AnalyseCalc.Classeur2.feuille.ligne.cellule; import calc.commandes; -import calcul.enumerations; import calcul.enumerations.typeFichier; import xml.EnsembleFichiers; import xml.node; diff --git a/src/evaluer/evaluerAttributEtContenu.java b/src/evaluer/evaluerAttributEtContenu.java deleted file mode 100644 index 3ddacde..0000000 --- a/src/evaluer/evaluerAttributEtContenu.java +++ /dev/null @@ -1,16 +0,0 @@ -package evaluer; - -import xml.node; - -public class evaluerAttributEtContenu { - - public evaluerAttributEtContenu(node nodeSujet, node nodeEtudiant, node analyse) { - - - - - } - - - -} diff --git a/src/evaluer/evaluerAttributs.java b/src/evaluer/evaluerAttributs.java new file mode 100644 index 0000000..bc606d6 --- /dev/null +++ b/src/evaluer/evaluerAttributs.java @@ -0,0 +1,97 @@ +package evaluer; + +import java.util.Map; +import outils.outils; +import xml.node; + +public class evaluerAttributs { + + private node nEtudiant ; + private node nAnalyse ; + private node nSujet ; + + /** + * Evaluer les attributs des nodes.
+ * @param nodeSujet : le node du sujet (colonne, ligne) + * @param nodeEtudiant : le node de l'étudiant. + * @param analyse : le node analyse qui contiendra les résultats. + */ + public evaluerAttributs(node nodeSujet, node nodeEtudiant, node analyse) { + nEtudiant = nodeEtudiant; + nAnalyse = analyse; + nSujet = nodeSujet; + if(nodeSujet.getNameNode().equals("colonne")) evaluerAttributColonne(); + if(nodeSujet.getNameNode().equals("ligne")) { + evaluerAttributLigne(); + evaluerAttributCellule(nodeSujet); + } + } + + /** + * Evaluer les attributs du node colonne.
+ */ + private void evaluerAttributColonne() { + node colonneEtudiant = trouveColonneEtudiant(); + for (Map.Entry entry : nSujet.getAttributs().entrySet()){ + if(nSujet.isAttributEvaluer(entry.getKey())) { + nAnalyse.addEnfant(new outils().Compare("colonne",entry.getKey(), entry.getValue(), colonneEtudiant.getAttributs().get(entry.getKey()))); + } + } + } + + /** + * Evaluer les attributs du node ligne.
+ */ + private void evaluerAttributLigne() { + node ligneEtudiant = trouveLigneEtudiant(); + for (Map.Entry entry : nSujet.getAttributs().entrySet()){ + if(nSujet.isAttributEvaluer(entry.getKey())) { + nAnalyse.addEnfant(new outils().Compare("ligne",entry.getKey(), entry.getValue(), ligneEtudiant.getAttributs().get(entry.getKey()))); + } + } + } + + /** + * Evaluer les attributs du node cellule;
+ */ + private void evaluerAttributCellule(node ligneSujet) { + for (node cellule : ligneSujet.retourneAllEnfants("cellule")) { + if(cellule.isEvaluer()) { + node celluleEtudiant = trouveCelluleEtudiant(cellule); + for (Map.Entry entry : cellule.getAttributs().entrySet()){ + if(cellule.isAttributEvaluer(entry.getKey())) { + nAnalyse.addEnfant(new outils().Compare("cellule",entry.getKey(), entry.getValue(), celluleEtudiant.getAttributs().get(entry.getKey()))); + } + } + } + } + } + + /** + * Trouve la colonne de l'étudiant.
+ * @return + */ + private node trouveColonneEtudiant() { + if(nEtudiant==null) return null; + return nEtudiant.retourneFirstEnfant("colonne", "RefColonne", nSujet.getAttributs().get("RefColonne")); + } + + /** + * Trouve la ligne de l'étudiant.
+ * @return + */ + private node trouveLigneEtudiant() { + if(nEtudiant==null) return null; + return nEtudiant.retourneFirstEnfant("ligne", "RefLigne", nSujet.getAttributs().get("RefLigne")); + } + + /** + * Trouve la cellule de l'étudiant.
+ * * @return + */ + private node trouveCelluleEtudiant(node cellule) { + if(nEtudiant==null) return null; + node Tempo = trouveLigneEtudiant(); + return Tempo.retourneFirstEnfant("cellule", "RefLigne", cellule.getAttributs().get("RefLigne"), "RefColonne", cellule.getAttributs().get("RefColonne")); + } +} diff --git a/src/evaluer/evaluerNodesClasseurStudent.java b/src/evaluer/evaluerNodesClasseurStudent.java index 5d7ced7..cf46654 100644 --- a/src/evaluer/evaluerNodesClasseurStudent.java +++ b/src/evaluer/evaluerNodesClasseurStudent.java @@ -5,14 +5,14 @@ import xml.node; public class evaluerNodesClasseurStudent { - private node analyse = new node(); + private node nAna = new node(); private node nodeEtudiant = new node(); public evaluerNodesClasseurStudent(node ana, node nodStudent) { nodeEtudiant = nodStudent; - analyse = ana; + nAna = ana; evaluerLesFeuilles(); - analyse.getAttributs().put("test", "reussi"); + nAna.getAttributs().put("test", "reussi"); } /** @@ -21,29 +21,53 @@ public class evaluerNodesClasseurStudent { private void evaluerLesFeuilles() { for (node feuilleSujet : commandes.sujet.retourneAllEnfants("feuille")) { if(feuilleSujet.isEvaluer()) { - node evaluerFeuille = new node("feuille"); - evaluerFeuille.getAttributs().put("nomFeuille", feuilleSujet.getAttributs().get("nomFeuille")); - analyse.addEnfant(evaluerFeuille); - evaluerLesColonnes(feuilleSujet, evaluerFeuille); + node anaFeuille = new node("feuille"); + anaFeuille.getAttributs().put("nomFeuille", feuilleSujet.getAttributs().get("nomFeuille")); + nAna.addEnfant(anaFeuille); + evaluerLesColonnes(feuilleSujet, anaFeuille); + evaluerLesLignes(feuilleSujet, anaFeuille); } } } /** - * Evaluer les colonnes les unes après les autres. + * Trouve la feuille de l'étudiant.
+ * @param nomFeuille + * @return + */ + private node trouveLaFeuilleEtudiant(String nomFeuille) { + return nodeEtudiant.retourneFirstEnfant("feuille", "nomFeuille", nomFeuille); + } + + /** + * Evaluer les colonnes les unes après les autres.
* @param feuilleSujet * @param evaluerFeuille */ - private void evaluerLesColonnes(node feuilleSujet, node evaluerFeuille) { + private void evaluerLesColonnes(node feuilleSujet, node anaFeuille) { for (node colonne : feuilleSujet.retourneAllEnfants("colonne")) { if(colonne.isEvaluer()) { - new evaluerAttributEtContenu(colonne,nodeEtudiant,analyse); + new evaluerAttributs( colonne, trouveLaFeuilleEtudiant(feuilleSujet.getAttributs().get("nomFeuille")) , nAna); + } + } + } + + /** + * Evaluer les lignes les unes après les autres.
+ * Pour chaque ligne, évaluer les cellules les unes après les autres.
+ * @param feuilleSujet + * @param anaFeuille + */ + private void evaluerLesLignes(node feuilleSujet, node anaFeuille) { + for (node ligne : feuilleSujet.retourneAllEnfants("ligne")) { + if(ligne.isEvaluer()) { + new evaluerAttributs( ligne, trouveLaFeuilleEtudiant(feuilleSujet.getAttributs().get("nomFeuille")) , nAna); } } } public node getAnalyse() { - return analyse; + return nAna; } public node getNodeEtudaint() { diff --git a/src/outils/outils.java b/src/outils/outils.java index 2a2bdec..0e56325 100644 --- a/src/outils/outils.java +++ b/src/outils/outils.java @@ -1,7 +1,5 @@ package outils; - - import java.io.UnsupportedEncodingException; import java.util.ArrayList; import java.util.regex.Matcher; @@ -11,328 +9,11 @@ import xml.node; - - public class outils { - private int pointsClass = 0; - private int pointTotal=0; - private int pointEnJeu = 0; - - -// /** -// * -// * @param code -// * @return -// */ -// public static String TraductionWriter(String code) { -// -// //************************************************************** -// //** PARAGRAPHE -// //************************************************************** -// -// //Nom des styles de paragraphe -// if(code.equals("Heading_20_1")) code="Titre 1"; -// if(code.equals("Heading_20_2")) code="Titre 2"; -// if(code.equals("Heading_20_3")) code="Titre 3"; -// if(code.equals("Standard_20__28_user_29_")) code="Standard"; -// -// -// // style paragraphe optionnel -// if(code.equals("style:family")) code="Optionnel

Type de style

"; //* -// if(code.equals("style:display-name")) code="Optionnel

Nom du style affiché

"; //* -// if(code.equals("style:class")) code="Optionnel

Classe

"; //* -// if(code.equals("style:default-outline-level")) code="Plan & numérotation

Niveau de plan

"; //* -// if(code.equals("style:name")) code="Optionnel

Nom du style xml

"; //* -// if(code.equals("style:font-family-generic-complex")) code="Optionnel

Police de caractères générique

"; //* -// //* -// if(code.equals("style:justify-single-word")) code="Optionnel

Justifier un seul mot

"; -// if(code.equals("loext:contextual-spacing")) code="Optionnel

Espacement contextuel

"; -// -// // style paragraphe gestionnaire -// if(code.equals("style:next-style-name")) code="Gestionnaire

Style de suite

"; -// if(code.equals("style:parent-style-name")) code="Gestionnaire

Hétité de

"; -// -// // style paragraphe enchaînements -// String colorEn ="#CD5C5C"; -// if(code.equals("fo:keep-together")) code="Enchaînements

Ne pas scinder le paragraphe

"; -// if(code.equals("fo:keep-with-next")) code="Enchaînements

Conserver avec le paragraphe suivant

"; -// if(code.equals("fo:orphans")) code="Enchaînements

Traitement des orphelines

"; -// if(code.equals("fo:widows")) code="Enchaînements

Traitement des veuves

"; -// if(code.equals("fo:break-after")) code="Enchaînements

Saut après

"; -// if(code.equals("fo:break-before")) code="Enchaînements

Saut avant

"; -// -// -// -// if(code.equals("style:master-page-name")) code="Enchaînements

Saut de page

"; -// if(code.equals("style:page-number")) code="Enchaînements

Numérotation de la page

"; -// -// // style paragraphe alignement -// if(code.equals("fo:text-align")) code="Alignement

Alignement du paragraphe

"; -// -// // style paragraphe police -// String colorPo = "#FF8C00"; -// if(code.equals("style:font-name")) code="Police

Nom de la police de caractères

"; -// if(code.equals("fo:font-size")) code="Police

Taille des caractères

"; -// if(code.equals("style:font-style-name")) code="Police

Style de la police

"; -// if(code.equals("fo:font-family")) code="Police

Famille de police de caractères

"; -// if(code.equals("fo:font-weight")) code="Police

Style \"Gras\"

"; -// if(code.equals("fo:font-style")) code="Police

Style de la font

"; -// if(code.equals("style:font-size-asian")) code="Police

Taille des caractères

"; -// -// -// //style paragraphe effets de caractère -// String colorEc = "#FF1493"; -// if(code.equals("fo:text-shadow")) code="Effets de caractère

Ombré

"; -// if(code.equals("fo:font-variant")) code="Effets de caractère

Petites majuscule

"; -// if(code.equals("style:text-underline-style")) code="Effets de caractère

Soulignement

"; -// if(code.equals("style:text-underline-color")) code="Effets de caractère

Couleur du soulignement

"; -// if(code.equals("fo:text-transform")) code="Effets de caractère

...

"; -// if(code.equals("style:text-underline-type")) code="Effets de caractère

Type 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="Bordures

Bordure tout autour

"; -// if(code.equals("fo:border-bottom")) code="Bordures

Bordure du bas

"; -// if(code.equals("fo:border-right")) code="Bordures

Bordure de droite

"; -// if(code.equals("fo:border-top")) code="Bordures

Bordure du haut

"; -// if(code.equals("fo:border-left")) code="Bordures

Bordure de gauche

"; -// -// if(code.equals("fo:padding")) code="Bordures

Remplissage synchronisé

"; -// if(code.equals("fo:padding-top")) code="Bordures

Remplissage haut

"; -// if(code.equals("fo:padding-bottom")) code="Bordures

Remplissage bas

"; -// if(code.equals("fo:padding-left")) code="Bordures

Remplissage gauche

"; -// if(code.equals("fo:padding-right")) code="Bordures

Remplissage droite

"; -// -// if(code.equals("style:shadow")) code="Bordures

Ombrage

"; -// -// -// -// -// -// // style paragraphe retraits et espacement -// if(code.equals("fo:margin-right")) code="Retraits et espacement

Retrait à droite

"; -// if(code.equals("fo:margin-left")) code="Retraits et espacement

Retrait à gauche

"; -// if(code.equals("fo:margin-top")) code="Retraits et espacement

Espacement au-dessus

"; -// if(code.equals("fo:margin-bottom")) code="Retraits et espacement

Espacement sous le paragraphe

"; -// if(code.equals("fo:line-height")) code="Retraits et espacement

Interligne

"; -// if(code.equals("fo:text-indent")) code="Retraits et espacement

Retait de première ligne

"; -// if(code.equals("style:auto-text-indent")) code="Retraits et espacement

Retait 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="Page

Marge gauche

"; -// if(code.equals("layout_properties_fo:margin-top")) code="Page

Marge haute

"; -// if(code.equals("layout_properties_fo:margin-right")) code="Page

Marge droite

"; -// if(code.equals("layout_properties_fo:margin-bottom")) code="Page

Marge basse

"; -// -// if(code.equals("layout_properties_style:print-orientation")) code="Page

Orientation page

"; -// if(code.equals("layout_style:page-usage")) code="Page

Mise en page

"; -// if(code.equals("layout_fo:page-height")) code="Page

Hauteur de la page

"; -// if(code.equals("layout_properties_fo:page-width")) code="Page

Largeur de la page

"; -// if(code.equals("layout_properties_fo:page-height")) code="Page

Hauteur de la page

"; -// if(code.equals("layout_properties_style:num-format")) code="Page

Format de la numérotation de la page

"; -// -// -// //Bordure de page -// if(code.equals("layout_fo:border-top")) code="Bordures de page

Bordure haute

"; -// if(code.equals("layout_fo:border-left")) code="Bordures de page

Bordure gauche

"; -// if(code.equals("layout_fo:border-right")) code="Bordures de page

Bordure droite

"; -// if(code.equals("layout_fo:border-bottom")) code="Bordures de page

Bordure basse

"; -// if(code.equals("layout_properties_fo:padding")) code="Bordures de page

Remplissage synchronisé

"; -// if(code.equals("layout_properties_fo:border")) code="Bordures de page

Bordures 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 page

Image

"; -// if(code.equals("layout_properties_draw:fill")) code="Arrière plan de la page

Type d'arrière plan de la page

"; -// -// -// // Entête -// String colorE = "#4B0082"; -// if(code.equals("2-header-properties_fo:border-bottom")) code="Entête

Bordure basse

"; -// if(code.equals("2-header-properties_fo:border-left")) code="Entête

Bordure gauche

"; -// if(code.equals("2-header-properties_fo:border-right")) code="Entête

Bordure droite

"; -// if(code.equals("2-header-properties_fo:border-top")) code="Entête

Bordure haute

"; -// if(code.equals("2-header-properties_fo:border")) code="Entête

Bordures tout autour

"; -// -// -// -// -// if(code.equals("2-header-properties_fo:margin-bottom")) code="Entête

Marge basse

"; -// if(code.equals("2-header-properties_fo:margin-left")) code="Entête

Marge gauche

"; -// if(code.equals("2-header-properties_fo:margin-right")) code="Entête

Marge droite

"; -// -// if(code.equals("2-header-properties_fo:min-height")) code="Entête

Hauteur minimale de l'entête

"; -// if(code.equals("2-header-properties_fo:padding")) code="Entête

Remplissage synchronisé

"; -// -// // Pied de page -// String colorPied = "#FF69B4"; -// if(code.equals("4-footer-style_fo:border-bottom")) code="Pied de page

Bordure basse

"; -// if(code.equals("4-footer-style_fo:border-left")) code="Pied de page

Bordure gauche

"; -// if(code.equals("4-footer-style_fo:border-right")) code="Pied de page

Bordure droite

"; -// if(code.equals("4-footer-style_fo:border-top")) code="Pied de page

Bordure haute

"; -// if(code.equals("4-footer-style_fo:border")) code="Pied de page

Bordures tout autour

"; -// -// -// -// -// if(code.equals("4-footer-style_fo:margin-top")) code="Pied de page

Marge haute

"; -// if(code.equals("4-footer-style_fo:margin-left")) code="Pied de page

Marge gauche

"; -// if(code.equals("4-footer-style_fo:margin-right")) code="Pied de page

Marge droite

"; -// if(code.equals("4-footer-style_fo:margin-bottom")) code="Pied de page

Marge basse

"; -// -// if(code.equals("4-footer-style_fo:min-height")) code="Pied de page

Hauteur minimale de l'entête

"; -// if(code.equals("4-footer-style_fo:padding")) code="Pied de page

Remplissage synchronisé

"; -// -// -// // Champs pied de page -// String colorC = "#FF7F50"; -// if(code.equals("footer_text:bookmark-ref_text:ref-name")) code="Champ dans le pied de page

Champ \"Marque page\"

"; -// if(code.equals("footer_text:bookmark-ref_text:bookmark-ref_name")) code="Champ dans le pied de page

Référence du marque page

"; -// if(code.equals("footer_text:bookmark-ref_text:reference-format")) code="Champ dans le pied de page

Type de référence du marque page

"; -// if(code.equals("footer_text:bookmark-ref_text:bookmark-ref_content")) code="Champ dans le pied de page

Valeur du champ marque page

"; -// -// if(code.equals("footer_text:page-number_text:page-number_content")) code="Champ dans le pied de page

Valeur du champ numéro de page

"; -// if(code.equals("footer_text:page-number_text:page-number_name")) code="Champ dans le pied de page

Champ \"Numéro de page\"

"; -// if(code.equals("footer_text:page-number_text:select-page")) code="Champ dans le pied de page

Valeur du champ sélectionné

"; -// if(code.equals("footer_text:date_text:date_name")) code="Champ dans le pied de page

Champ \"Date\"

"; -// if(code.equals("footer_text:page-count_text:page-count_name")) code="Champ dans le pied de page

Champ \"Nombre de page\"

"; -// if(code.equals("footer_text:title_text:title_name")) code="Champ dans le pied de page

Champ \"Titre\"

"; -// if(code.equals("footer_text:initial-creator_text:initial-creator_name")) code="Champ dans le pied de page

Champ \"Auteur\"

"; -// -// -// // Champs entête -// String colorEnt= "#8B0000"; -// if(code.equals("header_text:chapter_text:chapter_content")) code="Champ dans l'entête

Valeur du champ chapitre sélectionné

"; -// if(code.equals("header_text:chapter_text:chapter_name")) code="Champ dans l'entête

Champ \"Chapitre\"

"; -// if(code.equals("header_text:chapter_text:display")) code="Champ dans l'entête

Type d'affichage du champ chapitre

"; -// if(code.equals("header_text:chapter_text:outline-level")) code="Champ dans l'entête

Niveau du plan du chapitre

"; -// -// if(code.equals("header_text:title_text:title_content")) code="Champ dans l'entête

Valeur du champ titre sélectionné

"; -// if(code.equals("header_text:title_text:title_name")) code="Champ dans l'entête

Champ \"Titre\"

"; -// if(code.equals("header_text:title_text:display")) code="Champ dans l'entête

Type d'affichage du champ titre

"; -// if(code.equals("header_text:title_text:outline-level")) code="Champ dans l'entête

Niveau du plan du titre

"; -// -// if(code.equals("header_text:page-number_text:page-number_name")) code="Champ dans l'entête

Champ \"Numéro de page\"

"; -// if(code.equals("header_text:page-count_text:page-count_name")) code="Champ dans l'entête

Champ \"Nombre de page\"

"; -// if(code.equals("header_text:initial-creator_text:initial-creator_name")) code="Champ dans l'entête

Champ \"Auteur\"

"; -// if(code.equals("header_text:date_text:date_name")) code="Champ dans l'entête

Champ \"Date\"

"; -// -// String colorCol= "#FF4040"; -// if(code.equals("column_fo:column-count")) code="Colonnes

Nombre de colonne

"; -// if(code.equals("column_fo:column-gap")) code="Colonnes

Gouttiè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="Page

Largeur de la page

"; -// -// if(code.equals("layout_draw:fill-image-name")) code="Optionnel

Image d'arrière-plan

"; //* -// if(code.equals("layout_fo:margin-bottom")) code="Page

Espacement sous l'en-tête

"; -// if(code.equals("layout_fo:margin-top")) code="Page

Marge en haut

"; -// if(code.equals("layout_fo:margin-right")) code="Page

Marge à droite

"; -// if(code.equals("layout_fo:margin-left")) code="Page

Marge à 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="Optionnel

Nom du style du cadre ou de l'image

"; -// if(code.equals("style-style:name")) code="Optionnel

Nom du style du cadre ou de l'image

"; -// if(code.equals("style-style:protect")) code="Options

Protections

"; -// -// // type -// if(code.equals("draw:name")) code="Type

Nom de l'objet

"; -// if(code.equals("text:anchor-type")) code="Type

Type d'ancrage

"; -// if(code.equals("text:anchor-page-number")) code="Type

Ancrage dans la page numéro

"; -// if(code.equals("svg:width")) code="Type

Largeur

"; -// if(code.equals("fo:min-height")) code="Type

Hauteur minimale

"; -// -// if(code.equals("style:rel-width")) code="Type

Largeur par rapport à

"; -// if(code.equals("style:rel-height")) code="Type

Hauteur par rapport à

"; -// if(code.equals("svg:height")) code="Type

Hauteur

"; -// -// //adapter -// if(code.equals("style-fo:margin-bottom")) code="Adapter

Espacement en bas

"; -// if(code.equals("style-fo:margin-right")) code="Adapter

Espacement à droite

"; -// if(code.equals("style-fo:margin-top")) code="Adapter

Espacement en haut

"; -// if(code.equals("style-fo:margin-left")) code="Adapter

Espacement à gauche

"; -// -// if(code.equals("style-style:wrap")) code="Adapter

Adaptation du texte

"; -// if(code.equals("style-style:number-wrapped-paragraphs")) code="Adapter

Nombre de ligne adaptée

"; -// if(code.equals("style-style:wrap-contour")) code="Adapter

Contour

"; -// -// -// -// -// //position -// if(code.equals("style-style:horizontal-pos")) code="Position

Horizontale

"; -// if(code.equals("style-style:horizontal-rel")) code="Position

Horizontalement par rapport à

"; -// if(code.equals("style-style:vertical-pos")) code="Position

Verticale

"; -// if(code.equals("style-style:vertical-rel")) code="Position

Verticalement par rapport à

"; -// if(code.equals("svg:y")) code="Position

Position Y verticale

"; -// if(code.equals("svg:x")) code="Position

Position X horizontale

"; -// -// -// -// //légende -// if(code.equals("Contenu")) code="Légende

"; -// if(code.equals("ContenuSequence")) code="Légende

Valeur de la variable de séquence

"; -// if(code.equals("text:style-name")) code="Légende

Nom de variable de séquence

"; -// if(code.equals("text:name")) code="Légende

Nom2 de variable de séquence

"; -// -// -// -// -// if(code.equals("style-fo:padding")) code="Bordures

Remplissage

"; -// if(code.equals("style-fo:border")) code="Bordures

Bordures

"; -// -// -// // index -// if(code.equals("text:protected")) code="Protection

Protection 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.
* @return */ @@ -1073,6 +633,8 @@ public class outils { } + + public static String retourneEncodageUTF8(String txt){ if (txt!=null) { try { @@ -1133,66 +695,13 @@ public class outils { return A; } - /** - * Initialisation des points - */ - public void initilisePointClass() { - this.pointsClass=0; - this.pointEnJeu=0; - this.pointTotal=0; - - } - - /** - * La proportion ne doit pas être linéaire sinon c'est trop facile - * @return - */ - public double getPropClass() { - double a = (double) this.pointsClass; - double b = (double) this.pointTotal; - - return (double) Math.pow(a/b, 3); - } - public int getPointsClass() { - return this.pointsClass; - } - - public int getPointTotal() { - return this.pointTotal; - } - - - public int getPointEnJeu() { - return this.pointEnJeu; - } - - - public void setPointsClass(int pointsClass) { - this.pointsClass = pointsClass; - } - - - public void setPointTotal(int pointTotal) { - this.pointTotal = pointTotal; - } - - - public void setPointEnJeu(int pointEnJeu) { - this.pointEnJeu = pointEnJeu; - } - - private void IncrementPointTotal(Integer pt) { - this.pointTotal=this.pointTotal+ pt; - } - - private void IncrementPointClass(Integer pt) { - this.pointsClass=this.pointsClass+ pt; - } } + + diff --git a/src/outils/resultatNotationParComparaison.java b/src/outils/resultatNotationParComparaison.java new file mode 100644 index 0000000..759f6e5 --- /dev/null +++ b/src/outils/resultatNotationParComparaison.java @@ -0,0 +1,150 @@ +package outils; + +import xml.node; + +public class resultatNotationParComparaison { + + private boolean optionnel; // + private boolean correct; // + private String nomNode; + private String description; // + private String valeurSujet; // + private String valeurEtudiant; // + private int point; // + private int total; // + private node resultat = new node("resultat"); + + // **Constructeur** + public resultatNotationParComparaison(boolean optionnel ,boolean correct, String nomNode, String description, String valeurSujet, String valeurEtudiant, int point, int total) { + this.optionnel = optionnel; + this.correct = correct; + this.nomNode = nomNode; + this.description = description; + this.valeurSujet = valeurSujet; + this.valeurEtudiant = valeurEtudiant; + this.point = point; + this.total = total; + this.resultat.getAttributs().put("optionnel",String.valueOf(optionnel)); + this.resultat.getAttributs().put("correct",String.valueOf(correct)); + this.resultat.getAttributs().put("nomNode",nomNode); + this.resultat.getAttributs().put("description",description); + this.resultat.getAttributs().put("valeurSujet",valeurSujet); + this.resultat.getAttributs().put("valeurEtudiant",valeurEtudiant); + this.resultat.getAttributs().put("point",String.valueOf(point)); + this.resultat.getAttributs().put("total",String.valueOf(total)); + } + + public resultatNotationParComparaison(node resultat) { + this.resultat = resultat; + this.optionnel = Boolean.valueOf(this.resultat.getAttributs().get("optionnel")); + this.correct = Boolean.valueOf(this.resultat.getAttributs().get("correct")); + this.nomNode = this.resultat.getAttributs().get("nomNode"); + this.description = this.resultat.getAttributs().get("description"); + this.valeurSujet = this.resultat.getAttributs().get("valeurSujet"); + this.valeurEtudiant = this.resultat.getAttributs().get("valeurEtudiant"); + this.point = Integer.valueOf(this.resultat.getAttributs().get("point")); + this.total = Integer.valueOf(this.resultat.getAttributs().get("total")); + } + + // **Getters et Setters** + public boolean isOptionnel() { + return optionnel; + } + + public void setOptionnel(boolean optionnel) { + this.optionnel = optionnel; + this.resultat.getAttributs().put("optionnel",String.valueOf(optionnel)); + } + + public boolean isCorrect() { + return correct; + } + + public void setCorrect(boolean correct) { + this.correct = correct; + this.resultat.getAttributs().put("correct",String.valueOf(correct)); + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + this.resultat.getAttributs().put("description",description); + } + + public String getValeurSujet() { + return description; + } + + public void setValeurSujet(String valeurSujet) { + this.valeurSujet = valeurSujet; + this.resultat.getAttributs().put("valeurSujet",valeurSujet); + } + + public String getNomNode() { + return nomNode; + } + + public void setValeurEtudiant(String valeurEtudiant) { + this.valeurEtudiant = valeurEtudiant; + this.resultat.getAttributs().put("valeurEtudiant",valeurEtudiant); + } + + public String getValeurEtudiant() { + return valeurEtudiant; + } + + public void setNomNode(String nomNode) { + this.nomNode = nomNode; + this.resultat.getAttributs().put("nomNode",nomNode); + } + + public int getPoint() { + return point; + } + + public void setPoint(int valeur) { + this.point = valeur; + this.resultat.getAttributs().put("point",String.valueOf(point)); + } + + public int getTotal() { + return total; + } + + public void setTotal(int total) { + this.total = total; + this.resultat.getAttributs().put("total",String.valueOf(total)); + } + + + public node getResultat() { + return resultat; + } + + public void setResultat(node resultat) { + this.resultat = resultat; + } + + // **Affichage des informations de l'objet Constituer** + @Override + public String toString() { + return "resultat { " + + "Optionnel = " + optionnel + + ", Correct = " + correct + + ", nomNode = '" + nomNode + "'" + + ", description = '" + description + "'" + + ", valeurSujet = '" + valeurSujet + "'" + + ", valeurEtudiant = '" + valeurEtudiant + "'" + + ", point = " + point + + ", total = " + total + + " }"; + } + + + + } + + diff --git a/src/xml/node.java b/src/xml/node.java index 95448b7..62131bb 100644 --- a/src/xml/node.java +++ b/src/xml/node.java @@ -59,6 +59,11 @@ private boolean nodeClose = false; if(!Boolean.valueOf(this.getAttributs().get("evaluer"))) return false; return true; } + + public boolean isAttributEvaluer(String key) { + return this.attributs.get(key).contains("‽"); + } + public String getNameNode() { if(this.equals(null)) return ""; @@ -205,6 +210,14 @@ private boolean nodeClose = false; return null; } + /** + * Retourne le premier node ayant le nameNode et ayant l'attribut nameAttribut avec comme valeur valueAttribut.
+ * Sinom retourne un null.
+ * @param nameNode + * @param nameAttribut + * @param valueAttribut + * @return + */ public node retourneFirstEnfant(String nameNode, String nameAttribut, String valueAttribut) { if(this.nameNode.equals(nameNode) && this.attributs.containsKey(nameAttribut)) { if(this.attributs.get(nameAttribut).equals(valueAttribut)) return this; @@ -216,6 +229,18 @@ private boolean nodeClose = false; return null; } + /** + * Retourne le premier node ayant le nameNode et ayant :
+ * + L'attribut nameAttribut1 avec comme valeur valueAttribut1.
+ * + L'attribut nameAttribut2 avec comme valeur valueAttribut2.
+ * Sinom retourne un null.
+ * @param nameNode + * @param nameAttribut1 + * @param valueAttribut1 + * @param nameAttribut2 + * @param valueAttribut2 + * @return + */ public node retourneFirstEnfant(String nameNode, String nameAttribut1, String valueAttribut1,String nameAttribut2, String valueAttribut2) { if(this.nameNode.equals(nameNode) && this.attributs.containsKey(nameAttribut1) && this.attributs.containsKey(nameAttribut2)) { if(this.attributs.get(nameAttribut1).equals(valueAttribut1) && this.attributs.get(nameAttribut2).equals(valueAttribut2)) return this;