Création interface graphique
2
bin/.gitignore
vendored
@ -1 +1,3 @@
|
||||
/app/
|
||||
/MEPTL/
|
||||
/resources/
|
||||
|
@ -2,7 +2,7 @@
|
||||
<svg
|
||||
inkscape:export-ydpi="128"
|
||||
inkscape:export-xdpi="128"
|
||||
inkscape:export-filename="C:\Users\pabr6\eclipse-workspace\evalWriter\icons\accueil.png"
|
||||
inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\accueil.png"
|
||||
sodipodi:docname="accueill.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
id="svg8"
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -2,7 +2,7 @@
|
||||
<svg
|
||||
inkscape:export-ydpi="128"
|
||||
inkscape:export-xdpi="128"
|
||||
inkscape:export-filename="C:\Users\pabr6\eclipse-workspace\evalWriter\icons\accueil.png"
|
||||
inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\accueil.png"
|
||||
sodipodi:docname="accueill.svg"
|
||||
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
|
||||
id="svg8"
|
||||
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -20,7 +20,16 @@ import cXML.Run.UserStatus;
|
||||
*/
|
||||
public class commandes {
|
||||
|
||||
//** Les commandes par défaut
|
||||
//** Application console par défaut.
|
||||
//** Si la valeur ets false alors c'est une application avec inteface graphique.
|
||||
public static boolean console = true;
|
||||
|
||||
//** Le node du fichier d'analyse
|
||||
public static node sujet = new node();
|
||||
|
||||
//***************************************************
|
||||
//** Les commandes par défaut à travers la console **
|
||||
//***************************************************
|
||||
static String nameSujet = ""; //sujet par défaut
|
||||
public static boolean analyse = false; //analyse des fichiers étudiants
|
||||
public static boolean ecritCode = false; // -write : ecriture du code du sujet
|
||||
@ -40,15 +49,15 @@ public class commandes {
|
||||
public static boolean licence = false; // affiche la licence
|
||||
public static boolean zipfeedback = false; // Les feedback dans une archive ZIP
|
||||
public static boolean fichierStudentMoodle = false; // Les fichiers étudiants sont directement dans le dossier courant de l'application.
|
||||
static cXML.Run.UserStatus Profil = cXML.Run.UserStatus.TEACHER ; //Le profil TEACHER permet de lire dans les dossiers contenus dans le répertoire courant de l'application. Le profil STUDENT permet de lire au niveau du répertoire courant de l'application.
|
||||
public static cXML.Run.UserStatus Profil = cXML.Run.UserStatus.TEACHER ; //Le profil TEACHER permet de lire dans les dossiers contenus dans le répertoire courant de l'application. Le profil STUDENT permet de lire au niveau du répertoire courant de l'application.
|
||||
public static boolean fourniDossierDestination = false; //répertoire de destination des feedbacks et CSV;
|
||||
public static String nameCSV = ""; //le nom du fichier contenant la liste des étudiants
|
||||
public static String nameSVG =""; //le nom du nouveau logo
|
||||
public static String contenuFichierSVG =""; // Le nouveau logo
|
||||
public static String path ="";
|
||||
public static String pathDestination ="";
|
||||
public static String version ="3.6.0"; // La version
|
||||
public static String Command ="";
|
||||
public static String version ="3.6.1"; // La version actuelle
|
||||
public static String Command =""; //récupère le texte de la commande dans la console
|
||||
|
||||
//** setting valeur par défaut
|
||||
public static String culture = "FR";
|
||||
@ -61,16 +70,45 @@ public class commandes {
|
||||
public static int tolerance_vert = 30;
|
||||
public static int tolerance_bleu = 30;
|
||||
|
||||
//** Variable de mise à jour du fichier d'analyse
|
||||
//** Variables de mise à jour du fichier d'analyse
|
||||
public static boolean MAJnameAnalysisFile =false;
|
||||
public static boolean MAJFichierAnalyse = false;
|
||||
public static String hash ="0";
|
||||
|
||||
//** Variable pour l'interface du logiciel
|
||||
//** Variables du fichier d'analyse
|
||||
public static String analyse_culture = "FR";
|
||||
public static String analyse_metaSujet="";
|
||||
public static String analyse_auteur="";
|
||||
public static String analyse_Initial_Creator="";
|
||||
public static String analyse_version="";
|
||||
public static String analyse_creationDate="";
|
||||
public static String analyse_titre="";
|
||||
public static String analyse_link_sujet="";
|
||||
public static String analyse_link_help="";
|
||||
public static String analyse_date="";
|
||||
public static boolean analyse_historiquePresent=false;
|
||||
public static boolean analyse_presenceMetaSujet=false;
|
||||
public static boolean analyse_controleDateCreation=false;
|
||||
public static boolean analyse_controle_Initial_Creator=false;
|
||||
public static boolean analyse_baremeABC=false;
|
||||
public static double analyse_progression=1;
|
||||
public static double analyse_notefrom=20;
|
||||
public static int analyse_tolerance_characters = 5;
|
||||
public static double analyse_tolerance_text = 0.79;
|
||||
public static int analyse_number_match = 2;
|
||||
public static int analyse_mini_number_modification = 0;
|
||||
public static int analyse_nombres_modifications_simultané_maxi = 100;
|
||||
public static int analyse_tolerance_rouge = 30;
|
||||
public static int analyse_tolerance_vert = 30;
|
||||
public static int analyse_tolerance_bleu = 30;
|
||||
|
||||
|
||||
//** Variables pour l'interface du logiciel
|
||||
public static String Titre = "analyseWriter";
|
||||
public static String filename="";
|
||||
public static boolean fichierValide = false;
|
||||
public static node sujet = null;
|
||||
public static boolean fichierAnalyseValide = false;
|
||||
public static String Annee ="2022";
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -68,8 +68,6 @@ public class meptl {
|
||||
//*******************
|
||||
new commandes(args,commandes.path);
|
||||
|
||||
//** Node pour le chargement du node sujet (fichier d'analyse)
|
||||
node nodeSujet = new node();
|
||||
|
||||
//** Nouveau node qui permet de convertir le fichier contenant la liste des étudiants en node.
|
||||
node nodeCSV = null;
|
||||
@ -144,30 +142,36 @@ public class meptl {
|
||||
//** PREPARATION du node Sujet pour analyse -use file.xml ou -use file.xml -sujet **
|
||||
//***********************************************************************************
|
||||
if(commandes.analyse||commandes.ecritNodeAnalyse) {
|
||||
nodeSujet = chargementsujet(commandes.nameSujet, true);
|
||||
commandes.sujet = chargementFichierAnalyse(commandes.nameSujet, true);
|
||||
|
||||
if(nodeSujet==null) {
|
||||
if(commandes.sujet==null) {
|
||||
//***************************
|
||||
//** bye bye analyseWriter **
|
||||
//***************************
|
||||
commandes.clotureApplicationAvecErreur();
|
||||
}
|
||||
|
||||
//** Chargement de la culture **
|
||||
if(nodeSujet.retourneFirstEnfantsByName("setting").isHasAttributs()) {
|
||||
commandes.culture = nodeSujet.retourneFirstEnfantsByName("setting").getAttributs().get("culture"); //récupère la culture de l'utilisateur
|
||||
}
|
||||
|
||||
//** La méthode verificationFichier Analyse permet de détecter des erreurs dans le fichier d'analyse
|
||||
new verificationFichierAnalyse(nodeSujet);
|
||||
//******************************************************************************************************
|
||||
//** La méthode verification Fichier Analyse permet de détecter des erreurs dans le fichier d'analyse **
|
||||
//** Permet aussi de verifier la mise à jour du hash ou du nom du fichier d'analyse **
|
||||
//******************************************************************************************************
|
||||
new verificationFichierAnalyse();
|
||||
|
||||
|
||||
if(verificationFichierAnalyse.erreur==true) verificationFichierAnalyse.clotureWithErrorInanalyzeFile();
|
||||
//a.ecritureNodeEnXML(nodeSujet, "sujet","",false); // ecriture du node sujet
|
||||
|
||||
//****************************************************
|
||||
//** Chargement des paramètres du fichier d'analyse **
|
||||
//****************************************************
|
||||
chargementParametresFichierAnalyse();
|
||||
|
||||
//************************************************
|
||||
//** Nouvelle ecriture du fichier si MAJ fichier**
|
||||
//************************************************
|
||||
if(commandes.MAJFichierAnalyse||commandes.MAJnameAnalysisFile) {
|
||||
nodeSujet.getAttributs().put("hash", commandes.hash);
|
||||
nodeSujet.getAttributs().put("analysis_filename", commandes.nameSujet);
|
||||
commandes.sujet.getAttributs().put("hash", commandes.hash);
|
||||
commandes.sujet.getAttributs().put("analysis_filename", commandes.nameSujet);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -179,40 +183,6 @@ public class meptl {
|
||||
commandes.contenuFichierSVG= chargementFichierSVG(a,commandes.nameSVG);
|
||||
}
|
||||
|
||||
//***********************************************************************
|
||||
//** chargement du node translation qui se trouve dans le node setting **
|
||||
//***********************************************************************
|
||||
outils.chargeTraduction(nodeSujet.retourneFirstEnfantsByName("translation"));
|
||||
|
||||
//************************************************
|
||||
//** Charge les nouvelles tolérances pour texte **
|
||||
//************************************************
|
||||
if(nodeSujet.containElementByName("text:similarity")) {
|
||||
node similarity = nodeSujet.retourneFirstEnfantsByName("text:similarity");
|
||||
if(similarity.getAttributs().get("tolerance_characters")!=null) commandes.tolerance_characters = Integer.valueOf(similarity.getAttributs().get("tolerance_characters"));
|
||||
if(similarity.getAttributs().get("tolerance_text")!=null) commandes.tolerance_text = Double.valueOf(similarity.getAttributs().get("tolerance_text"));
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
//** Charge le nombre de match limite et le nombre minimal **
|
||||
//***********************************************************
|
||||
if(nodeSujet.containElementByName("plagiarism")) {
|
||||
node plagiarism = nodeSujet.retourneFirstEnfantsByName("plagiarism");
|
||||
if(plagiarism.getAttributs().get("number_match") != null) commandes.number_match = Integer.valueOf(plagiarism.getAttributs().get("number_match"));
|
||||
if(plagiarism.getAttributs().get("mini_number_modification") != null) commandes.mini_number_modification = Integer.valueOf(plagiarism.getAttributs().get("mini_number_modification"));
|
||||
if(plagiarism.getAttributs().get("nombres_modifications_simultané_maxi") != null) commandes.nombres_modifications_simultané_maxi = Integer.valueOf(plagiarism.getAttributs().get("nombres_modifications_simultané_maxi"));
|
||||
}
|
||||
|
||||
//**************************************
|
||||
//** Charge tolerance pour la couleur **
|
||||
//**************************************
|
||||
if(nodeSujet.containElementByName("color")) {
|
||||
node color = nodeSujet.retourneFirstEnfantsByName("color");
|
||||
if(color.getAttributs().get("tolerance_rouge") != null) commandes.tolerance_rouge= Integer.valueOf(color.getAttributs().get("tolerance_rouge"));
|
||||
if(color.getAttributs().get("tolerance_vert") != null) commandes.tolerance_vert= Integer.valueOf(color.getAttributs().get("tolerance_vert"));
|
||||
if(color.getAttributs().get("tolerance_bleu") != null) commandes.tolerance_bleu= Integer.valueOf(color.getAttributs().get("tolerance_bleu"));
|
||||
}
|
||||
|
||||
//**********************************************
|
||||
//** Chargement et verification du CVS fourni **
|
||||
//**********************************************
|
||||
@ -281,10 +251,11 @@ public class meptl {
|
||||
//** Analyse des fichiers student **
|
||||
//**********************************
|
||||
if(commandes.analyse||commandes.ecritNodeAnalyse) {
|
||||
node init =verificationFichierAnalyse.InitialisationAvantAnalyse(nodeSujet);
|
||||
node init =verificationFichierAnalyse.InitialisationAvantAnalyse(commandes.sujet);
|
||||
|
||||
if(!Boolean.valueOf(init.getAttributs().get("erreur"))) {
|
||||
// Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant
|
||||
node ana = analyse(nodStudent, nodeSujet, i, a);
|
||||
node ana = analyse(nodStudent, commandes.sujet, i, a);
|
||||
|
||||
//**************************************************
|
||||
//** Ecriture des fichiers d'analyse des students **
|
||||
@ -305,7 +276,7 @@ public class meptl {
|
||||
try {
|
||||
long size = 48000000; //valeur par défaut
|
||||
String nameZip = "feedbackMoodle"; //nom zip par défaut
|
||||
node zip = nodeSujet.retourneFirstEnfantsByName("zip");
|
||||
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");
|
||||
@ -336,13 +307,13 @@ public class meptl {
|
||||
}
|
||||
}
|
||||
|
||||
if(nodeSujet!=null) {
|
||||
if(commandes.sujet!=null) {
|
||||
//*****************************************************
|
||||
//** Exportation au format CSV si -csv ou -verifcsv **
|
||||
//*****************************************************
|
||||
if(commandes.ecritNoteCSV && !commandes.fourniCSV) {
|
||||
if(!commandes.verifHisto2) ecritureCSV(ensembleanalyse);
|
||||
if(commandes.verifHisto2) ecritureCSV(ensembleanalyse,verif,a,nodeSujet.retourneFirstEnfantsByName("setting"));
|
||||
if(commandes.verifHisto2) ecritureCSV(ensembleanalyse,verif,a,commandes.sujet.retourneFirstEnfantsByName("setting"));
|
||||
//a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant
|
||||
}
|
||||
|
||||
@ -350,7 +321,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, nodeSujet.retourneFirstEnfantsByName("setting"));
|
||||
ecritureCSV(ensembleanalyse,verif,a,nodeCSV, commandes.sujet.retourneFirstEnfantsByName("setting"));
|
||||
//a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant
|
||||
}
|
||||
|
||||
@ -372,14 +343,14 @@ public class meptl {
|
||||
|
||||
|
||||
/**
|
||||
* Lecture du fichier Student pour vérification.<br>
|
||||
* Lecture du fichier Student pour vérification des historiques.<br>
|
||||
* <br>
|
||||
* @param nod node
|
||||
* @param a
|
||||
* @param i
|
||||
* @return
|
||||
*/
|
||||
private static node LectureFichierEtudiantPourVerification(node nod, Run a, Integer i) {
|
||||
public static node LectureFichierEtudiantPourVerification(node nod, Run a, Integer i) {
|
||||
node fichier = new node();
|
||||
fichier.setNomElt("fichier");
|
||||
fichier.getAttributs().put("filename", a.getLectDossiers().getEC().getListeFichierodt().get(i));
|
||||
@ -506,8 +477,7 @@ public class meptl {
|
||||
* @return le node contenant tous les nodes de la lectures.
|
||||
* @throws IOException Input Output exception file.
|
||||
*/
|
||||
@SuppressWarnings("unchecked")
|
||||
private static node LectureFichierEtudiantSousFormeDeNode(node nod, Run a, Integer i) throws IOException {
|
||||
public static node LectureFichierEtudiantSousFormeDeNode(node nod, Run a, Integer i) throws IOException {
|
||||
node nodecontent = nod.retourneFirstEnfantsByName("office:document-content");
|
||||
node nodestyle = nod.retourneFirstEnfantsByName("office:document-styles");
|
||||
node nodbody = nod.retourneFirstEnfantsByName("office:text"); //a.NodeFirstName(nodecontent, "office:text");
|
||||
@ -1004,7 +974,7 @@ public class meptl {
|
||||
* @throws IOException
|
||||
* @throws CloneNotSupportedException
|
||||
*/
|
||||
public static node chargementsujet(String nameSujet, Boolean sansNodeEvaluer) throws CloneNotSupportedException, IOException {
|
||||
public static node chargementFichierAnalyse(String nameSujet, Boolean sansNodeEvaluer) throws CloneNotSupportedException, IOException {
|
||||
String targetString = "";
|
||||
//read file into stream, try-with-resources
|
||||
|
||||
@ -1052,7 +1022,161 @@ public class meptl {
|
||||
return LeNodeSujet;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Chargement des paramètres du fichier d'analyse
|
||||
*/
|
||||
public static void chargementParametresFichierAnalyse() {
|
||||
|
||||
try {
|
||||
|
||||
//** Chargement du titre de l'exercice
|
||||
if(commandes.sujet.getAttributs().get("titre")!=null) {
|
||||
commandes.analyse_titre=commandes.sujet.getAttributs().get("titre");
|
||||
}
|
||||
|
||||
// Chargement de la progression
|
||||
if(commandes.sujet.getAttributs().get("progression")!=null) {
|
||||
commandes.analyse_progression= Double.valueOf(commandes.sujet.getAttributs().get("progression"));
|
||||
}
|
||||
|
||||
// Chargement de la notefrom
|
||||
if(commandes.sujet.getAttributs().get("notefrom")!=null) {
|
||||
commandes.analyse_notefrom= Double.valueOf(commandes.sujet.getAttributs().get("notefrom"));
|
||||
}
|
||||
|
||||
// Chargement de la date de creation
|
||||
if(commandes.sujet.getAttributs().get("creationDate")!=null) {
|
||||
commandes.analyse_creationDate= commandes.sujet.getAttributs().get("creationDate");
|
||||
}
|
||||
|
||||
// Chargement de la version
|
||||
if(commandes.sujet.getAttributs().get("version")!=null) {
|
||||
commandes.analyse_version= commandes.sujet.getAttributs().get("version");
|
||||
}
|
||||
|
||||
// Chargement du link_sujet
|
||||
if(commandes.sujet.getAttributs().get("link_sujet")!=null) {
|
||||
commandes.analyse_link_sujet= commandes.sujet.getAttributs().get("link_sujet");
|
||||
}
|
||||
|
||||
// Chargement du link_help
|
||||
if(commandes.sujet.getAttributs().get("link_help")!=null) {
|
||||
commandes.analyse_link_help= commandes.sujet.getAttributs().get("link_help");
|
||||
}
|
||||
|
||||
// Chargement du controleDateCreation
|
||||
if(commandes.sujet.getAttributs().get("controleDateCreation")!=null) {
|
||||
commandes.analyse_controleDateCreation = Boolean.valueOf(commandes.sujet.getAttributs().get("controleDateCreation"));
|
||||
}
|
||||
|
||||
// Chargement du presenceMetaSujet
|
||||
if(commandes.sujet.getAttributs().get("presenceMetaSujet")!=null) {
|
||||
commandes.analyse_presenceMetaSujet = Boolean.valueOf(commandes.sujet.getAttributs().get("presenceMetaSujet"));
|
||||
}
|
||||
|
||||
// Chargement du historiquePresent
|
||||
if(commandes.sujet.getAttributs().get("historiquePresent")!=null) {
|
||||
commandes.analyse_historiquePresent = Boolean.valueOf(commandes.sujet.getAttributs().get("historiquePresent"));
|
||||
}
|
||||
|
||||
// Chargement du baremeABC
|
||||
if(commandes.sujet.getAttributs().get("baremeABC")!=null) {
|
||||
commandes.analyse_baremeABC = Boolean.valueOf(commandes.sujet.getAttributs().get("baremeABC"));
|
||||
}
|
||||
|
||||
// Chargement du controle_Initial_Creator
|
||||
if(commandes.sujet.getAttributs().get("controle_Initial_Creator")!=null) {
|
||||
commandes.analyse_controle_Initial_Creator = Boolean.valueOf(commandes.sujet.getAttributs().get("controle_Initial_Creator"));
|
||||
}
|
||||
|
||||
// Chargement du metaSujet
|
||||
if(commandes.sujet.getAttributs().get("metaSujet")!=null) {
|
||||
commandes.analyse_metaSujet= commandes.sujet.getAttributs().get("metaSujet");
|
||||
}
|
||||
|
||||
// Chargement du auteur
|
||||
if(commandes.sujet.getAttributs().get("auteur")!=null) {
|
||||
commandes.analyse_auteur= commandes.sujet.getAttributs().get("auteur");
|
||||
}
|
||||
|
||||
// Chargement du Initial_Creator
|
||||
if(commandes.sujet.getAttributs().get("Initial_Creator")!=null) {
|
||||
commandes.analyse_auteur= commandes.sujet.getAttributs().get("Initial_Creator");
|
||||
}
|
||||
|
||||
// Chargement du filename
|
||||
if(commandes.sujet.getAttributs().get("filename")!=null) {
|
||||
commandes.analyse_auteur= commandes.sujet.getAttributs().get("filename");
|
||||
}
|
||||
|
||||
// Chargement du date
|
||||
if(commandes.sujet.getAttributs().get("date")!=null) {
|
||||
commandes.analyse_date= commandes.sujet.getAttributs().get("date");
|
||||
}
|
||||
|
||||
|
||||
//*****************************************************************
|
||||
//** chargement de la culture qui se trouve dans le node setting **
|
||||
//*****************************************************************
|
||||
if(commandes.sujet.retourneFirstEnfantsByName("setting").isHasAttributs()) {
|
||||
if(commandes.sujet.retourneFirstEnfantsByName("setting").getAttributs().get("culture")!=null) {
|
||||
commandes.culture = commandes.sujet.retourneFirstEnfantsByName("setting").getAttributs().get("culture"); //récupère la culture de l'utilisateur
|
||||
}
|
||||
}
|
||||
|
||||
//***********************************************************************
|
||||
//** chargement du node translation qui se trouve dans le node setting **
|
||||
//***********************************************************************
|
||||
outils.chargeTraduction(commandes.sujet.retourneFirstEnfantsByName("translation"));
|
||||
|
||||
//************************************************
|
||||
//** Charge les nouvelles tolérances pour texte **
|
||||
//************************************************
|
||||
if(commandes.sujet.containElementByName("text:similarity")) {
|
||||
node similarity = commandes.sujet.retourneFirstEnfantsByName("text:similarity");
|
||||
if(similarity.getAttributs().get("tolerance_characters")!=null) commandes.tolerance_characters = Integer.valueOf(similarity.getAttributs().get("tolerance_characters"));
|
||||
if(similarity.getAttributs().get("tolerance_text")!=null) commandes.tolerance_text = Double.valueOf(similarity.getAttributs().get("tolerance_text"));
|
||||
}
|
||||
|
||||
//***********************************************************
|
||||
//** Charge le nombre de match limite et le nombre minimal **
|
||||
//***********************************************************
|
||||
if(commandes.sujet.containElementByName("plagiarism")) {
|
||||
node plagiarism = commandes.sujet.retourneFirstEnfantsByName("plagiarism");
|
||||
if(plagiarism.getAttributs().get("number_match") != null) commandes.number_match = Integer.valueOf(plagiarism.getAttributs().get("number_match"));
|
||||
if(plagiarism.getAttributs().get("mini_number_modification") != null) commandes.mini_number_modification = Integer.valueOf(plagiarism.getAttributs().get("mini_number_modification"));
|
||||
if(plagiarism.getAttributs().get("nombres_modifications_simultané_maxi") != null) commandes.nombres_modifications_simultané_maxi = Integer.valueOf(plagiarism.getAttributs().get("nombres_modifications_simultané_maxi"));
|
||||
}
|
||||
|
||||
//**************************************
|
||||
//** Charge tolerance pour la couleur **
|
||||
//**************************************
|
||||
if(commandes.sujet.containElementByName("color")) {
|
||||
node color = commandes.sujet.retourneFirstEnfantsByName("color");
|
||||
if(color.getAttributs().get("tolerance_rouge") != null) commandes.tolerance_rouge= Integer.valueOf(color.getAttributs().get("tolerance_rouge"));
|
||||
if(color.getAttributs().get("tolerance_vert") != null) commandes.tolerance_vert= Integer.valueOf(color.getAttributs().get("tolerance_vert"));
|
||||
if(color.getAttributs().get("tolerance_bleu") != null) commandes.tolerance_bleu= Integer.valueOf(color.getAttributs().get("tolerance_bleu"));
|
||||
}
|
||||
|
||||
}catch (Exception e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//** Adéquation par les valeurs par défaut si pas dans le fichier d'analyse
|
||||
commandes.analyse_culture = commandes.culture;
|
||||
commandes.analyse_tolerance_characters = commandes.tolerance_characters;
|
||||
commandes.analyse_tolerance_text = commandes.tolerance_text;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Début de l'analyse par comparaison du node étudiant avec le node sujet.
|
||||
@ -1062,7 +1186,7 @@ public class meptl {
|
||||
* @param a, objet Run de la class cXML
|
||||
* @return le node analyse contenant toute l'analyse.
|
||||
*/
|
||||
private static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) {
|
||||
public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) {
|
||||
|
||||
// initialisation des nodes d'analyse
|
||||
node erreurs = new node();
|
||||
@ -1796,7 +1920,7 @@ public class meptl {
|
||||
* @param nodana
|
||||
* @return
|
||||
*/
|
||||
private static String retourneLeNomDuFeedback( String filename,node nodana, node verif) {
|
||||
public static String retourneLeNomDuFeedback( String filename,node nodana, node verif) {
|
||||
System.getProperty("file.encoding","UTF-8");
|
||||
|
||||
int number_match = 2;
|
||||
@ -1867,30 +1991,67 @@ public class meptl {
|
||||
* Affichage uniquement dans la console Les erreurs.
|
||||
* @param nod
|
||||
*/
|
||||
private static void messageSystem(node nod) {
|
||||
public static StringBuilder messageSystem(node nod) {
|
||||
StringBuilder Text = new StringBuilder();
|
||||
|
||||
node ouverture = nod.retourneFirstEnfantsByName("ouverture");
|
||||
node notation = nod.retourneFirstEnfantsByName("bodyetnotation");
|
||||
node erreurs = nod.retourneFirstEnfantsByName("erreurs");
|
||||
|
||||
boolean flagError = Boolean.valueOf(erreurs.getAttributs().get("oneError"));
|
||||
|
||||
if(!commandes.fichierStudentMoodle) {System.out.println("\t Dossier analysé : " + ouverture.getAttributs().get("dossier"));}else {System.out.println("\t Fichier analysé : " + ouverture.getAttributs().get("dossier"));}
|
||||
if(!commandes.fichierStudentMoodle) {
|
||||
Text.append("\t Dossier analysé : " + ouverture.getAttributs().get("dossier"));
|
||||
System.out.println("\t Dossier analysé : " + ouverture.getAttributs().get("dossier"));}
|
||||
else {
|
||||
Text.append("\t Fichier analysé : " + ouverture.getAttributs().get("dossier"));
|
||||
System.out.println("\t Fichier analysé : " + ouverture.getAttributs().get("dossier"));}
|
||||
|
||||
if(notation.getAttributs().get("baremeABC").equals("true")) {
|
||||
Text.append("\t Note : " + notation.getAttributs().get("noteABC"));
|
||||
System.out.println("\t Note : " + notation.getAttributs().get("noteABC"));
|
||||
}else {
|
||||
Text.append("\t Note : " + notation.getAttributs().get("note") + "/" + ouverture.getAttributs().get("notefrom"));
|
||||
System.out.println("\t Note : " + notation.getAttributs().get("note") + "/" + ouverture.getAttributs().get("notefrom"));
|
||||
}
|
||||
|
||||
if(flagError) {
|
||||
Text.append("\t ERREUR dans le fichier de l'étudiant.");
|
||||
System.out.println("\t ERREUR dans le fichier de l'étudiant.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueHistorique"))) System.out.println("\t Erreur : Il n'y a pas d'historique dans le fichier.Peut être que le fichier n'a pas été modifié ou il a été réïnitialisé par l'étudiant.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueCreationDate"))) System.out.println("\t Erreur : Ce n'est pas la bonne date de création du fichier. Le fichier a été réïnitialisé ou ce n'est pas le fichier de l'évaluation.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueValeurCreationDate"))) System.out.println("\t Erreur : Ce n'est pas la bonne date de création du fichier.");
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueMetaSujet"))) System.out.println("\t Erreur : La propriété personnalisé \"Sujet\" a été supprimé dans le fichier de l'étudiant.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueValeurMetaSujet"))) System.out.println("\t Erreur : La propriété personnalisé \"Sujet \" a été modifié par l'étudiant.\nLa valeur de cette propriété personnalisé dans le fichier de l'étudiant est \"" + ouverture.getAttributs().get("metaSujet")+"\".\nCe n'est pas la valeur correct.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueInitialCreator"))) System.out.println("\t Erreur : La propriété personnalisé \"Sujet\" n'est pas correct.");
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueHistorique"))) {
|
||||
Text.append("\t Erreur : Il n'y a pas d'historique dans le fichier.Peut être que le fichier n'a pas été modifié ou il a été réïnitialisé par l'étudiant.");
|
||||
System.out.println("\t Erreur : Il n'y a pas d'historique dans le fichier.Peut être que le fichier n'a pas été modifié ou il a été réïnitialisé par l'étudiant.");
|
||||
}
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueCreationDate"))) {
|
||||
Text.append("\t Erreur : Ce n'est pas la bonne date de création du fichier. Le fichier a été réïnitialisé ou ce n'est pas le fichier de l'évaluation.");
|
||||
System.out.println("\t Erreur : Ce n'est pas la bonne date de création du fichier. Le fichier a été réïnitialisé ou ce n'est pas le fichier de l'évaluation.");
|
||||
}
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueValeurCreationDate"))) {
|
||||
Text.append("\t Erreur : Ce n'est pas la bonne date de création du fichier.");
|
||||
System.out.println("\t Erreur : Ce n'est pas la bonne date de création du fichier.");
|
||||
}
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueMetaSujet"))) {
|
||||
Text.append("\t Erreur : La propriété personnalisé \"Sujet\" a été supprimé dans le fichier de l'étudiant.");
|
||||
System.out.println("\t Erreur : La propriété personnalisé \"Sujet\" a été supprimé dans le fichier de l'étudiant.");
|
||||
}
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueValeurMetaSujet"))) {
|
||||
Text.append("\t Erreur : La propriété personnalisé \"Sujet \" a été modifié par l'étudiant.\nLa valeur de cette propriété personnalisé dans le fichier de l'étudiant est \"" + ouverture.getAttributs().get("metaSujet")+"\".\nCe n'est pas la valeur correct.");
|
||||
System.out.println("\t Erreur : La propriété personnalisé \"Sujet \" a été modifié par l'étudiant.\nLa valeur de cette propriété personnalisé dans le fichier de l'étudiant est \"" + ouverture.getAttributs().get("metaSujet")+"\".\nCe n'est pas la valeur correct.");
|
||||
}
|
||||
|
||||
if(Boolean.valueOf(erreurs.getAttributs().get("manqueInitialCreator"))) {
|
||||
Text.append("\t Erreur : La propriété personnalisé \"Sujet\" n'est pas correct.");
|
||||
System.out.println("\t Erreur : La propriété personnalisé \"Sujet\" n'est pas correct.");
|
||||
}
|
||||
}
|
||||
System.out.println();
|
||||
|
||||
return Text;
|
||||
}
|
||||
|
||||
|
||||
@ -1985,7 +2146,7 @@ public class meptl {
|
||||
* @param a
|
||||
* @return le node verif
|
||||
*/
|
||||
private static node verificationHistorique(node verification, Run a) {
|
||||
public static node verificationHistorique(node verification, Run a) {
|
||||
|
||||
|
||||
node verif = new node();
|
||||
@ -2179,7 +2340,7 @@ public class meptl {
|
||||
* @param nodesana
|
||||
* @throws IOException
|
||||
*/
|
||||
private static void ecritureCSV(node ana) throws IOException{
|
||||
public static void ecritureCSV(node ana) throws IOException{
|
||||
Date aujourdhui = new Date();
|
||||
Path outputFilePath = Paths.get(commandes.path + "/DateLong" + aujourdhui.getTime()+ "-Notes.csv");
|
||||
if(commandes.fourniDossierDestination) outputFilePath = Paths.get(commandes.path +"/"+ commandes.pathDestination + "/DateLong" + aujourdhui.getTime()+ "-Notes.csv");
|
||||
@ -2222,7 +2383,7 @@ public class meptl {
|
||||
* @param a
|
||||
* @throws IOException
|
||||
*/
|
||||
private static void ecritureCSV(node ana, node verif, Run a, node setting) throws IOException{
|
||||
public static void ecritureCSV(node ana, node verif, Run a, node setting) throws IOException{
|
||||
String separator =";"; //valeur par défaut du séparteur
|
||||
|
||||
|
||||
@ -2290,7 +2451,7 @@ public class meptl {
|
||||
* @param verification
|
||||
* @throws IOException
|
||||
*/
|
||||
private static void ecritureCSV(node ana, node verif, Run a, node nodeCVS, node setting) throws IOException {
|
||||
public static void ecritureCSV(node ana, node verif, Run a, node nodeCVS, node setting) throws IOException {
|
||||
|
||||
String separator =";"; //valeur par défaut du séparteur
|
||||
Charset encoding = StandardCharsets.UTF_8; //valeur par défaut
|
||||
|
@ -18,38 +18,40 @@ import cXML.node;
|
||||
*/
|
||||
public class verificationFichierAnalyse {
|
||||
public static boolean erreur = false;
|
||||
public static StringBuilder messageErreur = new StringBuilder();
|
||||
|
||||
public verificationFichierAnalyse(node Sujet) throws CloneNotSupportedException{
|
||||
public verificationFichierAnalyse() throws CloneNotSupportedException{
|
||||
|
||||
if(Sujet==null) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur, le fichier d'analyse est null.");
|
||||
System.out.println();
|
||||
if(!commandes.console) System.out.println("Début de la vérification.");
|
||||
|
||||
if(commandes.sujet==null) {
|
||||
messageErreur.append("\n**-** Erreur, le fichier d'analyse est null.\n");
|
||||
System.out.println(messageErreur.toString());
|
||||
erreur=true;
|
||||
clotureWithErrorInanalyzeFile();
|
||||
}
|
||||
|
||||
//** Vérification des attributs du node fichier
|
||||
if(Sujet.getAttributs().size()>0) {
|
||||
verificationNodeFichier(Sujet.getAttributs());
|
||||
if(commandes.sujet.getAttributs().size()>0) {
|
||||
verificationNodeFichier(commandes.sujet.getAttributs());
|
||||
}else {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur, le fichier d'analyse est vide.");
|
||||
System.out.println();
|
||||
erreur=true;
|
||||
messageErreur.append("\n**-** Erreur, le node fichier n'a pas d'attribut.\n");
|
||||
System.out.println(messageErreur.toString());
|
||||
erreur=true;
|
||||
}
|
||||
|
||||
|
||||
//** Verification du hash et du nom du fichier d'analyse
|
||||
commandes.hash = String.valueOf(Run.HashNode(Sujet,0));
|
||||
if(Sujet.getAttributs().get("analysis_filename")!=null) {
|
||||
if(!Sujet.getAttributs().get("analysis_filename").equals(commandes.nameSujet)) {
|
||||
commandes.hash = String.valueOf(Run.HashNode(commandes.sujet,0));
|
||||
if(commandes.sujet.getAttributs().get("analysis_filename")!=null) {
|
||||
if(!commandes.sujet.getAttributs().get("analysis_filename").equals(commandes.nameSujet)) {
|
||||
commandes.MAJnameAnalysisFile=true;
|
||||
}
|
||||
}
|
||||
if(Sujet.getAttributs().get("hash")==null) {
|
||||
if(commandes.sujet.getAttributs().get("hash")==null) {
|
||||
commandes.MAJFichierAnalyse =true;
|
||||
}else {
|
||||
if(!Sujet.getAttributs().get("hash").equals(commandes.hash)) {
|
||||
if(!commandes.sujet.getAttributs().get("hash").equals(commandes.hash)) {
|
||||
commandes.MAJFichierAnalyse=true;
|
||||
}
|
||||
}
|
||||
@ -59,142 +61,144 @@ public class verificationFichierAnalyse {
|
||||
|
||||
|
||||
//** Vérification des attributs du node style:paragraph et vérification style de paragraphe par défaut
|
||||
if(Sujet.retourneEnfantsByNameExist("style:paragraph")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("style:paragraph").getAttributs(),"style:paragraph");
|
||||
if(Sujet.retourneFirstEnfantsByName("style:paragraph").retourneEnfantsByNameExist("style:default-style")) {
|
||||
verifcationStyleParagraphDefaut(Sujet.retourneFirstEnfantsByName("style:paragraph").retourneFirstEnfantsByName("style:default-style"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("style:paragraph")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("style:paragraph").getAttributs(),"style:paragraph");
|
||||
if(commandes.sujet.retourneFirstEnfantsByName("style:paragraph").retourneEnfantsByNameExist("style:default-style")) {
|
||||
verifcationStyleParagraphDefaut(commandes.sujet.retourneFirstEnfantsByName("style:paragraph").retourneFirstEnfantsByName("style:default-style"));
|
||||
}
|
||||
}
|
||||
|
||||
//Vérification des attributs du node office:meta
|
||||
if(Sujet.retourneEnfantsByNameExist("office:meta")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("office:meta").getAttributs(),"office:meta");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("office:meta"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("office:meta")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("office:meta").getAttributs(),"office:meta");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("office:meta"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node style:page
|
||||
if(Sujet.retourneEnfantsByNameExist("style:page")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("style:page").getAttributs(),"style:page");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("style:page"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("style:page")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("style:page").getAttributs(),"style:page");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("style:page"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node sequences
|
||||
if(Sujet.retourneEnfantsByNameExist("sequences")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("sequences").getAttributs(),"sequences");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("sequences"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("sequences")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("sequences").getAttributs(),"sequences");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("sequences"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node numerotationchapitre
|
||||
if(Sujet.retourneEnfantsByNameExist("numerotationchapitre")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("numerotationchapitre").getAttributs(),"numerotationchapitre");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("numerotationchapitre"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("numerotationchapitre")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("numerotationchapitre").getAttributs(),"numerotationchapitre");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("numerotationchapitre"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node frames
|
||||
if(Sujet.retourneEnfantsByNameExist("frames")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("frames").getAttributs(),"frames");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("frames"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("frames")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("frames").getAttributs(),"frames");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("frames"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node sections
|
||||
if(Sujet.retourneEnfantsByNameExist("sections")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("sections").getAttributs(),"sections");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("sections"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("sections")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("sections").getAttributs(),"sections");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("sections"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node sections
|
||||
if(Sujet.retourneEnfantsByNameExist("tableaux")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("tableaux").getAttributs(),"tableaux");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("tableaux"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("tableaux")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("tableaux").getAttributs(),"tableaux");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("tableaux"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node biblio
|
||||
if(Sujet.retourneEnfantsByNameExist("biblio")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("biblio").getAttributs(),"biblio");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("biblio"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("biblio")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("biblio").getAttributs(),"biblio");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("biblio"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node tablematieres
|
||||
if(Sujet.retourneEnfantsByNameExist("tablematieres")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("tablematieres").getAttributs(),"tablematieres");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("tablematieres"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("tablematieres")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("tablematieres").getAttributs(),"tablematieres");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("tablematieres"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node tableillustrations
|
||||
if(Sujet.retourneEnfantsByNameExist("tableillustrations")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("tableillustrations").getAttributs(),"tableillustrations");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("tableillustrations"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("tableillustrations")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("tableillustrations").getAttributs(),"tableillustrations");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("tableillustrations"));
|
||||
}
|
||||
|
||||
//Vérification des attributs du node structurepage
|
||||
if(Sujet.retourneEnfantsByNameExist("structurepage")) {
|
||||
verificationNodeEvaluate(Sujet.retourneFirstEnfantsByName("structurepage").getAttributs(),"structurepage");
|
||||
verifLongContenuNode(Sujet.retourneFirstEnfantsByName("structurepage"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("structurepage")) {
|
||||
verificationNodeEvaluate(commandes.sujet.retourneFirstEnfantsByName("structurepage").getAttributs(),"structurepage");
|
||||
verifLongContenuNode(commandes.sujet.retourneFirstEnfantsByName("structurepage"));
|
||||
}
|
||||
|
||||
|
||||
//vérification du node structure
|
||||
if(Sujet.retourneEnfantsByNameExist("structurepage")) {
|
||||
verifNodeAutoriserDansStructure(Sujet.retourneFirstEnfantsByName("structurepage"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("structurepage")) {
|
||||
verifNodeAutoriserDansStructure(commandes.sujet.retourneFirstEnfantsByName("structurepage"));
|
||||
}
|
||||
|
||||
//vérification du node setting
|
||||
if(Sujet.retourneEnfantsByNameExist("setting")) {
|
||||
verificationNodeSetting(Sujet.retourneFirstEnfantsByName("setting"));
|
||||
if(commandes.sujet.retourneEnfantsByNameExist("setting")) {
|
||||
verificationNodeSetting(commandes.sujet.retourneFirstEnfantsByName("setting"));
|
||||
}
|
||||
|
||||
|
||||
if(!erreur) commandes.fichierAnalyseValide = true;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Vérification des attribut du node fichier.
|
||||
* @param attribut
|
||||
*/
|
||||
private static void verificationNodeFichier(Dictionary<String, String> attribut) {
|
||||
// le node fichier ne doit pas avoir un attribut addmenu="true"
|
||||
if(attribut.get("addmenu")!=null) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
System.out.println("Le node \"fichier\" ne doit pas contenir l'attribut \"addmenu = true\".");
|
||||
System.out.println();
|
||||
erreur=true;
|
||||
}
|
||||
|
||||
if(!commandes.console) System.out.println("Début de la vérification du node fichier.");
|
||||
|
||||
// le node fichier doit avoir l'attribut evaluer=true
|
||||
if(attribut.get("evaluer")==null) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
System.out.println("Le node \"fichier\" doit contenir evaluer=\"true\".");
|
||||
System.out.println("l'attribut \"evaluer\" a été supprimé.");
|
||||
System.out.println();
|
||||
messageErreur.append("\n**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
messageErreur.append("\nLe node \"fichier\" doit contenir evaluer=\"true\".");
|
||||
messageErreur.append("\nL'attribut \"evaluer\" a été supprimé.");
|
||||
messageErreur.append("\n");
|
||||
System.out.println(messageErreur.toString());
|
||||
erreur=true;
|
||||
}else {
|
||||
if(!attribut.get("evaluer").equals("true")) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
System.out.println("Le node \"fichier\" doit contenir evaluer=\"true\".");
|
||||
System.out.println("La valeur doit être TRUE.");
|
||||
System.out.println();
|
||||
if(!attribut.get("evaluer").equalsIgnoreCase("true")) {
|
||||
messageErreur.append("\n**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
messageErreur.append("\nLe node \"fichier\" doit contenir evaluer=\"true\".");
|
||||
messageErreur.append("\nLa valeur doit être true.");
|
||||
messageErreur.append("\n");
|
||||
System.out.println(messageErreur.toString());
|
||||
erreur=true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// le node fichier doit contenir l'attribut metaSujet et une valeur autre que le point d'interrogation ou vide
|
||||
if(attribut.get("metaSujet")==null) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
System.out.println("Le node \"fichier\" doit contenir l'attribut \"sujetMeta\".");
|
||||
System.out.println("L'attribut \"sujetMeta\" a été supprimé.");
|
||||
System.out.println("Cet attribut doit contenir une valeur.");
|
||||
System.out.println();
|
||||
erreur=true;
|
||||
}else {
|
||||
if(attribut.get("evaluer").equals("?") || attribut.get("evaluer").isEmpty() ) {
|
||||
System.out.println();
|
||||
System.out.println("**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
System.out.println("L'attribut \"sujetMeta\" doit contenir une valeur autre que \"?\" ou vide.");
|
||||
System.out.println("Dans les propriétés personnalisées des fichiers ODF, vous pouvez ajouter la propriété \"Sujet\" et faire correspondre à cette valeur.");
|
||||
System.out.println("Voir la documentation d'analyseWriter.");
|
||||
System.out.println();
|
||||
erreur=true;
|
||||
}
|
||||
messageErreur.append("\n**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
messageErreur.append("\nLe node \"fichier\" doit contenir l'attribut \"sujetMeta\".");
|
||||
messageErreur.append("\nL'attribut \"sujetMeta\" a été supprimé.");
|
||||
messageErreur.append("\nCet attribut doit contenir une valeur.");
|
||||
messageErreur.append("\n");
|
||||
System.out.println(messageErreur);
|
||||
erreur=true;
|
||||
}
|
||||
if(attribut.get("metaSujet")!=null)if(attribut.get("metaSujet").isEmpty() ) {
|
||||
messageErreur.append("\n**-** Erreur dans le fichier d'analyse le node \"fichier\".");
|
||||
messageErreur.append("\nL'attribut \"sujetMeta\" doit contenir une valeur autre que vide.");
|
||||
messageErreur.append("\nDans les propriétés personnalisées des fichiers ODF, vous pouvez ajouter la propriété \"Sujet\" et faire correspondre avec cette valeur.");
|
||||
messageErreur.append("\nVoir la documentation d'analyseWriter.");
|
||||
messageErreur.append("\n");
|
||||
System.out.println(messageErreur.toString());
|
||||
erreur=true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -560,7 +564,7 @@ public class verificationFichierAnalyse {
|
||||
|
||||
/**
|
||||
* Avertissement sur le style de paragraphe par défaut.</br>
|
||||
* Ne doit pas contenir lattribut evaleur=true.
|
||||
* Ne doit pas contenir l'attribut evaleur=true.
|
||||
* @param styleParagraphDefault
|
||||
*/
|
||||
private static void verifcationStyleParagraphDefaut(node styleParagraphDefault) {
|
||||
@ -578,7 +582,7 @@ public class verificationFichierAnalyse {
|
||||
|
||||
|
||||
/**
|
||||
* Le contenu d'un node doit être supérieur à 3 caractère pour qu'il puisse être évalué.
|
||||
* Le contenu d'un node doit être supérieur à 3 caractères pour qu'il puisse être évalué.
|
||||
* @param nod
|
||||
*/
|
||||
private static void verifLongContenuNode(node nod) {
|
||||
@ -627,7 +631,7 @@ public class verificationFichierAnalyse {
|
||||
* @throws IOException
|
||||
*/
|
||||
public static void MiseAJourFichierAnalyse() throws CloneNotSupportedException, IOException {
|
||||
node nodeCalculHash = meptl.chargementsujet(commandes.nameSujet, false);
|
||||
node nodeCalculHash = meptl.chargementFichierAnalyse(commandes.nameSujet, false);
|
||||
commandes.hash = String.valueOf(Run.HashNode(nodeCalculHash,0));
|
||||
boolean maj =false;
|
||||
if(nodeCalculHash.getAttributs().get("hash")==null) {
|
||||
@ -672,8 +676,13 @@ public class verificationFichierAnalyse {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Permet l'écriture du fichier sujet.xml sans les nodes non évaluer.
|
||||
* @throws CloneNotSupportedException
|
||||
* @throws IOException
|
||||
*/
|
||||
static public void ecrisLeFichierSujetXML() throws CloneNotSupportedException, IOException {
|
||||
node nodeSujet = meptl.chargementsujet(commandes.nameSujet, true);
|
||||
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.
|
||||
@ -734,7 +743,7 @@ public class verificationFichierAnalyse {
|
||||
System.out.println("\t\t│ (\")__(\") .. à bientôt, analyseWriter. │");
|
||||
System.out.println("\t\t└───────────────────────────────────────────────────────────┘");
|
||||
System.out.println();
|
||||
System.exit(0);
|
||||
if(commandes.console) System.exit(0);
|
||||
}
|
||||
|
||||
|
||||
|
109
src/app/about.java
Normal file
@ -0,0 +1,109 @@
|
||||
package app;
|
||||
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Font;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
import MEPTL.commandes;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class about extends JFrame{
|
||||
|
||||
|
||||
/**
|
||||
* Launch the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
about window = new about();
|
||||
window.setVisible(true);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Create the application.
|
||||
*/
|
||||
public about() {
|
||||
initialize();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the contents of the frame.
|
||||
*/
|
||||
private void initialize() {
|
||||
setResizable(false);
|
||||
setTitle(commandes.Titre);
|
||||
setLocation(100, 100);
|
||||
setSize(383,415);
|
||||
// setBounds(100, 100, 426, 486);
|
||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
getContentPane().setLayout(null);
|
||||
ImageIcon img = new ImageIcon(getClass().getResource("/evalwriter.png") );
|
||||
setIconImage(img.getImage());
|
||||
|
||||
JPanel contentPane = (JPanel) getContentPane();
|
||||
|
||||
JLabel lblNewLabelTitre = new JLabel();
|
||||
ImageIcon img2 = new ImageIcon(getClass().getResource("/accueil.png") );
|
||||
lblNewLabelTitre.setIcon(img2);
|
||||
lblNewLabelTitre.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblNewLabelTitre.setFont(new Font("Pacifico", Font.PLAIN, 26));
|
||||
lblNewLabelTitre.setBounds(10, 10, 357, 69);
|
||||
contentPane.add(lblNewLabelTitre);
|
||||
|
||||
JLabel lblNewLabelVersion = new JLabel("<HTML><B><U>Version :</U></B> " + commandes.version + "</HTML>");
|
||||
lblNewLabelVersion.setFont(new Font("Tahoma", Font.PLAIN, 16));
|
||||
lblNewLabelVersion.setBounds(20, 80, 240, 20);
|
||||
contentPane.add(lblNewLabelVersion);
|
||||
|
||||
JLabel lblNewLabelAnnee = new JLabel("<HTML><B><U>Année :</U></B> " + commandes.Annee + "</HTML>");
|
||||
lblNewLabelAnnee.setFont(new Font("Tahoma", Font.PLAIN, 16));
|
||||
lblNewLabelAnnee.setBounds(20, 110, 240, 20);
|
||||
contentPane.add(lblNewLabelAnnee);
|
||||
|
||||
JLabel lblCredit = new JLabel("Crédit");
|
||||
lblCredit.setFont(new Font("Tahoma", Font.BOLD | Font.ITALIC, 14));
|
||||
lblCredit.setBounds(20, 230, 60, 20);
|
||||
getContentPane().add(lblCredit);
|
||||
|
||||
|
||||
JLabel lblNewLabelAuteur = new JLabel("Auteur : P. Rodriguez");
|
||||
lblNewLabelAuteur.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
lblNewLabelAuteur.setBounds(20, 250, 240, 20);
|
||||
contentPane.add(lblNewLabelAuteur);
|
||||
|
||||
JLabel lblInformationEnseignant = new JLabel("Enseignants d'informatique à l'université d'Artois");
|
||||
lblInformationEnseignant.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
lblInformationEnseignant.setBounds(20, 270, 296, 20);
|
||||
getContentPane().add(lblInformationEnseignant);
|
||||
|
||||
JLabel lblCommentaire = new JLabel("<HTML>Outil permettant l’évaluation des fichiers réalisés avec un traitement de texte au format ODF.<br><br>"
|
||||
+ "Cet outil a été créé dans un esprit de partage.<br></HTML>");
|
||||
lblCommentaire.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
lblCommentaire.setHorizontalAlignment(SwingConstants.LEFT);
|
||||
lblCommentaire.setVerticalAlignment(SwingConstants.TOP);
|
||||
lblCommentaire.setBounds(20, 144, 326, 75);
|
||||
getContentPane().add(lblCommentaire);
|
||||
|
||||
JLabel lblLicence = new JLabel("<HTML><B><U>Licence :</U></B> GNU GLP 3.0</HTML>");
|
||||
lblLicence.setFont(new Font("Tahoma", Font.PLAIN, 16));
|
||||
lblLicence.setBounds(20, 305, 296, 35);
|
||||
getContentPane().add(lblLicence);
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
365
src/app/evaluate.java
Normal file
@ -0,0 +1,365 @@
|
||||
package app;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
|
||||
import org.xml.sax.SAXException;
|
||||
|
||||
import MEPTL.commandes;
|
||||
import MEPTL.feedbacks;
|
||||
import MEPTL.meptl;
|
||||
import MEPTL.verificationFichierAnalyse;
|
||||
import cXML.Run;
|
||||
import cXML.node;
|
||||
import net.lingala.zip4j.exception.ZipException;
|
||||
|
||||
import javax.swing.JFileChooser;
|
||||
|
||||
import javax.swing.JToolBar;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JLabel;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.io.IOException;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.GridBagConstraints;
|
||||
import javax.swing.JCheckBox;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Font;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.JTextPane;
|
||||
import java.awt.Color;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public class evaluate extends JFrame {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 1L;
|
||||
private JPanel contentPane;
|
||||
private JLabel lblPath = new JLabel();
|
||||
private JCheckBox chckbxfichiersEtudaints = new JCheckBox();
|
||||
private JCheckBox chckbxZipfeedback = new JCheckBox();
|
||||
private JCheckBox chckbxnoFeedback = new JCheckBox();
|
||||
private JCheckBox chckbxNoNote = new JCheckBox();
|
||||
private JTextPane textPane = new JTextPane();
|
||||
|
||||
/**
|
||||
* Create the frame.
|
||||
*/
|
||||
public evaluate() {
|
||||
|
||||
setIconImage(Toolkit.getDefaultToolkit().getImage(evaluate.class.getResource("/resources/evalwriter.ico")));
|
||||
|
||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
setBounds(100, 100, 882, 533);
|
||||
contentPane = new JPanel();
|
||||
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
|
||||
setContentPane(contentPane);
|
||||
contentPane.setLayout(new BorderLayout(0, 0));
|
||||
|
||||
JToolBar toolBar = new JToolBar();
|
||||
contentPane.add(toolBar, BorderLayout.NORTH);
|
||||
|
||||
JButton btnSelectFolder = new JButton("Selection dossier");
|
||||
btnSelectFolder.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
|
||||
JFileChooser chooser = new JFileChooser();
|
||||
|
||||
chooser.setCurrentDirectory(new java.io.File(commandes.path));
|
||||
chooser.setDialogTitle("choosertitle");
|
||||
chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
|
||||
chooser.setAcceptAllFileFilterUsed(false);
|
||||
|
||||
if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
|
||||
System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
|
||||
System.out.println("getSelectedFile() : " + chooser.getSelectedFile().getAbsolutePath());
|
||||
commandes.path = chooser.getSelectedFile().getAbsolutePath();
|
||||
} else {
|
||||
System.out.println("No Selection ");
|
||||
}
|
||||
|
||||
refreshLabel();
|
||||
|
||||
}
|
||||
});
|
||||
btnSelectFolder.setIcon(new ImageIcon(evaluate.class.getResource("/resources/open.png")));
|
||||
btnSelectFolder.setSelectedIcon(new ImageIcon(evaluate.class.getResource("/resources/evalwriter.png")));
|
||||
btnSelectFolder.setToolTipText("Sélectionner un dossier (CTRL+O)");
|
||||
toolBar.add(btnSelectFolder);
|
||||
|
||||
JButton btnNewButton = new JButton("Evaluer");
|
||||
btnNewButton.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
try {
|
||||
evaluerLesFichiersEtudiants();
|
||||
} catch (ParserConfigurationException | SAXException | IOException | CloneNotSupportedException e1) {
|
||||
// TODO Auto-generated catch block
|
||||
e1.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
btnNewButton.setIcon(new ImageIcon(evaluate.class.getResource("/resources/evaluate.png")));
|
||||
toolBar.add(btnNewButton);
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
contentPane.add(panel, BorderLayout.WEST);
|
||||
GridBagLayout gbl_panel = new GridBagLayout();
|
||||
gbl_panel.columnWidths = new int[]{104, 0};
|
||||
gbl_panel.rowHeights = new int[]{14, 0, 0, 0, 0, 0, 0, 0};
|
||||
gbl_panel.columnWeights = new double[]{0.0, Double.MIN_VALUE};
|
||||
gbl_panel.rowWeights = new double[]{0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, Double.MIN_VALUE};
|
||||
panel.setLayout(gbl_panel);
|
||||
lblPath.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
lblPath.setText("<HTML><B><U>Dossier de l'analyse</U></B> : " + commandes.path.substring(commandes.path.lastIndexOf("\\")+1,commandes.path.length()) + "</HTML>");
|
||||
|
||||
|
||||
|
||||
GridBagConstraints gbc_lblPath = new GridBagConstraints();
|
||||
gbc_lblPath.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_lblPath.anchor = GridBagConstraints.NORTHWEST;
|
||||
gbc_lblPath.gridx = 0;
|
||||
gbc_lblPath.gridy = 1;
|
||||
panel.add(lblPath, gbc_lblPath);
|
||||
|
||||
chckbxfichiersEtudaints = new JCheckBox("Les fichiers ne sont pas dans des dossiers nominatifs");
|
||||
chckbxfichiersEtudaints.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
chckbxfichiersEtudaints.setToolTipText("Cochez si les fichiers des étudiants ne sont pas dans des dossier nominatifs");
|
||||
GridBagConstraints gbc_chckbxfichiersEtudaints = new GridBagConstraints();
|
||||
gbc_chckbxfichiersEtudaints.anchor = GridBagConstraints.WEST;
|
||||
gbc_chckbxfichiersEtudaints.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_chckbxfichiersEtudaints.gridx = 0;
|
||||
gbc_chckbxfichiersEtudaints.gridy = 2;
|
||||
panel.add(chckbxfichiersEtudaints, gbc_chckbxfichiersEtudaints);
|
||||
|
||||
chckbxnoFeedback = new JCheckBox("Pas de feedback");
|
||||
chckbxnoFeedback.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
GridBagConstraints gbc_chckbxnoFeedback = new GridBagConstraints();
|
||||
gbc_chckbxnoFeedback.anchor = GridBagConstraints.WEST;
|
||||
gbc_chckbxnoFeedback.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_chckbxnoFeedback.gridx = 0;
|
||||
gbc_chckbxnoFeedback.gridy = 4;
|
||||
panel.add(chckbxnoFeedback, gbc_chckbxnoFeedback);
|
||||
|
||||
chckbxZipfeedback = new JCheckBox("Zip les feedbacks");
|
||||
chckbxZipfeedback.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
GridBagConstraints gbc_chckbxZipfeedback = new GridBagConstraints();
|
||||
gbc_chckbxZipfeedback.insets = new Insets(0, 0, 5, 0);
|
||||
gbc_chckbxZipfeedback.anchor = GridBagConstraints.NORTHWEST;
|
||||
gbc_chckbxZipfeedback.gridx = 0;
|
||||
gbc_chckbxZipfeedback.gridy = 5;
|
||||
panel.add(chckbxZipfeedback, gbc_chckbxZipfeedback);
|
||||
|
||||
chckbxNoNote = new JCheckBox("Pas de note dans les feedbacks");
|
||||
chckbxNoNote.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
GridBagConstraints gbc_chckbxNoNote = new GridBagConstraints();
|
||||
gbc_chckbxNoNote.anchor = GridBagConstraints.WEST;
|
||||
gbc_chckbxNoNote.gridx = 0;
|
||||
gbc_chckbxNoNote.gridy = 6;
|
||||
panel.add(chckbxNoNote, gbc_chckbxNoNote);
|
||||
|
||||
|
||||
JPanel panel_1 = new JPanel();
|
||||
contentPane.add(panel_1, BorderLayout.CENTER);
|
||||
panel_1.setLayout(null);
|
||||
|
||||
textPane = new JTextPane();
|
||||
textPane.setFont(new Font("Tahoma", Font.PLAIN, 12));
|
||||
textPane.setBounds(30, 28, 495, 412);
|
||||
panel_1.add(textPane);
|
||||
|
||||
|
||||
|
||||
refreshLabel();
|
||||
setVisible(true);
|
||||
}
|
||||
|
||||
|
||||
private void refreshLabel() {
|
||||
if(!commandes.fichierAnalyseValide) {
|
||||
textPane.setText(MEPTL.verificationFichierAnalyse.messageErreur.toString());
|
||||
chckbxfichiersEtudaints.setEnabled(false);
|
||||
chckbxZipfeedback.setEnabled(false);
|
||||
chckbxnoFeedback.setEnabled(false);
|
||||
chckbxNoNote.setEnabled(false);
|
||||
}
|
||||
|
||||
lblPath.setText("<HTML><B><U>Dossier de l'analyse</U></B> : " + commandes.path.substring(commandes.path.lastIndexOf("\\")+1,commandes.path.length()) + "</HTML>");
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void evaluerLesFichiersEtudiants() throws ParserConfigurationException, SAXException, IOException, CloneNotSupportedException {
|
||||
|
||||
commandes.analyse=true;
|
||||
|
||||
if(chckbxfichiersEtudaints.isSelected()) commandes.fichierStudentMoodle=true;
|
||||
if(chckbxZipfeedback.isSelected()) commandes.zipfeedback=true;
|
||||
if(chckbxnoFeedback.isSelected()) commandes.sansFeeback=true;
|
||||
if(chckbxNoNote.isSelected()) commandes.noNote=true;
|
||||
|
||||
Run a = new Run(commandes.path,commandes.Profil, commandes.fichierStudentMoodle);
|
||||
|
||||
//** Nouveau node qui permet de convertir le fichier contenant la liste des étudiants en node.
|
||||
node nodeCSV = null;
|
||||
|
||||
//*****************************************
|
||||
//** Nombre de fichier writer à analyser **
|
||||
//*****************************************
|
||||
int nbFichierWriter = a.getLectDossiers().getEC().getListeContentWriter().size();
|
||||
|
||||
|
||||
|
||||
//***************************************
|
||||
//** -verif ou -use file.xml -verifcsv **
|
||||
//***************************************
|
||||
node verif = new node();
|
||||
if(commandes.verifHisto || commandes.verifHisto2) {
|
||||
node verification = new node();
|
||||
verification.setNomElt("verification");
|
||||
verification.getAttributs().put("nombre_fichier", String.valueOf(a.getLectDossiers().getEC().getListeFichierodt().size()));
|
||||
for(int i = 0 ; i < nbFichierWriter ; i++) {
|
||||
node nod = Run.XMLContent(a.getLectDossiers().getEC().getListeContentWriter().get(i));
|
||||
node nodStudent = meptl.LectureFichierEtudiantPourVerification(nod,a,i);
|
||||
verification.getNodes().add(nodStudent);
|
||||
}
|
||||
//a.ecritureNodeEnXML(verification, "VerificationHistorique","",false); //écriture du node de l'étudiant
|
||||
verif = meptl.verificationHistorique(verification, a); // vérification des correspondances entre les fichiers
|
||||
|
||||
//********************************
|
||||
//** Ecriture du node verif.xml **
|
||||
//********************************
|
||||
Run.ecritureNodeEnXML(verif, "Verif",commandes.pathDestination,commandes.fourniDossierDestination, "Verif"); //écriture du node de vérification
|
||||
if(!commandes.analyse) {
|
||||
//** bye bye analyseWriter
|
||||
commandes.clotureApplication();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
System.getProperty("file.encoding","UTF-8");
|
||||
|
||||
//*********************************************************
|
||||
//** Node contenant l'ensemble des analyses des étudiants **
|
||||
//*********************************************************
|
||||
node ensembleanalyse = new node();
|
||||
ensembleanalyse.setNomElt("analyses");
|
||||
|
||||
|
||||
StringBuilder textMessage = new StringBuilder();
|
||||
|
||||
//*****************************************************
|
||||
//** Parcours l'ensemble des fichiers des étudiants ***
|
||||
//*****************************************************
|
||||
for(int i = 0 ; i < nbFichierWriter ; i++) {
|
||||
|
||||
//** 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;
|
||||
|
||||
//***********************************************************
|
||||
//** Lecture et transformation en node du fichier étudiant **
|
||||
//***********************************************************
|
||||
node nod = Run.XMLContent(a.getLectDossiers().getEC().getListeContentWriter().get(i));
|
||||
node nodStudent = meptl.LectureFichierEtudiantSousFormeDeNode(nod,a,i);
|
||||
//a.ecritureNodeEnXML(nodStudent, a.getLectDossiers().getEC().getListeNomDossier().get(i),"",false,""); //écriture du node de l'étudiant
|
||||
|
||||
//**********************************
|
||||
//** Analyse des fichiers student **
|
||||
//**********************************
|
||||
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);
|
||||
|
||||
//**************************************************
|
||||
//** 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
|
||||
}
|
||||
|
||||
//****************************
|
||||
//** Création des feedbacks **
|
||||
//****************************
|
||||
if(!commandes.sansFeeback&&!commandes.ecritNodeAnalyse) {
|
||||
if(!commandes.zipfeedback) {
|
||||
//feedback(ana, verif); //classique directement dans le répertoire
|
||||
feedbacks.feedback(ana,verif, false);
|
||||
}
|
||||
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), meptl.retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),size,nameZip);
|
||||
} catch (ZipException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//********************************************************************************
|
||||
//** Ajoute au node ensembleanalyse lorsque -csv file.csv ou -verifcsv file.scv **
|
||||
//********************************************************************************
|
||||
if(commandes.ecritNoteCSV) ensembleanalyse.addNode(ana);
|
||||
|
||||
//*********************************************************
|
||||
//** Message dans la console sur l'analyse de l'étudiant **
|
||||
//*********************************************************
|
||||
textMessage.append(meptl.messageSystem(ana).toString());
|
||||
textPane.setText(textMessage.toString());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(commandes.sujet!=null) {
|
||||
//*****************************************************
|
||||
//** Exportation au format CSV si -csv ou -verifcsv **
|
||||
//*****************************************************
|
||||
if(commandes.ecritNoteCSV && !commandes.fourniCSV) {
|
||||
if(!commandes.verifHisto2) meptl.ecritureCSV(ensembleanalyse);
|
||||
if(commandes.verifHisto2) meptl.ecritureCSV(ensembleanalyse,verif,a,commandes.sujet.retourneFirstEnfantsByName("setting"));
|
||||
//a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant
|
||||
}
|
||||
|
||||
//***********************************************************************
|
||||
//** Exportation au format CSV si -csv file.csv ou -verifcsv file.csv **
|
||||
//***********************************************************************
|
||||
if(commandes.ecritNoteCSV && commandes.fourniCSV) {
|
||||
meptl.ecritureCSV(ensembleanalyse,verif,a,nodeCSV, commandes.sujet.retourneFirstEnfantsByName("setting"));
|
||||
//a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant
|
||||
}
|
||||
|
||||
//**************************************
|
||||
//** Mise à jour du fichier d'analyse **
|
||||
//**************************************
|
||||
// if(commandes.MAJFichierAnalyse||commandes.MAJnameAnalysisFile) {
|
||||
// verificationFichierAnalyse.MiseAJourFichierAnalyse();
|
||||
// verificationFichierAnalyse.messagMiseAJourFichierAnalyseAprèsAnalyse();
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
@ -14,22 +14,26 @@ import javax.swing.JOptionPane;
|
||||
import javax.swing.filechooser.FileNameExtensionFilter;
|
||||
|
||||
import MEPTL.commandes;
|
||||
import MEPTL.meptl;
|
||||
import MEPTL.verificationFichierAnalyse;
|
||||
import cXML.Run;
|
||||
import cXML.node;
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class filechooser extends JFileChooser{
|
||||
public class filechooserXML extends JFileChooser{
|
||||
|
||||
|
||||
public filechooser() {
|
||||
public filechooserXML() {
|
||||
setDialogTitle("Choisir un fichier d'analyse");
|
||||
|
||||
//addChoosableFileFilter(new FileNameExtensionFilter("ODF Writer", "odt"));
|
||||
addChoosableFileFilter(new FileNameExtensionFilter("Fichier d'évaluation", "xml"));
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("ODF Writer", "odt");
|
||||
// addChoosableFileFilter(new FileNameExtensionFilter("Fichier d'analyse .XML", "xml"));
|
||||
// FileNameExtensionFilter filter = new FileNameExtensionFilter("Fichier format ODF Writer .ODT", "odt");
|
||||
FileNameExtensionFilter filter = new FileNameExtensionFilter("Fichier d'analyse .XML", "xml");
|
||||
setFileFilter(filter);
|
||||
setFileFilter(getAcceptAllFileFilter());
|
||||
// setFileFilter(getAcceptAllFileFilter());
|
||||
|
||||
|
||||
|
||||
@ -53,9 +57,6 @@ public class filechooser extends JFileChooser{
|
||||
openFileXML(file);
|
||||
}
|
||||
|
||||
System.out.println("path " + commandes.path);
|
||||
System.out.println("Nom du premier node " + commandes.sujet.getNomElt());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,20 +92,28 @@ public class filechooser extends JFileChooser{
|
||||
new InputStreamReader(
|
||||
new FileInputStream(file.getAbsoluteFile()), "UTF-8"));
|
||||
String line;
|
||||
String targetString = "";
|
||||
StringBuilder targetString = new StringBuilder();
|
||||
while ((line = br.readLine()) != null) {
|
||||
targetString = targetString + line;
|
||||
targetString.append(line);
|
||||
}
|
||||
|
||||
//node.node2(targetString);
|
||||
commandes.sujet = new node(targetString.replace("\t","").replace("\r", "").replace("\n", ""));
|
||||
commandes.sujet = new node(targetString.toString().replace("\t","").replace("\r", "").replace("\n", ""));
|
||||
|
||||
//commandes.sujet = Run.parentAndLevel(commandes.sujet, commandes.sujet.getNomElt(), 0);
|
||||
|
||||
//Run.ecritureNodeEnXML(A, filename, path);
|
||||
commandes.sujet = Run.parentAndLevel(commandes.sujet, commandes.sujet.getNomElt(), 0);
|
||||
// Vérification de la conformité du fichier d'analyse
|
||||
if(!fichierSujetValide()) JOptionPane.showMessageDialog(null, "Le fichier d'analyse n'est pas valide.");
|
||||
|
||||
//Chargement des paramètres du fichier d'analyse
|
||||
meptl.chargementParametresFichierAnalyse();
|
||||
|
||||
// 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());
|
||||
|
||||
if(!fichierSujetValide()) JOptionPane.showMessageDialog(null, "Le fichier n'est pas valide.");
|
||||
|
||||
|
||||
} catch (UnsupportedEncodingException e1) {
|
||||
@ -117,15 +126,13 @@ public class filechooser extends JFileChooser{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Verification rapide du fichier.
|
||||
* @return
|
||||
*/
|
||||
public static boolean fichierSujetValide () {
|
||||
if(commandes.sujet==null) return false;
|
||||
if(!commandes.sujet.getNomElt().equals("fichier")) return false;
|
||||
if(commandes.sujet.getAttributs().get("metaSujet")==null) return false;
|
||||
if(!commandes.sujet.retourneEnfantsByNameExist("style:page")) return false;
|
||||
if(!commandes.sujet.retourneEnfantsByNameExist("style:paragraphe")) return false;
|
||||
if(!commandes.sujet.retourneEnfantsByNameExist("structurepage")) return false;
|
||||
|
||||
commandes.fichierValide = true;
|
||||
if(commandes.sujet==null) {System.out.println("Le fichier est null."); return false;}
|
||||
if(!commandes.sujet.getNomElt().equals("fichier")) {System.out.println("Pas de node fichier."); return false;}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -13,8 +13,8 @@ import javax.swing.SwingConstants;
|
||||
|
||||
import MEPTL.commandes;
|
||||
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Toolkit;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class mainApp extends JFrame implements ActionListener {
|
||||
@ -22,14 +22,18 @@ public class mainApp extends JFrame implements ActionListener {
|
||||
//public static final String LOOK_AND_FEEL_1 = "javax.swing.plaf.nimbus.NimbusLookAndFeel";
|
||||
|
||||
private JFrame frmEvalwriter;
|
||||
public static JFrame Creer ;
|
||||
// public static JFrame Creer ;
|
||||
|
||||
JButton btnCreate;
|
||||
JButton actCharge;
|
||||
JButton aPropos;
|
||||
private JButton btnCrerUnFichier;
|
||||
|
||||
/**
|
||||
* Launch the application.
|
||||
*/
|
||||
public static void main(String[] args) {
|
||||
commandes.console=false;
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
try {
|
||||
@ -54,42 +58,28 @@ public class mainApp extends JFrame implements ActionListener {
|
||||
*/
|
||||
private void initialize() {
|
||||
|
||||
|
||||
frmEvalwriter = new JFrame();
|
||||
frmEvalwriter.setIconImage(Toolkit.getDefaultToolkit().getImage(mainApp.class.getResource("/resources/evalwriter.ico")));
|
||||
frmEvalwriter.setResizable(false);
|
||||
// frmEvalwriter.setTitle(utils.Titre);
|
||||
frmEvalwriter.setBounds(100, 100, 417, 265);
|
||||
frmEvalwriter.setTitle("analyseWriter");
|
||||
frmEvalwriter.setBounds(100, 100, 555, 457);
|
||||
frmEvalwriter.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||
frmEvalwriter.getContentPane().setLayout(null);
|
||||
ImageIcon img = new ImageIcon(getClass().getResource("/evalwriter.png") );
|
||||
frmEvalwriter.setIconImage(img.getImage());
|
||||
setIconImage(img.getImage());
|
||||
|
||||
btnCreate = new JButton("Créer ou modifier un fichier d'analyse");
|
||||
btnCreate = new JButton("Modifier un fichier d'analyse");
|
||||
btnCreate.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
btnCreate.addActionListener(this);
|
||||
|
||||
btnCreate.setBounds(34, 152, 338, 50);
|
||||
btnCreate.setBounds(34, 163, 470, 50);
|
||||
frmEvalwriter.getContentPane().add(btnCreate);
|
||||
|
||||
actCharge = new JButton("Charge le fichier d'analyse");
|
||||
actCharge = new JButton("Charge le fichier d'analyse pour évaluer les fichiers des étudiants");
|
||||
actCharge.setBackground(Color.PINK);
|
||||
actCharge.addActionListener(this);
|
||||
// actCharge.addActionListener(new ActionListener() {
|
||||
// public void actionPerformed(ActionEvent arg0) {
|
||||
// System.out.println( "Open1" );
|
||||
// new filechooser();
|
||||
// if(commandes.fichierValide) {
|
||||
// System.out.println("Le chargement de la nouvelle structure est réussi.");
|
||||
//// tree.setModel(utils.getTree().getModel()) ;
|
||||
//// textNodeSelect.setText("Le chargement de la nouvelle structure est réussi.");
|
||||
//// create.this.MAJToolBar();
|
||||
// }
|
||||
// System.out.println( "Open2Close" );
|
||||
// frmEvalwriter.dispose();
|
||||
// }
|
||||
// });
|
||||
actCharge.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
actCharge.setBounds(34, 96, 338, 45);
|
||||
actCharge.setBounds(34, 96, 470, 45);
|
||||
frmEvalwriter.getContentPane().add(actCharge);
|
||||
|
||||
JLabel lblNewLabel = new JLabel();
|
||||
@ -97,8 +87,23 @@ public class mainApp extends JFrame implements ActionListener {
|
||||
lblNewLabel.setIcon(img2);
|
||||
lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
|
||||
lblNewLabel.setFont(new Font("Pacifico", Font.PLAIN, 26));
|
||||
lblNewLabel.setBounds(10, 11, 391, 74);
|
||||
lblNewLabel.setBounds(34, 11, 470, 74);
|
||||
frmEvalwriter.getContentPane().add(lblNewLabel);
|
||||
|
||||
aPropos = new JButton("A Propos");
|
||||
aPropos.addActionListener(this);
|
||||
aPropos.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
aPropos.setBounds(34, 326, 161, 50);
|
||||
frmEvalwriter.getContentPane().add(aPropos);
|
||||
|
||||
btnCrerUnFichier = new JButton("Créer un fichier d'analyse à partir d'un fichier ODF");
|
||||
btnCrerUnFichier.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
}
|
||||
});
|
||||
btnCrerUnFichier.setFont(new Font("Tahoma", Font.PLAIN, 14));
|
||||
btnCrerUnFichier.setBounds(34, 235, 470, 50);
|
||||
frmEvalwriter.getContentPane().add(btnCrerUnFichier);
|
||||
}
|
||||
|
||||
|
||||
@ -110,19 +115,24 @@ public class mainApp extends JFrame implements ActionListener {
|
||||
}
|
||||
|
||||
if(e.getSource()==actCharge) {
|
||||
System.out.println( "Open1" );
|
||||
new filechooser();
|
||||
if(commandes.fichierValide) {
|
||||
System.out.println("Le chargement de la nouvelle structure est réussi.");
|
||||
if(!commandes.console) System.out.println( "Début chargement du fichier d'analyse." );
|
||||
new filechooserXML();
|
||||
if(commandes.fichierAnalyseValide) System.out.println("Le chargement du fichier d'analyse est réussi.");
|
||||
|
||||
// tree.setModel(utils.getTree().getModel()) ;
|
||||
// textNodeSelect.setText("Le chargement de la nouvelle structure est réussi.");
|
||||
// create.this.MAJToolBar();
|
||||
}
|
||||
System.out.println( "Open2Close" );
|
||||
frmEvalwriter.dispose();
|
||||
}
|
||||
|
||||
if(!commandes.console) System.out.println( "Fin chargement du fichier d'analyse" );
|
||||
new evaluate();
|
||||
frmEvalwriter.dispose();
|
||||
}
|
||||
|
||||
if(e.getSource()==aPropos) {
|
||||
new about();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
BIN
src/resources/accueil.png
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
src/resources/evaluate.png
Normal file
After Width: | Height: | Size: 790 B |
BIN
src/resources/evalwriter.ico
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
src/resources/evalwriter.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
src/resources/open.png
Normal file
After Width: | Height: | Size: 1.2 KiB |