diff --git a/analyseWriter.exe b/analyseWriter.exe index f419e99..457b37f 100644 Binary files a/analyseWriter.exe and b/analyseWriter.exe differ diff --git a/analyseWriter.jar b/analyseWriter.jar index faf8929..bbee6b7 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index 78b40c7..582913d 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -3,3 +3,7 @@ /evaluer/ /fenetres/ /list/ +/informationmultiple.png +/informationmultiple.svg +/informationmultiplemini.png +/resources/ diff --git a/bin/calcul/calculNombrePointEvaluation.class b/bin/calcul/calculNombrePointEvaluation.class index f87945a..97e3c32 100644 Binary files a/bin/calcul/calculNombrePointEvaluation.class and b/bin/calcul/calculNombrePointEvaluation.class differ diff --git a/bin/evalnumeropage.svg b/bin/evalnumeropage.svg index 10a0140..3d57fc7 100644 --- a/bin/evalnumeropage.svg +++ b/bin/evalnumeropage.svg @@ -4,7 +4,7 @@ inkscape:export-xdpi="90" inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\evalnumeropage.png" sodipodi:docname="evalnumeropage.svg" - inkscape:version="1.1.2 (b8e25be833, 2022-02-05)" + inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)" id="svg8" version="1.1" viewBox="0 0 12.7 12.7" @@ -181,8 +181,8 @@ inkscape:document-rotation="0" inkscape:current-layer="g14476" inkscape:document-units="mm" - inkscape:cy="28.000973" - inkscape:cx="11.415031" + inkscape:cy="28.049755" + inkscape:cx="-1.3171189" inkscape:zoom="10.249644" inkscape:pageshadow="2" inkscape:pageopacity="0.0" @@ -200,35 +200,49 @@ inkscape:bbox-nodes="true" inkscape:snap-midpoints="true" inkscape:object-paths="true" - inkscape:snap-global="false"> + inkscape:snap-global="false" + inkscape:showpageshadow="2" + inkscape:deskcolor="#d1d1d1"> + id="guide1279" + inkscape:locked="false" /> + id="guide1281" + inkscape:locked="false" /> + id="guide1283" + inkscape:locked="false" /> + id="guide1285" + inkscape:locked="false" /> + id="guide1287" + inkscape:locked="false" /> + id="guide1289" + inkscape:locked="false" /> + id="guide1291" + inkscape:locked="false" /> + @@ -314,6 +328,20 @@ style="fill:#ff0000;stroke-width:2.81646" x="-90.369453" y="60.364491"># + + + diff --git a/bin/evaluer/evaluationAttribut.class b/bin/evaluer/evaluationAttribut.class index 1a10e52..86d322a 100644 Binary files a/bin/evaluer/evaluationAttribut.class and b/bin/evaluer/evaluationAttribut.class differ diff --git a/bin/fenetres/afficheText.class b/bin/fenetres/afficheText.class index 5f1e94c..1aa0866 100644 Binary files a/bin/fenetres/afficheText.class and b/bin/fenetres/afficheText.class differ diff --git a/bin/fenetres/createPopupMenu.class b/bin/fenetres/createPopupMenu.class index 388964b..99214e0 100644 Binary files a/bin/fenetres/createPopupMenu.class and b/bin/fenetres/createPopupMenu.class differ diff --git a/bin/fenetres/create_act/actEvalNumeroAbsoluePageOui.class b/bin/fenetres/create_act/actEvalNumeroAbsoluePageOui.class index 6ad1088..83b33b6 100644 Binary files a/bin/fenetres/create_act/actEvalNumeroAbsoluePageOui.class and b/bin/fenetres/create_act/actEvalNumeroAbsoluePageOui.class differ diff --git a/bin/list/listeAttributsAnalyseWriter.class b/bin/list/listeAttributsAnalyseWriter.class index af2422a..4cb6900 100644 Binary files a/bin/list/listeAttributsAnalyseWriter.class and b/bin/list/listeAttributsAnalyseWriter.class differ diff --git a/icons/evalnumeropage.svg b/icons/evalnumeropage.svg index 10a0140..3d57fc7 100644 --- a/icons/evalnumeropage.svg +++ b/icons/evalnumeropage.svg @@ -4,7 +4,7 @@ inkscape:export-xdpi="90" inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\evalnumeropage.png" sodipodi:docname="evalnumeropage.svg" - inkscape:version="1.1.2 (b8e25be833, 2022-02-05)" + inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)" id="svg8" version="1.1" viewBox="0 0 12.7 12.7" @@ -181,8 +181,8 @@ inkscape:document-rotation="0" inkscape:current-layer="g14476" inkscape:document-units="mm" - inkscape:cy="28.000973" - inkscape:cx="11.415031" + inkscape:cy="28.049755" + inkscape:cx="-1.3171189" inkscape:zoom="10.249644" inkscape:pageshadow="2" inkscape:pageopacity="0.0" @@ -200,35 +200,49 @@ inkscape:bbox-nodes="true" inkscape:snap-midpoints="true" inkscape:object-paths="true" - inkscape:snap-global="false"> + inkscape:snap-global="false" + inkscape:showpageshadow="2" + inkscape:deskcolor="#d1d1d1"> + id="guide1279" + inkscape:locked="false" /> + id="guide1281" + inkscape:locked="false" /> + id="guide1283" + inkscape:locked="false" /> + id="guide1285" + inkscape:locked="false" /> + id="guide1287" + inkscape:locked="false" /> + id="guide1289" + inkscape:locked="false" /> + id="guide1291" + inkscape:locked="false" /> + @@ -314,6 +328,20 @@ style="fill:#ff0000;stroke-width:2.81646" x="-90.369453" y="60.364491"># + + + diff --git a/icons/evalnumeropageancrage.png b/icons/evalnumeropageancrage.png new file mode 100644 index 0000000..6731405 Binary files /dev/null and b/icons/evalnumeropageancrage.png differ diff --git a/icons/evalnumeropageancrage.svg b/icons/evalnumeropageancrage.svg new file mode 100644 index 0000000..7cc8657 --- /dev/null +++ b/icons/evalnumeropageancrage.svg @@ -0,0 +1,333 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + # + + + + diff --git a/icons/evalnumeropageancragemini.png b/icons/evalnumeropageancragemini.png new file mode 100644 index 0000000..2761d81 Binary files /dev/null and b/icons/evalnumeropageancragemini.png differ diff --git a/src/calcul/calculNombrePointEvaluation.java b/src/calcul/calculNombrePointEvaluation.java index 1d2987b..3a96389 100644 --- a/src/calcul/calculNombrePointEvaluation.java +++ b/src/calcul/calculNombrePointEvaluation.java @@ -142,6 +142,16 @@ public class calculNombrePointEvaluation { } } + if(nod.getAttributs().get("evalAncrageNumeroAbsoluePage")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalAncrageNumeroAbsoluePage")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalAncrageNumeroAbsoluePage"); + } + } + + + //*********************************************** //** Les points par la méthode analyseStyle ***** //*********************************************** diff --git a/src/evaluer/evaluationAttribut.java b/src/evaluer/evaluationAttribut.java index d1f2515..e10867c 100644 --- a/src/evaluer/evaluationAttribut.java +++ b/src/evaluer/evaluationAttribut.java @@ -7,6 +7,7 @@ import java.util.regex.Pattern; import MEPTL.commandes; import cXML.node; import list.listeAttributsAnalyseWriter; +import list.listeDesNodesAncrable; import list.listeDesNodesEvalPlacement; public class evaluationAttribut { @@ -295,6 +296,15 @@ public class evaluationAttribut { } } + // evaluation de l'ancrage au numéro absolu de la page. + if(k.equals("evalAncrageNumeroAbsoluePage") && listeDesNodesAncrable.isAncrable(sujet)) { + if(nodeStudent!=null) { + retour = evaluationNumeroAbsoluePage(retour,nodeStudent.retourneNodePage(), sujet.retourneNodePage().getAttributs().get("numeroabsolue"), sujet.getAttributs().get("evalAncrageNumeroAbsoluePage"),"Ancrage"); + }else { + retour = evaluationNumeroAbsoluePage(retour,null, "Pas trouvé la page", sujet.retourneNodePage().getAttributs().get("numeroabsolue"),"Ancrage"); + } + } + // evaluation du placement du paragraphe if(k.equals("evalPlacement") && listeDesNodesEvalPlacement.isPlacement(sujet)) { retour=evalPlacement(sujet, nodeStudent, retour, nameElt); @@ -875,10 +885,10 @@ public class evaluationAttribut { private static node evaluationNumeroAbsoluePage(node retour, node nodStudent, String numeroAbsoluePage, String point, String nameElt) { node item = null; if(nodStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(numeroAbsoluePage,"numéro absolue", nodStudent.getAttributs().get("numeroabsolue"),numeroAbsoluePage + "‽" +point, nameElt ); + item = retourneNoteAvecResultatsAnalyse(numeroAbsoluePage,"numéro absolue", "page "+nodStudent.getAttributs().get("numeroabsolue"),"page "+numeroAbsoluePage + "‽" +point, nameElt ); }else { evaluation.IncrementPointTotal(Integer.valueOf(point)); - item = new node(numeroAbsoluePage, "Erreur", "Numéro de la page absolue" , "null", numeroAbsoluePage, 2, evaluation.getPointEnJeu(),nameElt); + item = new node(numeroAbsoluePage, "Erreur", "Numéro de la page absolue" , "null", "page "+numeroAbsoluePage, 2, evaluation.getPointEnJeu(),nameElt); } retour.getNodes().add(item); return retour; diff --git a/src/fenetres/afficheText.java b/src/fenetres/afficheText.java index b456a00..f83368d 100644 --- a/src/fenetres/afficheText.java +++ b/src/fenetres/afficheText.java @@ -74,6 +74,7 @@ public class afficheText extends JEditorPane { String imageDernierEnfant= ""; String imagePremierEnfant= ""; String imageIsDoublon= ""; + String imageEvalAncrageNumeroAbsoluPage= ""; StringBuilder sb = new StringBuilder(); @@ -243,6 +244,9 @@ public class afficheText extends JEditorPane { if(Lesattributsdunode.get(i).equals("isDoublon") && nod.getAttributs().get(Lesattributsdunode.get(i)).equals("true")) { sb.append("
  • "+imageIsDoublon+ " " + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); } + if(Lesattributsdunode.get(i).equals("evalAncrageNumeroAbsoluePage") && !nod.getAttributs().get(Lesattributsdunode.get(i)).equals("0")) { + sb.append("
  • "+imageEvalAncrageNumeroAbsoluPage+ " " + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); + } // sb.append("
  • " + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); } diff --git a/src/fenetres/createPopupMenu.java b/src/fenetres/createPopupMenu.java index 7a2082d..b822d62 100644 --- a/src/fenetres/createPopupMenu.java +++ b/src/fenetres/createPopupMenu.java @@ -16,6 +16,8 @@ import fenetres.create_act.actCollapseNode; import fenetres.create_act.actCopy; import fenetres.create_act.actDeleteNode; import fenetres.create_act.actDownNode; +import fenetres.create_act.actEvalAncrageNumeroAbsoluePageNon; +import fenetres.create_act.actEvalAncrageNumeroAbsoluePageOui; import fenetres.create_act.actEvalEnteteActive; import fenetres.create_act.actEvalEnteteActiveNon; import fenetres.create_act.actEvalEntetePasActive; @@ -86,6 +88,7 @@ import fenetres.create_act.mnEvaluerATraversAnalyseStyleFalse; import fenetres.create_act.mnEvaluerATraversAnalyseStyleTrue; import list.listeDesNodesAllContent; import list.listeDesNodesAnalyseStyle; +import list.listeDesNodesAncrable; import list.listeDesNodesAvecEvalNameNode; import list.listeDesNodesAvecOU; import list.listeDesNodesEvalPlacement; @@ -251,7 +254,7 @@ if(nod!=null) { } /** - * + * Insertion de l'information du node.
    * @return */ private JMenu mnInsereInformation() { @@ -263,7 +266,7 @@ if(nod!=null) { } /** - * + * Insertion de l'information sur tous les nodes de la page.
    * @return */ private JMenu mnInsereInformationMultiple() { @@ -274,6 +277,18 @@ if(nod!=null) { return mnInsereInformationMultiple; } + /** + * Evaluation de l'ancrage du node dans la page par son numéro absolue.
    + * @return + */ + private JMenu mnEvalAncrageNumeroAbsoluPageAncrage() { + JMenu mnEvalAncrageNumeroAbsoluPageAncrage = new JMenu("Numéro absolue de la page"); + mnEvalAncrageNumeroAbsoluPageAncrage.setIcon(new ImageIcon(create.class.getResource("/resources/evalnumeropageancragemini.png"))); + mnEvalAncrageNumeroAbsoluPageAncrage.add(new actEvalAncrageNumeroAbsoluePageOui()); + mnEvalAncrageNumeroAbsoluPageAncrage.add(new actEvalAncrageNumeroAbsoluePageNon()); + return mnEvalAncrageNumeroAbsoluPageAncrage; + } + /** * Menu Titre pour le niveau 1.
    @@ -694,13 +709,17 @@ if(nod!=null) { if(listeDesNodesAllContent.isAllContent(nod) ) { mnGroupeMethodeEvaluer.addSeparator(); - mnGroupeMethodeEvaluer.add(new actAllContent()); + mnGroupeMethodeEvaluer.add(new actAllContent()); if(listeDesNodesPourEvaluerPage.isPage(nod)) { mnGroupeMethodeEvaluer.addSeparator(); mnGroupeMethodeEvaluer.add(new actAllContentChilds()); } } + if(listeDesNodesAncrable.isAncrable(nod)) { + mnGroupeMethodeEvaluer.addSeparator(); + mnGroupeMethodeEvaluer.add(mnEvalAncrageNumeroAbsoluPageAncrage()); + } if(listeEvalNameNode.isNodeEvalNameNode(nod)) { mnGroupeMethodeEvaluer.addSeparator(); diff --git a/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageNon.java b/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageNon.java new file mode 100644 index 0000000..5c91630 --- /dev/null +++ b/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageNon.java @@ -0,0 +1,30 @@ +package fenetres.create_act; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; + +import cXML.node; +import fenetres.create; + +public class actEvalAncrageNumeroAbsoluePageNon extends AbstractAction{ + { + putValue( Action.NAME, "Supprime évaluer l'ancrage au numéro absolue de la page" ); + putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation de l'ancrage au numéro absolue de la page." ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/falsemini.png")) ); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) fenetres.create.getSelectNode().getUserObject(); + nod.supprimeAttribut("evalAncrageNumeroAbsoluePage"); + fenetres.create.getTextNodeSelect().refreshAffichage(nod); + } + +} diff --git a/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageOui.java b/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageOui.java new file mode 100644 index 0000000..da15e71 --- /dev/null +++ b/src/fenetres/create_act/actEvalAncrageNumeroAbsoluePageOui.java @@ -0,0 +1,55 @@ +package fenetres.create_act; + +import java.awt.event.ActionEvent; + +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.ImageIcon; +import javax.swing.JOptionPane; + +import cXML.node; +import fenetres.baliseStyle; +import fenetres.create; + +public class actEvalAncrageNumeroAbsoluePageOui extends AbstractAction{ + { + putValue( Action.NAME, "Oui, combien de point?" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer l'ancrage au numéro absolue de la page" ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png")) ); + putValue( Action.SMALL_ICON, new ImageIcon(create.class.getResource("/resources/truemini.png")) ); + } + /** + * + */ + private static final long serialVersionUID = 1L; + + @Override + public void actionPerformed(ActionEvent e) { + node nod = (node) fenetres.create.getSelectNode().getUserObject(); + int point = 0; + if(nod.getAttributs().get("evalAncrageNumeroAbsoluePage")!=null) { + point = Integer.valueOf(nod.getAttributs().get("evalAncrageNumeroAbsoluePage")); + } + + String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point); + + if(!a.isEmpty()) { + try { + point = Integer.valueOf(a); + if(point<=0) { + nod.getAttributs().put("evalAncrageNumeroAbsoluePage", String.valueOf(0)); + fenetres.create.getTextNodeSelect().setText(baliseStyle.balise()); + fenetres.create.getTextNodeSelect().setText("

    Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.
    Cependant,la valeur a été modifiée.
    evalAncrageNumeroAbsoluePage=0.

    "); + }else { + nod.getAttributs().put("evalAncrageNumeroAbsoluePage", String.valueOf(point)); + } + } catch (Exception e2) { + fenetres.create.getTextNodeSelect().setText(baliseStyle.balise()); + fenetres.create.getTextNodeSelect().setText("

    Erreur la valeur doit être un nombre entier.
    L'attribut n'a pas été modifiée.

    "); + } + } + fenetres.create.getTextNodeSelect().refreshAffichage(nod); + + } + +} diff --git a/src/fenetres/create_act/actEvalNumeroAbsoluePageOui.java b/src/fenetres/create_act/actEvalNumeroAbsoluePageOui.java index d3e5bd3..4db984b 100644 --- a/src/fenetres/create_act/actEvalNumeroAbsoluePageOui.java +++ b/src/fenetres/create_act/actEvalNumeroAbsoluePageOui.java @@ -48,6 +48,8 @@ public class actEvalNumeroAbsoluePageOui extends AbstractAction{ fenetres.create.getTextNodeSelect().setText("

    Erreur la valeur doit être un nombre entier.
    L'attribut n'a pas été modifiée.

    "); } } - fenetres.create.getTextNodeSelect().refreshAffichage(nod); } + fenetres.create.getTextNodeSelect().refreshAffichage(nod); + + } } diff --git a/src/list/listeAttributsAnalyseWriter.java b/src/list/listeAttributsAnalyseWriter.java index 0c1def4..e648afc 100644 --- a/src/list/listeAttributsAnalyseWriter.java +++ b/src/list/listeAttributsAnalyseWriter.java @@ -28,8 +28,6 @@ public class listeAttributsAnalyseWriter { if(attribut.equals("recherche_index")) return true; if(attribut.equals("recherche_contenu_exact")) return true; if(attribut.equals("styletitre")) return true; //ancienne version, il faudra les supprimer au fur plus ajouter depuis la version v4.1.2 - if(attribut.equals("evalNameCreator")) return true; - if(attribut.equals("evalNameInitialCreator")) return true; if(attribut.equals("recherche_anchor-page-number")) return true; if(attribut.equals("recherche_contenu_plus_proche_voisin")) return true; if(attribut.equals("numero")) return true; @@ -37,9 +35,10 @@ public class listeAttributsAnalyseWriter { if(attribut.equals("isDoublon")) return true; - if(attribut.equals("EvaluerATraversAnalyseStyle")) return true; - // Les attributs évaluateurs + if(attribut.equals("EvaluerATraversAnalyseStyle")) return true; + if(attribut.equals("evalNameCreator")) return true; + if(attribut.equals("evalNameInitialCreator")) return true; if(attribut.equals("evalNameLegacyStyle")) return true; if(attribut.equals("allContent")) return true; if(attribut.equals("evalNameNode")) return true; @@ -55,6 +54,8 @@ public class listeAttributsAnalyseWriter { if(attribut.equals("evalPlacement")) return true; if(attribut.equals("evalLastChild")) return true; if(attribut.equals("evalFirstChild")) return true; + if(attribut.equals("evalAncrageNumeroAbsoluePage")) return true; + //Les attribut placer dans le node fichier du fichier d'analyse diff --git a/src/list/listeDesNodesAncrable.java b/src/list/listeDesNodesAncrable.java new file mode 100644 index 0000000..fcbcbb5 --- /dev/null +++ b/src/list/listeDesNodesAncrable.java @@ -0,0 +1,18 @@ +package list; + +import cXML.node; + +public class listeDesNodesAncrable { + + + public static Boolean isAncrable(node nod) { + + if(nod.getNomElt().equals("text:p")) return true; + if(nod.getNomElt().equals("text:h")) return true; + if(nod.getNomElt().equals("text:list")) return true; + if(nod.getNomElt().equals("text:list-item")) return true; + + return false; + } + +} diff --git a/src/resources/evalnumeropageancrage.png b/src/resources/evalnumeropageancrage.png new file mode 100644 index 0000000..6731405 Binary files /dev/null and b/src/resources/evalnumeropageancrage.png differ diff --git a/src/resources/evalnumeropageancragemini.png b/src/resources/evalnumeropageancragemini.png new file mode 100644 index 0000000..2761d81 Binary files /dev/null and b/src/resources/evalnumeropageancragemini.png differ