diff --git a/.classpath b/.classpath index df2dd8b..87e98ef 100644 --- a/.classpath +++ b/.classpath @@ -2,10 +2,10 @@ - + diff --git a/.project b/.project index 5495b6d..24f30da 100644 --- a/.project +++ b/.project @@ -3,6 +3,7 @@ analyseWriter + cXML diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs new file mode 100644 index 0000000..e0ae23f --- /dev/null +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.ui.text.custom_code_templates= diff --git a/.settings/org.eclipse.ltk.core.refactoring.prefs b/.settings/org.eclipse.ltk.core.refactoring.prefs new file mode 100644 index 0000000..cfcd1d3 --- /dev/null +++ b/.settings/org.eclipse.ltk.core.refactoring.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/analyseWriter.jar b/analyseWriter.jar index 58f5be0..1114134 100644 Binary files a/analyseWriter.jar and b/analyseWriter.jar differ diff --git a/bin/.gitignore b/bin/.gitignore index 75cdbd6..f13ae4e 100644 --- a/bin/.gitignore +++ b/bin/.gitignore @@ -1,2 +1 @@ /app/ -/resources/ diff --git a/bin/MEPTL/HTML.class b/bin/MEPTL/HTML.class index 8eeef9f..d269ee7 100644 Binary files a/bin/MEPTL/HTML.class and b/bin/MEPTL/HTML.class differ diff --git a/bin/MEPTL/StringSimilarity.class b/bin/MEPTL/StringSimilarity.class index 6346239..facd6d3 100644 Binary files a/bin/MEPTL/StringSimilarity.class and b/bin/MEPTL/StringSimilarity.class differ diff --git a/bin/MEPTL/analyseLesNodesEnfants.class b/bin/MEPTL/analyseLesNodesEnfants.class index 119ac72..1610449 100644 Binary files a/bin/MEPTL/analyseLesNodesEnfants.class and b/bin/MEPTL/analyseLesNodesEnfants.class differ diff --git a/bin/MEPTL/analyseLesNodesPrincipaux.class b/bin/MEPTL/analyseLesNodesPrincipaux.class index 5e6af84..a61aa26 100644 Binary files a/bin/MEPTL/analyseLesNodesPrincipaux.class and b/bin/MEPTL/analyseLesNodesPrincipaux.class differ diff --git a/bin/MEPTL/commandes.class b/bin/MEPTL/commandes.class index 3690fe4..9dfa4fb 100644 Binary files a/bin/MEPTL/commandes.class and b/bin/MEPTL/commandes.class differ diff --git a/bin/MEPTL/ecritureSujet.class b/bin/MEPTL/ecritureSujet.class index 8f3da31..faa29fb 100644 Binary files a/bin/MEPTL/ecritureSujet.class and b/bin/MEPTL/ecritureSujet.class differ diff --git a/bin/MEPTL/feedbacks.class b/bin/MEPTL/feedbacks.class index 68ae139..661af1e 100644 Binary files a/bin/MEPTL/feedbacks.class and b/bin/MEPTL/feedbacks.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index 01360bf..48ee2e5 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/MEPTL/outils.class b/bin/MEPTL/outils.class index c2ceca0..2a50af3 100644 Binary files a/bin/MEPTL/outils.class and b/bin/MEPTL/outils.class differ diff --git a/bin/MEPTL/rechercherUnNodeStudent.class b/bin/MEPTL/rechercherUnNodeStudent.class index 8b4c5f5..106442a 100644 Binary files a/bin/MEPTL/rechercherUnNodeStudent.class and b/bin/MEPTL/rechercherUnNodeStudent.class differ diff --git a/bin/MEPTL/verificationFichierAnalyse.class b/bin/MEPTL/verificationFichierAnalyse.class index e1a2118..9a93a80 100644 Binary files a/bin/MEPTL/verificationFichierAnalyse.class and b/bin/MEPTL/verificationFichierAnalyse.class differ diff --git a/bin/app/about$1.class b/bin/app/about$1.class index 93451be..51498cc 100644 Binary files a/bin/app/about$1.class and b/bin/app/about$1.class differ diff --git a/bin/app/about$2.class b/bin/app/about$2.class index ef78a4a..ab3e545 100644 Binary files a/bin/app/about$2.class and b/bin/app/about$2.class differ diff --git a/bin/app/about.class b/bin/app/about.class index ab7f68f..b9cbf9e 100644 Binary files a/bin/app/about.class and b/bin/app/about.class differ diff --git a/bin/app/create$1.class b/bin/app/create$1.class index 3d712c4..469cf89 100644 Binary files a/bin/app/create$1.class and b/bin/app/create$1.class differ diff --git a/bin/app/create$10.class b/bin/app/create$10.class index dcf5947..7852cb7 100644 Binary files a/bin/app/create$10.class and b/bin/app/create$10.class differ diff --git a/bin/app/create$11.class b/bin/app/create$11.class index 40a0235..c13f512 100644 Binary files a/bin/app/create$11.class and b/bin/app/create$11.class differ diff --git a/bin/app/create$12.class b/bin/app/create$12.class index 189616a..9246b20 100644 Binary files a/bin/app/create$12.class and b/bin/app/create$12.class differ diff --git a/bin/app/create$13.class b/bin/app/create$13.class index 983d05f..8739c4f 100644 Binary files a/bin/app/create$13.class and b/bin/app/create$13.class differ diff --git a/bin/app/create$14.class b/bin/app/create$14.class index 537ac53..de2e3d3 100644 Binary files a/bin/app/create$14.class and b/bin/app/create$14.class differ diff --git a/bin/app/create$15.class b/bin/app/create$15.class index 983ab88..4ab4260 100644 Binary files a/bin/app/create$15.class and b/bin/app/create$15.class differ diff --git a/bin/app/create$16.class b/bin/app/create$16.class index 3466bad..05da56a 100644 Binary files a/bin/app/create$16.class and b/bin/app/create$16.class differ diff --git a/bin/app/create$17.class b/bin/app/create$17.class index 0e017c0..5791eaf 100644 Binary files a/bin/app/create$17.class and b/bin/app/create$17.class differ diff --git a/bin/app/create$18.class b/bin/app/create$18.class index 11998ee..dbe5785 100644 Binary files a/bin/app/create$18.class and b/bin/app/create$18.class differ diff --git a/bin/app/create$19.class b/bin/app/create$19.class index 3f3e7eb..dd5a1ad 100644 Binary files a/bin/app/create$19.class and b/bin/app/create$19.class differ diff --git a/bin/app/create$2.class b/bin/app/create$2.class index eb9d9c9..ee4a3ef 100644 Binary files a/bin/app/create$2.class and b/bin/app/create$2.class differ diff --git a/bin/app/create$20.class b/bin/app/create$20.class index d3de12c..e29d598 100644 Binary files a/bin/app/create$20.class and b/bin/app/create$20.class differ diff --git a/bin/app/create$21.class b/bin/app/create$21.class index 9cd73ec..9000f7d 100644 Binary files a/bin/app/create$21.class and b/bin/app/create$21.class differ diff --git a/bin/app/create$22.class b/bin/app/create$22.class index c7e6b61..92369db 100644 Binary files a/bin/app/create$22.class and b/bin/app/create$22.class differ diff --git a/bin/app/create$23.class b/bin/app/create$23.class index a096c02..c08951f 100644 Binary files a/bin/app/create$23.class and b/bin/app/create$23.class differ diff --git a/bin/app/create$3.class b/bin/app/create$3.class index 793befc..0d55b16 100644 Binary files a/bin/app/create$3.class and b/bin/app/create$3.class differ diff --git a/bin/app/create$4.class b/bin/app/create$4.class index d317b94..c34d2f6 100644 Binary files a/bin/app/create$4.class and b/bin/app/create$4.class differ diff --git a/bin/app/create$5.class b/bin/app/create$5.class index 84099c0..71a0cf0 100644 Binary files a/bin/app/create$5.class and b/bin/app/create$5.class differ diff --git a/bin/app/create$6.class b/bin/app/create$6.class index 1db2dc0..90f3efa 100644 Binary files a/bin/app/create$6.class and b/bin/app/create$6.class differ diff --git a/bin/app/create$7.class b/bin/app/create$7.class index db0ea37..d55ba4a 100644 Binary files a/bin/app/create$7.class and b/bin/app/create$7.class differ diff --git a/bin/app/create$8.class b/bin/app/create$8.class index b320b77..ae5bb94 100644 Binary files a/bin/app/create$8.class and b/bin/app/create$8.class differ diff --git a/bin/app/create$9.class b/bin/app/create$9.class index b37d174..98b690a 100644 Binary files a/bin/app/create$9.class and b/bin/app/create$9.class differ diff --git a/bin/app/create.class b/bin/app/create.class index d5c455c..890d53e 100644 Binary files a/bin/app/create.class and b/bin/app/create.class differ diff --git a/bin/app/evaluate$1$1.class b/bin/app/evaluate$1$1.class deleted file mode 100644 index a3d1ec4..0000000 Binary files a/bin/app/evaluate$1$1.class and /dev/null differ diff --git a/bin/app/evaluate$1$2.class b/bin/app/evaluate$1$2.class deleted file mode 100644 index ba1c4ed..0000000 Binary files a/bin/app/evaluate$1$2.class and /dev/null differ diff --git a/bin/app/evaluate$1.class b/bin/app/evaluate$1.class index 653ed81..65e0929 100644 Binary files a/bin/app/evaluate$1.class and b/bin/app/evaluate$1.class differ diff --git a/bin/app/evaluate$10.class b/bin/app/evaluate$10.class index ec0aa7c..c12c0c4 100644 Binary files a/bin/app/evaluate$10.class and b/bin/app/evaluate$10.class differ diff --git a/bin/app/evaluate$11.class b/bin/app/evaluate$11.class index b47388b..d7ad2d4 100644 Binary files a/bin/app/evaluate$11.class and b/bin/app/evaluate$11.class differ diff --git a/bin/app/evaluate$12.class b/bin/app/evaluate$12.class index 73520d4..84ad983 100644 Binary files a/bin/app/evaluate$12.class and b/bin/app/evaluate$12.class differ diff --git a/bin/app/evaluate$13.class b/bin/app/evaluate$13.class index 467e645..e76898b 100644 Binary files a/bin/app/evaluate$13.class and b/bin/app/evaluate$13.class differ diff --git a/bin/app/evaluate$14.class b/bin/app/evaluate$14.class index 05949a3..0c8d69d 100644 Binary files a/bin/app/evaluate$14.class and b/bin/app/evaluate$14.class differ diff --git a/bin/app/evaluate$15.class b/bin/app/evaluate$15.class index 92dc08f..e220828 100644 Binary files a/bin/app/evaluate$15.class and b/bin/app/evaluate$15.class differ diff --git a/bin/app/evaluate$16.class b/bin/app/evaluate$16.class index e4b0495..8693f12 100644 Binary files a/bin/app/evaluate$16.class and b/bin/app/evaluate$16.class differ diff --git a/bin/app/evaluate$17.class b/bin/app/evaluate$17.class index 7f55037..d4cbd67 100644 Binary files a/bin/app/evaluate$17.class and b/bin/app/evaluate$17.class differ diff --git a/bin/app/evaluate$2.class b/bin/app/evaluate$2.class index a30a931..34b8a6b 100644 Binary files a/bin/app/evaluate$2.class and b/bin/app/evaluate$2.class differ diff --git a/bin/app/evaluate$3.class b/bin/app/evaluate$3.class index 007df0d..103ca40 100644 Binary files a/bin/app/evaluate$3.class and b/bin/app/evaluate$3.class differ diff --git a/bin/app/evaluate$4.class b/bin/app/evaluate$4.class index 4ee5d7c..f0148ae 100644 Binary files a/bin/app/evaluate$4.class and b/bin/app/evaluate$4.class differ diff --git a/bin/app/evaluate$5.class b/bin/app/evaluate$5.class index 843b10f..2255356 100644 Binary files a/bin/app/evaluate$5.class and b/bin/app/evaluate$5.class differ diff --git a/bin/app/evaluate$6.class b/bin/app/evaluate$6.class index 4db5992..3957292 100644 Binary files a/bin/app/evaluate$6.class and b/bin/app/evaluate$6.class differ diff --git a/bin/app/evaluate$7.class b/bin/app/evaluate$7.class index 1e0b055..cbee3d2 100644 Binary files a/bin/app/evaluate$7.class and b/bin/app/evaluate$7.class differ diff --git a/bin/app/evaluate$8.class b/bin/app/evaluate$8.class index 12f42d6..8974b21 100644 Binary files a/bin/app/evaluate$8.class and b/bin/app/evaluate$8.class differ diff --git a/bin/app/evaluate$9.class b/bin/app/evaluate$9.class index cdab27f..a589d98 100644 Binary files a/bin/app/evaluate$9.class and b/bin/app/evaluate$9.class differ diff --git a/bin/app/evaluate.class b/bin/app/evaluate.class index 5948b0b..f31f0a8 100644 Binary files a/bin/app/evaluate.class and b/bin/app/evaluate.class differ diff --git a/bin/app/filechooserXML.class b/bin/app/filechooserXML.class index 92ddafe..5824865 100644 Binary files a/bin/app/filechooserXML.class and b/bin/app/filechooserXML.class differ diff --git a/bin/app/mainApp$1.class b/bin/app/mainApp$1.class index 2b5da31..f816380 100644 Binary files a/bin/app/mainApp$1.class and b/bin/app/mainApp$1.class differ diff --git a/bin/app/mainApp$2.class b/bin/app/mainApp$2.class index 2840065..79ee35d 100644 Binary files a/bin/app/mainApp$2.class and b/bin/app/mainApp$2.class differ diff --git a/bin/app/mainApp$3.class b/bin/app/mainApp$3.class deleted file mode 100644 index 1fc3fa9..0000000 Binary files a/bin/app/mainApp$3.class and /dev/null differ diff --git a/bin/app/mainApp.class b/bin/app/mainApp.class index 3ce0eb4..6f21b73 100644 Binary files a/bin/app/mainApp.class and b/bin/app/mainApp.class differ diff --git a/bin/app/msgBox$1.class b/bin/app/msgBox$1.class index 0abae2a..2930c03 100644 Binary files a/bin/app/msgBox$1.class and b/bin/app/msgBox$1.class differ diff --git a/bin/app/msgBox$2.class b/bin/app/msgBox$2.class index df56ecb..d63d6ee 100644 Binary files a/bin/app/msgBox$2.class and b/bin/app/msgBox$2.class differ diff --git a/bin/app/msgBox$3.class b/bin/app/msgBox$3.class index 2670190..cfbe11d 100644 Binary files a/bin/app/msgBox$3.class and b/bin/app/msgBox$3.class differ diff --git a/bin/app/msgBox.class b/bin/app/msgBox.class index 7d4e872..f5dad34 100644 Binary files a/bin/app/msgBox.class and b/bin/app/msgBox.class differ diff --git a/bin/app/package-info.class b/bin/app/package-info.class index 8825c51..edc3f15 100644 Binary files a/bin/app/package-info.class and b/bin/app/package-info.class differ diff --git a/bin/app/progress.class b/bin/app/progress.class deleted file mode 100644 index 096fe7e..0000000 Binary files a/bin/app/progress.class and /dev/null differ diff --git a/bin/resources/attributmini.png b/bin/resources/attributmini.png new file mode 100644 index 0000000..c23113b Binary files /dev/null and b/bin/resources/attributmini.png differ diff --git a/bin/resources/poidsmini.png b/bin/resources/poidsmini.png new file mode 100644 index 0000000..899fcf8 Binary files /dev/null and b/bin/resources/poidsmini.png differ diff --git a/bin/resources/sautmini.png b/bin/resources/sautmini.png new file mode 100644 index 0000000..b631cfd Binary files /dev/null and b/bin/resources/sautmini.png differ diff --git a/bin/resources/titremini.png b/bin/resources/titremini.png new file mode 100644 index 0000000..11b39a5 Binary files /dev/null and b/bin/resources/titremini.png differ diff --git a/bin/resources/voirmini.png b/bin/resources/voirmini.png new file mode 100644 index 0000000..96d82bb Binary files /dev/null and b/bin/resources/voirmini.png differ diff --git a/bin/resources/whatmini.png b/bin/resources/whatmini.png new file mode 100644 index 0000000..b123504 Binary files /dev/null and b/bin/resources/whatmini.png differ diff --git a/src/app/attributs.java b/src/app/attributs.java new file mode 100644 index 0000000..6607b9b --- /dev/null +++ b/src/app/attributs.java @@ -0,0 +1,171 @@ +package app; + +import java.awt.BorderLayout; + +import javax.swing.JFrame; +import javax.swing.JPanel; +import javax.swing.border.EmptyBorder; + +import cXML.node; + +import java.awt.FlowLayout; +import java.util.ArrayList; +import java.util.Enumeration; + +import net.miginfocom.swing.MigLayout; +import javax.swing.JLabel; +import java.awt.Font; +import javax.swing.JScrollPane; +import javax.swing.JTextField; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; + +public class attributs extends JFrame { + + /** + * + */ + private static final long serialVersionUID = 1L; + private JPanel contentPane; + + + + /** + * Create the frame. + */ + public attributs(node nod) { + setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); + setBounds(100, 100, 727, 669); + contentPane = new JPanel(); + contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); + setContentPane(contentPane); + contentPane.setLayout(new BorderLayout(0, 0)); + + ArrayList Leslabels = new ArrayList(); + ArrayList Lesvaleurs = new ArrayList(); + ArrayList Lesevaluer = new ArrayList(); + ArrayList Lespoints = new ArrayList(); + + JPanel panelGauche = new JPanel(); + contentPane.add(panelGauche, BorderLayout.WEST); + + JPanel panelHaut = new JPanel(); + contentPane.add(panelHaut, BorderLayout.NORTH); + + JLabel lblNomNode = new JLabel(nod.getNomElt()); + lblNomNode.setFont(new Font("Tahoma", Font.BOLD, 14)); + panelHaut.add(lblNomNode); + + JPanel panelBas = new JPanel(); + contentPane.add(panelBas, BorderLayout.SOUTH); + panelBas.setLayout(new FlowLayout(FlowLayout.RIGHT, 5, 5)); + + JButton btnNewButton = new JButton("Valider"); + panelBas.add(btnNewButton); + + JPanel panelDroite = new JPanel(); + contentPane.add(panelDroite, BorderLayout.EAST); + + JScrollPane scrollPaneCentre = new JScrollPane(); + contentPane.add(scrollPaneCentre, BorderLayout.CENTER); + + JPanel panelCentre = new JPanel(); + scrollPaneCentre.setViewportView(panelCentre); + panelCentre.setLayout(new MigLayout("", "[100px:n,grow][150px:n,grow 150][::80px][80px:n,grow]", "[::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px][::20px]")); + + JLabel lblNewLabel = new JLabel("Nom attribut"); + lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 11)); + panelCentre.add(lblNewLabel, "cell 0 0"); + + JLabel lblNewLabel_1 = new JLabel("Valeurs"); + lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 11)); + panelCentre.add(lblNewLabel_1, "flowx,cell 1 0"); + + JLabel lblNewLabel_2 = new JLabel("Evaluer"); + lblNewLabel_2.setFont(new Font("Tahoma", Font.BOLD, 11)); + panelCentre.add(lblNewLabel_2, "cell 2 0"); + + JLabel lblNewLabel_3 = new JLabel("Point(s)"); + lblNewLabel_3.setFont(new Font("Tahoma", Font.BOLD, 11)); + panelCentre.add(lblNewLabel_3, "cell 3 0"); + + + + + Enumeration key = nod.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + String value = nod.getAttributs().get(k); + String point = "0"; + JCheckBox checkEval = new JCheckBox(); + boolean evaluer = false; + if(value.contains("‽")||value.contains("‼")) { + evaluer=true; + if(value.contains("‽")) { + point = value.substring(value.lastIndexOf("‽")+1,value.length()); + value = value.substring(0,value.lastIndexOf("‽")); + } + if(value.contains("‼")) { + point = value.substring(value.lastIndexOf("‼")+1,value.length()); + value = value.substring(0,value.lastIndexOf("‼")); + } + } + JTextField txtFielPoints = new JTextField(point); + txtFielPoints.setColumns(2); + checkEval.setSelected(evaluer); + + Leslabels.add(new JLabel(k)); + Lesvaleurs.add(new JTextField(value)); + Lespoints.add(txtFielPoints); + Lesevaluer.add(checkEval); + } + + + + + for(int i = 0 ; iPARAMETRES"); + lblTITRE.setForeground(Color.RED); + lblTITRE.setFont(new Font("Tahoma", Font.BOLD, 16)); + lblTITRE.setHorizontalAlignment(SwingConstants.CENTER); + panelWest.add(lblTITRE, "cell 0 0,alignx left,aligny center"); + + lblFileAnalyse = new JLabel("Fichier de l'analyse : "); + lblFileAnalyse.setHorizontalAlignment(SwingConstants.LEFT); + lblFileAnalyse.setFont(new Font("Tahoma", Font.BOLD, 14)); + panelWest.add(lblFileAnalyse, "flowy,cell 0 1,alignx left,growy"); + + 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"); + panelWest.add(chckbxfichiersEtudaints, "flowy,cell 0 2,grow"); + + lblFichierCSV = new JLabel("Fichier CSV liste des étudiants :"); + lblFichierCSV.setFont(new Font("Tahoma", Font.BOLD, 14)); + panelWest.add(lblFichierCSV, "flowy,cell 0 4,grow"); + + lblFichierSVG = new JLabel("Fichier SVG :"); + lblFichierSVG.setFont(new Font("Tahoma", Font.BOLD, 14)); + panelWest.add(lblFichierSVG, "flowy,cell 0 6,growx"); + + chckCSVNotes = new JCheckBox("Créer un fichier CSV des notes"); + chckCSVNotes.setToolTipText("Cochez si vous voulez importer les notes dans un fichier CSV."); + panelWest.add(chckCSVNotes, "cell 0 4,grow"); + + lblPath = new JLabel(); + lblPath.setHorizontalAlignment(SwingConstants.LEFT); + lblPath.setFont(new Font("Tahoma", Font.BOLD, 14)); + lblPath.setText("Dossier de l'analyse : " + commandes.path.substring(commandes.path.lastIndexOf("\\")+1,commandes.path.length()) + ""); + panelWest.add(lblPath, "cell 0 1,grow"); + + chckbxnoFeedback = new JCheckBox("Pas de feedback"); + chckbxnoFeedback.setToolTipText("Cochez si vous ne voulez pas générer des feedbacks"); + chckbxnoFeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxnoFeedback, "cell 0 2,grow"); + + chckbxZipfeedback = new JCheckBox("Zip les feedbacks"); + chckbxZipfeedback.setToolTipText("Cochez si vous voulez placer tous les feedbacks dans une archive ZIP"); + chckbxZipfeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxZipfeedback, "cell 0 2,grow"); + + chckbxNoNote = new JCheckBox("Pas de note dans les feedbacks"); + chckbxNoNote.setToolTipText("Cochez si vous voulez pas faire apparaître les notes dans les feedbacks"); + chckbxNoNote.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxNoNote, "cell 0 2,grow"); + + chckbxVerif = new JCheckBox("Vérification des historiques avant analyse"); + chckbxVerif.setToolTipText("Cochez si vous voulez vérifier les échanges de fichiers entre les étudiants."); + chckbxVerif.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxVerif, "cell 0 2,grow"); + + chckbxNewLogo = new JCheckBox("Nouveau logo"); + chckbxNewLogo.setToolTipText("Cochez si vous voulez remplacer le logo par celui au-dessus."); + chckbxNewLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxNewLogo, "cell 0 6"); + + chckbxNoLogo = new JCheckBox("Pas de logo"); + chckbxNoLogo.setToolTipText("Cochez si vous voulez pas de logo dans les feedbacks."); + chckbxNoLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); + panelWest.add(chckbxNoLogo, "cell 0 6"); + + + JPanel panelCentre = new JPanel(); + contentPane.add(panelCentre, BorderLayout.CENTER); + panelCentre.setLayout(new BorderLayout(0, 0)); + + JScrollPane scrollPane = new JScrollPane(); + panelCentre.add(scrollPane); + + progressBarre = new JProgressBar(); + progressBarre.setEnabled(true); + panelCentre.add(progressBarre, BorderLayout.NORTH); + + txtpnmessages = new JEditorPane(); + txtpnmessages.setFont(new Font("Tahoma", Font.PLAIN, 14)); + txtpnmessages.setText("*** Charger un fichier d'analyse. ***"); + scrollPane.setViewportView(txtpnmessages); + + this.setExtendedState(MAXIMIZED_BOTH); + + refreshLabel(); + setVisible(true); +// Pro(); + + } + + + + private void Pro() { +// progressBarre = new JProgressBar(); + progressBarre.setMaximum(100000000); + progressBarre.setStringPainted(true); + for(int i = 0 ; i < 1000; i++) { + progressBarre.setValue(i); + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + } + + + private void createMenu() { JMenuBar menuBar = new JMenuBar(); menuBar.setFont(new Font("Segoe UI", Font.BOLD, 14)); setJMenuBar(menuBar); @@ -133,194 +259,101 @@ public class evaluate extends JFrame { mnMenu_Informations.add(actDocumentation); mnMenu_Informations.addSeparator(); mnMenu_Informations.add( actAbout ); - - - contentPane = new JPanel(); - contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); - setContentPane(contentPane); - contentPane.setLayout(new BorderLayout(0, 0)); - + } + + + + private void createToolBar() { toolBar = new JToolBar(); - contentPane.add(toolBar, BorderLayout.NORTH); - + JButton btnSelectFileAnalyse = toolBar.add( actOpen ); + btnSelectFileAnalyse.setHideActionText( true ); + btnSelectFileAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyse.png"))); + - JButton btnSelectFileAnalyse = toolBar.add( actOpen ); - btnSelectFileAnalyse.setHideActionText( true ); - btnSelectFileAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyse.png"))); + JButton btnInformationAnalyse = toolBar.add( actCodeFichierAnalyse ); + btnInformationAnalyse.setHideActionText(true); + btnInformationAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo2.png"))); - - JButton btnInformationAnalyse = toolBar.add( actCodeFichierAnalyse ); - btnInformationAnalyse.setHideActionText(true); - btnInformationAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo2.png"))); - - - JButton btnAfficheCodeFichierAnalyse = toolBar.add( actAboutFichierAnalyse ); - btnAfficheCodeFichierAnalyse.setHideActionText(true); - btnAfficheCodeFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo.png"))); - toolBar.add(btnAfficheCodeFichierAnalyse); - - JButton btnModifierFichierAnalyse = toolBar.add(actModifierFichierAnalyse); - btnModifierFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseModif.png"))); - btnModifierFichierAnalyse.setHideActionText(true); - toolBar.add(btnModifierFichierAnalyse); - - toolBar.addSeparator(); - - JButton btnNewFichierAnalyse = toolBar.add(actNewFichierAnalyse); - btnNewFichierAnalyse.setHideActionText(true); - btnNewFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierODF.png"))); - toolBar.add(btnNewFichierAnalyse); - - toolBar.addSeparator(); - - JButton btnEvaluerLesFichiers = toolBar.add(actEvaluate); - btnEvaluerLesFichiers.setHideActionText(true); - - JButton btnFichierCSV = toolBar.add(actChargeListeEtudiantCSV ); - btnFichierCSV.setHideActionText(true); - btnFichierCSV.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSV.png"))); - toolBar.add(btnFichierCSV); - - JButton btnInfoListeEtudiant = toolBar.add(actAfficheListeEtudiant); - btnInfoListeEtudiant.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSVInfo.png"))); - btnInfoListeEtudiant.setHideActionText(true); - toolBar.add(btnInfoListeEtudiant); - - JButton btnVerificationCSVavecFichierAnalyse = toolBar.add( actVerifCSV ); - btnVerificationCSVavecFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSVInfoXML.png"))); - btnVerificationCSVavecFichierAnalyse.setHideActionText(true); - toolBar.add(btnVerificationCSVavecFichierAnalyse); - - toolBar.addSeparator(); - - JButton btnFichierSVG = toolBar.add(actChargeLogo); - btnFichierSVG.setHideActionText(true); - btnFichierSVG.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierSVG.png"))); - toolBar.add(btnFichierSVG); - - toolBar.addSeparator(); - - JButton btnSelectFolder = toolBar.add(actSelectFolder); - btnSelectFolder.setIcon(new ImageIcon(evaluate.class.getResource("/resources/open.png"))); - btnSelectFolder.setHideActionText(true); - toolBar.add(btnSelectFolder); - - btnEvaluerLesFichiers.setIcon(new ImageIcon(evaluate.class.getResource("/resources/evaluate.png"))); - toolBar.add(btnEvaluerLesFichiers); - - JButton btnVerifHistorique = toolBar.add(actVerifHistorique); - btnVerifHistorique.setIcon(new ImageIcon(evaluate.class.getResource("/resources/verifhistorique.png"))); - btnVerifHistorique.setHideActionText(true); - toolBar.add(btnVerifHistorique); - - toolBar.addSeparator(); - - JButton btnNewButton = toolBar.add( actDocumentation ); - btnNewButton.setIcon(new ImageIcon(evaluate.class.getResource("/resources/documentation.png"))); - btnNewButton.setHideActionText(true); - toolBar.add(btnNewButton); - - JButton btnAbout = toolBar.add(actAbout); - btnAbout.setIcon(new ImageIcon(evaluate.class.getResource("/resources/apropos.png"))); - btnAbout.setHideActionText(true); - toolBar.add(btnAbout); - - toolBar.addSeparator(); - - toolBar.addSeparator(); - - JButton btnExit = toolBar.add(actExit); - btnExit.setIcon(new ImageIcon(evaluate.class.getResource("/resources/exit.png"))); - btnExit.setHideActionText(true); - toolBar.add(btnExit); - JPanel panel = new JPanel(); - contentPane.add(panel, BorderLayout.WEST); - panel.setLayout(new MigLayout("", "[309px][]", "[38.00][71px][71px][][71px][][74.00][][]")); + JButton btnAfficheCodeFichierAnalyse = toolBar.add( actAboutFichierAnalyse ); + btnAfficheCodeFichierAnalyse.setHideActionText(true); + btnAfficheCodeFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseInfo.png"))); + toolBar.add(btnAfficheCodeFichierAnalyse); - JLabel lblTITRE = new JLabel("PARAMETRES"); - lblTITRE.setForeground(Color.RED); - lblTITRE.setFont(new Font("Tahoma", Font.BOLD, 16)); - lblTITRE.setHorizontalAlignment(SwingConstants.CENTER); - panel.add(lblTITRE, "cell 0 0,alignx left,aligny center"); + JButton btnModifierFichierAnalyse = toolBar.add(actModifierFichierAnalyse); + btnModifierFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierAnalyseModif.png"))); + btnModifierFichierAnalyse.setHideActionText(true); + toolBar.add(btnModifierFichierAnalyse); - lblFileAnalyse = new JLabel("Fichier de l'analyse : "); - lblFileAnalyse.setHorizontalAlignment(SwingConstants.LEFT); - lblFileAnalyse.setFont(new Font("Tahoma", Font.BOLD, 14)); - panel.add(lblFileAnalyse, "flowy,cell 0 1,alignx left,growy"); + toolBar.addSeparator(); - 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"); - panel.add(chckbxfichiersEtudaints, "flowy,cell 0 2,grow"); + JButton btnNewFichierAnalyse = toolBar.add(actNewFichierAnalyse); + btnNewFichierAnalyse.setHideActionText(true); + btnNewFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierODF.png"))); + toolBar.add(btnNewFichierAnalyse); - lblFichierCSV = new JLabel("Fichier CSV liste des étudiants :"); - lblFichierCSV.setFont(new Font("Tahoma", Font.BOLD, 14)); - panel.add(lblFichierCSV, "flowy,cell 0 4,grow"); + toolBar.addSeparator(); - lblFichierSVG = new JLabel("Fichier SVG :"); - lblFichierSVG.setFont(new Font("Tahoma", Font.BOLD, 14)); - panel.add(lblFichierSVG, "flowy,cell 0 6,growx"); + JButton btnEvaluerLesFichiers = toolBar.add(actEvaluate); + btnEvaluerLesFichiers.setHideActionText(true); - chckCSVNotes = new JCheckBox("Créer un fichier CSV des notes"); - chckCSVNotes.setToolTipText("Cochez si vous voulez importer les notes dans un fichier CSV."); - panel.add(chckCSVNotes, "cell 0 4,grow"); - lblPath.setHorizontalAlignment(SwingConstants.LEFT); - 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, "cell 0 1,grow"); + JButton btnFichierCSV = toolBar.add(actChargeListeEtudiantCSV ); + btnFichierCSV.setHideActionText(true); + btnFichierCSV.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSV.png"))); + toolBar.add(btnFichierCSV); - chckbxnoFeedback = new JCheckBox("Pas de feedback"); - chckbxnoFeedback.setToolTipText("Cochez si vous ne voulez pas générer des feedbacks"); - chckbxnoFeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxnoFeedback, "cell 0 2,grow"); + JButton btnInfoListeEtudiant = toolBar.add(actAfficheListeEtudiant); + btnInfoListeEtudiant.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSVInfo.png"))); + btnInfoListeEtudiant.setHideActionText(true); + toolBar.add(btnInfoListeEtudiant); - chckbxZipfeedback = new JCheckBox("Zip les feedbacks"); - chckbxZipfeedback.setToolTipText("Cochez si vous voulez placer tous les feedbacks dans une archive ZIP"); - chckbxZipfeedback.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxZipfeedback, "cell 0 2,grow"); + JButton btnVerificationCSVavecFichierAnalyse = toolBar.add( actVerifCSV ); + btnVerificationCSVavecFichierAnalyse.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierCSVInfoXML.png"))); + btnVerificationCSVavecFichierAnalyse.setHideActionText(true); + toolBar.add(btnVerificationCSVavecFichierAnalyse); - chckbxNoNote = new JCheckBox("Pas de note dans les feedbacks"); - chckbxNoNote.setToolTipText("Cochez si vous voulez pas faire apparaître les notes dans les feedbacks"); - chckbxNoNote.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxNoNote, "cell 0 2,grow"); + toolBar.addSeparator(); - chckbxVerif = new JCheckBox("Vérification des historiques avant analyse"); - chckbxVerif.setToolTipText("Cochez si vous voulez vérifier les échanges de fichiers entre les étudiants."); - chckbxVerif.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxVerif, "cell 0 2,grow"); + JButton btnFichierSVG = toolBar.add(actChargeLogo); + btnFichierSVG.setHideActionText(true); + btnFichierSVG.setIcon(new ImageIcon(evaluate.class.getResource("/resources/fichierSVG.png"))); + toolBar.add(btnFichierSVG); - chckbxNewLogo = new JCheckBox("Nouveau logo"); - chckbxNewLogo.setToolTipText("Cochez si vous voulez remplacer le logo par celui au-dessus."); - chckbxNewLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxNewLogo, "cell 0 6"); + toolBar.addSeparator(); - chckbxNoLogo = new JCheckBox("Pas de logo"); - chckbxNoLogo.setToolTipText("Cochez si vous voulez pas de logo dans les feedbacks."); - chckbxNoLogo.setFont(new Font("Tahoma", Font.PLAIN, 12)); - panel.add(chckbxNoLogo, "cell 0 6"); - + JButton btnSelectFolder = toolBar.add(actSelectFolder); + btnSelectFolder.setIcon(new ImageIcon(evaluate.class.getResource("/resources/open.png"))); + btnSelectFolder.setHideActionText(true); + toolBar.add(btnSelectFolder); - JPanel panel_1 = new JPanel(); - contentPane.add(panel_1, BorderLayout.CENTER); - panel_1.setLayout(new GridLayout(1, 0, 0, 0)); + btnEvaluerLesFichiers.setIcon(new ImageIcon(evaluate.class.getResource("/resources/evaluate.png"))); + toolBar.add(btnEvaluerLesFichiers); - JScrollPane scrollPane = new JScrollPane(); - panel_1.add(scrollPane); + JButton btnVerifHistorique = toolBar.add(actVerifHistorique); + btnVerifHistorique.setIcon(new ImageIcon(evaluate.class.getResource("/resources/verifhistorique.png"))); + btnVerifHistorique.setHideActionText(true); + toolBar.add(btnVerifHistorique); - progressBar = new JProgressBar(); - progressBar.setEnabled(false); - scrollPane.setColumnHeaderView(progressBar); + toolBar.addSeparator(); - txtpnmessages = new JEditorPane(); - txtpnmessages.setFont(new Font("Tahoma", Font.PLAIN, 14)); - txtpnmessages.setText("Charger un fichier d'analyse."); - scrollPane.setViewportView(txtpnmessages); + JButton btnNewButton = toolBar.add( actDocumentation ); + btnNewButton.setIcon(new ImageIcon(evaluate.class.getResource("/resources/documentation.png"))); + btnNewButton.setHideActionText(true); + toolBar.add(btnNewButton); - this.setExtendedState(MAXIMIZED_BOTH); - - refreshLabel(); - setVisible(true); + JButton btnAbout = toolBar.add(actAbout); + btnAbout.setIcon(new ImageIcon(evaluate.class.getResource("/resources/apropos.png"))); + btnAbout.setHideActionText(true); + toolBar.add(btnAbout); + + toolBar.addSeparator(); + + toolBar.addSeparator(); + + JButton btnExit = toolBar.add(actExit); + btnExit.setIcon(new ImageIcon(evaluate.class.getResource("/resources/exit.png"))); + btnExit.setHideActionText(true); + toolBar.add(btnExit); } @@ -329,7 +362,8 @@ public class evaluate extends JFrame { */ private void refreshLabel() { if(!commandes.fichierAnalyseValide) { - txtpnmessages.setText(MEPTL.verificationFichierAnalyse.messageErreur.toString()); + if(!MEPTL.verificationFichierAnalyse.messageErreur.toString().isEmpty()) txtpnmessages.setText(MEPTL.verificationFichierAnalyse.messageErreur.toString()); + chckbxfichiersEtudaints.setEnabled(false); chckbxZipfeedback.setEnabled(false); chckbxnoFeedback.setEnabled(false); @@ -338,7 +372,6 @@ public class evaluate extends JFrame { chckbxNewLogo.setEnabled(false); chckbxNoLogo.setEnabled(false); chckbxVerif.setEnabled(false); - }else { chckbxfichiersEtudaints.setEnabled(true); chckbxZipfeedback.setEnabled(true); @@ -388,7 +421,7 @@ public class evaluate extends JFrame { text.append("\nFichier d'analyse :"); text.append("\n"+commandes.PathFilenameAnalysis+"\n"); - progressBar.setVisible(false); + progressBarre.setVisible(false); txtpnmessages.setText(text.toString()); } @@ -424,38 +457,25 @@ public class evaluate extends JFrame { @Override public void actionPerformed( ActionEvent e ) { if(commandes.fichierAnalyseValide) { -// JOptionPane.showMessageDialog(null, "Je boss", "Je travaille", JOptionPane.PLAIN_MESSAGE, null); - - // TODO Auto-generated method stub +// JOptionPane.showMessageDialog(null, "Je boss", "Je travaille", JOptionPane.PLAIN_MESSAGE, null); +// new msgBox("Je travaille dure.",true,false,"Attendez"); + + + + + evaluerLesFichiersEtudiants E = new evaluerLesFichiersEtudiants(chckbxfichiersEtudaints.isSelected(), chckbxZipfeedback.isSelected(),chckbxnoFeedback.isSelected(), + chckbxNoNote.isSelected(), chckCSVNotes.isSelected(), chckbxNewLogo.isSelected(), chckbxNoLogo.isSelected(), chckbxVerif.isSelected(), + progressBarre, txtpnmessages); + + E.run(); + + + - Thread t1 = new Thread(new Runnable() { - @Override - public void run() { -// JOptionPane.showConfirmDialog(null, "Message"); - msgBox V = new msgBox("Je travaille dure.",true,false,"Attendez"); - V.setVisible(true); -// V.close(); - } - }); + -// JOptionPane.showConfirmDialog(null, "Message"); - - Thread t2 = new Thread(new Runnable() { - @Override - public void run() { - try { - evaluerLesFichiersEtudiants(); - } catch (ParserConfigurationException | SAXException | IOException - | CloneNotSupportedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - }); - - t1.start(); - t2.start(); + // try { // t1.join(); @@ -1034,36 +1054,48 @@ public class evaluate extends JFrame { System.out.println( "Affiche la liste des étudaints déjà en mémoire." ); } }; + + + - /** - * Permet l'évaluation des fichiers des étudaints. - * @throws ParserConfigurationException - * @throws SAXException - * @throws IOException - * @throws CloneNotSupportedException - */ - private void evaluerLesFichiersEtudiants() throws ParserConfigurationException, SAXException, IOException, CloneNotSupportedException { - - commandes.analyse=true; - progressBar.setVisible(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; - if(chckCSVNotes.isSelected()) commandes.ecritNoteCSV=true; - if(chckbxNewLogo.isSelected()) commandes.newLogo=true; - if(chckbxNoLogo.isSelected()) commandes.noLogo = true; - if(chckbxVerif.isSelected()) commandes.verifHisto2 = true; - - meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(); - - txtpnmessages.setText(commandes.message.toString()); - progressBar.setVisible(false); +// /** +// * Permet l'évaluation des fichiers des étudaints. +// * @throws ParserConfigurationException +// * @throws SAXException +// * @throws IOException +// * @throws CloneNotSupportedException +// */ +// private void evaluerLesFichiersEtudiants() throws ParserConfigurationException, SAXException, IOException, CloneNotSupportedException { +// +// commandes.analyse=true; +// progressBarre.setVisible(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; +// if(chckCSVNotes.isSelected()) commandes.ecritNoteCSV=true; +// if(chckbxNewLogo.isSelected()) commandes.newLogo=true; +// if(chckbxNoLogo.isSelected()) commandes.noLogo = true; +// if(chckbxVerif.isSelected()) commandes.verifHisto2 = true; +// +// meptl.analyseVerifieHistoriqueLesFichiersEtudiantsEtExportNoteCSV(); +// +// txtpnmessages.setText(commandes.message.toString()); +// +// +// } - - } + + + } + + + + + + diff --git a/src/app/evaluerLesFichiersEtudiants.java b/src/app/evaluerLesFichiersEtudiants.java new file mode 100644 index 0000000..bacc50d --- /dev/null +++ b/src/app/evaluerLesFichiersEtudiants.java @@ -0,0 +1,254 @@ +package app; + +import java.io.IOException; + +import javax.swing.JEditorPane; +import javax.swing.JProgressBar; +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; + +public class evaluerLesFichiersEtudiants implements Runnable{ + + private final JProgressBar progressBarre; + private final JEditorPane txt; + + + public evaluerLesFichiersEtudiants(boolean listeEtudiantCSV, boolean zipfeedback, boolean nofeedback, boolean nonote + , boolean notedansunCSV, boolean newlogo, boolean nologo, boolean verifhisto2uniquement, JProgressBar progressBar, JEditorPane txt) { + + commandes.analyse=true; + + if(listeEtudiantCSV) commandes.fichierStudentMoodle=true; + if(zipfeedback) commandes.zipfeedback=true; + if(nofeedback) commandes.sansFeeback=true; + if(nonote) commandes.noNote=true; + if(notedansunCSV) commandes.ecritNoteCSV=true; + if(newlogo) commandes.newLogo=true; + if(nologo) commandes.noLogo = true; + if(verifhisto2uniquement) commandes.verifHisto2 = true; + this.progressBarre=progressBar; + this.txt=txt; + } + + + @Override + public synchronized void run() { + + + commandes.message = new StringBuilder(); + commandes.message.append("\n *** LES FICHIERS ANALYSES & EVALUES ***\n"); + commandes.message.append("\n"); + commandes.message.append("\n Dossier contenant les fichiers des étudiants."); + commandes.message.append("\n " + commandes.path + "\n"); + commandes.message.append("\n Les fichiers des étudiants ne sont pas dans des dossiers nominatifs ?"); + commandes.message.append(" " + commandes.fichierStudentMoodle+"\n"); + + Run a = null; + try { + a = new Run(commandes.path,commandes.Profil, commandes.fichierStudentMoodle); + } catch (ParserConfigurationException e2) { + e2.printStackTrace(); + } catch (SAXException e2) { + e2.printStackTrace(); + } catch (IOException e2) { + e2.printStackTrace(); + } + + + //********************************************** + //** Chargement et verification du CVS fourni ** + //********************************************** + if(commandes.fourniCSV) { + commandes.nodeCSV = meptl.chargementFichierCSV(); + } + + + //***************************************** + //** Nombre de fichier writer à analyser ** + //***************************************** + int nbFichierWriter = a.getLectDossiers().getEC().getListeContentWriter().size(); + commandes.analyse_Nbre_Fichier_Student = nbFichierWriter; + progressBarre.setMaximum(nbFichierWriter); + progressBarre.setVisible(true); + progressBarre.setStringPainted(true); + commandes.message.append("\nNombre de fichier à analyser et évaluer : " + Integer.valueOf(nbFichierWriter) + "\n"); + + + //*************************************** + //** -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 ** + //******************************** + try { + Run.ecritureNodeEnXML(verif, "Verif",commandes.path, "Verif"); + } catch (IOException e) { + e.printStackTrace(); + } //écriture du node de vérification + commandes.message.append("\n*******************************************************"); + commandes.message.append("\nEcriture du fichier Verif.xml dans le dossier d'analyse"); + commandes.message.append("\n*******************************************************"); + if(!commandes.analyse) { + //** bye bye analyseWriter + commandes.clotureApplication(); + } + } + + //********************************************************* + //** Node contenant l'ensemble des analyses des étudiants ** + //********************************************************* + node ensembleanalyse = new node(); + ensembleanalyse.setNomElt("analyses"); + + //***************************************************** + //** Parcours l'ensemble des fichiers des étudiants *** + //***************************************************** + for(int i = 0 ; i < nbFichierWriter ; i++) { + progressBarre.setValue(i); + txt.setText(String.valueOf(i) +"/"+ String.valueOf(nbFichierWriter-1)); + + //index de l'étudiant + commandes.analyse_index_Fichier_Student = 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=null; + try { + nodStudent = meptl.LectureFichierEtudiantSousFormeDeNode(nod,a,i); + } catch (IOException e1) { + e1.printStackTrace(); + } + //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) { + try { + Run.ecritureNodeEnXML(ana, "nodana"+ana.retourneFirstEnfantsByName("ouverture").getAttributs().get("dossier"),commandes.path,""); + } catch (IOException e) { + e.printStackTrace(); + } + } + + //**************************** + //** Création des feedbacks ** + //**************************** + if(!commandes.sansFeeback&&!commandes.ecritNodeAnalyse) { + if(!commandes.zipfeedback) { + //feedback(ana, verif); //classique directement dans le répertoire + try { + feedbacks.feedback(ana,verif, false); + } catch (IOException e) { + e.printStackTrace(); + } + } + if(commandes.zipfeedback) { // Dans une archive pour Moodle + try { + a.AddStreamToZip(feedbacks.feedback(ana, verif, true), meptl.retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),commandes.analyse_size,commandes.analyse_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 ** + //********************************************************* + commandes.message.append(meptl.messageSystem(ana).toString()); + } + } + + + txt.setText(commandes.message.toString()); + + //***************************************************** + //** Exportation au format CSV si -csv ou -verifcsv ** + //***************************************************** + if(commandes.ecritNoteCSV && !commandes.fourniCSV) { + if(!commandes.verifHisto2) + try { + meptl.ecritureCSV(ensembleanalyse); + } catch (IOException e) { + e.printStackTrace(); + } + if(commandes.verifHisto2) + try { + meptl.ecritureCSV(ensembleanalyse,verif,a,commandes.sujet.retourneFirstEnfantsByName("setting")); + } catch (IOException e) { + e.printStackTrace(); + } + } + + //*********************************************************************** + //** Exportation au format CSV si -csv file.csv ou -verifcsv file.csv ** + //*********************************************************************** + if(commandes.ecritNoteCSV && commandes.fourniCSV) { + try { + meptl.ecritureCSV(ensembleanalyse,verif,a,commandes.nodeCSV, commandes.sujet.retourneFirstEnfantsByName("setting")); + } catch (IOException e) { + e.printStackTrace(); + } + //a.ecritureNodeEnXML(ensembleanalyse, "ensembleAnalyse"); //écriture du node de l'étudiant + } + + //************************************** + //** Mise à jour du fichier d'analyse ** + //************************************** + if(commandes.MAJFichierAnalyse||commandes.MAJnameAnalysisFile) { + try { + verificationFichierAnalyse.MiseAJourFichierAnalyse(); + } catch (CloneNotSupportedException | IOException e) { + e.printStackTrace(); + } + verificationFichierAnalyse.messagMiseAJourFichierAnalyseAprèsAnalyse(); + } + + + + } + +} diff --git a/src/app/mainApp.java b/src/app/mainApp.java index 033fe5a..04b47cd 100644 --- a/src/app/mainApp.java +++ b/src/app/mainApp.java @@ -37,16 +37,17 @@ public class mainApp extends JFrame implements ActionListener{ */ public static void main(String[] args) { commandes.console=false; - EventQueue.invokeLater(new Runnable() { - public void run() { +// EventQueue.invokeLater(new Runnable() { +// public void run() { try { mainApp window = new mainApp(); +// window.setVisible(true); window.frmEvalwriter.setVisible(true); } catch (Exception e) { e.printStackTrace(); } - } - }); +// } +// }); } /** @@ -137,7 +138,7 @@ public class mainApp extends JFrame implements ActionListener{ if(e.getSource()==actCharge) { if(!commandes.console) System.out.println( "Début chargement du fichier d'analyse." ); - new evaluate(); + evaluate f = new evaluate(); frmEvalwriter.dispose(); } diff --git a/src/app/progress.java b/src/app/progress.java deleted file mode 100644 index 679af4b..0000000 --- a/src/app/progress.java +++ /dev/null @@ -1,71 +0,0 @@ -package app; - - -import javax.swing.JFrame; -import javax.swing.JPanel; -import javax.swing.JProgressBar; - - -public class progress extends JFrame { - public progress() { - } - - /** - * - */ - private static final long serialVersionUID = 1L; - - // create a frame - static JFrame f; - - static JProgressBar b; - - public static void main() - { - - // create a frame - f = new JFrame("ProgressBar demo"); - - // create a panel - JPanel p = new JPanel(); - - // create a progressbar - b = new JProgressBar(); - - // set initial value - b.setValue(0); - - b.setStringPainted(true); - - // add progressbar - p.add(b); - - // add panel - f.getContentPane().add(p); - - // set the size of the frame - f.setSize(500, 500); - f.setVisible(true); - - fill(); - } - - // function to increase progress - public static void fill() - { - int i = 0; - try { - while (i <= 100) { - // fill the menu bar - b.setValue(i + 10); - - // delay the thread - Thread.sleep(1000); - i += 20; - } - } - catch (Exception e) { - } - } - -} diff --git a/src/app/proprieteFichierAnalyse.java b/src/app/proprieteFichierAnalyse.java index 05fdfc1..eecc1ac 100644 --- a/src/app/proprieteFichierAnalyse.java +++ b/src/app/proprieteFichierAnalyse.java @@ -12,7 +12,7 @@ import javax.swing.JTextField; import MEPTL.commandes; - +import MEPTL.meptl; import javax.swing.JButton; import javax.swing.JComboBox; @@ -188,8 +188,8 @@ public class proprieteFichierAnalyse extends JFrame { textFieldNoteFrom.setFont(new Font("Tahoma", Font.PLAIN, 12)); contentPane.add(textFieldNoteFrom, "cell 1 5,growx"); textFieldNoteFrom.setColumns(10); - if(commandes.sujet.getAttributs().get("noteFrom")!=null){ - textFieldNoteFrom.setText(commandes.sujet.getAttributs().get("noteFrom")); + if(commandes.sujet.getAttributs().get("notefrom")!=null){ + textFieldNoteFrom.setText(commandes.sujet.getAttributs().get("notefrom")); } btnAideNoteFrom = new JButton(""); @@ -341,7 +341,7 @@ public class proprieteFichierAnalyse extends JFrame { commandes.sujet.getAttributs().put("metaSujet", textFieldMetaSujet.getText() ); commandes.sujet.getAttributs().put("presenceMetaSujet", comboBoxPresenceMetaSujet.getSelectedItem().toString() ); commandes.sujet.getAttributs().put("baremeABC", comboBoxBaremeABC.getSelectedItem().toString() ); - commandes.sujet.getAttributs().put("noteFrom", textFieldNoteFrom.getText() ); + commandes.sujet.getAttributs().put("notefrom", textFieldNoteFrom.getText() ); commandes.sujet.getAttributs().put("progression", textFieldProgression.getText() ); commandes.sujet.getAttributs().put("historiquePresent", comboBoxhistoriquePresent.getSelectedItem().toString() ); commandes.sujet.getAttributs().put("creationDate", textFieldDateCreation.getText() ); @@ -351,6 +351,9 @@ public class proprieteFichierAnalyse extends JFrame { commandes.sujet.getAttributs().put("link_help", textFieldlink_help.getText() ); commandes.sujet.getAttributs().put("link_sujet", textFieldlink_sujet.getText() ); + + meptl.chargementParametresFichierAnalyse(); + dispose(); } });