diff --git a/analyseWriter.exe b/analyseWriter.exe index d2014d3..2953904 100644 Binary files a/analyseWriter.exe and b/analyseWriter.exe differ diff --git a/analyseWriter.jar b/analyseWriter.jar index 5855432..a6ad0d7 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index 9b3132a..af869f2 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/evaluer/analyseFichier.class b/bin/evaluer/analyseFichier.class index bee0110..bec8c72 100644 Binary files a/bin/evaluer/analyseFichier.class and b/bin/evaluer/analyseFichier.class differ diff --git a/bin/evaluer/evaluation.class b/bin/evaluer/evaluation.class index 41c7705..84d0b6e 100644 Binary files a/bin/evaluer/evaluation.class and b/bin/evaluer/evaluation.class differ diff --git a/bin/fenetres/create$3.class b/bin/fenetres/create$3.class index 2fae042..c31f9e9 100644 Binary files a/bin/fenetres/create$3.class and b/bin/fenetres/create$3.class differ diff --git a/bin/fenetres/create.class b/bin/fenetres/create.class index c40053e..6403623 100644 Binary files a/bin/fenetres/create.class and b/bin/fenetres/create.class differ diff --git a/bin/fenetres/evaluate$5.class b/bin/fenetres/evaluate$5.class index 0d9a8ab..0171f73 100644 Binary files a/bin/fenetres/evaluate$5.class and b/bin/fenetres/evaluate$5.class differ diff --git a/bin/fenetres/evaluerLesFichiersEtudiants.class b/bin/fenetres/evaluerLesFichiersEtudiants.class index 623b5c2..4011f15 100644 Binary files a/bin/fenetres/evaluerLesFichiersEtudiants.class and b/bin/fenetres/evaluerLesFichiersEtudiants.class differ diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index a34204e..aa9ecb0 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -17,6 +17,8 @@ import java.util.Dictionary; import java.util.Enumeration; import java.util.Hashtable; import java.util.regex.Pattern; + +import javax.swing.JEditorPane; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; import cXML.node; @@ -52,8 +54,7 @@ public class meptl { * @throws InterruptedException */ public static void main(String[] args) throws ParserConfigurationException, SAXException, IOException, CloneNotSupportedException, InterruptedException { - System.getProperty("file.encoding","UTF-8"); - + System.getProperty("file.encoding","UTF-8"); commandes.path = System.getProperty("user.dir"); // patch = "C:/Users/pabr6/OneDrive/Desktop/Nouveau dossier"; @@ -244,11 +245,12 @@ public class meptl { //********************************** //** Analyse des fichiers student ** //********************************** + JEditorPane txt = new JEditorPane(); if(commandes.analyse||commandes.ecritNodeAnalyse) { if(!verificationFichierAnalyse.erreur) { // Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant - node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a,txt,"0"); //************************************************** //** Ecriture des fichiers d'analyse des students ** @@ -1461,7 +1463,7 @@ public class meptl { * @throws SAXException * @throws CloneNotSupportedException */ - public static void analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV() throws IOException, ParserConfigurationException, SAXException, CloneNotSupportedException { + public static void analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(JEditorPane txt) throws IOException, ParserConfigurationException, SAXException, CloneNotSupportedException { commandes.message = new StringBuilder(); commandes.message.append("\n *** LES FICHIERS ANALYSES & EVALUES ***\n"); @@ -1548,9 +1550,8 @@ public class meptl { //** Analyse des fichiers student ** //********************************** if(commandes.analyse||commandes.ecritNodeAnalyse) { - // Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant - node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a, txt, String.valueOf(nbFichierWriter)); //************************************************** //** Ecriture des fichiers d'analyse des students ** diff --git a/src/evaluer/analyseFichier.java b/src/evaluer/analyseFichier.java index 7811d80..8ef2bcc 100644 --- a/src/evaluer/analyseFichier.java +++ b/src/evaluer/analyseFichier.java @@ -2,6 +2,9 @@ package evaluer; import java.text.DecimalFormat; +import javax.swing.JEditorPane; + +import MEPTL.commandes; import MEPTL.meptl; import cXML.Run; import cXML.node; @@ -16,7 +19,7 @@ public class analyseFichier { * @param a, objet Run de la class cXML * @return retourne le node "ana" analyse contenant toute l'analyse. */ - public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) { + public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a,JEditorPane txt, String texteAfficher) { // initialisation des nodes d'analyse node erreurs = new node(); @@ -52,6 +55,14 @@ public class analyseFichier { if(nodSujet.getAttributs().get("baremeABC")!=null) nodouverture.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC")); nodouverture.setClose(true); + + texteAfficher = texteAfficher + "\n" + nodouverture.getAttributs().get("dossier"); + txt.setText(texteAfficher); + +// txt.setText("\nEvaluation du fichier n° " + String.valueOf(indexStudent) +"/ " + nbFichierWriter + " fichier(s)"+ +// "\n" + nodouverture.getAttributs().get("dossier")); + + //Body et note (par défaut valeur nulle) node nodbodyetnotation = new node(); nodbodyetnotation.setNomElt("bodyetnotation"); @@ -206,7 +217,7 @@ public class analyseFichier { }else { return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,""); } - + } @@ -246,6 +257,8 @@ public class analyseFichier { try { notefrom = Math.abs(Double.valueOf(nodouverture.getAttributs().get("notefrom"))); }catch (Exception e) { + commandes.message.append("

** La variable notefrom ne peut être convertie en double. **

"); + commandes.message.append("

La valeur de notefrom est alors automatique de 20.

"); System.out.println("The \"noteFrom\" attribute of the analyze file cannot be converted to a \"double\"."); System.out.println("Value of notefrom = 20."); } @@ -254,6 +267,8 @@ public class analyseFichier { try { progression = Math.abs(Double.valueOf(nodouverture.getAttributs().get("progression"))); }catch (Exception e) { + commandes.message.append("

** La variable progression ne peut être convertie en double. **

"); + commandes.message.append("

La valeur du coef. de progression est alors automatique de 1.

"); System.out.println("The \"progression\" attribute of the analyze file cannot be converted to \"double\"."); System.out.println("Value of progression = 1."); } @@ -262,6 +277,8 @@ public class analyseFichier { try { baremeABC = Boolean.valueOf(nodouverture.getAttributs().get("baremeABC")); }catch (Exception e) { + commandes.message.append("

** La variable baremeABC ne peut être convertie en boolean. **

"); + commandes.message.append("

La valeur de baremeABC est alors automatique de false.

"); System.out.println("The \"baremeABC\" attribute of the analyze file cannot be converted to \"boolean\"."); System.out.println("Value of baremeABC = false."); } diff --git a/src/evaluer/evaluation.java b/src/evaluer/evaluation.java index 0d1168c..70517e2 100644 --- a/src/evaluer/evaluation.java +++ b/src/evaluer/evaluation.java @@ -197,7 +197,7 @@ public class evaluation { // couleur simple pas de bordure ou pas d'autres fonctions - if(Sujet.contains("#") && !Sujet.contains("pt") && Sujet.contains(" ") && !Sujet.contains("¦") && !Sujet.contains("↕") && !Sujet.contains("↑") && !Sujet.contains("¢") ) { + if(Sujet.contains("#") && !Sujet.contains("pt") && !Sujet.contains(" ") && !Sujet.contains("¦") && !Sujet.contains("↕") && !Sujet.contains("↑") && !Sujet.contains("¢") ) { if(TraitementCouleur(Sujet,A).equals("Correct : ")) { IncrementPointClass(pointEnJeu); return "Correct : +" + pointString; @@ -313,6 +313,7 @@ public class evaluation { try { point = Integer.valueOf(B.substring(B.indexOf("‽")+1,B.length())); }catch (Exception e) { + commandes.message.append("

** ERREUR sur la ventillation des points : " + B + " **

"); System.out.println("ERREUR sur la ventillation des points : " +B); e.getMessage(); } @@ -342,16 +343,30 @@ public class evaluation { String Text[] = B.split("→"); + if(Text.length<2) { + commandes.message.append("

** ERREUR sur l'intervalle : " + B + " **

"); + System.out.println("** ERREUR de l'intervalle "+ B + " **"); + } + + // rechercher un digite une ou plusieur fois en fin. Pattern p = Pattern.compile("[^0-9\\.]"); // remplacement de toutes les occurrences par "" - Text[0]= p.matcher(Text[0]).replaceAll(""); - Text[1] = p.matcher(Text[1]).replaceAll(""); + if(Text[0]!=null) Text[0]= p.matcher(Text[0]).replaceAll(""); + if(Text[1]!=null) Text[1] = p.matcher(Text[1]).replaceAll(""); A = p.matcher(A).replaceAll(""); - double b0 = Double.valueOf(Text[0]); - double b1 = Double.valueOf(Text[1]); + double b0=0.0; + double b1=0.0; + try{ + b0 = Double.valueOf(Text[0]); + b1 = Double.valueOf(Text[1]); + }catch (Exception e) { + commandes.message.append("

** ERREUR de conversion en double de : " + String.valueOf(Text[0]) + " ou " + String.valueOf(Text[1]) +" **

"); + System.out.println(e.toString()); + } + if(A.isEmpty()) return "Erreur : "; double v = Double.valueOf(A); @@ -372,12 +387,19 @@ public class evaluation { // rechercher un digite une ou plusieur fois en fin. Pattern p = Pattern.compile("[^0-9\\.]"); - + if(Text.length<2) { + commandes.message.append("

** ERREUR sur l'intervalle : " + Intervale + " **

"); + System.out.println("** ERREUR de l'intervalle "+ Intervale + " **"); + } // remplacement de toutes les occurrences par "" - Text[0]= p.matcher(Text[0]).replaceAll(""); - - double b0 = Double.valueOf(Text[0]); - + if(Text[0]!=null) Text[0]= p.matcher(Text[0]).replaceAll(""); + double b0=0.0; + try { + b0 = Double.valueOf(Text[0]); + }catch (Exception e) { + commandes.message.append("

** ERREUR de conversion en double de : " + String.valueOf(Text[0]) + " **

"); + System.out.println(e.toString()); + } return b0; } @@ -387,17 +409,24 @@ public class evaluation { * @return */ public static double TraitementIntervaleRetourneValeurMaximale(String Intervale) { - String Text[] = Intervale.split("→"); - + String Text[] = Intervale.split("→"); // rechercher un digite une ou plusieur fois en fin. Pattern p = Pattern.compile("[^0-9\\.]"); - + if(Text.length<2) { + commandes.message.append("

** ERREUR sur l'intervalle : " + Intervale + " **

"); + System.out.println("** ERREUR de l'intervalle "+ Intervale + " **"); + } // remplacement de toutes les occurrences par "" - Text[0]= p.matcher(Text[0]).replaceAll(""); - Text[1] = p.matcher(Text[1]).replaceAll(""); - - double b1 = Double.valueOf(Text[1]); + if(Text[0]!=null)Text[0]= p.matcher(Text[0]).replaceAll(""); + if(Text[1]!=null) Text[1]= p.matcher(Text[1]).replaceAll(""); + double b1 = 0.0; + try { + b1 = Double.valueOf(Text[1]); + }catch (Exception e) { + commandes.message.append("

** ERREUR de conversion en double de : " + String.valueOf(Text[1]) + " **

"); + System.out.println(e.toString()); + } return b1; } @@ -434,7 +463,6 @@ public class evaluation { if((tailleAtailleB-IT))taille = true; } - // traitement du type de trait String typeA = TextA[1]; String typeB = TextB[1]; @@ -493,6 +521,14 @@ public class evaluation { if(B==null) return "Erreur : "; if(B.isEmpty()) return "Erreur : "; + Pattern p = Pattern.compile("#.{6}"); + Matcher m = p.matcher(Sujet.trim()); + if(!m.find()) { + commandes.message.append("

** ERREUR la couleur du sujet n'est pas correct " + Sujet + " **

"); + commandes.message.append("

** La couleur sera automatiquement mis à noir #000000**

"); + Sujet="000000"; + } + // traitement de la couleur du trait String couleurS = Sujet.replace("#", ""); String couleurB = B.replace("#", ""); diff --git a/src/fenetres/create.java b/src/fenetres/create.java index 81879d1..98ecff0 100644 --- a/src/fenetres/create.java +++ b/src/fenetres/create.java @@ -526,8 +526,6 @@ public final class create extends JFrame { System.out.println( "Redo" ); } }; - - /** * diff --git a/src/fenetres/evaluate.java b/src/fenetres/evaluate.java index 3289db1..c5569b3 100644 --- a/src/fenetres/evaluate.java +++ b/src/fenetres/evaluate.java @@ -753,7 +753,7 @@ public class evaluate extends JFrame { try { msgBox V = new msgBox("Je travaille dure.",false,false,"Attendez"); Thread.sleep(100); - meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(); + meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(fenetres.evaluate.getTxtpnmessages()); txtpnmessages.setContentType("text/plain"); txtpnmessages.setText(commandes.message.toString()); V.close(); diff --git a/src/fenetres/evaluerLesFichiersEtudiants.java b/src/fenetres/evaluerLesFichiersEtudiants.java index ba618c1..4593836 100644 --- a/src/fenetres/evaluerLesFichiersEtudiants.java +++ b/src/fenetres/evaluerLesFichiersEtudiants.java @@ -81,9 +81,10 @@ public class evaluerLesFichiersEtudiants implements Runnable{ //** Nombre de fichier writer à analyser ** //***************************************** int nbFichierWriter = a.getLectDossiers().getEC().getListeContentWriter().size(); + String NbFichiers = String.valueOf(nbFichierWriter); commandes.analyse_Nbre_Fichier_Student = nbFichierWriter; commandes.message.append("
"); - commandes.message.append("

Nombre de fichier à analyser et évaluer : " + Integer.valueOf(nbFichierWriter) + "

"); + commandes.message.append("

Nombre de fichier à analyser et évaluer : " + NbFichiers + "

"); commandes.message.append("
"); commandes.message.append("
"); @@ -133,7 +134,8 @@ public class evaluerLesFichiersEtudiants implements Runnable{ //** Parcours l'ensemble des fichiers des étudiants *** //***************************************************** for(int i = 0 ; i < nbFichierWriter ; i++) { - txt.setText("\nEvaluation du fichier n° " + String.valueOf(i+1) +"/"+ String.valueOf(nbFichierWriter) + " fichier(s)"); + String texteAfficher = "\nEvaluation du fichier n° " + String.valueOf(i+1) + "/" + String.valueOf(nbFichierWriter) + " fichier(s)"; + txt.setText(texteAfficher); //index de l'étudiant commandes.analyse_index_Fichier_Student = i; @@ -171,7 +173,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 = analyseFichier.analyse(nodStudent, commandes.sujet, i, a); + node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a, txt,texteAfficher); // try { // Run.ecritureNodeEnXML(ana, "analyse", commandes.path, ""); // } catch (IOException e1) {