This commit is contained in:
pablo rodriguez 2022-06-11 16:53:59 +02:00
parent 299865f3f5
commit 4306a47afc
8 changed files with 56 additions and 29 deletions

29
aW.xml Normal file
View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="UTF-8"?>
<launch4jConfig>
<dontWrapJar>false</dontWrapJar>
<headerType>gui</headerType>
<jar>C:\Users\pabr6\git\analyseWriter\MEPTL\analyseWriter.jar</jar>
<outfile>C:\Users\pabr6\OneDrive\Documents\Second exercice avec analyseWriter - Champ auteur\analyseWriter\analyseWriter.exe</outfile>
<errTitle>Erreur</errTitle>
<cmdLine></cmdLine>
<chdir></chdir>
<priority>normal</priority>
<downloadUrl>http://java.com/download</downloadUrl>
<supportUrl></supportUrl>
<stayAlive>false</stayAlive>
<restartOnCrash>false</restartOnCrash>
<manifest></manifest>
<icon>C:\Users\pabr6\git\analyseWriter\MEPTL\icons\analyseWriter.ico</icon>
<classPath>
<mainClass>app.mainApp</mainClass>
</classPath>
<jre>
<path></path>
<bundledJre64Bit>false</bundledJre64Bit>
<bundledJreAsFallback>false</bundledJreAsFallback>
<minVersion>16</minVersion>
<maxVersion></maxVersion>
<jdkPreference>preferJre</jdkPreference>
<runtimeBits>64/32</runtimeBits>
</jre>
</launch4jConfig>

Binary file not shown.

Binary file not shown.

View File

@ -837,57 +837,54 @@ public class verificationFichierAnalyse {
*/
public static void MiseAJourFichierAnalyse() throws CloneNotSupportedException, IOException {
node nodeCalculHash = meptl.chargementFichierAnalyse(commandes.nameSujet, false);
commandes.hash = String.valueOf(Run.HashNode(nodeCalculHash,0));
commandes.hash = String.valueOf(Run.HashNode(commandes.sujet,0));
boolean maj =false;
if(nodeCalculHash.getAttributs().get("hash")==null) {
if(commandes.sujet.getAttributs().get("hash")==null) {
maj=true;
}else {
if(!nodeCalculHash.getAttributs().get("hash").equals(commandes.hash)) {
if(!commandes.sujet.getAttributs().get("hash").equals(commandes.hash)) {
maj=true;
}
}
if(nodeCalculHash.getAttributs().get("analysis_filename")==null) {
if(commandes.sujet.getAttributs().get("analysis_filename")==null) {
maj=true;
}else {
if(!nodeCalculHash.getAttributs().get("analysis_filename").equals(commandes.nameSujet)) {
if(!commandes.sujet.getAttributs().get("analysis_filename").equals(commandes.analysis_filename)) {
maj=true;
}
}
if(maj) {
int nbespace = "───────────────────────────┐".length()-commandes.hash.length();
if (nbespace<0) nbespace=1;
int nbespace2 = "───────────────────────────────┐".length()-commandes.nameSujet.length();
int nbespace2 = "───────────────────────────────┐".length()-commandes.analysis_filename.length();
if (nbespace2<0) nbespace2=1;
System.out.println("\t\t┌────────────────────────────────────────────────────────────────────┐");
System.out.println("\t\t│ Le hash du code de l'évaluation ou le nom du fichier d'analyse │");
System.out.println("\t\t│ a été mise à jour dans le fichier d'analyse. │");
System.out.println("\t\t│ │");
System.out.println("\t\t│ Le hash du code de l'évaluation est : " + commandes.hash + new String(new char[nbespace]).replace("\0", " ") +"" );
System.out.println("\t\t│ Le nom du fichier d'analyse est : " + commandes.nameSujet + new String(new char[nbespace2]).replace("\0", " ") +"" );
System.out.println("\t\t│ Le nom du fichier d'analyse est : " + commandes.analysis_filename + new String(new char[nbespace2]).replace("\0", " ") +"" );
System.out.println("\t\t│ │");
System.out.println("\t\t└────────────────────────────────────────────────────────────────────┘");
System.out.println();
nodeCalculHash.getAttributs().put("hash", commandes.hash);
nodeCalculHash.getAttributs().put("analysis_filename", commandes.nameSujet);
commandes.sujet.getAttributs().put("hash", commandes.hash);
commandes.sujet.getAttributs().put("analysis_filename", commandes.nameSujet);
commandes.message.append("\n");
commandes.message.append("\n*********************************************************************");
commandes.message.append("\n Le hash du code de l'évaluation ou le nom du fichier d'analyse");
commandes.message.append("\n a été mise à jour dans le fichier d'analyse.");
commandes.message.append("\n");
commandes.message.append("\n Le hash du code de l'évaluation est : " + commandes.hash );
commandes.message.append("\n Le nom du fichier d'analyse est : " + commandes.nameSujet);
commandes.message.append("\n*********************************************************************");
commandes.message.append("\n");
commandes.message.append("<hr><h1>Le hash du code de l'évaluation ou le nom du fichier d'analyse</h1><hr>");
commandes.message.append("<p> a été mise à jour dans le fichier d'analyse.</p>");
commandes.message.append("<br>");
commandes.message.append("<p> Le hash du code de l'évaluation est : " + commandes.hash +"</p>");
commandes.message.append("<p> Le nom du fichier d'analyse est : " + commandes.analysis_filename + "</p>");
commandes.message.append("<hr>");
commandes.message.append("<br>");
String cheminVersFichierAnalyse = commandes.path;
String cheminVersFichierAnalyse = commandes.PathFilenameAnalysis;
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(".")),cheminVersFichierAnalyse,"Sujet");
if(commandes.analysis_filename.contains(".")) {
Run.ecritureNodeEnXML(commandes.sujet,commandes.analysis_filename.substring(0, commandes.nameSujet.lastIndexOf(".")),cheminVersFichierAnalyse,"Sujet");
}else {
Run.ecritureNodeEnXML(nodeCalculHash,commandes.nameSujet,cheminVersFichierAnalyse,"Sujet");
Run.ecritureNodeEnXML(commandes.sujet,commandes.analysis_filename,cheminVersFichierAnalyse,"Sujet");
}
}else {
@ -895,9 +892,9 @@ public class verificationFichierAnalyse {
System.out.println("\t\t│ Vérification du hash et du nom du fichier correct. │");
System.out.println("\t\t└─────────────────────────────────────────────────────┘");
System.out.println();
commandes.message.append("\n**********************************************************");
commandes.message.append("\n Vérification du hash et du nom du fichier correct.");
commandes.message.append("\n**********************************************************");
commandes.message.append("<p>**********************************************************</p>");
commandes.message.append("<p> Vérification du hash et du nom du fichier correct.</p>");
commandes.message.append("<p>**********************************************************</p>");
}
//** bye bye analyseWriter

View File

@ -89,7 +89,7 @@ public class afficheText extends JEditorPane {
}
}
if(Lesattributsdunode.get(i).equals("titre")||Lesattributsdunode.get(i).equals("titre1")||Lesattributsdunode.get(i).equals("titre2")||Lesattributsdunode.get(i).equals("titre3")) {
if(Lesattributsdunode.get(i).length()>0) {
if(nod.getAttributs().get(Lesattributsdunode.get(i)).length()>0) {
sb.append("<li class=\"p4\">"+imageTitre + " <b>" + Lesattributsdunode.get(i) + "=\"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
}
}

View File

@ -92,7 +92,8 @@ public class evaluerLesFichiersEtudiants implements Runnable{
commandes.analyse_Nbre_Fichier_Student = nbFichierWriter;
commandes.message.append("<br>");
commandes.message.append("<p>Nombre de fichier à analyser et évaluer : " + Integer.valueOf(nbFichierWriter) + "</p>");
commandes.message.append("<br>");
commandes.message.append("<hr>");
//***************************************
//** -verif ou -use file.xml -verifcsv **
@ -122,7 +123,7 @@ public class evaluerLesFichiersEtudiants implements Runnable{
e.printStackTrace();
} //écriture du node de vérification
commandes.message.append("<br>");
commandes.message.append("<hr><h1>Ecriture du fichier Verif.xml dans le dossier d'analyse</h1><hr>");
commandes.message.append("<hr><h1> *** Ecriture du fichier Verif.xml dans le dossier d'analyse *** </h1><hr>");
commandes.message.append("<br>");
if(!commandes.analyse) {
//** bye bye analyseWriter