diff --git a/.classpath b/.classpath index d7506b6..2af9cb4 100644 --- a/.classpath +++ b/.classpath @@ -1,10 +1,10 @@ - + - + diff --git a/analyseWriter.jar b/analyseWriter.jar index 155dd25..f77b11b 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index 32afe63..6b0e9b3 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,6 +1,3 @@ /MEPTL/ /app/ -/fichierODF.png -/fichierSVG.png -/fichier_analyseXML.svg -/fichier_svg.svg +/resources/ diff --git a/bin/MEPTL/commandes.class b/bin/MEPTL/commandes.class index 3dfedcf..6ed088a 100644 Binary files a/bin/MEPTL/commandes.class and b/bin/MEPTL/commandes.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index 39054ed..01360bf 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/MEPTL/verificationFichierAnalyse.class b/bin/MEPTL/verificationFichierAnalyse.class index 7e7b3dd..8ab6bee 100644 Binary files a/bin/MEPTL/verificationFichierAnalyse.class and b/bin/MEPTL/verificationFichierAnalyse.class differ diff --git a/bin/app/evaluate$1.class b/bin/app/evaluate$1.class index c0cef76..c56dd8b 100644 Binary files a/bin/app/evaluate$1.class and b/bin/app/evaluate$1.class differ diff --git a/bin/app/evaluate$2.class b/bin/app/evaluate$2.class index d2d705d..cfc3e0f 100644 Binary files a/bin/app/evaluate$2.class and b/bin/app/evaluate$2.class differ diff --git a/bin/app/evaluate.class b/bin/app/evaluate.class index 2c8798d..92c2ded 100644 Binary files a/bin/app/evaluate.class and b/bin/app/evaluate.class differ diff --git a/bin/app/filechooserXML.class b/bin/app/filechooserXML.class index 12ba786..ac01fd1 100644 Binary files a/bin/app/filechooserXML.class and b/bin/app/filechooserXML.class differ diff --git a/bin/apropos.png b/bin/apropos.png index ea4b14d..fbba6ba 100644 Binary files a/bin/apropos.png and b/bin/apropos.png differ diff --git a/bin/apropos.svg b/bin/apropos.svg index 9e02571..116bb0a 100644 --- a/bin/apropos.svg +++ b/bin/apropos.svg @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + XML + + + + + + + + diff --git a/bin/fichier_svg.svg b/bin/fichier_svg.svg new file mode 100644 index 0000000..9e71e2e --- /dev/null +++ b/bin/fichier_svg.svg @@ -0,0 +1,259 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + SVG + + + + diff --git a/bin/resources/apropos.png b/bin/resources/apropos.png index ea4b14d..fbba6ba 100644 Binary files a/bin/resources/apropos.png and b/bin/resources/apropos.png differ diff --git a/icons/apropos.png b/icons/apropos.png index ea4b14d..fbba6ba 100644 Binary files a/icons/apropos.png and b/icons/apropos.png differ diff --git a/icons/apropos.svg b/icons/apropos.svg index 9e02571..116bb0a 100644 --- a/icons/apropos.svg +++ b/icons/apropos.svg @@ -1,7 +1,7 @@ + + + + + + + + + + + + + + + diff --git a/icons/fichierAnalyseInfo.png b/icons/fichierAnalyseInfo.png new file mode 100644 index 0000000..e65ccfb Binary files /dev/null and b/icons/fichierAnalyseInfo.png differ diff --git a/icons/fichierCSVInfo.png b/icons/fichierCSVInfo.png new file mode 100644 index 0000000..c5de141 Binary files /dev/null and b/icons/fichierCSVInfo.png differ diff --git a/icons/fichier_analyseXML info.svg b/icons/fichier_analyseXML info.svg new file mode 100644 index 0000000..883da90 --- /dev/null +++ b/icons/fichier_analyseXML info.svg @@ -0,0 +1,270 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + XML + + + + + + + + diff --git a/icons/fichier_csv_student_info.svg b/icons/fichier_csv_student_info.svg new file mode 100644 index 0000000..214aa04 --- /dev/null +++ b/icons/fichier_csv_student_info.svg @@ -0,0 +1,283 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + CSV + + + + + + + + diff --git a/src/MEPTL/commandes.java b/src/MEPTL/commandes.java index 3c7ca98..44e72a6 100644 --- a/src/MEPTL/commandes.java +++ b/src/MEPTL/commandes.java @@ -26,6 +26,7 @@ public class commandes { //** Le node du fichier d'analyse public static node sujet = new node(); + public static node nodeCSV = null; //*************************************************** //** Les commandes par défaut à travers la console ** @@ -109,13 +110,14 @@ public class commandes { //** Variables pour l'interface du logiciel public static String Titre = "analyseWriter"; - public static String filename=""; + public static String PathFilenameAnalysis=""; public static boolean fichierAnalyseValide = false; //mise à jour de la valeur dans MEPTL.verificationFichierAnalyse public static String Annee ="2022"; public static int analyse_Nbre_Fichier_Student = 0; public static int analyse_index_Fichier_Student = 0; public static StringBuilder message = new StringBuilder(); + /** * * @param args : table des arguments diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index 407ef5f..3b3bd8d 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -116,7 +116,7 @@ public class meptl { //** Chargement du format (content) et transformation en node pour l'application node nod = Run.XMLContent(a.getLectDossiers().getEC().getListeContentWriter().get(i)); node nodStudent = LectureFichierEtudiantSousFormeDeNode(nod,a,i); - Run.ecritureNodeEnXML(nodStudent, a.getLectDossiers().getEC().getListeNomDossier().get(i),"",false,""); //écriture du node de l'étudiant + Run.ecritureNodeEnXML(nodStudent, a.getLectDossiers().getEC().getListeNomDossier().get(i),commandes.path,""); //écriture du node de l'étudiant } //** bye bye analyseWriter commandes.clotureApplication(); @@ -131,7 +131,7 @@ public class meptl { nodSujet = LectureFichierEtudiantSousFormeDeNode(nodSujet,a,index); nodSujet.getAttributs().put("analysis_filename", a.getLectDossiers().getEC().getListeNomDossier().get(index)+".xml"); nodSujet = ecritureSujet.nodePourEcritureSujet(nodSujet,a,index); - Run.ecritureNodeEnXML(nodSujet, a.getLectDossiers().getEC().getListeNomDossier().get(index),"",false,"Sujet"); + Run.ecritureNodeEnXML(nodSujet, a.getLectDossiers().getEC().getListeNomDossier().get(index),commandes.path,"Sujet"); } //** bye bye analyseWriter commandes.clotureApplication(); @@ -215,7 +215,7 @@ public class meptl { //******************************** //** Ecriture du node verif.xml ** //******************************** - Run.ecritureNodeEnXML(verif, "Verif",commandes.pathDestination,commandes.fourniDossierDestination, "Verif"); //écriture du node de vérification + Run.ecritureNodeEnXML(verif, "Verif",commandes.path,"Verif"); //écriture du node de vérification if(!commandes.analyse) { //** bye bye analyseWriter commandes.clotureApplication(); @@ -260,7 +260,7 @@ public class meptl { //** Ecriture des fichiers d'analyse des students ** //************************************************** if(commandes.ecritNodeAnalyse) { - Run.ecritureNodeEnXML(ana, "nodana"+ana.retourneFirstEnfantsByName("ouverture").getAttributs().get("dossier"),"",false,""); //écriture du node analyse de l'étudiant + Run.ecritureNodeEnXML(ana, "nodana"+ana.retourneFirstEnfantsByName("ouverture").getAttributs().get("dossier"),commandes.path,""); //écriture du node analyse de l'étudiant } //**************************** @@ -422,29 +422,53 @@ public class meptl { if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) { if(nod.getAttributs().get("addmenu").equals("false") && niv==1) { System.out.println(); - System.out.println("** ERREUR -- L'attribut \"addmenu\" n'est pas associé au node principal \"" + nod.getNomElt() + "\" dans le fichier d'analyse."); + System.out.println("** ERREUR -- L'attribut \"addmenu\" n'est pas associé au node principal <" + nod.getNomElt() + "> dans le fichier d'analyse."); System.out.println("** -- Changer la valeur de l'attribut \"addmenu\" à TRUE."); System.out.println(); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n ERREUR L'attribut \"addmenu\" n'est pas associé au node principal <" + nod.getNomElt() + "> dans le fichier d'analyse."); + commandes.message.append("\n Changer la valeur de l'attribut \"addmenu\" à TRUE."); + commandes.message.append("\n******************************************************"); erreur =true; } if(nod.getAttributs().get("addmenu").equals("true") && nod.getAttributs().get("titre")==null && nod.getAttributs().get("titre1")==null && nod.getAttributs().get("titre2")==null && nod.getAttributs().get("titre3")==null) { System.out.println(); - System.out.println("** WARNING -- L'attribut \"addmenu\" n'est pas associé à un titre dans le node \"" + nod.getNomElt() + "\", dans le fichier d'analyse."); + System.out.println("** WARNING -- L'attribut \"addmenu\" n'est pas associé à un titre dans le node <" + nod.getNomElt() + ">, dans le fichier d'analyse."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\nAVERTISSEMENT -- L'attribut \"addmenu\" n'est pas associé à un titre dans le node <" + nod.getNomElt() + ">, dans le fichier d'analyse."); + commandes.message.append("\n******************************************************"); + if(nod.getAttributs().get("titre")==null && nod.getAttributs().get("titre1")==null && nod.getAttributs().get("titre2")==null && nod.getAttributs().get("titre3")==null){ System.out.println("** -- Ajouter l'attribut \"titre\" à ce node."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n Ajouter l'attribut \"titre\" à ce node."); + commandes.message.append("\n******************************************************"); } + if(nod.getAttributs().get("titre").isEmpty()){ System.out.println("** -- Ajouter l'attribut \"titre\" une valeur."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n Ajouter l'attribut \"titre\" une valeur."); + commandes.message.append("\n******************************************************"); } if(nod.getAttributs().get("titre1").isEmpty()){ System.out.println("** -- Ajouter l'attribut \"titre1\" une valeur."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n Ajouter l'attribut \"titre1\" une valeur."); + commandes.message.append("\n******************************************************"); } if(nod.getAttributs().get("titre2").isEmpty()){ System.out.println("** -- Ajouter l'attribut \"titre2\" une valeur."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n Ajouter l'attribut \"titre2\" une valeur."); + commandes.message.append("\n******************************************************"); } if(nod.getAttributs().get("titre3").isEmpty()){ System.out.println("** -- Ajouter l'attribut \"titre2\" une valeur."); + commandes.message.append("\n******************************************************"); + commandes.message.append("\n Ajouter l'attribut \"titre2\" une valeur."); + commandes.message.append("\n******************************************************"); } System.out.println(); erreur =true; @@ -983,10 +1007,13 @@ public class meptl { String targetString = ""; //read file into stream, try-with-resources + String cheminVerFichierAnalyse = Run.path + "/" + nameSujet; + if(!commandes.console) cheminVerFichierAnalyse = commandes.PathFilenameAnalysis; + try { BufferedReader br = new BufferedReader( new InputStreamReader( - new FileInputStream(Run.path + "/" + nameSujet), "UTF-8")); + new FileInputStream(cheminVerFichierAnalyse), "UTF-8")); String line; while ((line = br.readLine()) != null) { @@ -1109,10 +1136,6 @@ public class meptl { commandes.analyse_Initial_Creator= commandes.sujet.getAttributs().get("Initial_Creator"); } - // Chargement du filename - if(commandes.sujet.getAttributs().get("filename")!=null) { - commandes.filename= commandes.sujet.getAttributs().get("filename"); - } // Chargement du date if(commandes.sujet.getAttributs().get("date")!=null) { @@ -1188,11 +1211,6 @@ public class meptl { } - - - - - //** Adéquation par les valeurs par défaut si pas dans le fichier d'analyse commandes.analyse_culture = commandes.culture; @@ -1213,8 +1231,12 @@ public class meptl { public static void analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV() throws IOException, ParserConfigurationException, SAXException, CloneNotSupportedException { commandes.message = new StringBuilder(); - commandes.message.append("LES FICHIERS EVALUES"); + commandes.message.append("\n *** LES FICHIERS ANALYSES & EVALUES ***\n"); commandes.message.append("\n"); + commandes.message.append("\n Dossier contenant les fichiers des étudiants."); + commandes.message.append("\n " + commandes.path + "\n"); + commandes.message.append("\n Les fichiers des étudiants ne sont pas dans des dossiers nominatifs ?"); + commandes.message.append(" " + commandes.fichierStudentMoodle+"\n"); Run a = new Run(commandes.path,commandes.Profil, commandes.fichierStudentMoodle); @@ -1222,9 +1244,8 @@ public class meptl { //********************************************** //** Chargement et verification du CVS fourni ** //********************************************** - node nodeCSV = null; if(commandes.fourniCSV) { - nodeCSV = chargementFichierCSV(); + commandes.nodeCSV = chargementFichierCSV(); } @@ -1233,7 +1254,7 @@ public class meptl { //***************************************** int nbFichierWriter = a.getLectDossiers().getEC().getListeContentWriter().size(); commandes.analyse_Nbre_Fichier_Student = nbFichierWriter; - + commandes.message.append("\nNombre de fichier à analyser et évaluer : " + Integer.valueOf(nbFichierWriter) + "\n"); //*************************************** @@ -1255,7 +1276,10 @@ public class meptl { //******************************** //** Ecriture du node verif.xml ** //******************************** - Run.ecritureNodeEnXML(verif, "Verif",commandes.pathDestination,commandes.fourniDossierDestination, "Verif"); //écriture du node de vérification + Run.ecritureNodeEnXML(verif, "Verif",commandes.path, "Verif"); //écriture du node de vérification + commandes.message.append("\n*******************************************************"); + commandes.message.append("\nEcriture du fichier Verif.xml dans le dossier d'analyse"); + commandes.message.append("\n*******************************************************"); if(!commandes.analyse) { //** bye bye analyseWriter commandes.clotureApplication(); @@ -1278,7 +1302,7 @@ public class meptl { //** Ne prends pas en compte le dossier destination créé par la commande -dest //** Si pas d'analyse alors le nom doit contenir le caractère $ dans le nom du dossier. - if(commandes.fourniDossierDestination)if(a.getLectDossiers().getEC().getListeNomDossier().get(i).equals(commandes.pathDestination)) continue; + if(commandes.fourniDossierDestination) if(a.getLectDossiers().getEC().getListeNomDossier().get(i).equals(commandes.pathDestination)) continue; //*********************************************************** //** Lecture et transformation en node du fichier étudiant ** @@ -1299,7 +1323,7 @@ public class meptl { //** Ecriture des fichiers d'analyse des students ** //************************************************** if(commandes.ecritNodeAnalyse) { - Run.ecritureNodeEnXML(ana, "nodana"+ana.retourneFirstEnfantsByName("ouverture").getAttributs().get("dossier"),"",false,""); //écriture du node analyse de l'étudiant + Run.ecritureNodeEnXML(ana, "nodana"+ana.retourneFirstEnfantsByName("ouverture").getAttributs().get("dossier"),commandes.path,""); //écriture du node analyse de l'étudiant } //**************************** @@ -1347,7 +1371,7 @@ public class meptl { //** Exportation au format CSV si -csv file.csv ou -verifcsv file.csv ** //*********************************************************************** if(commandes.ecritNoteCSV && commandes.fourniCSV) { - ecritureCSV(ensembleanalyse,verif,a,nodeCSV, commandes.sujet.retourneFirstEnfantsByName("setting")); + ecritureCSV(ensembleanalyse,verif,a,commandes.nodeCSV, commandes.sujet.retourneFirstEnfantsByName("setting")); //a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant } @@ -2345,6 +2369,13 @@ public class meptl { ArrayList LesFichiers = verification.retourneLesEnfantsByName("fichier", new ArrayList()); + System.out.println(); + System.out.println("***** DEBUT VERIFICATION DES HISTORIQUES DES MODIFICATION ****"); + System.out.println(); + + commandes.message.append("\n\n***** DEBUT VERIFICATION DES HISTORIQUES DES MODIFICATION ****\n"); + + for(int i = 0 ; i < LesFichiers.size() ; i++) { node nodStudent = new node(); nodStudent.setNomElt("fichier"); @@ -2362,6 +2393,7 @@ public class meptl { int compteurnombreCorrespondancesconsecutive = 0; System.out.println(LesFichiers.get(i).getAttributs().get("dossier") + " - number of modifications : " + nombreModifications); + commandes.message.append("\n"+LesFichiers.get(i).getAttributs().get("dossier") + " - number of modifications : " + nombreModifications); @SuppressWarnings("unchecked") ArrayList LesFichiers2 = (ArrayList) LesFichiers.clone(); @@ -2376,6 +2408,7 @@ public class meptl { node nodDate = null; node nodDateCreator = null; String dcdate1 =""; + @SuppressWarnings("unused") String dccreator =""; nodDate = HitoriqueDuFichier.get(j).retourneFirstEnfantsByName("dc:date"); nodDateCreator = HitoriqueDuFichier.get(j).retourneFirstEnfantsByName("dc:creator"); @@ -2411,10 +2444,10 @@ public class meptl { String dccreator2 = HitoriqueDuFichier2.get(j2).retourneFirstEnfantsByName("dc:creator").getContenu().get(0); node N2 = HitoriqueDuFichier2.get(j2).retourneFirstEnfantsByName(N1.getNomElt()); - if(a.equalNode(N1, N2)) { //Verification des deux nodes de l'historique identiques - if(dcdate1.equals(dcdate2) && N1.getNomElt().equals(N2.getNomElt()) && dccreator.equals(dccreator2)) { //cette ligne est redondante + if(Run.equalNode(N1, N2)) { //Verification des deux nodes de l'historique identiques +// if(dcdate1.equals(dcdate2) && N1.getNomElt().equals(N2.getNomElt()) && dccreator.equals(dccreator2)) { //cette ligne est redondante - if(nodStudent.retourneFirstNodeByNameAndAttributValueExactStrict("correspondance", "date", dcdate2)==null) { + if(nodStudent.retourneFirstNodeByNameAndAttributValueExactStrict("correspondance", "date", dcdate2)==null) { //affinage du match compteurnombreCorrespondance++; if(compteurnombreCorrespondancesSuivi==0) { @@ -2439,10 +2472,11 @@ public class meptl { correspondance.getAttributs().put("Avec_etudiant", nameStudent2); correspondance.getAttributs().put("dc:creator", dccreator2); nodStudent.getNodes().add(correspondance); - System.out.println("\t** Find a match ** " + dcdate1); + System.out.println("\t** Trouve une correspondance ** " + dcdate1); + commandes.message.append("\n\t** Trouve une correspondance ** " + dcdate1); break; } - } +// } } } } @@ -2481,7 +2515,7 @@ public class meptl { verif.getNodes().add(nodStudent); System.out.println("\tDate de modification date unique " + String.valueOf(lesdates.size())); - + commandes.message.append("\n\tDate de modification date unique " + String.valueOf(lesdates.size())); } // Ci-dessous le code pour vérifier la première date de modification dans le fichier. @@ -2515,9 +2549,20 @@ public class meptl { System.out.println("\t\t ************************"); System.out.println("\t\t ** Plagiat PROBABLE **"); System.out.println("\t\t ************************"); + + commandes.message.append("\n\t\t ************************"); + commandes.message.append("\n\t\t Plagiat PROBABLE "); + commandes.message.append("\n\t\t ************************"); } } + System.out.println(); + System.out.println("** FIN DE LA VERIFIACTION **"); + System.out.println(); + + commandes.message.append("\n** FIN DE LA VERIFICATION **\n"); + + return verif; } diff --git a/src/MEPTL/verificationFichierAnalyse.java b/src/MEPTL/verificationFichierAnalyse.java index 32d19e9..11f227a 100644 --- a/src/MEPTL/verificationFichierAnalyse.java +++ b/src/MEPTL/verificationFichierAnalyse.java @@ -833,8 +833,10 @@ public class verificationFichierAnalyse { * @throws IOException */ public static void MiseAJourFichierAnalyse() throws CloneNotSupportedException, IOException { + node nodeCalculHash = meptl.chargementFichierAnalyse(commandes.nameSujet, false); commandes.hash = String.valueOf(Run.HashNode(nodeCalculHash,0)); + boolean maj =false; if(nodeCalculHash.getAttributs().get("hash")==null) { maj=true; @@ -877,11 +879,14 @@ public class verificationFichierAnalyse { commandes.message.append("\n*********************************************************************"); commandes.message.append("\n"); + String cheminVersFichierAnalyse = commandes.path; + if(!commandes.console) cheminVersFichierAnalyse = commandes.PathFilenameAnalysis.substring(0,commandes.PathFilenameAnalysis.lastIndexOf("\\")); if(commandes.nameSujet.contains(".")) { - Run.ecritureNodeEnXML(nodeCalculHash,commandes.nameSujet.substring(0, commandes.nameSujet.lastIndexOf(".")),commandes.pathDestination,false,"Sujet"); + Run.ecritureNodeEnXML(nodeCalculHash,commandes.nameSujet.substring(0, commandes.nameSujet.lastIndexOf(".")),cheminVersFichierAnalyse,"Sujet"); }else { - Run.ecritureNodeEnXML(nodeCalculHash,commandes.nameSujet,commandes.pathDestination,false,"Sujet"); + Run.ecritureNodeEnXML(nodeCalculHash,commandes.nameSujet,cheminVersFichierAnalyse,"Sujet"); } + }else { System.out.println("\t\t┌─────────────────────────────────────────────────────┐"); System.out.println("\t\t│ Vérification du hash et du nom du fichier correct. │"); @@ -906,7 +911,7 @@ public class verificationFichierAnalyse { node nodeSujet = meptl.chargementFichierAnalyse(commandes.nameSujet, true); nodeSujet.getAttributs().put("hash", String.valueOf(Run.HashNode(nodeSujet, 0))); nodeSujet.getAttributs().put("analysis_filename", "sujet.xml"); - Run.ecritureNodeEnXML(nodeSujet, "sujet","",false, "Sujet"); // ecriture du node sujet. Uniquement les nodes évalués. + Run.ecritureNodeEnXML(nodeSujet, "sujet",commandes.path,"Sujet"); // ecriture du node sujet. Uniquement les nodes évalués. System.out.println("\t\t┌─────────────────────────────────────────────────────────────────────┐"); System.out.println("\t\t│ Un nouveau fichier \"sujet.xml\" a été créé dans le dossier courant. │"); System.out.println("\t\t└─────────────────────────────────────────────────────────────────────┘"); diff --git a/src/app/evaluate.java b/src/app/evaluate.java index ce8d9a0..664c8df 100644 --- a/src/app/evaluate.java +++ b/src/app/evaluate.java @@ -23,6 +23,9 @@ import org.xml.sax.SAXException; import MEPTL.commandes; import MEPTL.meptl; +import cXML.Run; +import cXML.node; + import javax.swing.SwingConstants; import java.awt.GridLayout; import javax.swing.JScrollPane; @@ -46,6 +49,7 @@ public class evaluate extends JFrame { private JCheckBox chckbxNoNote = new JCheckBox(); private JCheckBox chckCSVNotes = new JCheckBox(); private JCheckBox chckbxNoLogo = new JCheckBox(); + private JCheckBox chckbxVerif = new JCheckBox(); JCheckBox chckbxNewLogo = new JCheckBox(); private JTextPane txtpnmessages = new JTextPane(); private JProgressBar progressBar = new JProgressBar(); @@ -55,6 +59,9 @@ public class evaluate extends JFrame { private JButton btnFichierCSV = new JButton(); private JButton btnAbout = new JButton(); private JButton btnFichierSVG = new JButton(); + private JButton btnExit = new JButton(); + private JButton btnInformationAnalyse = new JButton(); + private JButton btnInfoListeEtudiant; /** * Create the frame. @@ -79,6 +86,11 @@ public class evaluate extends JFrame { btnSelectFileAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyse.png"))); toolBar.add(btnSelectFileAnalyse); + btnInformationAnalyse = new JButton(""); + btnInformationAnalyse.setToolTipText("Information sur l'analyse"); + btnInformationAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo.png"))); + toolBar.add(btnInformationAnalyse); + btnSelectFolder = new JButton(""); btnSelectFolder.setIcon(new ImageIcon(evaluate.class.getResource("/resources/open2.png"))); btnSelectFolder.setSelectedIcon(new ImageIcon(evaluate.class.getResource("/resources/evalwriter.png"))); @@ -95,6 +107,13 @@ public class evaluate extends JFrame { btnFichierCSV.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSV.png"))); toolBar.add(btnFichierCSV); + btnInfoListeEtudiant = new JButton(""); + btnInfoListeEtudiant.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSVInfo.png"))); + btnInfoListeEtudiant.setToolTipText("Affichage liste des étudiants"); + toolBar.add(btnInfoListeEtudiant); + + toolBar.addSeparator(); + btnFichierSVG = new JButton(""); btnFichierSVG.setToolTipText("Sélectionner le fichier Logo"); btnFichierSVG.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierSVG.png"))); @@ -114,11 +133,22 @@ public class evaluate extends JFrame { toolBar.addSeparator(); + toolBar.addSeparator(); + btnAbout = new JButton(""); btnAbout.setIcon(new ImageIcon(evaluate.class.getResource("/resources/apropos.png"))); btnAbout.setToolTipText("Informations"); toolBar.add(btnAbout); + toolBar.addSeparator(); + + toolBar.addSeparator(); + + btnExit = new JButton(""); + btnExit.setIcon(new ImageIcon(evaluate.class.getResource("/resources/exit.png"))); + btnExit.setToolTipText("Fermer l'application"); + toolBar.add(btnExit); + JPanel panel = new JPanel(); contentPane.add(panel, BorderLayout.WEST); panel.setLayout(new MigLayout("", "[309px]", "[71px][71px][][71px][][74.00][][]")); @@ -142,6 +172,7 @@ public class evaluate extends JFrame { panel.add(lblFichierSVG, "flowy,cell 0 5,growx"); chckCSVNotes = new JCheckBox("Créer un fichier CSV des notes"); + chckCSVNotes.setToolTipText("Cochez si vous voulez importer les notes dans un fichier CSV."); panel.add(chckCSVNotes, "cell 0 3,grow"); lblPath.setHorizontalAlignment(SwingConstants.LEFT); lblPath.setFont(new Font("Tahoma", Font.BOLD, 14)); @@ -149,22 +180,33 @@ public class evaluate extends JFrame { panel.add(lblPath, "cell 0 0,grow"); chckbxnoFeedback = new JCheckBox("Pas de feedback"); + chckbxnoFeedback.setToolTipText("Cochez si vous ne voulez pas générer des feedbacks"); chckbxnoFeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); panel.add(chckbxnoFeedback, "cell 0 1,grow"); chckbxZipfeedback = new JCheckBox("Zip les feedbacks"); + chckbxZipfeedback.setToolTipText("Cochez si vous voulez placer tous les feedbacks dans une archive ZIP"); chckbxZipfeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); panel.add(chckbxZipfeedback, "cell 0 1,grow"); chckbxNoNote = new JCheckBox("Pas de note dans les feedbacks"); + chckbxNoNote.setToolTipText("Cochez si vous voulez pas faire apparaître les notes dans les feedbacks"); chckbxNoNote.setFont(new Font("Tahoma", Font.PLAIN, 12)); panel.add(chckbxNoNote, "cell 0 1,grow"); + chckbxVerif = new JCheckBox("Vérification des historiques avant analyse"); + chckbxVerif.setToolTipText("Cochez si vous voulez vérifier les échanges de fichiers entre les étudiants."); + chckbxVerif.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panel.add(chckbxVerif, "cell 0 1, grow"); + chckbxNewLogo = new JCheckBox("Nouveau logo"); - chckbxNewLogo.setFont(new Font("Tahoma", Font.PLAIN, 11)); + chckbxNewLogo.setToolTipText("Cochez si vous voulez remplacer le logo par celui au-dessus."); + chckbxNewLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); panel.add(chckbxNewLogo, "cell 0 5"); chckbxNoLogo = new JCheckBox("Pas de logo"); + chckbxNoLogo.setToolTipText("Cochez si vous voulez pas de logo dans les feedbacks."); + chckbxNoLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); panel.add(chckbxNoLogo, "cell 0 5"); @@ -180,7 +222,7 @@ public class evaluate extends JFrame { scrollPane.setColumnHeaderView(progressBar); txtpnmessages = new JTextPane(); - txtpnmessages.setFont(new Font("Tahoma", Font.PLAIN, 12)); + txtpnmessages.setFont(new Font("Tahoma", Font.PLAIN, 14)); txtpnmessages.setText("Charger un fichier d'analyse."); scrollPane.setViewportView(txtpnmessages); @@ -204,6 +246,7 @@ public class evaluate extends JFrame { chckCSVNotes.setEnabled(false); chckbxNewLogo.setEnabled(false); chckbxNoLogo.setEnabled(false); + chckbxVerif.setEnabled(false); }else { chckbxfichiersEtudaints.setEnabled(true); @@ -213,6 +256,7 @@ public class evaluate extends JFrame { chckCSVNotes.setEnabled(true); chckbxNewLogo.setEnabled(true); chckbxNoLogo.setEnabled(true); + chckbxVerif.setEnabled(true); StringBuilder text = new StringBuilder(); @@ -245,7 +289,13 @@ public class evaluate extends JFrame { text.append("\nContrôle la date de céation : " + commandes.analyse_controleDateCreation); text.append("\n______"); text.append("\nContrôle l'auteur initial du fichier : " + commandes.analyse_controle_Initial_Creator); - text.append("\n***********************************************"); + text.append("\n\n***********************************************"); + + text.append("\n\n***********************************************"); + text.append("\nDossier de l'analyse contenant les fichiers des étudiants :"); + text.append("\n"+commandes.path+"\n"); + text.append("\nFichier d'analyse :"); + text.append("\n"+commandes.PathFilenameAnalysis+"\n"); progressBar.setVisible(false); txtpnmessages.setText(text.toString()); @@ -256,7 +306,7 @@ public class evaluate extends JFrame { lblFileAnalyse.setText("Fichier de l'analyse : " + commandes.analysis_filename + ""); lblFichierSVG.setText("Fichier SVG : " + commandes.nameSVG.substring(commandes.nameSVG.lastIndexOf("\\")+1,commandes.nameSVG.length()) + ""); lblFichierCSV.setText("Fichier CSV : " + commandes.nameCSV + ""); - + } @@ -303,7 +353,7 @@ public class evaluate extends JFrame { if(commandes.fichierAnalyseValide) { try { msgBox V = new msgBox("Je travaille dure.",false,false,"Attendez"); - Thread.sleep(500); + Thread.sleep(200); evaluerLesFichiersEtudiants(); V.close(); } catch (ParserConfigurationException | SAXException | IOException | CloneNotSupportedException e1) { @@ -336,13 +386,17 @@ public class evaluate extends JFrame { System.out.println("getSelectedFile() : " + chooser.getSelectedFile().getAbsolutePath()); commandes.nameCSV = chooser.getSelectedFile().getAbsolutePath(); commandes.fourniCSV=true; + commandes.nodeCSV = meptl.chargementFichierCSV(); + txtpnmessages.setText(Run.ecritureNode(commandes.nodeCSV, 0).toString()); } else { commandes.nameCSV = ""; commandes.fourniCSV=false; System.out.println("No Selection "); + commandes.nodeCSV = new node(); + refreshLabel(); } - refreshLabel(); + } }); @@ -385,6 +439,38 @@ public class evaluate extends JFrame { } }); + + // Exit + btnExit.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + dispose(); + } + }); + + // Information + btnInformationAnalyse.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if(commandes.fichierAnalyseValide) { + refreshLabel(); + }else { + txtpnmessages.setText("*** Veuillez charger un fichier d'analyse ***"); + } + } + }); + + + // liste des étudiants + btnInfoListeEtudiant.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + if(commandes.fourniCSV) { + txtpnmessages.setText(Run.ecritureNode(commandes.nodeCSV, 0).toString()); + }else { + txtpnmessages.setText("*** Veuillez sélectionner un fichier CSV contenant la liste des étudiants ***"); + } + + } + }); + } @@ -410,6 +496,7 @@ public class evaluate extends JFrame { if(chckCSVNotes.isSelected()) commandes.ecritNoteCSV=true; if(chckbxNewLogo.isSelected()) commandes.newLogo=true; if(chckbxNoLogo.isSelected()) commandes.noLogo = true; + if(chckbxVerif.isSelected()) commandes.verifHisto2 = true; meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(); diff --git a/src/app/filechooserXML.java b/src/app/filechooserXML.java index 494d638..2c980ca 100644 --- a/src/app/filechooserXML.java +++ b/src/app/filechooserXML.java @@ -37,10 +37,11 @@ public class filechooserXML extends JFileChooser { - if(!commandes.filename.isEmpty()) { - File file = new File(commandes.path ); //+ "\\" + utils.filename + ".xml" + if(!commandes.PathFilenameAnalysis.isEmpty()) { + File file = new File(commandes.PathFilenameAnalysis ); //+ "\\" + utils.filename + ".xml" setCurrentDirectory(file); } + setPreferredSize(new Dimension(550, 420)); @@ -84,7 +85,7 @@ public class filechooserXML extends JFileChooser { private void openFileXML(File file) { commandes.path = file.getPath().substring(0,file.getPath().lastIndexOf("\\")); - commandes.filename = file.getName().substring(0,file.getName().lastIndexOf(".")); + commandes.PathFilenameAnalysis = file.getPath(); commandes.nameSujet = file.getName().toString(); BufferedReader br; diff --git a/src/resources/apropos.png b/src/resources/apropos.png index ea4b14d..fbba6ba 100644 Binary files a/src/resources/apropos.png and b/src/resources/apropos.png differ diff --git a/src/resources/exit.png b/src/resources/exit.png new file mode 100644 index 0000000..9eb7a87 Binary files /dev/null and b/src/resources/exit.png differ diff --git a/src/resources/fichierAnalyseInfo.png b/src/resources/fichierAnalyseInfo.png new file mode 100644 index 0000000..e65ccfb Binary files /dev/null and b/src/resources/fichierAnalyseInfo.png differ diff --git a/src/resources/fichierCSVInfo.png b/src/resources/fichierCSVInfo.png new file mode 100644 index 0000000..c5de141 Binary files /dev/null and b/src/resources/fichierCSVInfo.png differ