diff --git a/bin/.gitignore b/bin/.gitignore index 495731b..cc3666c 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,7 +1,3 @@ /resources/ /app/ /MEPTL/ -/fichierAnalyse.png -/fichier_analyse.svg -/open.svg -/open2.png diff --git a/bin/MEPTL/commandes.class b/bin/MEPTL/commandes.class index c392758..04b77c7 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 bed4b22..37a6127 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/app/evaluate$1.class b/bin/app/evaluate$1.class index 1bfc480..af6f3e6 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 672d05e..7c77387 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 7127b2f..28fcefa 100644 Binary files a/bin/app/evaluate.class and b/bin/app/evaluate.class differ diff --git a/bin/fichierAnalyse.png b/bin/fichierAnalyse.png new file mode 100644 index 0000000..1cbea18 Binary files /dev/null and b/bin/fichierAnalyse.png differ diff --git a/bin/fichier_analyse.svg b/bin/fichier_analyse.svg new file mode 100644 index 0000000..89f5c5f --- /dev/null +++ b/bin/fichier_analyse.svg @@ -0,0 +1,325 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/open.svg b/bin/open.svg new file mode 100644 index 0000000..69a5a63 --- /dev/null +++ b/bin/open.svg @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/bin/open2.png b/bin/open2.png new file mode 100644 index 0000000..a50d959 Binary files /dev/null and b/bin/open2.png differ diff --git a/icons/fichierCSV.png b/icons/fichierCSV.png new file mode 100644 index 0000000..de88a0a Binary files /dev/null and b/icons/fichierCSV.png differ diff --git a/icons/fichier_csv_student.svg b/icons/fichier_csv_student.svg new file mode 100644 index 0000000..a01a9a8 --- /dev/null +++ b/icons/fichier_csv_student.svg @@ -0,0 +1,269 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + CSV + + + + diff --git a/src/MEPTL/commandes.java b/src/MEPTL/commandes.java index 68837b3..7b5c869 100644 --- a/src/MEPTL/commandes.java +++ b/src/MEPTL/commandes.java @@ -55,7 +55,7 @@ public class commandes { 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 pathDestination =""; //Pour le mode console uniquement 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 @@ -711,7 +711,14 @@ public class commandes { System.out.println("\t\t│ (\")__(\") .. see you soon, analyseWriter. │"); System.out.println("\t\t└───────────────────────────────────────────────────────────┘"); System.out.println(); - System.exit(0); + + commandes.message.append("\n"); + commandes.message.append("\n*************************"); + commandes.message.append("\nLe fichier \""+ filename + "\" n'existe pas."); + commandes.message.append("\n*************************"); + commandes.message.append("\n"); + + if(commandes.console) System.exit(0); } diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index de7fac3..b1fe4b5 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -187,7 +187,7 @@ public class meptl { //** Chargement et verification du CVS fourni ** //********************************************** if(commandes.fourniCSV) { - nodeCSV = chargementFichierCSV(a, commandes.nameCSV); + nodeCSV = chargementFichierCSV(); } }catch (Exception e) { @@ -1222,7 +1222,7 @@ public class meptl { //********************************************** node nodeCSV = null; if(commandes.fourniCSV) { - nodeCSV = chargementFichierCSV(a, commandes.nameCSV); + nodeCSV = chargementFichierCSV(); } @@ -2899,20 +2899,24 @@ public class meptl { /** - * Chargement dans un node du fichier CSV de la liset des étudiants.
+ * Chargement dans un node du fichier CSV de la liste des étudiants.
* La liste des étudiants doit contenir les champs Prénom, Nom, Numéro d'identification, Adresse de courriel - * Le séparateur doit être le point-virgule et l'encodage UTF-8 + * Le séparateur doit être le point-virgule et l'encodage UTF-8. * @param a * @param nameCSV * @return * @throws IOException */ - private static node chargementFichierCSV(Run a, String nameCSV) { + private static node chargementFichierCSV() { String targetString = ""; + + String cheminVersLeFichierCSV = ""; + if(commandes.console) cheminVersLeFichierCSV = commandes.path + "/" + commandes.nameCSV; + try { - BufferedReader br = new BufferedReader( + BufferedReader br = new BufferedReader( new InputStreamReader( - new FileInputStream(a.getPatch() + "/" + nameCSV), "UTF-8")); + new FileInputStream(cheminVersLeFichierCSV), "UTF-8")); String line; while ((line = br.readLine()) != null) { @@ -2921,7 +2925,7 @@ public class meptl { br.close(); } catch (IOException e) { - commandes.clotureWithErrorFile(nameCSV); + commandes.clotureWithErrorFile(commandes.nameCSV); e.printStackTrace(); } diff --git a/src/app/evaluate.java b/src/app/evaluate.java index d27213e..42fa089 100644 --- a/src/app/evaluate.java +++ b/src/app/evaluate.java @@ -21,6 +21,7 @@ import javax.swing.JPanel; import javax.swing.JTextPane; import javax.swing.JToolBar; import javax.swing.border.EmptyBorder; +import javax.swing.filechooser.FileNameExtensionFilter; import javax.xml.parsers.ParserConfigurationException; import org.xml.sax.SAXException; @@ -51,6 +52,7 @@ public class evaluate extends JFrame { private JPanel contentPane; private JLabel lblPath = new JLabel(); private JLabel lblFileAnalyse = new JLabel(); + private JLabel lblFichierCSV = new JLabel(); private JCheckBox chckbxfichiersEtudaints = new JCheckBox(); private JCheckBox chckbxZipfeedback = new JCheckBox(); private JCheckBox chckbxnoFeedback = new JCheckBox(); @@ -61,6 +63,7 @@ public class evaluate extends JFrame { private JButton btnSelectFileAnalyse = new JButton(); private JButton btnSelectFolder = new JButton(); private JButton btnEvaluerLesFichiers = new JButton(); + private JButton btnFichierCSV = new JButton(); /** * Create the frame. @@ -90,6 +93,11 @@ public class evaluate extends JFrame { btnSelectFileAnalyse.setToolTipText("Sélection du fichier d'analyse"); btnSelectFileAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyse.png"))); toolBar.add(btnSelectFileAnalyse); + + btnFichierCSV = new JButton("Sélection fichier CSV"); + btnFichierCSV.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSV.png"))); + toolBar.add(btnFichierCSV); + btnEvaluerLesFichiers.setIcon(new ImageIcon(evaluate.class.getResource("/resources/evaluate.png"))); toolBar.add(btnEvaluerLesFichiers); @@ -99,13 +107,17 @@ public class evaluate extends JFrame { lblFileAnalyse = new JLabel("Fichier de l'analyse : "); lblFileAnalyse.setHorizontalAlignment(SwingConstants.LEFT); - lblFileAnalyse.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblFileAnalyse.setFont(new Font("Tahoma", Font.BOLD, 14)); panel.add(lblFileAnalyse); lblPath.setHorizontalAlignment(SwingConstants.LEFT); - lblPath.setFont(new Font("Tahoma", Font.PLAIN, 14)); + lblPath.setFont(new Font("Tahoma", Font.BOLD, 14)); lblPath.setText("Dossier de l'analyse : " + commandes.path.substring(commandes.path.lastIndexOf("\\")+1,commandes.path.length()) + ""); panel.add(lblPath); + lblFichierCSV = new JLabel("Fichier CSV liste des étudiants :"); + lblFichierCSV.setFont(new Font("Tahoma", Font.BOLD, 14)); + panel.add(lblFichierCSV); + 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"); @@ -168,25 +180,29 @@ public class evaluate extends JFrame { chckCSVNotes.setEnabled(true); StringBuilder text = new StringBuilder(); - - text.append("Le titre de l'exercice est " + commandes.analyse_titre); + + text.append("\n***********************************************"); + text.append("\n** INFORMATIONS **"); + text.append("\n***********************************************"); + text.append("\nLe titre de l'exercice est : " + commandes.analyse_titre); text.append("\n"); - text.append("Le sujet (metaSujet) est " + commandes.analyse_metaSujet); - text.append("\n"); - text.append("L'auteur de l'exercice est " + commandes.analyse_auteur); + text.append("\nLe sujet (metaSujet) est : " + commandes.analyse_metaSujet); text.append("\n"); + text.append("\nL'auteur de l'exercice est : " + commandes.analyse_auteur); text.append("\n"); + if(commandes.analyse_baremeABC==true) { - text.append("La notation est sous la forme d'un barème alphabétique ABCDE."); - text.append("\tLa progression est de " + String.valueOf(commandes.analyse_progression)); + text.append("\nLa notation est sous la forme d'un barème alphabétique ABCDE."); + text.append("\n\tLa progression est de " + String.valueOf(commandes.analyse_progression)); }else { - text.append("La notation est sous la forme d'une note numérique."); - text.append("\tLe barème est sur " + String.valueOf(commandes.analyse_notefrom)); - text.append("\tLa progression est de " + String.valueOf(commandes.analyse_progression)); + text.append("\nLa notation est sous la forme d'une note numérique."); + text.append("\n\tLe barème est sur " + String.valueOf(commandes.analyse_notefrom)); + text.append("\n\tLa progression est de " + String.valueOf(commandes.analyse_progression)); } text.append("\n"); - - + text.append("\nLe hash de l'évaluation est : " + commandes.hash); + text.append("\n"); + text.append("\n***********************************************"); progressBar.setVisible(false); txtpnmessages.setText(text.toString()); @@ -195,7 +211,8 @@ public class evaluate extends JFrame { lblPath.setText("Dossier de l'analyse : " + commandes.path.substring(commandes.path.lastIndexOf("\\")+1,commandes.path.length()) + ""); lblFileAnalyse.setText("Fichier de l'analyse : " + commandes.filename + ""); - + lblFichierCSV.setText("Fichier CSV liste des étudiants :" + commandes.nameCSV.substring(commandes.nameCSV.lastIndexOf("\\")+1,commandes.nameCSV.length()) + ""); + } @@ -211,7 +228,7 @@ public class evaluate extends JFrame { JFileChooser chooser = new JFileChooser(); chooser.setCurrentDirectory(new java.io.File(commandes.path)); - chooser.setDialogTitle("choosertitle"); + chooser.setDialogTitle("Sélectionner le dossier contenant les fichiers des étudiants."); chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); chooser.setAcceptAllFileFilterUsed(false); @@ -247,6 +264,35 @@ public class evaluate extends JFrame { } } }); + + // Sélectionne un fichier CSV + btnFichierCSV.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + + JFileChooser chooser = new JFileChooser(); + chooser.setDialogTitle("Choisir un fichier CSV"); + + chooser.setCurrentDirectory(new java.io.File(commandes.path)); + chooser.setFileSelectionMode(JFileChooser.FILES_ONLY); + FileNameExtensionFilter filter = new FileNameExtensionFilter("Format CSV", "csv"); + chooser.setFileFilter(filter); + chooser.setAcceptAllFileFilterUsed(true); + + if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) { + System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory()); + System.out.println("getSelectedFile() : " + chooser.getSelectedFile().getAbsolutePath()); + commandes.nameCSV = chooser.getSelectedFile().getAbsolutePath(); + commandes.fourniCSV=true; + } else { + commandes.nameCSV = ""; + commandes.fourniCSV=false; + System.out.println("No Selection "); + } + + refreshLabel(); + } + }); + } diff --git a/src/resources/fichierCSV.png b/src/resources/fichierCSV.png new file mode 100644 index 0000000..de88a0a Binary files /dev/null and b/src/resources/fichierCSV.png differ