diff --git a/analyseWriter.exe b/analyseWriter.exe index 58c88e0..4b1205f 100644 Binary files a/analyseWriter.exe and b/analyseWriter.exe differ diff --git a/analyseWriter.jar b/analyseWriter.jar index ed708a8..8309d5e 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index f6621de..c3fb15f 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -8,3 +8,8 @@ /piedpagenon.png /piedpagenon.svg /piedpagenonmini.png +/list/ +/evalnamesequence.png +/evalnamesequence.svg +/evalnamesequencemini.png +/evaluer/ diff --git a/bin/MEPTL/HTML.class b/bin/MEPTL/HTML.class index d269ee7..406af0f 100644 Binary files a/bin/MEPTL/HTML.class and b/bin/MEPTL/HTML.class differ diff --git a/bin/MEPTL/analyseLesNodesEnfants.class b/bin/MEPTL/analyseLesNodesEnfants.class deleted file mode 100644 index 632faa4..0000000 Binary files a/bin/MEPTL/analyseLesNodesEnfants.class and /dev/null differ diff --git a/bin/MEPTL/analyseLesNodesPrincipaux.class b/bin/MEPTL/analyseLesNodesPrincipaux.class deleted file mode 100644 index 280530a..0000000 Binary files a/bin/MEPTL/analyseLesNodesPrincipaux.class and /dev/null differ diff --git a/bin/MEPTL/ecritureSujet.class b/bin/MEPTL/ecritureSujet.class index 631c450..b090d0a 100644 Binary files a/bin/MEPTL/ecritureSujet.class and b/bin/MEPTL/ecritureSujet.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index 07288b7..1b86729 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/MEPTL/outils.class b/bin/MEPTL/outils.class deleted file mode 100644 index 034872e..0000000 Binary files a/bin/MEPTL/outils.class and /dev/null differ diff --git a/bin/MEPTL/rechercherUnNodeStudent.class b/bin/MEPTL/rechercherUnNodeStudent.class index c01f4b8..e1123c1 100644 Binary files a/bin/MEPTL/rechercherUnNodeStudent.class and b/bin/MEPTL/rechercherUnNodeStudent.class differ diff --git a/bin/MEPTL/verificationFichierAnalyse.class b/bin/MEPTL/verificationFichierAnalyse.class index 5b78db0..75d6469 100644 Binary files a/bin/MEPTL/verificationFichierAnalyse.class and b/bin/MEPTL/verificationFichierAnalyse.class differ diff --git a/bin/app/afficheText.class b/bin/app/afficheText.class index 70e0e98..e8301af 100644 Binary files a/bin/app/afficheText.class and b/bin/app/afficheText.class differ diff --git a/bin/app/attributs$10.class b/bin/app/attributs$10.class index 3b96dc3..6167364 100644 Binary files a/bin/app/attributs$10.class and b/bin/app/attributs$10.class differ diff --git a/bin/app/attributs.class b/bin/app/attributs.class index 60ad300..da4fd6a 100644 Binary files a/bin/app/attributs.class and b/bin/app/attributs.class differ diff --git a/bin/app/create$1.class b/bin/app/create$1.class index 6760f46..bc374ee 100644 Binary files a/bin/app/create$1.class and b/bin/app/create$1.class differ diff --git a/bin/app/create$10.class b/bin/app/create$10.class index 52d489c..3f5eacf 100644 Binary files a/bin/app/create$10.class and b/bin/app/create$10.class differ diff --git a/bin/app/create$11.class b/bin/app/create$11.class index 134b42e..c8f2327 100644 Binary files a/bin/app/create$11.class and b/bin/app/create$11.class differ diff --git a/bin/app/create$12.class b/bin/app/create$12.class index 7e63529..4fce743 100644 Binary files a/bin/app/create$12.class and b/bin/app/create$12.class differ diff --git a/bin/app/create$13.class b/bin/app/create$13.class index 35dd2aa..3ec968f 100644 Binary files a/bin/app/create$13.class and b/bin/app/create$13.class differ diff --git a/bin/app/create$14.class b/bin/app/create$14.class index af2b272..4176407 100644 Binary files a/bin/app/create$14.class and b/bin/app/create$14.class differ diff --git a/bin/app/create$15.class b/bin/app/create$15.class index 4726e4a..764f111 100644 Binary files a/bin/app/create$15.class and b/bin/app/create$15.class differ diff --git a/bin/app/create$16.class b/bin/app/create$16.class index 1dcad15..ff74e58 100644 Binary files a/bin/app/create$16.class and b/bin/app/create$16.class differ diff --git a/bin/app/create$17.class b/bin/app/create$17.class index 0113ef1..a8fad6c 100644 Binary files a/bin/app/create$17.class and b/bin/app/create$17.class differ diff --git a/bin/app/create$18.class b/bin/app/create$18.class index f28af8e..7857070 100644 Binary files a/bin/app/create$18.class and b/bin/app/create$18.class differ diff --git a/bin/app/create$19.class b/bin/app/create$19.class index 4b5bc73..4afeba8 100644 Binary files a/bin/app/create$19.class and b/bin/app/create$19.class differ diff --git a/bin/app/create$2.class b/bin/app/create$2.class index b08490d..c74db38 100644 Binary files a/bin/app/create$2.class and b/bin/app/create$2.class differ diff --git a/bin/app/create$20.class b/bin/app/create$20.class index 60f9260..bf1e702 100644 Binary files a/bin/app/create$20.class and b/bin/app/create$20.class differ diff --git a/bin/app/create$21.class b/bin/app/create$21.class index 0d01618..752e37c 100644 Binary files a/bin/app/create$21.class and b/bin/app/create$21.class differ diff --git a/bin/app/create$22.class b/bin/app/create$22.class index fb303c2..ceaed5c 100644 Binary files a/bin/app/create$22.class and b/bin/app/create$22.class differ diff --git a/bin/app/create$23.class b/bin/app/create$23.class index 8f5f07f..62bc5ee 100644 Binary files a/bin/app/create$23.class and b/bin/app/create$23.class differ diff --git a/bin/app/create$24.class b/bin/app/create$24.class index b2dff06..e8b6825 100644 Binary files a/bin/app/create$24.class and b/bin/app/create$24.class differ diff --git a/bin/app/create$25.class b/bin/app/create$25.class index 64e7953..2822a84 100644 Binary files a/bin/app/create$25.class and b/bin/app/create$25.class differ diff --git a/bin/app/create$26.class b/bin/app/create$26.class index f2f5234..6255fea 100644 Binary files a/bin/app/create$26.class and b/bin/app/create$26.class differ diff --git a/bin/app/create$27.class b/bin/app/create$27.class index 7ea9023..0e63b0c 100644 Binary files a/bin/app/create$27.class and b/bin/app/create$27.class differ diff --git a/bin/app/create$28.class b/bin/app/create$28.class index f233561..4d2c67f 100644 Binary files a/bin/app/create$28.class and b/bin/app/create$28.class differ diff --git a/bin/app/create$29.class b/bin/app/create$29.class index c6b3b4d..4cf6418 100644 Binary files a/bin/app/create$29.class and b/bin/app/create$29.class differ diff --git a/bin/app/create$3.class b/bin/app/create$3.class index b1aedaf..9c0c4a6 100644 Binary files a/bin/app/create$3.class and b/bin/app/create$3.class differ diff --git a/bin/app/create$30.class b/bin/app/create$30.class index 39f54a5..119b4e1 100644 Binary files a/bin/app/create$30.class and b/bin/app/create$30.class differ diff --git a/bin/app/create$31.class b/bin/app/create$31.class index 0efe959..0c0bc28 100644 Binary files a/bin/app/create$31.class and b/bin/app/create$31.class differ diff --git a/bin/app/create$32.class b/bin/app/create$32.class index 7954ec8..63f904c 100644 Binary files a/bin/app/create$32.class and b/bin/app/create$32.class differ diff --git a/bin/app/create$33.class b/bin/app/create$33.class index 9f79bb0..32e1329 100644 Binary files a/bin/app/create$33.class and b/bin/app/create$33.class differ diff --git a/bin/app/create$34.class b/bin/app/create$34.class index 4e3e3d9..67941d7 100644 Binary files a/bin/app/create$34.class and b/bin/app/create$34.class differ diff --git a/bin/app/create$35.class b/bin/app/create$35.class index 966136c..0a368a9 100644 Binary files a/bin/app/create$35.class and b/bin/app/create$35.class differ diff --git a/bin/app/create$36.class b/bin/app/create$36.class index 139e688..c201d90 100644 Binary files a/bin/app/create$36.class and b/bin/app/create$36.class differ diff --git a/bin/app/create$37.class b/bin/app/create$37.class index fe16409..495d277 100644 Binary files a/bin/app/create$37.class and b/bin/app/create$37.class differ diff --git a/bin/app/create$38.class b/bin/app/create$38.class index 336fba4..b8cbfcb 100644 Binary files a/bin/app/create$38.class and b/bin/app/create$38.class differ diff --git a/bin/app/create$39.class b/bin/app/create$39.class index 11bd87f..e0feaaa 100644 Binary files a/bin/app/create$39.class and b/bin/app/create$39.class differ diff --git a/bin/app/create$4.class b/bin/app/create$4.class index dba69ff..a71d804 100644 Binary files a/bin/app/create$4.class and b/bin/app/create$4.class differ diff --git a/bin/app/create$40.class b/bin/app/create$40.class index 1cb28ce..1a6e6be 100644 Binary files a/bin/app/create$40.class and b/bin/app/create$40.class differ diff --git a/bin/app/create$41.class b/bin/app/create$41.class index d41fe76..05244e0 100644 Binary files a/bin/app/create$41.class and b/bin/app/create$41.class differ diff --git a/bin/app/create$42.class b/bin/app/create$42.class index e6a732c..435344c 100644 Binary files a/bin/app/create$42.class and b/bin/app/create$42.class differ diff --git a/bin/app/create$43.class b/bin/app/create$43.class index 64cdabe..2ecb424 100644 Binary files a/bin/app/create$43.class and b/bin/app/create$43.class differ diff --git a/bin/app/create$44.class b/bin/app/create$44.class index 723e75f..bd9df08 100644 Binary files a/bin/app/create$44.class and b/bin/app/create$44.class differ diff --git a/bin/app/create$45.class b/bin/app/create$45.class index 673e6af..3da1f3d 100644 Binary files a/bin/app/create$45.class and b/bin/app/create$45.class differ diff --git a/bin/app/create$46.class b/bin/app/create$46.class index 55291bf..3d240e4 100644 Binary files a/bin/app/create$46.class and b/bin/app/create$46.class differ diff --git a/bin/app/create$47.class b/bin/app/create$47.class index 2c14025..4414eb6 100644 Binary files a/bin/app/create$47.class and b/bin/app/create$47.class differ diff --git a/bin/app/create$48.class b/bin/app/create$48.class index 8076713..0ca7e2a 100644 Binary files a/bin/app/create$48.class and b/bin/app/create$48.class differ diff --git a/bin/app/create$49.class b/bin/app/create$49.class index cc40695..0608b50 100644 Binary files a/bin/app/create$49.class and b/bin/app/create$49.class differ diff --git a/bin/app/create$5.class b/bin/app/create$5.class index bd71523..c426c65 100644 Binary files a/bin/app/create$5.class and b/bin/app/create$5.class differ diff --git a/bin/app/create$50.class b/bin/app/create$50.class index c1a7d88..7e2622b 100644 Binary files a/bin/app/create$50.class and b/bin/app/create$50.class differ diff --git a/bin/app/create$51.class b/bin/app/create$51.class index e7dc694..30ad445 100644 Binary files a/bin/app/create$51.class and b/bin/app/create$51.class differ diff --git a/bin/app/create$52.class b/bin/app/create$52.class index 776ca71..e734449 100644 Binary files a/bin/app/create$52.class and b/bin/app/create$52.class differ diff --git a/bin/app/create$53.class b/bin/app/create$53.class index 9abe815..c4ef740 100644 Binary files a/bin/app/create$53.class and b/bin/app/create$53.class differ diff --git a/bin/app/create$54.class b/bin/app/create$54.class index 851db49..4a1f361 100644 Binary files a/bin/app/create$54.class and b/bin/app/create$54.class differ diff --git a/bin/app/create$55.class b/bin/app/create$55.class index af50fe8..eaefc1b 100644 Binary files a/bin/app/create$55.class and b/bin/app/create$55.class differ diff --git a/bin/app/create$56.class b/bin/app/create$56.class index ce86e4e..589eff4 100644 Binary files a/bin/app/create$56.class and b/bin/app/create$56.class differ diff --git a/bin/app/create$57.class b/bin/app/create$57.class index 0153441..0cfe427 100644 Binary files a/bin/app/create$57.class and b/bin/app/create$57.class differ diff --git a/bin/app/create$58.class b/bin/app/create$58.class index c35d794..76a751d 100644 Binary files a/bin/app/create$58.class and b/bin/app/create$58.class differ diff --git a/bin/app/create$59.class b/bin/app/create$59.class index b3d3341..9a84a0d 100644 Binary files a/bin/app/create$59.class and b/bin/app/create$59.class differ diff --git a/bin/app/create$6.class b/bin/app/create$6.class index cfa34ea..32e55e4 100644 Binary files a/bin/app/create$6.class and b/bin/app/create$6.class differ diff --git a/bin/app/create$7.class b/bin/app/create$7.class index 28e0acf..8352314 100644 Binary files a/bin/app/create$7.class and b/bin/app/create$7.class differ diff --git a/bin/app/create$8.class b/bin/app/create$8.class index cd35796..021d79f 100644 Binary files a/bin/app/create$8.class and b/bin/app/create$8.class differ diff --git a/bin/app/create$9.class b/bin/app/create$9.class index 4fc9ef1..6910cab 100644 Binary files a/bin/app/create$9.class and b/bin/app/create$9.class differ diff --git a/bin/app/create.class b/bin/app/create.class index e80ff56..dce66c7 100644 Binary files a/bin/app/create.class and b/bin/app/create.class differ diff --git a/bin/app/evaluerLesFichiersEtudiants.class b/bin/app/evaluerLesFichiersEtudiants.class index 8b16e9c..01e058a 100644 Binary files a/bin/app/evaluerLesFichiersEtudiants.class and b/bin/app/evaluerLesFichiersEtudiants.class differ diff --git a/bin/app/filechooserXML.class b/bin/app/filechooserXML.class index 9321d60..12526a0 100644 Binary files a/bin/app/filechooserXML.class and b/bin/app/filechooserXML.class differ diff --git a/bin/calcul/formatDateWriter.class b/bin/calcul/formatDateWriter.class index 077b8c9..79606cc 100644 Binary files a/bin/calcul/formatDateWriter.class and b/bin/calcul/formatDateWriter.class differ diff --git a/bin/calcul/listeAttributWriterPasEvaluableAvecCodeEvaluateur.class b/bin/calcul/listeAttributWriterPasEvaluableAvecCodeEvaluateur.class deleted file mode 100644 index a3336a5..0000000 Binary files a/bin/calcul/listeAttributWriterPasEvaluableAvecCodeEvaluateur.class and /dev/null differ diff --git a/bin/calcul/listeAttributWriterValeurPasModifiable.class b/bin/calcul/listeAttributWriterValeurPasModifiable.class deleted file mode 100644 index 14579e4..0000000 Binary files a/bin/calcul/listeAttributWriterValeurPasModifiable.class and /dev/null differ diff --git a/bin/calcul/listeAttributsAnalyseWriter.class b/bin/calcul/listeAttributsAnalyseWriter.class deleted file mode 100644 index 13692d5..0000000 Binary files a/bin/calcul/listeAttributsAnalyseWriter.class and /dev/null differ diff --git a/bin/calcul/listeNodeAnalyseWriter.class b/bin/calcul/listeNodeAnalyseWriter.class deleted file mode 100644 index a38b997..0000000 Binary files a/bin/calcul/listeNodeAnalyseWriter.class and /dev/null differ diff --git a/bin/calcul/listeNodeFormatageDirectDeWriter.class b/bin/calcul/listeNodeFormatageDirectDeWriter.class deleted file mode 100644 index 77cd9b3..0000000 Binary files a/bin/calcul/listeNodeFormatageDirectDeWriter.class and /dev/null differ diff --git a/icons/evalnamesequence.png b/icons/evalnamesequence.png new file mode 100644 index 0000000..7dff099 Binary files /dev/null and b/icons/evalnamesequence.png differ diff --git a/icons/evalnamesequence.svg b/icons/evalnamesequence.svg new file mode 100644 index 0000000..2853657 --- /dev/null +++ b/icons/evalnamesequence.svg @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + 2 + + + + + 1 + + + + + + diff --git a/icons/evalnamesequencemini.png b/icons/evalnamesequencemini.png new file mode 100644 index 0000000..d8d519d Binary files /dev/null and b/icons/evalnamesequencemini.png differ diff --git a/src/MEPTL/HTML.java b/src/MEPTL/HTML.java index 91167d4..e30b040 100644 --- a/src/MEPTL/HTML.java +++ b/src/MEPTL/HTML.java @@ -5,6 +5,7 @@ import java.util.ArrayList; import cXML.node; +import evaluer.evaluation; /** * @@ -264,12 +265,12 @@ public class HTML { String Tst = nod.getNodes().get(k).getAttributs().get("resultat"); - String Key = outils.traduction.get(nod.getNodes().get(k).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut"))); + String Key = evaluation.traduction.get(nod.getNodes().get(k).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut"))); - if(Key==null) Key = nod.getNodes().get(k).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut")); + if(Key==null) Key = nod.getNodes().get(k).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut")); String valueStudent = nod.getNodes().get(k).getAttributs().get("valueStudent"); - String valueSujet = outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("valueSujet")); + String valueSujet = evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("valueSujet")); int niveau = Integer.valueOf(nod.getNodes().get(k).getAttributs().get("niveau")); code = code + HTML.Table(Tst, Key, valueStudent, valueSujet, niveau); @@ -284,10 +285,10 @@ public class HTML { if(!nod.getNodes().get(k).getNodes().get(l).getNomElt().equals("saut")){ String Tst = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("resultat"); - String Key2 = outils.traduction.get(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut"))); - if(Key2==null) Key2 = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut")); + String Key2 = evaluation.traduction.get(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut"))); + if(Key2==null) Key2 = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut")); String valueStudent = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueStudent"); - String valueSujet = outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueSujet")); + String valueSujet = evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueSujet")); int niveau = Integer.valueOf(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("niveau")); code = code + HTML.Table(Tst, Key2, valueStudent, valueSujet, niveau); @@ -344,7 +345,7 @@ public class HTML { T1=T1+T.get(i)+"
\r"; } for(int i=0; i\r"; + T2=T2+evaluation.withoutPoint(S.get(i))+"
\r"; } String color = "#32cd32"; //vert diff --git a/src/MEPTL/ecritureSujet.java b/src/MEPTL/ecritureSujet.java index ad9fcd9..520765f 100644 --- a/src/MEPTL/ecritureSujet.java +++ b/src/MEPTL/ecritureSujet.java @@ -345,7 +345,8 @@ public class ecritureSujet { * @return */ public static boolean listeDesNodesByRecherche(String nameNode) { - if(nameNode.contains("text:")) return true; + if(nameNode.contains("text:p")) return true; + if(nameNode.contains("text:span")) return true; if(nameNode.equals("draw:text-box")) return true; return false; } diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index 298e3ca..0829414 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -10,27 +10,19 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -//import java.text.DateFormat; import java.text.DecimalFormat; -import java.text.ParseException; -import java.text.SimpleDateFormat; -//import java.time.LocalDateTime; -//import java.time.format.DateTimeFormatter; -//import java.time.format.FormatStyle; import java.util.ArrayList; import java.util.Date; import java.util.Dictionary; import java.util.Enumeration; import java.util.Hashtable; -//import java.util.regex.Matcher; import java.util.regex.Pattern; - import javax.xml.parsers.ParserConfigurationException; - import org.xml.sax.SAXException; - import cXML.node; -import calcul.listeAttributsAnalyseWriter; +import calcul.formatDateWriter; +import evaluer.analyseFichier; +import evaluer.evaluation; import cXML.Run; import cXML.Run.UserStatus; import net.lingala.zip4j.exception.ZipException; @@ -255,7 +247,7 @@ public class meptl { if(!verificationFichierAnalyse.erreur) { // Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant - node ana = analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); //************************************************** //** Ecriture des fichiers d'analyse des students ** @@ -274,15 +266,7 @@ public class meptl { } if(commandes.zipfeedback) { // Dans une archive pour Moodle try { -// long size = 48000000; //valeur par défaut -// String nameZip = "feedbackMoodle"; //nom zip par défaut -// node zip = commandes.sujet.retourneFirstEnfantsByName("zip"); -// if(zip!=null) { -// if(zip.getAttributs().get("size")!=null)size = Long.valueOf(zip.getAttributs().get("size")); -// if(zip.getAttributs().get("name")!=null)nameZip = zip.getAttributs().get("name"); -// } - //a.AddStreamToZip(feedbackForZip(ana, verif), retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),size,nameZip); - a.AddStreamToZip(feedbacks.feedback(ana, verif, true, false), retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),commandes.analyse_size,commandes.analyse_nameZip); + a.AddStreamToZip(feedbacks.feedback(ana, verif, true, false), retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),commandes.analyse_size,commandes.analyse_nameZip); } catch (ZipException e) { e.printStackTrace(); } catch (IOException e) { @@ -560,11 +544,7 @@ public class meptl { nodstyleparagraphe.addNode(a.NodesAyantAttribut(nodstyle, "style:family","text")); nodstyleparagraphe = ajouteValeurLesValeursDuStyleParagraphParent(nodstyleparagraphe); nodstyleparagraphe = ajouteValeurParDefautAuStyleParagraph(nodstyleparagraphe); - -// // le node des styles de formatage direct -// node nodstyleformatage = new node(); -// nodstyleformatage.setNomElt("style:formatagedirect"); -// nodstyleformatage.addNode(a.NodesAyantAttribut(nodstyle, "style:family","text")); //c'est redondant puisque déjà présent dans style:paragraph + //Le node numérotation des chapitres node nodnumerochapitre = new node(); @@ -1183,7 +1163,7 @@ public class meptl { //*********************************************************************** //** chargement du node translation qui se trouve dans le node setting ** //*********************************************************************** - outils.chargeTraduction(commandes.sujet.retourneFirstEnfantsByName("translation")); + evaluation.chargeTraduction(commandes.sujet.retourneFirstEnfantsByName("translation")); //************************************************ //** Charge les nouvelles tolérances pour texte ** @@ -1325,7 +1305,7 @@ public class meptl { if(commandes.analyse||commandes.ecritNodeAnalyse) { // Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant - node ana = meptl.analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); //************************************************** //** Ecriture des fichiers d'analyse des students ** @@ -1393,155 +1373,6 @@ public class meptl { } - - - - /** - * Début de l'analyse par comparaison du node étudiant avec le node sujet. - * @param nodStudent, le node étudiant. - * @param nodSujet, le node sujet. - * @param indexStudent, index de l'étudiant - * @param a, objet Run de la class cXML - * @return le node analyse contenant toute l'analyse. - */ - public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) { - - // initialisation des nodes d'analyse - node erreurs = new node(); - node nodmeta = new node(); - node nodpage = new node(); - node nodparagraph = new node(); - node nodsequence = new node(); - node nodnumerochapitre = new node(); - node nodframes = new node(); - node nodsections = new node(); - node nodtableaux = new node(); - node nodbiblio = new node(); - node nodtablematieres = new node(); - node nodtableillustrations = new node(); - node nodstructurepage = new node(); - - // ouverture - node nodouverture = new node(); - nodouverture.setNomElt("ouverture"); - nodouverture.setAttributs(nodSujet.getAttributs()); - nodouverture.getAttributs().put("dossier",a.getLectDossiers().getEC().getListeNomDossier().get(indexStudent)); - nodouverture.getAttributs().put("filename", a.getLectDossiers().getEC().getListeFichierodt().get(indexStudent)); - if(nodSujet.getAttributs().get("analysis_filename")!=null) nodouverture.getAttributs().put("filenameAnalyse", nodSujet.getAttributs().get("analysis_filename")); - if(nodStudent.getAttributs().get("producteur")!=null) nodouverture.getAttributs().put("producteur", nodStudent.getAttributs().get("producteur")); - if(nodStudent.getAttributs().get("dureeEdition")!=null) nodouverture.getAttributs().put("dureeEdition", nodStudent.getAttributs().get("dureeEdition")); - if(nodStudent.getAttributs().get("dateModification")!=null) nodouverture.getAttributs().put("dateModification", nodStudent.getAttributs().get("dateModification")); - nodouverture.getAttributs().put("patch", a.getPatch()); - if(nodSujet.getAttributs().get("historiquePresent")!=null) nodouverture.getAttributs().put("historiquePresent", nodSujet.getAttributs().get("historiquePresent")); - if(nodSujet.getAttributs().get("controleDateCreation")!=null) nodouverture.getAttributs().put("controleDateCreation", nodSujet.getAttributs().get("controleDateCreation")); - if(nodSujet.getAttributs().get("presenceMetaSujet")!=null) nodouverture.getAttributs().put("presenceMetaSujet", nodSujet.getAttributs().get("presenceMetaSujet")); - if(nodSujet.getAttributs().get("baremeABC")!=null) nodouverture.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC")); - nodouverture.setClose(true); - - //Body et note (par défaut valeur nulle) - node nodbodyetnotation = new node(); - nodbodyetnotation.setNomElt("bodyetnotation"); - nodbodyetnotation.getAttributs().put("note", "0"); - nodbodyetnotation.getAttributs().put("commentaire", ""); - nodbodyetnotation.getAttributs().put("proportioncorrect", "0"); - nodbodyetnotation.getAttributs().put("baremeABC", "false"); - if(nodSujet.getAttributs().get("baremeABC")!=null) nodbodyetnotation.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC")); - nodbodyetnotation.setClose(true); - - //Le menu - node nodmenu = new node(); - nodmenu.setNomElt("menu"); - nodmenu = retourneNodeMenu(nodSujet, nodmenu, 0, 0); - nodmenu.setClose(true); - - // verification de la métadonnées Sujet - erreurs = retourneNodeErreur(nodStudent, nodSujet, a); - - // verification si au moins une erreur alors l'analyse est terminée - if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))){ - return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage, nodSujet.getContenu().get(0)); - } - - // analyse Meta - if(nodSujet.retourneFirstEnfantsByName("office:meta").getNomElt().equals("office:meta")) { - nodmeta = analyseLesNodesPrincipaux.analyseLesMeta(nodStudent.retourneFirstEnfantsByName("office:meta"), nodSujet.retourneFirstEnfantsByName("office:meta"), a, nodmenu); - } - - // analyse les pages (nécessaire d'avoir aussi les styles de paragraphes) - if(nodSujet.retourneFirstEnfantsByName("style:page").getNomElt().equals("style:page")) { - if(nodSujet.containElementByName("style:paragraph")) { - nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,nodSujet.retourneFirstEnfantsByName("style:paragraph"),nodStudent.retourneFirstEnfantsByName("style:paragraph")); - }else { - nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,null,null); - } - } - - // analyse les paragraphes - if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) { - nodparagraph = analyseLesNodesPrincipaux.analyseParagraph(nodStudent.retourneFirstEnfantsByName("style:paragraph"), nodSujet.retourneFirstEnfantsByName("style:paragraph"), a, nodmenu); - } - - // analyse les variables de séquence - if(nodSujet.retourneFirstEnfantsByName("sequences").getNomElt().equals("sequences")) { - nodsequence = analyseLesNodesPrincipaux.analyseLesSequences(nodStudent.retourneFirstEnfantsByName("sequences"), nodSujet.retourneFirstEnfantsByName("sequences"), a, nodmenu); - } - - // analyse de la numérotation des chapitres - if(nodSujet.retourneFirstEnfantsByName("numerotationchapitre").getNomElt().equals("numerotationchapitre")) { - nodnumerochapitre = analyseLesNodesPrincipaux.analyseLaNumerotationChapitre(nodStudent.retourneFirstEnfantsByName("numerotationchapitre"), nodSujet.retourneFirstEnfantsByName("numerotationchapitre"), a, nodmenu); - } - - // analyse les frames - if(nodSujet.retourneFirstEnfantsByName("frames").getNomElt().equals("frames")) { - nodframes = analyseLesNodesPrincipaux.analyseLesFrames(nodStudent.retourneFirstEnfantsByName("frames"), nodSujet.retourneFirstEnfantsByName("frames"), a, nodmenu); - } - - // analyse des sections - if(nodSujet.retourneFirstEnfantsByName("sections").getNomElt().equals("sections")) { - nodsections = analyseLesNodesPrincipaux.analyseLesSections(nodStudent.retourneFirstEnfantsByName("sections"), nodSujet.retourneFirstEnfantsByName("sections"), a, nodmenu); - } - - // analyse les tableaux - if(nodSujet.retourneFirstEnfantsByName("tableaux").getNomElt().equals("tableaux")) { - nodtableaux = analyseLesNodesPrincipaux.analyseLesTableaux(nodStudent.retourneFirstEnfantsByName("tableaux"), nodSujet.retourneFirstEnfantsByName("tableaux"), a, nodmenu); - } - - // analyse la bibliographie de LibreOffice - if(nodSujet.retourneFirstEnfantsByName("biblio").getNomElt().equals("biblio")) { - nodbiblio = analyseLesNodesPrincipaux.analyseLaBiblio(nodStudent.retourneFirstEnfantsByName("biblio"), nodSujet.retourneFirstEnfantsByName("biblio"), a, nodmenu); - } - - // analyse des tables des matières - if(nodSujet.retourneFirstEnfantsByName("tablematieres").getNomElt().equals("tablematieres")) { - nodtablematieres = analyseLesNodesPrincipaux.analyseLesTablesMatieres(nodStudent.retourneFirstEnfantsByName("tablematieres"), nodSujet.retourneFirstEnfantsByName("tablematieres"), a, nodmenu); - } - - // analyse des tables illustrations - if(nodSujet.retourneFirstEnfantsByName("tableillustrations").getNomElt().equals("tableillustrations")) { - nodtableillustrations = analyseLesNodesPrincipaux.analyseLesTablesIllustrations(nodStudent.retourneFirstEnfantsByName("tableillustrations"), nodSujet.retourneFirstEnfantsByName("tableillustrations"), a, nodmenu); - } - - // analyse la structure du document - if(nodSujet.retourneFirstEnfantsByName("structurepage").getNomElt().equals("structurepage")) { - node nodSujetParagraphs = null; - if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) nodSujetParagraphs = nodSujet.retourneFirstEnfantsByName("style:paragraph"); - node nodStudentParagraphs = nodStudent.retourneFirstEnfantsByName("style:paragraph"); - nodstructurepage = analyseLesNodesPrincipaux.analyseStructurePage(nodStudent.retourneFirstEnfantsByName("structurepage"), nodSujet.retourneFirstEnfantsByName("structurepage"), a, nodmenu,nodSujetParagraphs, nodStudentParagraphs ); - } - - - // retourne le node analyse assemblé et calcul de la note avec le barème - if(nodSujet.getContenu().size()>0) { - return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,nodSujet.getContenu().get(0)); - }else { - return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,""); - } - - - } - - - /** * Les erreurs dans le fichier étudiant : erreur de métadonnées Sujet, date de création pour identifier le fichier à analyser. @@ -1649,9 +1480,6 @@ public class meptl { erreurs.getAttributs().put("manqueHistorique", "false"); manqueHistorique = false; } - - - if( manqueMetaSujet == false && manqueValeurMetaSujet == false && manqueCreationDate == false && manqueValeurCreationDate == false && manqueHistorique == false && manqueInitialCreator == false) { @@ -1660,530 +1488,14 @@ public class meptl { erreurs.getAttributs().put("oneError", "true"); } - - erreurs.setClose(true); return erreurs; } - /** - * Assemblage du node annalyse à partir des différents nodes de l'analyse.
- *
- * @param nodouverture - * @param nodbodyetnotation - * @param nodmenu - * @param erreurs - * @param nodmeta - * @param nodpage - * @param nodparagraph - * @param nodsequence - * @param nodnumerochapitre - * @param nodframes - * @param nodsections - * @param nodtableaux - * @param nodbiblio - * @param nodtablematieres - * @param nodtableillustrations - * @param nodstructurepage - * @return - */ - public static node clotureNodeAnalyse(node nodouverture, node nodbodyetnotation, node nodmenu, node erreurs, node nodmeta, node nodpage, - node nodparagraph, node nodsequence, node nodnumerochapitre, node nodframes, node nodsections, node nodtableaux, node nodbiblio, node nodtablematieres, - node nodtableillustrations, node nodstructurepage, String texteCommentaire) { - - node nodanalyse = new node(); - - //recalcul les points pour les placer dans le node nodbodyetnotation - double notefrom = 20; // valeur par défaut - double progression = 1; // valeur par défaut - boolean baremeABC = false; - if(nodouverture!=null) if(nodouverture.isClose()) { - if(nodouverture.getAttributs().get("notefrom")!=null) { - try { - notefrom = Math.abs(Double.valueOf(nodouverture.getAttributs().get("notefrom"))); - }catch (Exception e) { - System.out.println("The \"noteFrom\" attribute of the analyze file cannot be converted to a \"double\"."); - System.out.println("Value of notefrom = 20."); - } - } - if(nodouverture.getAttributs().get("progression")!=null) { - try { - progression = Math.abs(Double.valueOf(nodouverture.getAttributs().get("progression"))); - }catch (Exception e) { - System.out.println("The \"progression\" attribute of the analyze file cannot be converted to \"double\"."); - System.out.println("Value of progression = 1."); - } - } - if(nodouverture.getAttributs().get("baremeABC")!=null) { - try { - baremeABC = Boolean.valueOf(nodouverture.getAttributs().get("baremeABC")); - }catch (Exception e) { - System.out.println("The \"baremeABC\" attribute of the analyze file cannot be converted to \"boolean\"."); - System.out.println("Value of baremeABC = false."); - } - } - } - - - - - double pointmeta = 0; double pointmetatotal = 0 ; double poidsmeta = 0; - if(nodmeta!=null) if(nodmeta.isClose()) { - if(nodmeta.getAttributs().get("pointgagner")!=null) pointmeta = Double.valueOf(nodmeta.getAttributs().get("pointgagner")); - if(nodmeta.getAttributs().get("pointtotal")!=null) pointmetatotal = Double.valueOf(nodmeta.getAttributs().get("pointtotal")); - if(nodmeta.getAttributs().get("poids")!=null) try{poidsmeta = Math.abs(Double.valueOf(nodmeta.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointpage = 0; double pointpagetotal = 0 ; double poidspage = 0; - if(nodpage!=null) if(nodpage.isClose()) { - if(nodpage.getAttributs().get("pointgagner")!=null) pointpage = Double.valueOf(nodpage.getAttributs().get("pointgagner")); - if(nodpage.getAttributs().get("pointtotal")!=null) pointpagetotal = Double.valueOf(nodpage.getAttributs().get("pointtotal")); - if(nodpage.getAttributs().get("poids")!=null) try{poidspage = Math.abs(Double.valueOf(nodpage.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointparagraph = 0; double pointparagraphtotal = 0 ; double poidsparagraph = 0; - if(nodparagraph!=null) if(nodparagraph.isClose()) { - if(nodparagraph.getAttributs().get("pointgagner")!=null) pointparagraph = Double.valueOf(nodparagraph.getAttributs().get("pointgagner")); - if(nodparagraph.getAttributs().get("pointtotal")!=null) pointparagraphtotal = Double.valueOf(nodparagraph.getAttributs().get("pointtotal")); - if(nodparagraph.getAttributs().get("poids")!=null) try{Math.abs(poidsparagraph = Double.valueOf(nodparagraph.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointsequence = 0; double pointsequencetotal = 0 ; double poidssequence = 0; - if(nodsequence!=null) if(nodsequence.isClose()) { - if(nodsequence.getAttributs().get("pointgagner")!=null) pointsequence = Double.valueOf(nodsequence.getAttributs().get("pointgagner")); - if(nodsequence.getAttributs().get("pointtotal")!=null) pointsequencetotal = Double.valueOf(nodsequence.getAttributs().get("pointtotal")); - if(nodsequence.getAttributs().get("poids")!=null) try{poidssequence = Math.abs(Double.valueOf(nodsequence.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointnumerotation = 0; double pointnumerotationtotal = 0 ; double poidsnumerotation = 0; - if(nodnumerochapitre!=null) if(nodnumerochapitre.isClose()) { - if(nodnumerochapitre.getAttributs().get("pointgagner")!=null) pointnumerotation = Double.valueOf(nodnumerochapitre.getAttributs().get("pointgagner")); - if(nodnumerochapitre.getAttributs().get("pointtotal")!=null) pointnumerotationtotal = Double.valueOf(nodnumerochapitre.getAttributs().get("pointtotal")); - if(nodnumerochapitre.getAttributs().get("poids")!=null) try{poidsnumerotation = Math.abs(Double.valueOf(nodnumerochapitre.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointframe = 0; double pointframetotal = 0 ; double poidsframe = 0; - if(nodframes!=null) if(nodframes.isClose()) { - if(nodframes.getAttributs().get("pointgagner")!=null) pointframe = Double.valueOf(nodframes.getAttributs().get("pointgagner")); - if(nodframes.getAttributs().get("pointtotal")!=null) pointframetotal = Double.valueOf(nodframes.getAttributs().get("pointtotal")); - if(nodframes.getAttributs().get("poids")!=null) try{poidsframe = Math.abs(Double.valueOf(nodframes.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointsection = 0; double pointsectiontotal = 0 ; double poidssection = 0; - if(nodsections!=null) if(nodsections.isClose()) { - if(nodsections.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodsections.getAttributs().get("pointgagner")); - if(nodsections.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodsections.getAttributs().get("pointtotal")); - if(nodsections.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodsections.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointtableau = 0; double pointtableautotal = 0 ; double poidstableau = 0; - if(nodtableaux!=null) if(nodtableaux.isClose()) { - if(nodtableaux.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodtableaux.getAttributs().get("pointgagner")); - if(nodtableaux.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodtableaux.getAttributs().get("pointtotal")); - if(nodtableaux.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodtableaux.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointbiblio = 0; double pointbibliototal = 0 ; double poidsbiblio = 0; - if(nodbiblio!=null) if(nodbiblio.isClose()) { - if(nodbiblio.getAttributs().get("pointgagner")!=null) pointbiblio = Double.valueOf(nodbiblio.getAttributs().get("pointgagner")); - if(nodbiblio.getAttributs().get("pointtotal")!=null) pointbibliototal = Double.valueOf(nodbiblio.getAttributs().get("pointtotal")); - if(nodbiblio.getAttributs().get("poids")!=null) try{poidsbiblio = Math.abs(Double.valueOf(nodbiblio.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointtablematieres = 0; double pointtablematierestotal = 0 ; double poidstablematieres = 0; - if(nodtablematieres!=null) if(nodtablematieres.isClose()) { - if(nodtablematieres.getAttributs().get("pointgagner")!=null) pointtablematieres = Double.valueOf(nodtablematieres.getAttributs().get("pointgagner")); - if(nodtablematieres.getAttributs().get("pointtotal")!=null) pointtablematierestotal = Double.valueOf(nodtablematieres.getAttributs().get("pointtotal")); - if(nodtablematieres.getAttributs().get("poids")!=null) try{poidstablematieres = Math.abs(Double.valueOf(nodtablematieres.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointtableillustration = 0; double pointtableillustrationtotal = 0 ; double poidstableillustration = 0; - if(nodtableillustrations!=null) if(nodtableillustrations.isClose()) { - if(nodtableillustrations.getAttributs().get("pointgagner")!=null) pointtableillustration = Double.valueOf(nodtableillustrations.getAttributs().get("pointgagner")); - if(nodtableillustrations.getAttributs().get("pointtotal")!=null) pointtableillustrationtotal = Double.valueOf(nodtableillustrations.getAttributs().get("pointtotal")); - if(nodtableillustrations.getAttributs().get("poids")!=null) try{poidstableillustration = Math.abs(Double.valueOf(nodtableillustrations.getAttributs().get("poids")));}catch (Exception e) { }; - } - double pointstructure = 0; double pointstructuretotal = 0 ; double poidsstructure = 0; - if(nodstructurepage!=null) if(nodstructurepage.isClose()) { - if(nodstructurepage.getAttributs().get("pointgagner")!=null) pointstructure = Double.valueOf(nodstructurepage.getAttributs().get("pointgagner")); - if(nodstructurepage.getAttributs().get("pointtotal")!=null) pointstructuretotal = Double.valueOf(nodstructurepage.getAttributs().get("pointtotal")); - if(nodstructurepage.getAttributs().get("poids")!=null) try{poidsstructure = Math.abs(Double.valueOf(nodstructurepage.getAttributs().get("poids")));}catch (Exception e) { }; - } - - double proportionCorrect = 0 ; - double poidsTotal = 0; - double pointsTotal = 0; - double pointgagner = 0; - double note = 0 ; - - - - proportionCorrect = (poidsmeta*pointmeta + poidspage*pointpage + poidsparagraph*pointparagraph + poidssequence*pointsequence + poidsnumerotation*pointnumerotation + poidsframe*pointframe + poidsbiblio*pointbiblio + poidstablematieres*pointtablematieres + poidstableillustration*pointtableillustration + poidsstructure*pointstructure + poidssection*pointsection + poidstableau*pointtableau) - / (poidsmeta*pointmetatotal + poidspage*pointpagetotal + poidsparagraph*pointparagraphtotal + poidssequence*pointsequencetotal + poidsnumerotation*pointnumerotationtotal + poidsframe*pointframetotal + poidsbiblio*pointbibliototal + poidstablematieres*pointtablematierestotal + poidstableillustration*pointtableillustrationtotal + poidsstructure*pointstructuretotal + poidssection*pointsectiontotal + poidstableau*pointtableautotal); - - poidsTotal = poidsmeta + poidspage + poidsparagraph + poidssequence + poidsnumerotation + poidsframe + poidsbiblio + poidstablematieres + poidstableillustration + poidsstructure + poidssection + poidstableau; - pointsTotal = pointmetatotal + pointpagetotal + pointparagraphtotal + pointsequencetotal + pointnumerotationtotal + pointframetotal + pointbibliototal + pointtablematierestotal + pointtableillustrationtotal + pointstructuretotal + pointsectiontotal; - pointgagner = pointmeta + pointpage + pointparagraph + pointsequence + pointnumerotation + pointframe + pointsection + pointtableau + pointbiblio + pointtablematieres + pointtableillustration + pointstructure; - note = Math.pow(proportionCorrect, progression)*notefrom; - - DecimalFormat df = new DecimalFormat("###.##"); - - - nodbodyetnotation.getAttributs().put("proportioncorrect", df.format(proportionCorrect*100) + "%"); - nodbodyetnotation.getAttributs().put("note", df.format(note)); - nodbodyetnotation.getAttributs().put("pointstotal", String.valueOf(pointsTotal)); - nodbodyetnotation.getAttributs().put("poidstotal", String.valueOf(poidsTotal)); - nodbodyetnotation.getAttributs().put("pointgagner", String.valueOf(pointgagner)); - - if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))) { - nodbodyetnotation.getAttributs().put("proportioncorrect", "0%"); - nodbodyetnotation.getAttributs().put("note", "0.00"); - proportionCorrect = 0.00; - } - - // si bareme ABC (5 intervalles A, B, C, D, E de 20%) - if(baremeABC) { - double intervalle1 = Math.pow(0.2, 1/progression) ; - double intervalle2 = Math.pow(0.4, 1/progression) ; - double intervalle3 = Math.pow(0.6, 1/progression) ; - double intervalle4 = Math.pow(0.8, 1/progression) ; - - nodbodyetnotation.getAttributs().put("BorneE", String.valueOf(intervalle1)); - nodbodyetnotation.getAttributs().put("BorneD", String.valueOf(intervalle2)); - nodbodyetnotation.getAttributs().put("BorneC", String.valueOf(intervalle3)); - nodbodyetnotation.getAttributs().put("BorneB", String.valueOf(intervalle4)); - nodbodyetnotation.getAttributs().put("BorneA", "1.00"); - - if(proportionCorrect=intervalle1 && proportionCorrect=intervalle2 && proportionCorrect=intervalle3 && proportionCorrect=intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "A"); - } - - nodanalyse.ajouteEnfant(nodouverture); - nodanalyse.ajouteEnfant(nodbodyetnotation); - nodanalyse.ajouteEnfant(nodmenu); - nodanalyse.ajouteEnfant(erreurs); - - nodanalyse.ajouteEnfant(nodmeta); - nodanalyse.ajouteEnfant(nodpage); - nodanalyse.ajouteEnfant(nodparagraph); - nodanalyse.ajouteEnfant(nodsequence); - nodanalyse.ajouteEnfant(nodnumerochapitre); - nodanalyse.ajouteEnfant(nodframes); - nodanalyse.ajouteEnfant(nodsections); - nodanalyse.ajouteEnfant(nodtableaux); - nodanalyse.ajouteEnfant(nodbiblio); - nodanalyse.ajouteEnfant(nodtablematieres); - nodanalyse.ajouteEnfant(nodtableillustrations); - nodanalyse.ajouteEnfant(nodstructurepage); - - node nodfermeturebodyHTML = new node(); - nodfermeturebodyHTML.setNomElt("fermeture"); - nodfermeturebodyHTML.setClose(true); - - nodanalyse.getNodes().add(nodfermeturebodyHTML); - - nodanalyse.setNomElt("analyse"); - nodanalyse.setContenu(texteCommentaire); - nodanalyse.setClose(true); - - return nodanalyse; - } - - /** - * Analyse tous les attributs et les contenus d'un node.
- * Les attributs et les contenus doivent posséder la carcatère ‽ ou ‼.
- *
- * @param nodeStudent : le node de l'étudiant. - * @param sujet : le node du sujet - * @param retour : le node à retourner avec les enfants nommés nameItem. - * @param nameItem : le nom des nodes enfants. - * @param nameElt : le nom de l'élément (node) analysé. - * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyse. - */ - public static node evalLesAttributEtContenuDuNode(node nodeStudent, node sujet, node retour, String nameItem, String nameElt) { - Enumeration key = sujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - - if( sujet.getAttributs().get(k).contains("‽")){ - if(nodeStudent!=null) { - String valueAttributStudent = nodeStudent.getAttributs().get(k); - String valueAttributSujet = sujet.getAttributs().get(k); - - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = sujet.getAttributs().get(k); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt); - retour.getNodes().add(item); - } - } - - // evaluer avec evalNameNode, evalNameCreator, evalNameInitialCreator, evalEntetePasActive, evalPiedPagePasActive - if(!sujet.getAttributs().get(k).equals("0")) { - if(k.equals("evalNameNode") && !sujet.getAttributs().get(k).equals("0")) { - if(nodeStudent!=null) { - retour = evaluNameNode(retour,nodeStudent, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt()); - }else { - retour = evaluNameNode(retour,null, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt()); - } - } - - if(k.equals("evalNameCreator") && sujet.getNomElt().equals("dc:creator")) { - if(nodeStudent!=null) { - retour = evaluNameCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameCreator"),"Editeur"); - }else { - retour = evaluNameCreator(retour,null, "Pas trouvé l'auteur", sujet.getAttributs().get("evalNameCreator"),"Editeur"); - } - } - - if(k.equals("evalNameInitialCreator") && sujet.getNomElt().equals("meta:initial-creator")) { - if(nodeStudent!=null) { - retour = evalNameInitialCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameInitialCreator"),"Créateur"); - }else { - retour = evalNameInitialCreator(retour,null, "Pas trouvé le créateur", sujet.getAttributs().get("evalNameInitialCreator"),"Créateur"); - } - } - - if(k.equals("evalEntetePasActive") && sujet.getNomElt().equals("style:header-style")) { - if(nodeStudent!=null) { - int nbA=0; - int nbAs=0; - String reponseSujet = "oui"; - String reponseStudent = "oui"; - Enumeration key1 = sujet.getAttributs().keys(); - while(key1.hasMoreElements()) { - String k1 = key1.nextElement(); - if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++; - } - if(nbA==0) reponseSujet = "non"; - key1 = nodeStudent.getAttributs().keys(); - while(key1.hasMoreElements()) { - String k1 = key1.nextElement(); - if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++; - } - if(nbAs==0)reponseStudent = "non"; - retour = evaluEntetePasActive(retour,reponseStudent,reponseSujet,sujet.getAttributs().get("evalEntetePasActive"),"Entete"); - }else { - retour = evaluEntetePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Entete"); - } - } - - if(k.equals("evalPiedPagePasActive") && sujet.getNomElt().equals("style:footer-style")) { - if(nodeStudent!=null) { - int nbA=0; - int nbAs=0; - String reponseSujet = "oui"; - String reponseStudent = "oui"; - Enumeration key1 = sujet.getAttributs().keys(); - while(key1.hasMoreElements()) { - String k1 = key1.nextElement(); - if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++; - } - if(nbA==0) reponseSujet = "non"; - key1 = nodeStudent.getAttributs().keys(); - while(key1.hasMoreElements()) { - String k1 = key1.nextElement(); - if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++; - } - if(nbAs==0)reponseStudent = "non"; - retour = evaluPiedPagePasActive(retour,reponseStudent,reponseSujet , sujet.getAttributs().get("evalEntetePasActive"),"Pied page"); - }else { - retour = evaluPiedPagePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Pied page"); - } - } - - - - } - - } - //avec l'attribut allContent="strict1", allContent="strictSansEspace1" et allContent="environ1" - // il faut ajouter une méthode pour ignorer la casse - if(sujet.getAttributs().get("allContent")!=null) if(!sujet.getAttributs().get("allContent").isEmpty()){ - String points ="‽0"; - if(sujet.getAttributs().get("allContent").contains("strict")) points = sujet.getAttributs().get("allContent").replace("strict", "‽"); - if(sujet.getAttributs().get("allContent").contains("strictSansEspace")) points = sujet.getAttributs().get("allContent").replace("strictSansEspace", "≡‽"); - if(sujet.getAttributs().get("allContent").contains("environ")) points = sujet.getAttributs().get("allContent").replace("environ", "¢‽"); - - String testPoint = points.substring(points.indexOf("‽")+1, points.length()); - boolean pasDeProblem = true; - boolean pointSupAUn = false; - - try { - if(Integer.valueOf(testPoint)>=1) pointSupAUn=true; - }catch (Exception e) { - System.out.println("Dans le node " + sujet.getNomElt() + ".\nIl y a un problème avec la valeur de l'attribut allContent=\"" + sujet.getAttributs().get("allContent") + "\""); - System.out.println(e.toString()); - pasDeProblem=false; - } - - if(pasDeProblem && pointSupAUn) { - String allContentSujet = outils.withoutCodeAndPointPourRechercheContenuExact(sujet.retourneLesContenusEnfants("")) + points; - String allContentStudent = "null"; - if( nodeStudent!=null) allContentStudent = nodeStudent.retourneLesContenusEnfants(""); - node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", allContentStudent, allContentSujet, nameElt); - retour.getNodes().add(item); - } - - } - - // analyse le contenu du node avec tous les nodes sauf "text:sequence" - if(sujet.contenuEvaluer() && !sujet.getNomElt().equals("text:sequence")) { - String contenuStudent =""; - if(nodeStudent!=null) if(nodeStudent.getContenu().size()>0) contenuStudent = nodeStudent.getContenu().get(0); - String contenuSujet = sujet.getContenu().get(0); - node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", contenuStudent, contenuSujet, nameElt); - retour.getNodes().add(item); - } - - // analyse le contenu du node text:sequence et tous les enfants text:change (lorsque les légendes sont modifiées) - if(sujet.contenuEvaluer() && sujet.getNomElt().equals("text:sequence")) { - String contenuStudent =""; - if(nodeStudent!=null) if(nodeStudent.getContenu().size()>0) contenuStudent = nodeStudent.getContenu().get(0); //contenuStudent = nodeStudent.retourneLesContenusEnfants("text:change"); - String contenuSujet = sujet.getContenu().get(0); - node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", contenuStudent, contenuSujet, nameElt); - retour.getNodes().add(item); - } - - return retour; - } - - - - /** - * Retourne le node avec les résultats de la comparaison entre les deux valeurs (étudiant et sujet).
- *
- * @param nameNode - * @param Tst (résultat de la comparaison) - * @param property - * @param valueAttributStudent - * @param valueAttributSujet - * @return - */ - public static node retourneNoteAvecResultatsAnalyse(String nameNode, String property, String valueStudent, String valueSujet, String nameElt) { - String Tst = outils.Compare(valueStudent, valueSujet); - int niveau = 3; - if(Tst.contains("Correct")) niveau = 1; - if(Tst.contains("Erreur")) niveau = 2; - valueStudent = outils.remplaceCaracteresCodageAttribut(valueStudent); - valueSujet = outils.remplaceCaracteresCodageAttribut(valueSujet); - node item = new node(nameNode, Tst, property , valueStudent, valueSujet, niveau, outils.getPointEnJeu(),nameElt); - return item; - } - - - - /** - * Analyse tous les attributs des nodes .
- * Formatage direct des styles de paragraphe.
- * Les attributs doivent contenir le code ‼.
- *
- * @param nodeStudent : le node de l'étudiant. - * @param sujet : le node du sujet - * @param retour : le node à retourner avec les enfants nommés nameItem. - * @param nameItem : le nom des nodes enfants. - * @param nameElt : le nom de l'élément (node) analysé. - * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyse. - */ - public static node evalLesAttributAnalyseStyle(node nodeStyleParagraphStudent, node nodeStyleParagraphSujet, node retour, String nameItem, String nameElt) { - - Enumeration key = nodeStyleParagraphSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(nodeStyleParagraphSujet.getAttributs().get(k).contains("‼") || nodeStyleParagraphSujet.getAttributs().get(k).contains("‽")){ - if(nodeStyleParagraphStudent!=null) { - String valueAttributStudent = nodeStyleParagraphStudent.getAttributs().get(k); - String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt); - retour.getNodes().add(item); - } - } - } - - if(nodeStyleParagraphStudent!=null) { - if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); - } - } - } - } - }else { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); - } - } - } - - if(nodeStyleParagraphStudent!=null) { - if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - } - } - } - } - }else { - node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - } - } - } - - return retour; - } - - + /** * Retourne le nom du fichier de l'étudiant pour le Zip pour Moodle.
*
@@ -2480,7 +1792,7 @@ public class meptl { dccreator = nodDateCreator.getContenu().get(0); } - Date DcDate1 = DateLibreOffice(dcdate1); + Date DcDate1 = formatDateWriter.DateLibreOffice(dcdate1); if(DateMini==null) DateMini = DcDate1; // Amorçage de la date premère date de modification if(DateMini!=null && DateMini.after(DcDate1)) DateMini = DcDate1; //recherche la première date de modification @@ -2981,29 +2293,7 @@ public class meptl { return note; } - /** - * - * @param libreoffice_date - * @return - */ - private static Date DateLibreOffice(String libreoffice_date){ - boolean contientHeure = false; - if(libreoffice_date.contains("T")) { - libreoffice_date=libreoffice_date.replace("T", " "); - contientHeure=true; - } - SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); - Date d = null; - if(!contientHeure) simpledateformat = new SimpleDateFormat("yyyy-MM-dd"); - - try { - d = simpledateformat.parse(libreoffice_date); - }catch(ParseException e) { - e.printStackTrace(); - } - - return d; - } + /** @@ -3219,108 +2509,7 @@ public class meptl { - /** - * Evalue le nom du node - * - * @param retour : le node retour qui contient l'item ajouté - * @param nodStudent : le node Student qui peut être null - * @param nameNode : le nom du node - * @param point : les points - * @param nameElt : le nom de l'élément - * @return - */ - private static node evaluNameNode(node retour, node nodStudent, String nameNode, String point, String nameElt) { - node item = null; - if(nodStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(nameNode,"name", nodStudent.getNomElt(),nameNode + "‽" +point, nameElt ); - }else { - outils.IncrementPointTotal(Integer.valueOf(point)); - item = new node(nameNode, "Erreur", "Nom du node" , "null", nameNode, 2, outils.getPointEnJeu(),nameElt); - } - retour.getNodes().add(item); - return retour; - } - - /** - * Si le node style:header-style ne possède pas d'attribut alors l'entete n'est pas activé.
- * Le nombre d'attribut est null. - * @param retour - * @param nodStudent - * @param nameNode - * @param point - * @param nameElt - * @return - */ - private static node evaluEntetePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) { - node item = null; - if(nbAttributStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "‽" +point, nameElt ); - }else { - outils.IncrementPointTotal(Integer.valueOf(point)); - item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, outils.getPointEnJeu(),nameElt); - } - retour.getNodes().add(item); - return retour; - } - - private static node evaluPiedPagePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) { - node item = null; - if(nbAttributStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "‽" +point, nameElt ); - }else { - outils.IncrementPointTotal(Integer.valueOf(point)); - item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, outils.getPointEnJeu(),nameElt); - } - retour.getNodes().add(item); - return retour; - } - - - /** - * Evalue le champ auteur (éditeur). - * @param retour - * @param nodStudent - * @param nameCreator - * @param point - * @param nameElt - * @return - */ - private static node evaluNameCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) { - node item = null; - if(nodStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getAttributs().get("creator"),nameCreator + "↑‽" +point, nameElt ); - }else { - outils.IncrementPointTotal(Integer.valueOf(point)); - item = new node(nameCreator, "Erreur", "Nom du l'éditeur" , "null", nameCreator, 2, outils.getPointEnJeu(),nameElt); - } - retour.getNodes().add(item); - return retour; - } - - - /** - * Evalue le nom de l'auteur (créteur ou premier auteur) - * @param retour - * @param nodStudent - * @param nameCreator - * @param point - * @param nameElt - * @return - */ - private static node evalNameInitialCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) { - node item = null; - if(nodStudent!=null) { - item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getContenu().get(0),nameCreator + "↑‽" +point, nameElt ); - }else { - outils.IncrementPointTotal(Integer.valueOf(point)); - item = new node(nameCreator, "Erreur", "Nom du créateur" , "null", nameCreator, 2, outils.getPointEnJeu(),nameElt); - } - retour.getNodes().add(item); - return retour; - } - - } diff --git a/src/MEPTL/rechercherUnNodeStudent.java b/src/MEPTL/rechercherUnNodeStudent.java index 9d0560b..cdf2ae6 100644 --- a/src/MEPTL/rechercherUnNodeStudent.java +++ b/src/MEPTL/rechercherUnNodeStudent.java @@ -3,6 +3,7 @@ package MEPTL; import cXML.Run; import cXML.node; +import evaluer.evaluation; /** * @@ -170,7 +171,7 @@ public class rechercherUnNodeStudent { node nodStudent = null; if(nodSujet.getAttributs().get("recherche_contenu_exact").equals("true")) { if(!nodSujet.retourneLesContenusEnfants("").isEmpty()) { - String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants("")); + String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants("")); if(nod2Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod2Student.getNodes(), valueAttribut, nodSujet.getNomElt()); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt()); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt()); @@ -199,7 +200,7 @@ public class rechercherUnNodeStudent { // if(nod2Student!=null) System.out.println("nod2Student "+ nod2Student.toString() + " contenu=" + nod2Student.retourneLesContenusEnfants("")); - String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants("")); + String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants("")); // System.out.println("Contenu recherché = " + valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneLeNodeByContentPlusProche(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt(),0.5,null); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneLeNodeByContentPlusProche(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt(),0.5,null); @@ -258,28 +259,28 @@ public class rechercherUnNodeStudent { String nameNodeEnfantSujet = nodEnfantSujet.getNomElt(); if(nameNodeEnfantSujet.equals("text:user-defined")) { - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name")); if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut); } if(nameNodeEnfantSujet.equals("text:conditional-text")) { - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition")); if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut); } if(nameNodeEnfantSujet.equals("text:database-display")) { - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name")); if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut); } if(nameNodeEnfantSujet.equals("text:date")) { - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed")); if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut); @@ -317,28 +318,28 @@ public class rechercherUnNodeStudent { // //si le node "text:p" contient un "text:user-defined" alors le recherche par le "text:name" de ce node "text:user-defined" // if(nodSujet.containElementByName("text:user-defined")) { -// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name")); +// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name")); // if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut); // if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut); // if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut); // } // //si le node "text:p" contient un "text:conditional-text" alors le recherche par le "text:condition" de ce node "text:conditional-text" // if(nodSujet.containElementByName("text:conditional-text")) { -// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition")); +// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition")); // if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut); // if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut); // if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut); // } // //si le node "text:p" contient un "text:database-display" alors le recherche par le "text:column-name" de ce node "text:database-display" // if(nodSujet.containElementByName("text:database-display")) { -// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name")); +// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name")); // if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut); // if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut); // if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut); // } // //si le node "text:p" contient un "text:date" alors le recherche par le "text:fixed" de ce node "text:date" // if(nodSujet.containElementByName("text:date")) { -// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed")); +// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed")); // if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut); // if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut); // if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut); @@ -367,7 +368,7 @@ public class rechercherUnNodeStudent { //** Recherche par contenu if(!nodSujet.getContenu().isEmpty()) { - String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getContenu().get(0)); + String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getContenu().get(0)); if(nod2Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod2Student.getNodes(), valueAttribut, nodSujet.getNomElt()); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt()); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt()); @@ -399,7 +400,7 @@ public class rechercherUnNodeStudent { */ private static node findDrawFrame(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - String nameDraw = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("draw:name")); + String nameDraw = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("draw:name")); System.out.println("recherche image ou cadre ="+ nameDraw); //recherche par le nom de l'objet draw:name par défaut if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValueNetTexte(nod2Student, nameNode, "draw:name", nameDraw); @@ -409,7 +410,7 @@ public class rechercherUnNodeStudent { if(nodStudent!=null) return nodStudent; if(nodSujet.getAttributs().get("recherche_anchor-page-number")!=null) if(nodSujet.getAttributs().get("recherche_anchor-page-number").equalsIgnoreCase("true")) { - String AncragePage = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("text:anchor-page-number")); + String AncragePage = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("text:anchor-page-number")); if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:anchor-page-number", AncragePage); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:anchor-page-number", AncragePage); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:anchor-page-number", AncragePage); @@ -430,7 +431,7 @@ public class rechercherUnNodeStudent { */ private static node findTextConditional(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:condition")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:condition")); if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:condition", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:condition", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:condition", valueAttribut); @@ -450,9 +451,9 @@ public class rechercherUnNodeStudent { */ private static node findByTextName(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); - if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); - if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); + if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); + if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); + if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name"))); return nodStudent; } @@ -469,7 +470,7 @@ public class rechercherUnNodeStudent { */ private static node findTextDate(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:fixed")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:fixed")); if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:fixed", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:fixed", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:fixed", valueAttribut); @@ -510,7 +511,7 @@ public class rechercherUnNodeStudent { */ private static node findDataBase(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:column-name")); + String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:column-name")); if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:column-name", valueAttribut); if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:column-name", valueAttribut); if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:column-name", valueAttribut); @@ -553,9 +554,9 @@ public class rechercherUnNodeStudent { */ private static node findTable(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) { node nodStudent = null; - if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); - if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); - if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); + if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); + if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); + if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name"))); return nodStudent; } diff --git a/src/MEPTL/verificationFichierAnalyse.java b/src/MEPTL/verificationFichierAnalyse.java index 9f7ca67..fe0e589 100644 --- a/src/MEPTL/verificationFichierAnalyse.java +++ b/src/MEPTL/verificationFichierAnalyse.java @@ -8,6 +8,7 @@ import java.util.regex.Pattern; import cXML.Run; import cXML.node; +import evaluer.evaluation; /** * @@ -780,7 +781,7 @@ public class verificationFichierAnalyse { if(!nod.getContenu().isEmpty()) if( nod.getContenu().contains("‽") ) { if(nod.getAttributs().get("evaluer")!=null) { if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) { - if( outils.NetTexte(nod.getContenu().get(0)).length() <=3 ) { + if( evaluation.NetTexte(nod.getContenu().get(0)).length() <=3 ) { System.out.println(); System.out.println("**-** ERREUR dans le fichier d'analyse, le node \"" + nod.getNomElt() + "\"."); System.out.println("Le contenu du node est : " + nod.getContenu()); diff --git a/src/app/afficheText.java b/src/app/afficheText.java index 64bbc0e..173d50e 100644 --- a/src/app/afficheText.java +++ b/src/app/afficheText.java @@ -12,11 +12,11 @@ import java.util.stream.Collectors; import javax.swing.JEditorPane; import MEPTL.commandes; -import MEPTL.outils; import cXML.node; import calcul.calculIntervalleBaremeABCDE; import calcul.calculNotesProgression; -import calcul.listeAttributsAnalyseWriter; +import evaluer.evaluation; +import list.listeAttributsAnalyseWriter; public class afficheText extends JEditorPane { @@ -51,6 +51,7 @@ public class afficheText extends JEditorPane { String imageAtraversAnalyseStyle= ""; String imageEntetePasActive= ""; String imagePiedPagePasActive= ""; + String imageEvalNameSequence= ""; StringBuilder sb = new StringBuilder(); @@ -67,7 +68,7 @@ public class afficheText extends JEditorPane { sb.append("

Nom du style : " + nod.getAttributs().get("style:name")+ "


"); } if(nod.getNomElt().equals("draw:frame")) { - sb.append("

Nom du frame : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("draw:name"))+ "


"); + sb.append("

Nom du frame : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("draw:name"))+ "


"); } if(nod.getNomElt().equals("style:master-page")) { if(nod.getAttributs().get("style:display-name")!=null) { @@ -77,8 +78,8 @@ public class afficheText extends JEditorPane { } } if(nod.getNomElt().equals("page")) { - sb.append("

Numero absolue de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numeroabsolue")) - + " - Numerotation de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numero"))+ "


"); + sb.append("

Numero absolue de la page : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numeroabsolue")) + + " - Numerotation de la page : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numero"))+ "


"); } @@ -166,6 +167,9 @@ public class afficheText extends JEditorPane { if(Lesattributsdunode.get(i).equals("evalPiedPagePasActive") && !nod.getAttributs().get(Lesattributsdunode.get(i)).equals("0")) { sb.append("
  • "+imagePiedPagePasActive + " " + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); } + if(Lesattributsdunode.get(i).equals("evalNameSequence") && !nod.getAttributs().get(Lesattributsdunode.get(i)).equals("0")) { + sb.append("
  • "+imageEvalNameSequence + " " + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"
  • "); + } diff --git a/src/app/attributs.java b/src/app/attributs.java index bb703df..2c9d7d5 100644 --- a/src/app/attributs.java +++ b/src/app/attributs.java @@ -9,10 +9,10 @@ import javax.swing.border.EmptyBorder; import MEPTL.commandes; import cXML.node; -import calcul.listeAttributWriterPasEvaluableAvecCodeEvaluateur; -import calcul.listeAttributWriterValeurPasModifiable; -import calcul.listeAttributsAnalyseWriter; -import calcul.listeNodeFormatageDirectDeWriter; +import list.listeAttributWriterPasEvaluableAvecCodeEvaluateur; +import list.listeAttributWriterValeurPasModifiable; +import list.listeAttributsAnalyseWriter; +import list.listeNodeFormatageDirectDeWriter; import java.awt.FlowLayout; import java.util.ArrayList; diff --git a/src/app/create.java b/src/app/create.java index 3f2b2cf..441894f 100644 --- a/src/app/create.java +++ b/src/app/create.java @@ -46,8 +46,8 @@ import MEPTL.verificationFichierAnalyse; import cXML.Run; import cXML.node; import calcul.calculNombrePointEvaluation; -import calcul.listeAttributsAnalyseWriter; -import calcul.listeNodeFormatageDirectDeWriter; +import list.listeAttributsAnalyseWriter; +import list.listeNodeFormatageDirectDeWriter; import java.awt.event.InputEvent; import javax.swing.JToggleButton; @@ -282,8 +282,6 @@ public class create extends JFrame { mnRechercheContenuPlusProcheVoisin.addSeparator(); mnRechercheContenuPlusProcheVoisin.add(actRechercheContenuPlusProcheVoisinfalse); - - //Menu analyseStyle (évaluer le style du paragraphe) JMenu mnAnalyseStyle = new JMenu("Evaluer le style"); mnAnalyseStyle.setIcon(new ImageIcon(create.class.getResource("/resources/evaluerstylemini.png"))); @@ -298,10 +296,10 @@ public class create extends JFrame { mnevalEntetePasActive.add(actEvalEnteteActive); //Menu evalPiedPagePasActive (pour les style:footer-style) - JMenu mnevalPiedPagePasActive = new JMenu("Pied page pas activé"); - mnevalPiedPagePasActive.setIcon(new ImageIcon(create.class.getResource("/resources/piedpagenonmini.png"))); - mnevalPiedPagePasActive.add(actEvalPiedPagePasActive); - mnevalPiedPagePasActive.add(actEvalPiedPageActive); + JMenu mnEvalPiedPagePasActive = new JMenu("Pied page pas activé"); + mnEvalPiedPagePasActive.setIcon(new ImageIcon(create.class.getResource("/resources/piedpagenonmini.png"))); + mnEvalPiedPagePasActive.add(actEvalPiedPagePasActive); + mnEvalPiedPagePasActive.add(actEvalPiedPageActive); //Menu Evaluer présence d'un node pour les nodes de niveau > 1 JMenu mnEvalNameNode = new JMenu("Evaluer la présence du node"); @@ -309,6 +307,13 @@ public class create extends JFrame { mnEvalNameNode.add(actEvalNameNodeOui); mnEvalNameNode.add(actEvalNameNodeNon); + //Menu evalNameSequence (pour les text:sequence-decl) + JMenu mnEvalNameSequence = new JMenu("Evaluer le nom de la séquence"); + mnEvalNameSequence.setIcon(new ImageIcon(create.class.getResource("/resources/evalnamesequencemini.png"))); + mnEvalNameSequence.add(actEvalNameSequenceOui); + mnEvalNameSequence.add(actEvalNameSequenceNon); + + //Menue Recherche par le numéro de la page ancrer JMenu mnRechercheParNumeroPageAncrer = new JMenu("Recherche par le numéro de la page"); mnRechercheParNumeroPageAncrer.setIcon(new ImageIcon(create.class.getResource("/resources/rechercheancragepagemini.png"))); @@ -377,7 +382,11 @@ public class create extends JFrame { } if(nod.getNomElt().equals("style:footer-style")) { mnNiveauSup1.addSeparator(); - mnNiveauSup1.add(mnevalPiedPagePasActive); + mnNiveauSup1.add(mnEvalPiedPagePasActive); + } + if(nod.getNomElt().equals("text:sequence-decl")) { + mnNiveauSup1.addSeparator(); + mnNiveauSup1.add(mnEvalNameSequence); } @@ -1178,6 +1187,70 @@ public class create extends JFrame { } }; + /** + * Evalue le nom de la séquence + */ + private AbstractAction actEvalNameSequenceOui = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Oui, combien de point?" ); + putValue( Action.SHORT_DESCRIPTION, "Evaluer le nom de la séquence" ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + int point = 0; + if(nod.getAttributs().get("evalNameSequence")!=null) { + point = Integer.valueOf(nod.getAttributs().get("evalNameSequence")); + } + + 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("evalNameSequence", String.valueOf(0)); + textNodeSelect.setText(balisestyles()); + textNodeSelect.setText("

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

    "); + }else { + nod.getAttributs().put("evalNameSequence", String.valueOf(point)); + } + } catch (Exception e2) { + textNodeSelect.setText(balisestyles()); + textNodeSelect.setText("

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

    "); + } + } + textNodeSelect.refreshAffichage(nod); + } + }; + + /** + * Supprime l'évaluation du nom de la séquence. + */ + private AbstractAction actEvalNameSequenceNon = new AbstractAction() { + + private static final long serialVersionUID = 1L; + + { + putValue( Action.NAME, "Supprime évaluer le nom de la séquence" ); + putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation du nom de la séquence." ); + } + + @Override public void actionPerformed( ActionEvent e ) { + DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent(); + + node nod = (node) selectNode.getUserObject(); + nod.supprimeAttribut("evalNameSequence"); + textNodeSelect.refreshAffichage(nod); + } + }; + + /** * Supprime l'attribut evalEntetePasActive @@ -2445,7 +2518,7 @@ public class create extends JFrame { commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start"); commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end"); commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes"); - + commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change"); commandes.sujetSauvegarde = commandes.sujet.clone(); diff --git a/src/app/evaluerLesFichiersEtudiants.java b/src/app/evaluerLesFichiersEtudiants.java index 5e37c6c..29c0980 100644 --- a/src/app/evaluerLesFichiersEtudiants.java +++ b/src/app/evaluerLesFichiersEtudiants.java @@ -14,6 +14,7 @@ import MEPTL.verificationFichierAnalyse; import cXML.Run; import cXML.node; import calcul.calculIntervalleBaremeABCDE; +import evaluer.analyseFichier; import net.lingala.zip4j.exception.ZipException; public class evaluerLesFichiersEtudiants implements Runnable{ @@ -168,7 +169,7 @@ public class evaluerLesFichiersEtudiants implements Runnable{ if(commandes.analyse||commandes.ecritNodeAnalyse) { // Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant - node ana = meptl.analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); //************************************************** //** Ecriture des fichiers d'analyse des students ** diff --git a/src/app/filechooserXML.java b/src/app/filechooserXML.java index 99eb85d..843e9d1 100644 --- a/src/app/filechooserXML.java +++ b/src/app/filechooserXML.java @@ -78,6 +78,7 @@ public class filechooserXML extends JFileChooser { commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start"); //historique des modification commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end"); commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes"); + commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change"); commandes.sujetSauvegarde = commandes.sujet.clone(); @@ -89,13 +90,7 @@ public class filechooserXML extends JFileChooser { // Rechercher des erreurs dans le fichier d'analyse new verificationFichierAnalyse(); - - - // Affiche les erreurs dans une message box - //if(!commandes.fichierAnalyseValide) JOptionPane.showMessageDialog(null, verificationFichierAnalyse.messageErreur.toString()); - - } catch (UnsupportedEncodingException e1) { e1.printStackTrace(); diff --git a/src/calcul/formatDateWriter.java b/src/calcul/formatDateWriter.java index 85195fa..85bbb33 100644 --- a/src/calcul/formatDateWriter.java +++ b/src/calcul/formatDateWriter.java @@ -1,5 +1,8 @@ package calcul; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -16,4 +19,29 @@ public class formatDateWriter { return false; } + + /** + * + * @param libreoffice_date + * @return + */ + public static Date DateLibreOffice(String libreoffice_date){ + boolean contientHeure = false; + if(libreoffice_date.contains("T")) { + libreoffice_date=libreoffice_date.replace("T", " "); + contientHeure=true; + } + SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss"); + Date d = null; + if(!contientHeure) simpledateformat = new SimpleDateFormat("yyyy-MM-dd"); + + try { + d = simpledateformat.parse(libreoffice_date); + }catch(ParseException e) { + e.printStackTrace(); + } + + return d; + } + } diff --git a/src/evaluer/analyseFichier.java b/src/evaluer/analyseFichier.java new file mode 100644 index 0000000..6d6687c --- /dev/null +++ b/src/evaluer/analyseFichier.java @@ -0,0 +1,374 @@ +package evaluer; + +import java.text.DecimalFormat; + +import MEPTL.meptl; +import cXML.Run; +import cXML.node; + +public class analyseFichier { + + /** + * Début de l'analyse par comparaison du node étudiant avec le node sujet. + * @param nodStudent, le node étudiant. + * @param nodSujet, le node sujet. + * @param indexStudent, index de l'étudiant + * @param a, objet Run de la class cXML + * @return le node analyse contenant toute l'analyse. + */ + public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) { + + // initialisation des nodes d'analyse + node erreurs = new node(); + node nodmeta = new node(); + node nodpage = new node(); + node nodparagraph = new node(); + node nodsequence = new node(); + node nodnumerochapitre = new node(); + node nodframes = new node(); + node nodsections = new node(); + node nodtableaux = new node(); + node nodbiblio = new node(); + node nodtablematieres = new node(); + node nodtableillustrations = new node(); + node nodstructurepage = new node(); + + // ouverture + node nodouverture = new node(); + nodouverture.setNomElt("ouverture"); + nodouverture.setAttributs(nodSujet.getAttributs()); + nodouverture.getAttributs().put("dossier",a.getLectDossiers().getEC().getListeNomDossier().get(indexStudent)); + nodouverture.getAttributs().put("filename", a.getLectDossiers().getEC().getListeFichierodt().get(indexStudent)); + if(nodSujet.getAttributs().get("analysis_filename")!=null) nodouverture.getAttributs().put("filenameAnalyse", nodSujet.getAttributs().get("analysis_filename")); + if(nodStudent.getAttributs().get("producteur")!=null) nodouverture.getAttributs().put("producteur", nodStudent.getAttributs().get("producteur")); + if(nodStudent.getAttributs().get("dureeEdition")!=null) nodouverture.getAttributs().put("dureeEdition", nodStudent.getAttributs().get("dureeEdition")); + if(nodStudent.getAttributs().get("dateModification")!=null) nodouverture.getAttributs().put("dateModification", nodStudent.getAttributs().get("dateModification")); + nodouverture.getAttributs().put("patch", a.getPatch()); + if(nodSujet.getAttributs().get("historiquePresent")!=null) nodouverture.getAttributs().put("historiquePresent", nodSujet.getAttributs().get("historiquePresent")); + if(nodSujet.getAttributs().get("controleDateCreation")!=null) nodouverture.getAttributs().put("controleDateCreation", nodSujet.getAttributs().get("controleDateCreation")); + if(nodSujet.getAttributs().get("presenceMetaSujet")!=null) nodouverture.getAttributs().put("presenceMetaSujet", nodSujet.getAttributs().get("presenceMetaSujet")); + if(nodSujet.getAttributs().get("baremeABC")!=null) nodouverture.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC")); + nodouverture.setClose(true); + + //Body et note (par défaut valeur nulle) + node nodbodyetnotation = new node(); + nodbodyetnotation.setNomElt("bodyetnotation"); + nodbodyetnotation.getAttributs().put("note", "0"); + nodbodyetnotation.getAttributs().put("commentaire", ""); + nodbodyetnotation.getAttributs().put("proportioncorrect", "0"); + nodbodyetnotation.getAttributs().put("baremeABC", "false"); + if(nodSujet.getAttributs().get("baremeABC")!=null) nodbodyetnotation.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC")); + nodbodyetnotation.setClose(true); + + //Le menu + node nodmenu = new node(); + nodmenu.setNomElt("menu"); + nodmenu = meptl.retourneNodeMenu(nodSujet, nodmenu, 0, 0); + nodmenu.setClose(true); + + // verification de la métadonnées Sujet + erreurs = meptl.retourneNodeErreur(nodStudent, nodSujet, a); + + // verification si au moins une erreur alors l'analyse est terminée + if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))){ + return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage, nodSujet.getContenu().get(0)); + } + + // analyse Meta + if(nodSujet.retourneFirstEnfantsByName("office:meta").getNomElt().equals("office:meta")) { + nodmeta = analyseLesNodesPrincipaux.analyseLesMeta(nodStudent.retourneFirstEnfantsByName("office:meta"), nodSujet.retourneFirstEnfantsByName("office:meta"), a, nodmenu); + } + + // analyse les pages (nécessaire d'avoir aussi les styles de paragraphes) + if(nodSujet.retourneFirstEnfantsByName("style:page").getNomElt().equals("style:page")) { + if(nodSujet.containElementByName("style:paragraph")) { + nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,nodSujet.retourneFirstEnfantsByName("style:paragraph"),nodStudent.retourneFirstEnfantsByName("style:paragraph")); + }else { + nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,null,null); + } + } + + // analyse les paragraphes + if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) { + nodparagraph = analyseLesNodesPrincipaux.analyseParagraph(nodStudent.retourneFirstEnfantsByName("style:paragraph"), nodSujet.retourneFirstEnfantsByName("style:paragraph"), a, nodmenu); + } + + // analyse les variables de séquence + if(nodSujet.retourneFirstEnfantsByName("sequences").getNomElt().equals("sequences")) { + nodsequence = analyseLesNodesPrincipaux.analyseLesSequences(nodStudent.retourneFirstEnfantsByName("sequences"), nodSujet.retourneFirstEnfantsByName("sequences"), a, nodmenu); + } + + // analyse de la numérotation des chapitres + if(nodSujet.retourneFirstEnfantsByName("numerotationchapitre").getNomElt().equals("numerotationchapitre")) { + nodnumerochapitre = analyseLesNodesPrincipaux.analyseLaNumerotationChapitre(nodStudent.retourneFirstEnfantsByName("numerotationchapitre"), nodSujet.retourneFirstEnfantsByName("numerotationchapitre"), a, nodmenu); + } + + // analyse les frames + if(nodSujet.retourneFirstEnfantsByName("frames").getNomElt().equals("frames")) { + nodframes = analyseLesNodesPrincipaux.analyseLesFrames(nodStudent.retourneFirstEnfantsByName("frames"), nodSujet.retourneFirstEnfantsByName("frames"), a, nodmenu); + } + + // analyse des sections + if(nodSujet.retourneFirstEnfantsByName("sections").getNomElt().equals("sections")) { + nodsections = analyseLesNodesPrincipaux.analyseLesSections(nodStudent.retourneFirstEnfantsByName("sections"), nodSujet.retourneFirstEnfantsByName("sections"), a, nodmenu); + } + + // analyse les tableaux + if(nodSujet.retourneFirstEnfantsByName("tableaux").getNomElt().equals("tableaux")) { + nodtableaux = analyseLesNodesPrincipaux.analyseLesTableaux(nodStudent.retourneFirstEnfantsByName("tableaux"), nodSujet.retourneFirstEnfantsByName("tableaux"), a, nodmenu); + } + + // analyse la bibliographie de LibreOffice + if(nodSujet.retourneFirstEnfantsByName("biblio").getNomElt().equals("biblio")) { + nodbiblio = analyseLesNodesPrincipaux.analyseLaBiblio(nodStudent.retourneFirstEnfantsByName("biblio"), nodSujet.retourneFirstEnfantsByName("biblio"), a, nodmenu); + } + + // analyse des tables des matières + if(nodSujet.retourneFirstEnfantsByName("tablematieres").getNomElt().equals("tablematieres")) { + nodtablematieres = analyseLesNodesPrincipaux.analyseLesTablesMatieres(nodStudent.retourneFirstEnfantsByName("tablematieres"), nodSujet.retourneFirstEnfantsByName("tablematieres"), a, nodmenu); + } + + // analyse des tables illustrations + if(nodSujet.retourneFirstEnfantsByName("tableillustrations").getNomElt().equals("tableillustrations")) { + nodtableillustrations = analyseLesNodesPrincipaux.analyseLesTablesIllustrations(nodStudent.retourneFirstEnfantsByName("tableillustrations"), nodSujet.retourneFirstEnfantsByName("tableillustrations"), a, nodmenu); + } + + // analyse la structure du document + if(nodSujet.retourneFirstEnfantsByName("structurepage").getNomElt().equals("structurepage")) { + node nodSujetParagraphs = null; + if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) nodSujetParagraphs = nodSujet.retourneFirstEnfantsByName("style:paragraph"); + node nodStudentParagraphs = nodStudent.retourneFirstEnfantsByName("style:paragraph"); + nodstructurepage = analyseLesNodesPrincipaux.analyseStructurePage(nodStudent.retourneFirstEnfantsByName("structurepage"), nodSujet.retourneFirstEnfantsByName("structurepage"), a, nodmenu,nodSujetParagraphs, nodStudentParagraphs ); + } + + + // retourne le node analyse assemblé et calcul de la note avec le barème + if(nodSujet.getContenu().size()>0) { + return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,nodSujet.getContenu().get(0)); + }else { + return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,""); + } + + + } + + + /** + * Assemblage du node analyse à partir des différents nodes de l'analyse.
    + *
    + * @param nodouverture + * @param nodbodyetnotation + * @param nodmenu + * @param erreurs + * @param nodmeta + * @param nodpage + * @param nodparagraph + * @param nodsequence + * @param nodnumerochapitre + * @param nodframes + * @param nodsections + * @param nodtableaux + * @param nodbiblio + * @param nodtablematieres + * @param nodtableillustrations + * @param nodstructurepage + * @return + */ + public static node clotureNodeAnalyse(node nodouverture, node nodbodyetnotation, node nodmenu, node erreurs, node nodmeta, node nodpage, + node nodparagraph, node nodsequence, node nodnumerochapitre, node nodframes, node nodsections, node nodtableaux, node nodbiblio, node nodtablematieres, + node nodtableillustrations, node nodstructurepage, String texteCommentaire) { + + node nodanalyse = new node(); + + //recalcul les points pour les placer dans le node nodbodyetnotation + double notefrom = 20; // valeur par défaut + double progression = 1; // valeur par défaut + boolean baremeABC = false; + if(nodouverture!=null) if(nodouverture.isClose()) { + if(nodouverture.getAttributs().get("notefrom")!=null) { + try { + notefrom = Math.abs(Double.valueOf(nodouverture.getAttributs().get("notefrom"))); + }catch (Exception e) { + System.out.println("The \"noteFrom\" attribute of the analyze file cannot be converted to a \"double\"."); + System.out.println("Value of notefrom = 20."); + } + } + if(nodouverture.getAttributs().get("progression")!=null) { + try { + progression = Math.abs(Double.valueOf(nodouverture.getAttributs().get("progression"))); + }catch (Exception e) { + System.out.println("The \"progression\" attribute of the analyze file cannot be converted to \"double\"."); + System.out.println("Value of progression = 1."); + } + } + if(nodouverture.getAttributs().get("baremeABC")!=null) { + try { + baremeABC = Boolean.valueOf(nodouverture.getAttributs().get("baremeABC")); + }catch (Exception e) { + System.out.println("The \"baremeABC\" attribute of the analyze file cannot be converted to \"boolean\"."); + System.out.println("Value of baremeABC = false."); + } + } + } + + + + + double pointmeta = 0; double pointmetatotal = 0 ; double poidsmeta = 0; + if(nodmeta!=null) if(nodmeta.isClose()) { + if(nodmeta.getAttributs().get("pointgagner")!=null) pointmeta = Double.valueOf(nodmeta.getAttributs().get("pointgagner")); + if(nodmeta.getAttributs().get("pointtotal")!=null) pointmetatotal = Double.valueOf(nodmeta.getAttributs().get("pointtotal")); + if(nodmeta.getAttributs().get("poids")!=null) try{poidsmeta = Math.abs(Double.valueOf(nodmeta.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointpage = 0; double pointpagetotal = 0 ; double poidspage = 0; + if(nodpage!=null) if(nodpage.isClose()) { + if(nodpage.getAttributs().get("pointgagner")!=null) pointpage = Double.valueOf(nodpage.getAttributs().get("pointgagner")); + if(nodpage.getAttributs().get("pointtotal")!=null) pointpagetotal = Double.valueOf(nodpage.getAttributs().get("pointtotal")); + if(nodpage.getAttributs().get("poids")!=null) try{poidspage = Math.abs(Double.valueOf(nodpage.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointparagraph = 0; double pointparagraphtotal = 0 ; double poidsparagraph = 0; + if(nodparagraph!=null) if(nodparagraph.isClose()) { + if(nodparagraph.getAttributs().get("pointgagner")!=null) pointparagraph = Double.valueOf(nodparagraph.getAttributs().get("pointgagner")); + if(nodparagraph.getAttributs().get("pointtotal")!=null) pointparagraphtotal = Double.valueOf(nodparagraph.getAttributs().get("pointtotal")); + if(nodparagraph.getAttributs().get("poids")!=null) try{Math.abs(poidsparagraph = Double.valueOf(nodparagraph.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointsequence = 0; double pointsequencetotal = 0 ; double poidssequence = 0; + if(nodsequence!=null) if(nodsequence.isClose()) { + if(nodsequence.getAttributs().get("pointgagner")!=null) pointsequence = Double.valueOf(nodsequence.getAttributs().get("pointgagner")); + if(nodsequence.getAttributs().get("pointtotal")!=null) pointsequencetotal = Double.valueOf(nodsequence.getAttributs().get("pointtotal")); + if(nodsequence.getAttributs().get("poids")!=null) try{poidssequence = Math.abs(Double.valueOf(nodsequence.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointnumerotation = 0; double pointnumerotationtotal = 0 ; double poidsnumerotation = 0; + if(nodnumerochapitre!=null) if(nodnumerochapitre.isClose()) { + if(nodnumerochapitre.getAttributs().get("pointgagner")!=null) pointnumerotation = Double.valueOf(nodnumerochapitre.getAttributs().get("pointgagner")); + if(nodnumerochapitre.getAttributs().get("pointtotal")!=null) pointnumerotationtotal = Double.valueOf(nodnumerochapitre.getAttributs().get("pointtotal")); + if(nodnumerochapitre.getAttributs().get("poids")!=null) try{poidsnumerotation = Math.abs(Double.valueOf(nodnumerochapitre.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointframe = 0; double pointframetotal = 0 ; double poidsframe = 0; + if(nodframes!=null) if(nodframes.isClose()) { + if(nodframes.getAttributs().get("pointgagner")!=null) pointframe = Double.valueOf(nodframes.getAttributs().get("pointgagner")); + if(nodframes.getAttributs().get("pointtotal")!=null) pointframetotal = Double.valueOf(nodframes.getAttributs().get("pointtotal")); + if(nodframes.getAttributs().get("poids")!=null) try{poidsframe = Math.abs(Double.valueOf(nodframes.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointsection = 0; double pointsectiontotal = 0 ; double poidssection = 0; + if(nodsections!=null) if(nodsections.isClose()) { + if(nodsections.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodsections.getAttributs().get("pointgagner")); + if(nodsections.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodsections.getAttributs().get("pointtotal")); + if(nodsections.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodsections.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointtableau = 0; double pointtableautotal = 0 ; double poidstableau = 0; + if(nodtableaux!=null) if(nodtableaux.isClose()) { + if(nodtableaux.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodtableaux.getAttributs().get("pointgagner")); + if(nodtableaux.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodtableaux.getAttributs().get("pointtotal")); + if(nodtableaux.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodtableaux.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointbiblio = 0; double pointbibliototal = 0 ; double poidsbiblio = 0; + if(nodbiblio!=null) if(nodbiblio.isClose()) { + if(nodbiblio.getAttributs().get("pointgagner")!=null) pointbiblio = Double.valueOf(nodbiblio.getAttributs().get("pointgagner")); + if(nodbiblio.getAttributs().get("pointtotal")!=null) pointbibliototal = Double.valueOf(nodbiblio.getAttributs().get("pointtotal")); + if(nodbiblio.getAttributs().get("poids")!=null) try{poidsbiblio = Math.abs(Double.valueOf(nodbiblio.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointtablematieres = 0; double pointtablematierestotal = 0 ; double poidstablematieres = 0; + if(nodtablematieres!=null) if(nodtablematieres.isClose()) { + if(nodtablematieres.getAttributs().get("pointgagner")!=null) pointtablematieres = Double.valueOf(nodtablematieres.getAttributs().get("pointgagner")); + if(nodtablematieres.getAttributs().get("pointtotal")!=null) pointtablematierestotal = Double.valueOf(nodtablematieres.getAttributs().get("pointtotal")); + if(nodtablematieres.getAttributs().get("poids")!=null) try{poidstablematieres = Math.abs(Double.valueOf(nodtablematieres.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointtableillustration = 0; double pointtableillustrationtotal = 0 ; double poidstableillustration = 0; + if(nodtableillustrations!=null) if(nodtableillustrations.isClose()) { + if(nodtableillustrations.getAttributs().get("pointgagner")!=null) pointtableillustration = Double.valueOf(nodtableillustrations.getAttributs().get("pointgagner")); + if(nodtableillustrations.getAttributs().get("pointtotal")!=null) pointtableillustrationtotal = Double.valueOf(nodtableillustrations.getAttributs().get("pointtotal")); + if(nodtableillustrations.getAttributs().get("poids")!=null) try{poidstableillustration = Math.abs(Double.valueOf(nodtableillustrations.getAttributs().get("poids")));}catch (Exception e) { }; + } + double pointstructure = 0; double pointstructuretotal = 0 ; double poidsstructure = 0; + if(nodstructurepage!=null) if(nodstructurepage.isClose()) { + if(nodstructurepage.getAttributs().get("pointgagner")!=null) pointstructure = Double.valueOf(nodstructurepage.getAttributs().get("pointgagner")); + if(nodstructurepage.getAttributs().get("pointtotal")!=null) pointstructuretotal = Double.valueOf(nodstructurepage.getAttributs().get("pointtotal")); + if(nodstructurepage.getAttributs().get("poids")!=null) try{poidsstructure = Math.abs(Double.valueOf(nodstructurepage.getAttributs().get("poids")));}catch (Exception e) { }; + } + + double proportionCorrect = 0 ; + double poidsTotal = 0; + double pointsTotal = 0; + double pointgagner = 0; + double note = 0 ; + + + + proportionCorrect = (poidsmeta*pointmeta + poidspage*pointpage + poidsparagraph*pointparagraph + poidssequence*pointsequence + poidsnumerotation*pointnumerotation + poidsframe*pointframe + poidsbiblio*pointbiblio + poidstablematieres*pointtablematieres + poidstableillustration*pointtableillustration + poidsstructure*pointstructure + poidssection*pointsection + poidstableau*pointtableau) + / (poidsmeta*pointmetatotal + poidspage*pointpagetotal + poidsparagraph*pointparagraphtotal + poidssequence*pointsequencetotal + poidsnumerotation*pointnumerotationtotal + poidsframe*pointframetotal + poidsbiblio*pointbibliototal + poidstablematieres*pointtablematierestotal + poidstableillustration*pointtableillustrationtotal + poidsstructure*pointstructuretotal + poidssection*pointsectiontotal + poidstableau*pointtableautotal); + + poidsTotal = poidsmeta + poidspage + poidsparagraph + poidssequence + poidsnumerotation + poidsframe + poidsbiblio + poidstablematieres + poidstableillustration + poidsstructure + poidssection + poidstableau; + pointsTotal = pointmetatotal + pointpagetotal + pointparagraphtotal + pointsequencetotal + pointnumerotationtotal + pointframetotal + pointbibliototal + pointtablematierestotal + pointtableillustrationtotal + pointstructuretotal + pointsectiontotal; + pointgagner = pointmeta + pointpage + pointparagraph + pointsequence + pointnumerotation + pointframe + pointsection + pointtableau + pointbiblio + pointtablematieres + pointtableillustration + pointstructure; + note = Math.pow(proportionCorrect, progression)*notefrom; + + DecimalFormat df = new DecimalFormat("###.##"); + + + nodbodyetnotation.getAttributs().put("proportioncorrect", df.format(proportionCorrect*100) + "%"); + nodbodyetnotation.getAttributs().put("note", df.format(note)); + nodbodyetnotation.getAttributs().put("pointstotal", String.valueOf(pointsTotal)); + nodbodyetnotation.getAttributs().put("poidstotal", String.valueOf(poidsTotal)); + nodbodyetnotation.getAttributs().put("pointgagner", String.valueOf(pointgagner)); + + if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))) { + nodbodyetnotation.getAttributs().put("proportioncorrect", "0%"); + nodbodyetnotation.getAttributs().put("note", "0.00"); + proportionCorrect = 0.00; + } + + // si bareme ABC (5 intervalles A, B, C, D, E de 20%) + if(baremeABC) { + double intervalle1 = Math.pow(0.2, 1/progression) ; + double intervalle2 = Math.pow(0.4, 1/progression) ; + double intervalle3 = Math.pow(0.6, 1/progression) ; + double intervalle4 = Math.pow(0.8, 1/progression) ; + + nodbodyetnotation.getAttributs().put("BorneE", String.valueOf(intervalle1)); + nodbodyetnotation.getAttributs().put("BorneD", String.valueOf(intervalle2)); + nodbodyetnotation.getAttributs().put("BorneC", String.valueOf(intervalle3)); + nodbodyetnotation.getAttributs().put("BorneB", String.valueOf(intervalle4)); + nodbodyetnotation.getAttributs().put("BorneA", "1.00"); + + if(proportionCorrect=intervalle1 && proportionCorrect=intervalle2 && proportionCorrect=intervalle3 && proportionCorrect=intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "A"); + } + + nodanalyse.ajouteEnfant(nodouverture); + nodanalyse.ajouteEnfant(nodbodyetnotation); + nodanalyse.ajouteEnfant(nodmenu); + nodanalyse.ajouteEnfant(erreurs); + + nodanalyse.ajouteEnfant(nodmeta); + nodanalyse.ajouteEnfant(nodpage); + nodanalyse.ajouteEnfant(nodparagraph); + nodanalyse.ajouteEnfant(nodsequence); + nodanalyse.ajouteEnfant(nodnumerochapitre); + nodanalyse.ajouteEnfant(nodframes); + nodanalyse.ajouteEnfant(nodsections); + nodanalyse.ajouteEnfant(nodtableaux); + nodanalyse.ajouteEnfant(nodbiblio); + nodanalyse.ajouteEnfant(nodtablematieres); + nodanalyse.ajouteEnfant(nodtableillustrations); + nodanalyse.ajouteEnfant(nodstructurepage); + + node nodfermeturebodyHTML = new node(); + nodfermeturebodyHTML.setNomElt("fermeture"); + nodfermeturebodyHTML.setClose(true); + + nodanalyse.getNodes().add(nodfermeturebodyHTML); + + nodanalyse.setNomElt("analyse"); + nodanalyse.setContenu(texteCommentaire); + nodanalyse.setClose(true); + + return nodanalyse; + } + + + +} diff --git a/src/evaluer/analyseLesNodesEnfants.java b/src/evaluer/analyseLesNodesEnfants.java index 62fe861..8ea851d 100644 --- a/src/evaluer/analyseLesNodesEnfants.java +++ b/src/evaluer/analyseLesNodesEnfants.java @@ -1,6 +1,8 @@ -package MEPTL; +package evaluer; import cXML.node; +import MEPTL.meptl; +import MEPTL.rechercherUnNodeStudent; import cXML.Run; public class analyseLesNodesEnfants { @@ -66,7 +68,7 @@ public class analyseLesNodesEnfants { //************************************************************** //** Analyse attribut et contenu du node enfant de l'étudiant ** //************************************************************** - PourAnalyse = meptl.evalLesAttributEtContenuDuNode(nodStudentCorrespondantAuNodSujet, nodEnfantSujet, PourAnalyse, nomDuNodePourAnalyse,nameNode); + PourAnalyse = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudentCorrespondantAuNodSujet, nodEnfantSujet, PourAnalyse, nomDuNodePourAnalyse,nameNode); //******************************* //** méthode analyseStyle=true ** @@ -139,7 +141,7 @@ public class analyseLesNodesEnfants { //************************************************************** //** Analyse attribut et contenu du node enfant de l'étudiant ** //************************************************************** - PourAnalyse = meptl.evalLesAttributAnalyseStyle(StyleParagraphStudent, StyleParagraphSujet, PourAnalyse, nomDuNodePourAnalyse,"style:style"); + PourAnalyse = evaluationAttribut.evalLesAttributAnalyseStyle(StyleParagraphStudent, StyleParagraphSujet, PourAnalyse, nomDuNodePourAnalyse,"style:style"); } } diff --git a/src/evaluer/analyseLesNodesPrincipaux.java b/src/evaluer/analyseLesNodesPrincipaux.java index 5939e85..583ac59 100644 --- a/src/evaluer/analyseLesNodesPrincipaux.java +++ b/src/evaluer/analyseLesNodesPrincipaux.java @@ -1,8 +1,9 @@ -package MEPTL; +package evaluer; import java.util.ArrayList; import java.util.Enumeration; +import MEPTL.meptl; import cXML.Run; import cXML.node; @@ -32,7 +33,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //******************************************************** //** Parcours les nodes enfants du node ** @@ -40,9 +41,9 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetBiblio.getNodes().size(); i++) { if(nodSujetBiblio.getNodes().get(i).getNomElt().equals("text:bibliography")) { node nodSujetBibio = nodSujetBiblio.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); - String nomDeLaBiblio = outils.withoutCodeAndPoint(nodSujetBibio.getAttributs().get("text:name")); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); + String nomDeLaBiblio = evaluation.withoutCodeAndPoint(nodSujetBibio.getAttributs().get("text:name")); node biblio = new node(); biblio.setNomElt("biblio"); biblio.getAttributs().put("namebiblio", nomDeLaBiblio); @@ -58,47 +59,47 @@ public class analyseLesNodesPrincipaux { biblio = meptl.addNodeSautTitre(nodSujetBibio,biblio,nodmenu,a); - String TitreTable = outils.withoutCodeAndPoint(nodSujetBibio.retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants("")); + String TitreTable = evaluation.withoutCodeAndPoint(nodSujetBibio.retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants("")); node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetBiblio, "text:index-body"), TitreTable); node nodStudent = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodStudentBiblio, "text:index-body"), TitreTable); - biblio = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, biblio, "ana:biblio", nodSujet.getNomElt()); + biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, biblio, "ana:biblio", nodSujet.getNomElt()); for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(j ** @@ -135,9 +136,9 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetNumerotation.getNodes().size(); i++) { if(nodSujetNumerotation.getNodes().get(i).getNomElt().equals("text:outline-level-style")) { node numerotationSujet = nodSujetNumerotation.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); - String levelnumrotation = outils.withoutCodeAndPoint(nodSujetNumerotation.getNodes().get(i).getAttributs().get("text:level")); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); + String levelnumrotation = evaluation.withoutCodeAndPoint(nodSujetNumerotation.getNodes().get(i).getAttributs().get("text:level")); node numerotation = new node(); numerotation.setNomElt("numerotation"); numerotation.getAttributs().put("level", levelnumrotation); @@ -162,7 +163,7 @@ public class analyseLesNodesPrincipaux { //******************************************** //** analyse les attributs des nodes ** //******************************************** - numerotation = meptl.evalLesAttributEtContenuDuNode(numerotationStudent, numerotationSujet, numerotation, "ana:numerotation",numerotationSujet.getNomElt()); + numerotation = evaluationAttribut.evalLesAttributEtContenuDuNode(numerotationStudent, numerotationSujet, numerotation, "ana:numerotation",numerotationSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -172,8 +173,8 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - numerotation.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - numerotation.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + numerotation.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + numerotation.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodnumerotations.getNodes().add(numerotation); } @@ -182,9 +183,9 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodnumerotations.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodnumerotations.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodnumerotations.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodnumerotations.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodnumerotations.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodnumerotations.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodnumerotations.setClose(true); return nodnumerotations; @@ -214,7 +215,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //***************************************************** //** Parcours les nodes enfants du node ** @@ -222,9 +223,9 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetFrames.getNodes().size(); i++) { if(nodSujetFrames.getNodes().get(i).getNomElt().equals("draw:frame")) { node frameSujet = nodSujetFrames.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); - String nomDuFrame = outils.withoutCodeAndPoint(frameSujet.getAttributs().get("draw:name")); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); + String nomDuFrame = evaluation.withoutCodeAndPoint(frameSujet.getAttributs().get("draw:name")); node frame = new node(); frame.setNomElt("frame"); frame.getAttributs().put("nameframe", nomDuFrame); @@ -247,7 +248,7 @@ public class analyseLesNodesPrincipaux { //******************************************** //** analyse les attributs des nodes ** //******************************************** - frame = meptl.evalLesAttributEtContenuDuNode(frameStudent, frameSujet, frame, "ana:frame",frameSujet.getNomElt()); + frame = evaluationAttribut.evalLesAttributEtContenuDuNode(frameStudent, frameSujet, frame, "ana:frame",frameSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -257,17 +258,17 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - frame.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - frame.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + frame.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + frame.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodframes.getNodes().add(frame); } } //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodframes.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodframes.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodframes.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodframes.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodframes.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodframes.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodframes.setClose(true); return nodframes; } @@ -298,7 +299,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //*********************************************************************** //** Parcours les nodes enfants du node ou autres ** @@ -328,8 +329,8 @@ public class analyseLesNodesPrincipaux { //******************************* //** Recherche le node Student ** //******************************* - node nodStudent = a.retourneFirstNodeByNameAttributContainsValueNetTexte(nodStudentMeta, namenode,k,outils.withoutCodeAndPointPourRechercheContenuExact(valueOfAttribut)); - nodmeta = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, nodmeta, "ana:meta", namenode); + node nodStudent = a.retourneFirstNodeByNameAttributContainsValueNetTexte(nodStudentMeta, namenode,k,evaluation.withoutCodeAndPointPourRechercheContenuExact(valueOfAttribut)); + nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, nodmeta, "ana:meta", namenode); } } }else { @@ -340,12 +341,12 @@ public class analyseLesNodesPrincipaux { if(NStudent!=null) { if(!NStudent.isEmpty()) { - nodmeta = meptl.evalLesAttributEtContenuDuNode(NStudent.get(0), sujet.get(i), nodmeta, "ana:meta", namenode); + nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(NStudent.get(0), sujet.get(i), nodmeta, "ana:meta", namenode); }else { - nodmeta = meptl.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode); + nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode); } }else { - nodmeta = meptl.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode); + nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode); } } @@ -355,9 +356,9 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodmeta.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodmeta.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodmeta.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodmeta.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodmeta.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodmeta.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodmeta.setClose(true); return nodmeta; } @@ -386,7 +387,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //******************************************************* //** Parcours les nodes enfants du node ** @@ -394,9 +395,9 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetSections.getNodes().size(); i++) { if(nodSujetSections.getNodes().get(i).getNomElt().equals("text:section")) { node sectionSujet = nodSujetSections.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); - String nomDeLaSection = outils.withoutCodeAndPoint(sectionSujet.getAttributs().get("text:name")); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); + String nomDeLaSection = evaluation.withoutCodeAndPoint(sectionSujet.getAttributs().get("text:name")); node section = new node(); section.setNomElt("section"); @@ -420,7 +421,7 @@ public class analyseLesNodesPrincipaux { //*********************************************** //** analyse les attributs des nodes
    ** //*********************************************** - section = meptl.evalLesAttributEtContenuDuNode(sectionStudent, sectionSujet, section, "ana:section",sectionSujet.getNomElt()); + section = evaluationAttribut.evalLesAttributEtContenuDuNode(sectionStudent, sectionSujet, section, "ana:section",sectionSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -431,8 +432,8 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - section.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - section.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + section.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + section.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodsections.getNodes().add(section); } @@ -441,9 +442,9 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodsections.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodsections.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodsections.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodsections.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodsections.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodsections.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodsections.setClose(true); return nodsections; @@ -473,7 +474,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //************************************************************* //** Parcours les nodes enfants du node ** @@ -481,9 +482,9 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetSequence.getNodes().size(); i++) { if(nodSujetSequence.getNodes().get(i).getNomElt().equals("text:sequence-decl")) { node seqSujet = nodSujetSequence.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); - String nomSequence = outils.withoutCodeAndPoint(seqSujet.getAttributs().get("text:name")); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); + String nomSequence = evaluation.withoutCodeAndPoint(seqSujet.getAttributs().get("text:name")); node seq = new node(); seq.setNomElt("sequence"); seq.getAttributs().put("name", nomSequence); @@ -511,22 +512,22 @@ public class analyseLesNodesPrincipaux { //*********************************************** //** analyse les attributs des nodes
    ** //*********************************************** - seq = meptl.evalLesAttributEtContenuDuNode(seqStudent, seqSujet, seq, "ana:seq",seqSujet.getNomElt()); + seq = evaluationAttribut.evalLesAttributEtContenuDuNode(seqStudent, seqSujet, seq, "ana:seq",seqSujet.getNomElt()); //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - seq.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - seq.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + seq.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + seq.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodseq.getNodes().add(seq); } } //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodseq.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodseq.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodseq.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodseq.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodseq.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodseq.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodseq.setClose(true); return nodseq; } @@ -556,17 +557,17 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //****************************************************** //** Parcours les nodes enfants du node ** //****************************************************** for(int i = 0 ; i < nodSujetTableaux.getNodes().size(); i++) { if(nodSujetTableaux.getNodes().get(i).getNomElt().equals("table:table")) { - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); node tableSujet = nodSujetTableaux.getNodes().get(i); - String nomDeLaTable = outils.withoutCodeAndPoint(tableSujet.getAttributs().get("table:name")); + String nomDeLaTable = evaluation.withoutCodeAndPoint(tableSujet.getAttributs().get("table:name")); node tableau = new node(); tableau.setNomElt("tableau"); @@ -590,7 +591,7 @@ public class analyseLesNodesPrincipaux { //*************************************************** //** analyse les attributs des nodes ** //*************************************************** - tableau = meptl.evalLesAttributEtContenuDuNode(tableauStudent, tableSujet, tableau, "ana:tableau",tableSujet.getNomElt()); + tableau = evaluationAttribut.evalLesAttributEtContenuDuNode(tableauStudent, tableSujet, tableau, "ana:tableau",tableSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -661,17 +662,17 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - tableau.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - tableau.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + tableau.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + tableau.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodtableaux.getNodes().add(tableau); } } //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodtableaux.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodtableaux.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodtableaux.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodtableaux.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodtableaux.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodtableaux.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodtableaux.setClose(true); return nodtableaux; @@ -701,16 +702,16 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); for(int i = 0 ; i < nodSujetTableI.getNodes().size(); i++) { if(nodSujetTableI.getNodes().get(i).getNomElt().equals("text:illustration-index")) { - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); node table = new node(); table.setNomElt("tableillustrations"); - String TitreTable = outils.withoutCodeAndPoint(nodSujetTableI.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants("")); + String TitreTable = evaluation.withoutCodeAndPoint(nodSujetTableI.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants("")); node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetTableI, "text:index-body"), TitreTable); //***************************** @@ -731,7 +732,7 @@ public class analyseLesNodesPrincipaux { //********************************************* //** analyse les attributs des nodes ** //********************************************* - table = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt()); + table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt()); //**************************************************************** //** Parcours les nodes enfants du node ** @@ -739,38 +740,38 @@ public class analyseLesNodesPrincipaux { for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(j ** //********************************************* - table = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt()); + table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt()); //**************************************************************** //** Parcours les nodes enfants du node ** @@ -839,21 +840,21 @@ public class analyseLesNodesPrincipaux { for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(j ** //******************************************** - page = meptl.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt()); + page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt()); //********************************************** //** Analyse de tous les autres nodes enfants ** @@ -945,17 +946,17 @@ public class analyseLesNodesPrincipaux { //***************************************************************** //** Insère les attributs des points dans les nodes de l'analyse ** //***************************************************************** - page.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - page.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + page.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + page.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodpages.getNodes().add(page); } } //***************************************************************** //** Insère les attributs des points dans les nodes de l'analyse ** //***************************************************************** - nodpages.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodpages.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodpages.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodpages.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodpages.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodpages.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodpages.setClose(true); return nodpages; } @@ -983,17 +984,17 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //****************************************************** //** Parcours les nodes enfants du node ** //****************************************************** for(int i = 0 ; i < nodSujetParagraph.getNodes().size(); i++) { if(nodSujetParagraph.getNodes().get(i).getNomElt().equals("style:style")) { - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); node paragraphSujet = nodSujetParagraph.getNodes().get(i); - String nomDuParagraph = outils.withoutCodeAndPoint(paragraphSujet.getAttributs().get("style:name")); + String nomDuParagraph = evaluation.withoutCodeAndPoint(paragraphSujet.getAttributs().get("style:name")); node paragraph = new node(); paragraph.setNomElt("paragraph"); paragraph.getAttributs().put("name", nomDuParagraph); @@ -1016,7 +1017,7 @@ public class analyseLesNodesPrincipaux { //************************************************* //** analyse les attributs des nodes ** //************************************************* - paragraph = meptl.evalLesAttributEtContenuDuNode(paragraphStudent, paragraphSujet, paragraph, "ana:paragraph",paragraphSujet.getNomElt()); + paragraph = evaluationAttribut.evalLesAttributEtContenuDuNode(paragraphStudent, paragraphSujet, paragraph, "ana:paragraph",paragraphSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -1026,17 +1027,17 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - paragraph.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - paragraph.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + paragraph.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + paragraph.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodparagraphs.getNodes().add(paragraph); } } //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodparagraphs.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodparagraphs.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodparagraphs.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodparagraphs.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodparagraphs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodparagraphs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodparagraphs.setClose(true); return nodparagraphs; } @@ -1071,7 +1072,7 @@ public class analyseLesNodesPrincipaux { //*************************** //** initialise les points ** //*************************** - outils.initiliseLesPoints(); + evaluation.initiliseLesPoints(); //******************************************************** //** Parcours les nodes enfants du node ** @@ -1079,12 +1080,12 @@ public class analyseLesNodesPrincipaux { for(int i = 0 ; i < nodSujetS.getNodes().size(); i++) { if(nodSujetS.getNodes().get(i).getNomElt().equals("page")) { node pageSujet = nodSujetS.getNodes().get(i); - int pointDebut = outils.getPointsClass(); - int pointTotalDebut = outils.getPointTotal(); + int pointDebut = evaluation.getPointsClass(); + int pointTotalDebut = evaluation.getPointTotal(); - String nomDeLaPage = outils.withoutCodeAndPoint(pageSujet.getAttributs().get("style:master-page-name")); + String nomDeLaPage = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("style:master-page-name")); if(nomDeLaPage==null) nomDeLaPage="Défaut"; - String numeroabsolue = outils.withoutCodeAndPoint(pageSujet.getAttributs().get("numeroabsolue")); + String numeroabsolue = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("numeroabsolue")); node page = new node(); page.setNomElt("page"); page.getAttributs().put("namepage", nomDeLaPage); @@ -1108,7 +1109,7 @@ public class analyseLesNodesPrincipaux { //******************************************** //** analyse les attributs des nodes ** //******************************************** - page = meptl.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt()); + page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** @@ -1118,17 +1119,17 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - page.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut)); - page.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut)); + page.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); + page.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); nodSpages.getNodes().add(page); } } //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** - nodSpages.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass())); - nodSpages.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal())); - nodSpages.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect())); + nodSpages.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass())); + nodSpages.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal())); + nodSpages.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect())); nodSpages.setClose(true); return nodSpages; diff --git a/src/evaluer/evaluation.java b/src/evaluer/evaluation.java index 683f53f..3b16096 100644 --- a/src/evaluer/evaluation.java +++ b/src/evaluer/evaluation.java @@ -1,4 +1,4 @@ -package MEPTL; +package evaluer; import java.util.ArrayList; @@ -7,6 +7,8 @@ import java.util.Hashtable; import java.util.regex.Matcher; import java.util.regex.Pattern; +import MEPTL.HTML; +import MEPTL.commandes; import cXML.node; import calcul.StringSimilarity; /** @@ -14,7 +16,7 @@ import calcul.StringSimilarity; * @author pablo rodriguez * */ -public class outils { +public class evaluation { public static Dictionary traduction = new Hashtable(); @@ -104,7 +106,7 @@ public class outils { * Compare les chaînes de caractères A et sujet en fonction des 8 fonctions ‽ † ¢ → ¦ ↕ ↑ † ×
    * * @param A le texte de l'étudiant. - * @param Sujet le tetxte du sujet. + * @param Sujet le texte du sujet. * @return Une chaine de caractère contenant "Correct" ou "Erreur". */ public static String Compare(String A, String Sujet ) { @@ -808,7 +810,7 @@ public class outils { * @param A * @return */ - static String remplaceCaracteresCodageAttribut(String A) { + public static String remplaceCaracteresCodageAttribut(String A) { if(A!=null) { A = A.replace("_20_", " "); A = A.replace("_26_", "&"); @@ -817,137 +819,7 @@ public class outils { } -// /** -// * Nettoyage (suppression) des caractères spéciaux -// * @param A -// * @return -// */ -// static String NetTexte21(String A) { -// if (A!=null) { -// A=A.toLowerCase().trim(); -// -// ArrayList table1 = new ArrayList(); -// byte[] V = A.getBytes(); -// -// byte[] W = new byte[V.length]; -// int c =0; -// for(int i = 0 ; i < V.length;i++) { -// if(V[i]>0) { -// //if (V[i]!=63 && V[i]!=-128 && V[i]!=-103) { //63 les accents é ; -128 le symbole € -30,-128,-103 l'apostrophe -// W[c]=V[i]; -// table1.add((int) W[c]); -// c++; -// } -// } -// try { -// A = new String(W,"UTF-8"); -// -// } catch (UnsupportedEncodingException e) { -// // TODO Auto-generated catch block -// e.printStackTrace(); -// } -// -// A=A.replace("@", ""); -// A=A.replace("?", ""); -// A=A.replace("!", ""); -// A=A.replace("α", ""); -// A=A.replace("β", ""); -// A=A.replace("γ", ""); -// A=A.replace("δ", ""); -// A=A.replace("ε", ""); -// A=A.replace("σ", ""); -// A=A.replace("τ", ""); -// A=A.replace("ζ", ""); -// A=A.replace("η", ""); -// A=A.replace("θ", ""); -// A=A.replace("ι", ""); -// A=A.replace("’", ""); -// A=A.replace("'", ""); -// -// A=A.replace(" ", ""); -// A=A.replace("'", ""); -// A=A.replace("«", ""); -// A=A.replace("»", ""); -// A=A.replace("'", ""); -// A=A.replace("d'", ""); -// -// -// A=A.replace("’", ""); -// A=A.replace("e", ""); -// A=A.replace("é", ""); -// A=A.replace("é", ""); // pas le même encodage -// -// A=A.replace("è", ""); -// A=A.replace("è", ""); // pas le même encodage -// A=A.replace("ê", ""); -// -// -// A=A.replace("o", ""); -// A=A.replace("ô", ""); -// -// A=A.replace("a", ""); -// A=A.replace("â", ""); -// A=A.replace("â", ""); // pas le même encodage -// -// A=A.replace("à", ""); -// A=A.replace("à", ""); // pas le même encodage -// -// A=A.replace("u", ""); -// A=A.replace("ù", ""); -// A=A.replace("û", ""); -// -// A=A.replace("c", ""); -// A=A.replace("ç", ""); -// -// A=A.replace("i", ""); -// A=A.replace("î", ""); -// A=A.replace("ï", ""); -// A=A.replace("ï", ""); // pas le même encodage -// -// A=A.replace("0", ""); -// A=A.replace("1", ""); -// A=A.replace("2", ""); -// A=A.replace("3", ""); -// A=A.replace("4", ""); -// A=A.replace("5", ""); -// A=A.replace("6", ""); -// A=A.replace("7", ""); -// A=A.replace("8", ""); -// A=A.replace("9", ""); -// -// -// A=A.replace(":", ""); -// A=A.replace("-", ""); -// A=A.replace(".", ""); -// A=A.replace(",", ""); -// A=A.replace("_", ""); -// A=A.replace("_", ""); -// A=A.replace("(", ""); -// A=A.replace(")", ""); -// A=A.replace("\"", ""); -// A=A.replace("+", ""); -// A=A.replace("Œ", ""); -// A=A.replace("œ", ""); -// A=A.replace("oe", ""); -// A=A.replace("\r", ""); -// A=A.replace("\n", ""); -// A=A.replace("\t", ""); -// A=A.replace("/", ""); -// A=A.replace("(", ""); -// A=A.replace(")", ""); -// A=A.replace(" ",""); -// -// -// -// A=A.trim(); -// -// } -// return A; -// } - - - public static int getPointsClass() { return pointsClass; diff --git a/src/evaluer/evaluationAttribut.java b/src/evaluer/evaluationAttribut.java new file mode 100644 index 0000000..209cd9c --- /dev/null +++ b/src/evaluer/evaluationAttribut.java @@ -0,0 +1,428 @@ +package evaluer; + +import java.util.Enumeration; + +import cXML.node; +import list.listeAttributsAnalyseWriter; + +public class evaluationAttribut { + + + /** + * Analyse tous les attributs des nodes .
    + * Formatage direct des styles de paragraphe.
    + * Les attributs doivent contenir le code ‼.
    + *
    + * @param nodeStudent : le node de l'étudiant. + * @param sujet : le node du sujet + * @param retour : le node à retourner avec les enfants nommés nameItem. + * @param nameItem : le nom des nodes enfants. + * @param nameElt : le nom de l'élément (node) analysé. + * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyse. + */ + public static node evalLesAttributAnalyseStyle(node nodeStyleParagraphStudent, node nodeStyleParagraphSujet, node retour, String nameItem, String nameElt) { + + Enumeration key = nodeStyleParagraphSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(nodeStyleParagraphSujet.getAttributs().get(k).contains("‼") || nodeStyleParagraphSujet.getAttributs().get(k).contains("‽")){ + if(nodeStyleParagraphStudent!=null) { + String valueAttributStudent = nodeStyleParagraphStudent.getAttributs().get(k); + String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt); + retour.getNodes().add(item); + } + } + } + + if(nodeStyleParagraphStudent!=null) { + if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); + node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + if(propertiesStudent!=null) { + String valueAttributStudent = propertiesStudent.getAttributs().get(k); + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + } + } + } + } + }else { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + } + } + } + + if(nodeStyleParagraphStudent!=null) { + if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); + node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + if(propertiesStudent!=null) { + String valueAttributStudent = propertiesStudent.getAttributs().get(k); + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + } + } + } + } + }else { + node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + } + } + } + + return retour; + } + + + /** + * Analyse tous les attributs et les contenus d'un node.
    + * Les attributs et les contenus doivent posséder la carcatère ‽ ou ‼.
    + *
    + * @param nodeStudent : le node de l'étudiant. + * @param sujet : le node du sujet + * @param retour : le node à retourner avec les enfants nommés nameItem. + * @param nameItem : le nom des nodes enfants. + * @param nameElt : le nom de l'élément (node) analysé. + * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyse. + */ + public static node evalLesAttributEtContenuDuNode(node nodeStudent, node sujet, node retour, String nameItem, String nameElt) { + Enumeration key = sujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + + if( sujet.getAttributs().get(k).contains("‽")){ + if(nodeStudent!=null) { + String valueAttributStudent = nodeStudent.getAttributs().get(k); + String valueAttributSujet = sujet.getAttributs().get(k); + + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = sujet.getAttributs().get(k); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt); + retour.getNodes().add(item); + } + } + + // evaluer avec evalNameNode, evalNameCreator, evalNameInitialCreator, evalEntetePasActive, evalPiedPagePasActive + if(!sujet.getAttributs().get(k).equals("0")) { + if(k.equals("evalNameNode") && !sujet.getAttributs().get(k).equals("0")) { + if(nodeStudent!=null) { + retour = evaluNameNode(retour,nodeStudent, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt()); + }else { + retour = evaluNameNode(retour,null, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt()); + } + } + + if(k.equals("evalNameCreator") && sujet.getNomElt().equals("dc:creator")) { + if(nodeStudent!=null) { + retour = evaluNameCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameCreator"),"Editeur"); + }else { + retour = evaluNameCreator(retour,null, "Pas trouvé l'auteur", sujet.getAttributs().get("evalNameCreator"),"Editeur"); + } + } + + if(k.equals("evalNameInitialCreator") && sujet.getNomElt().equals("meta:initial-creator")) { + if(nodeStudent!=null) { + retour = evaluNameInitialCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameInitialCreator"),"Créateur"); + }else { + retour = evaluNameInitialCreator(retour,null, "Pas trouvé le créateur", sujet.getAttributs().get("evalNameInitialCreator"),"Créateur"); + } + } + + if(k.equals("evalEntetePasActive") && sujet.getNomElt().equals("style:header-style")) { + if(nodeStudent!=null) { + int nbA=0; + int nbAs=0; + String reponseSujet = "oui"; + String reponseStudent = "oui"; + Enumeration key1 = sujet.getAttributs().keys(); + while(key1.hasMoreElements()) { + String k1 = key1.nextElement(); + if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++; + } + if(nbA==0) reponseSujet = "non"; + key1 = nodeStudent.getAttributs().keys(); + while(key1.hasMoreElements()) { + String k1 = key1.nextElement(); + if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++; + } + if(nbAs==0)reponseStudent = "non"; + retour = evaluEntetePasActive(retour,reponseStudent,reponseSujet,sujet.getAttributs().get("evalEntetePasActive"),"Entete"); + }else { + retour = evaluEntetePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Entete"); + } + } + + if(k.equals("evalPiedPagePasActive") && sujet.getNomElt().equals("style:footer-style")) { + if(nodeStudent!=null) { + int nbA=0; + int nbAs=0; + String reponseSujet = "oui"; + String reponseStudent = "oui"; + Enumeration key1 = sujet.getAttributs().keys(); + while(key1.hasMoreElements()) { + String k1 = key1.nextElement(); + if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++; + } + if(nbA==0) reponseSujet = "non"; + key1 = nodeStudent.getAttributs().keys(); + while(key1.hasMoreElements()) { + String k1 = key1.nextElement(); + if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++; + } + if(nbAs==0)reponseStudent = "non"; + retour = evaluPiedPagePasActive(retour,reponseStudent,reponseSujet , sujet.getAttributs().get("evalEntetePasActive"),"Pied page"); + }else { + retour = evaluPiedPagePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Pied page"); + } + } + + if(k.equals("evalNameSequence") && sujet.getNomElt().equals("text:sequence-decl")) { + if(nodeStudent!=null) { + retour = evaluNameSequence(retour,nodeStudent, nodeStudent.getAttributs().get("text:name"), sujet.getAttributs().get("evalNameSequence"),"Sequence"); + }else { + retour = evaluNameSequence(retour,null, "Pas trouvé la séquence", sujet.getAttributs().get("evalNameSequence"),"Sequence"); + } + } + + + } + + } + //avec l'attribut allContent="strict1", allContent="strictSansEspace1" et allContent="environ1" + // il faut ajouter une méthode pour ignorer la casse + if(sujet.getAttributs().get("allContent")!=null) if(!sujet.getAttributs().get("allContent").isEmpty()){ + String points ="‽0"; + if(sujet.getAttributs().get("allContent").contains("strict")) points = sujet.getAttributs().get("allContent").replace("strict", "‽"); + if(sujet.getAttributs().get("allContent").contains("strictSansEspace")) points = sujet.getAttributs().get("allContent").replace("strictSansEspace", "≡‽"); + if(sujet.getAttributs().get("allContent").contains("environ")) points = sujet.getAttributs().get("allContent").replace("environ", "¢‽"); + + String testPoint = points.substring(points.indexOf("‽")+1, points.length()); + boolean pasDeProblem = true; + boolean pointSupAUn = false; + + try { + if(Integer.valueOf(testPoint)>=1) pointSupAUn=true; + }catch (Exception e) { + System.out.println("Dans le node " + sujet.getNomElt() + ".\nIl y a un problème avec la valeur de l'attribut allContent=\"" + sujet.getAttributs().get("allContent") + "\""); + System.out.println(e.toString()); + pasDeProblem=false; + } + + if(pasDeProblem && pointSupAUn) { + String allContentSujet = evaluation.withoutCodeAndPointPourRechercheContenuExact(sujet.retourneLesContenusEnfants("")) + points; + String allContentStudent = "null"; + if( nodeStudent!=null) allContentStudent = nodeStudent.retourneLesContenusEnfants(""); + node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", allContentStudent, allContentSujet, nameElt); + retour.getNodes().add(item); + } + + } + return retour; + } + + + + /** + * Evalue le nom du node + * + * @param retour : le node retour qui contient l'item ajouté + * @param nodStudent : le node Student qui peut être null + * @param nameNode : le nom du node + * @param point : les points + * @param nameElt : le nom de l'élément + * @return + */ + private static node evaluNameNode(node retour, node nodStudent, String nameNode, String point, String nameElt) { + node item = null; + if(nodStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nameNode,"name", nodStudent.getNomElt(),nameNode + "‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nameNode, "Erreur", "Nom du node" , "null", nameNode, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + /** + * Si le node style:header-style ne possède pas d'attribut alors l'entete n'est pas activé.
    + * Le nombre d'attribut est null. + * @param retour + * @param nodStudent + * @param nameNode + * @param point + * @param nameElt + * @return + */ + private static node evaluEntetePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) { + node item = null; + if(nbAttributStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + /** + * Si le node style:footer-style ne possède pas d'attribut alors l'entete n'est pas activé.
    + * @param retour + * @param nbAttributStudent + * @param nbAttribut + * @param point + * @param nameElt + * @return + */ + private static node evaluPiedPagePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) { + node item = null; + if(nbAttributStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + + /** + * Evalue le champ auteur (éditeur). + * @param retour + * @param nodStudent + * @param nameCreator + * @param point + * @param nameElt + * @return + */ + private static node evaluNameCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) { + node item = null; + if(nodStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getAttributs().get("creator"),nameCreator + "↑‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nameCreator, "Erreur", "Nom du l'éditeur" , "null", nameCreator, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + + /** + * Evalue le nom de l'auteur (créateur ou premier auteur) + * @param retour + * @param nodStudent + * @param nameCreator + * @param point + * @param nameElt + * @return + */ + private static node evaluNameInitialCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) { + node item = null; + if(nodStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getContenu().get(0),nameCreator + "↑‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nameCreator, "Erreur", "Nom du créateur" , "null", nameCreator, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + /** + * Evalue le nom de la séquence. + * @param retour + * @param nodStudent + * @param nameCreator + * @param point + * @param nameElt + * @return + */ + private static node evaluNameSequence(node retour, node nodStudent, String nameCreator, String point, String nameElt) { + node item = null; + if(nodStudent!=null) { + item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getAttributs().get("text:name"),nameCreator + "↑‽" +point, nameElt ); + }else { + evaluation.IncrementPointTotal(Integer.valueOf(point)); + item = new node(nameCreator, "Erreur", "Nom de la séquence" , "null", nameCreator, 2, evaluation.getPointEnJeu(),nameElt); + } + retour.getNodes().add(item); + return retour; + } + + + + /** + * Retourne le node avec les résultats de la comparaison entre les deux valeurs (étudiant et sujet).
    + *
    + * @param nameNode + * @param Tst (résultat de la comparaison) + * @param property + * @param valueAttributStudent + * @param valueAttributSujet + * @return + */ + public static node retourneNoteAvecResultatsAnalyse(String nameNode, String property, String valueStudent, String valueSujet, String nameElt) { + String Tst = evaluation.Compare(valueStudent, valueSujet); + int niveau = 3; + if(Tst.contains("Correct")) niveau = 1; + if(Tst.contains("Erreur")) niveau = 2; + valueStudent = evaluation.remplaceCaracteresCodageAttribut(valueStudent); + valueSujet = evaluation.remplaceCaracteresCodageAttribut(valueSujet); + node item = new node(nameNode, Tst, property , valueStudent, valueSujet, niveau, evaluation.getPointEnJeu(),nameElt); + return item; + } + +} diff --git a/src/list/listeAttributWriterPasEvaluableAvecCodeEvaluateur.java b/src/list/listeAttributWriterPasEvaluableAvecCodeEvaluateur.java index 9430865..e1d6730 100644 --- a/src/list/listeAttributWriterPasEvaluableAvecCodeEvaluateur.java +++ b/src/list/listeAttributWriterPasEvaluableAvecCodeEvaluateur.java @@ -1,4 +1,4 @@ -package calcul; +package list; public class listeAttributWriterPasEvaluableAvecCodeEvaluateur { diff --git a/src/list/listeAttributWriterValeurPasModifiable.java b/src/list/listeAttributWriterValeurPasModifiable.java index ce74a51..91ae746 100644 --- a/src/list/listeAttributWriterValeurPasModifiable.java +++ b/src/list/listeAttributWriterValeurPasModifiable.java @@ -1,4 +1,4 @@ -package calcul; +package list; public class listeAttributWriterValeurPasModifiable { diff --git a/src/list/listeAttributsAnalyseWriter.java b/src/list/listeAttributsAnalyseWriter.java index f002529..4696654 100644 --- a/src/list/listeAttributsAnalyseWriter.java +++ b/src/list/listeAttributsAnalyseWriter.java @@ -1,4 +1,4 @@ -package calcul; +package list; public class listeAttributsAnalyseWriter { @@ -22,7 +22,7 @@ public class listeAttributsAnalyseWriter { if(attribut.equals("recherche_index")) return true; if(attribut.equals("recherche_contenu_exact")) return true; if(attribut.equals("evalNameNode")) return true; - if(attribut.equals("styletitre")) return true; //ancienne version, il faudra les supprimer + 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; @@ -32,8 +32,9 @@ public class listeAttributsAnalyseWriter { if(attribut.equals("EvaluerATraversAnalyseStyle")) return true; if(attribut.equals("evalEntetePasActive")) return true; if(attribut.equals("evalPiedPagePasActive")) return true; + if(attribut.equals("evalNameSequence")) return true; - + //Les attribut placer dans le node fichier du fichier d'analyse if(attribut.equals("analysis_filename")) return true; if(attribut.equals("auteur")) return true; if(attribut.equals("baremeABC")) return true; diff --git a/src/list/listeNodeAnalyseWriter.java b/src/list/listeNodeAnalyseWriter.java index 14772fe..971fa3c 100644 --- a/src/list/listeNodeAnalyseWriter.java +++ b/src/list/listeNodeAnalyseWriter.java @@ -1,4 +1,4 @@ -package calcul; +package list; public class listeNodeAnalyseWriter { diff --git a/src/list/listeNodeFormatageDirectDeWriter.java b/src/list/listeNodeFormatageDirectDeWriter.java index f57437c..286f223 100644 --- a/src/list/listeNodeFormatageDirectDeWriter.java +++ b/src/list/listeNodeFormatageDirectDeWriter.java @@ -1,4 +1,4 @@ -package calcul; +package list; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/resources/evalnamesequence.png b/src/resources/evalnamesequence.png new file mode 100644 index 0000000..7dff099 Binary files /dev/null and b/src/resources/evalnamesequence.png differ diff --git a/src/resources/evalnamesequencemini.png b/src/resources/evalnamesequencemini.png new file mode 100644 index 0000000..d8d519d Binary files /dev/null and b/src/resources/evalnamesequencemini.png differ