MAJ (correction bug après suppression d'un node suivi des modifications

text:change-start. Le contenu du node parent n'était pas pris en compte
après la suppression. Correction dans la suppression d'un node par nom
du node : modification le contenu est concatené avec celui de l'index
i-1. Correction : Ecriture du node, s'il existe des contenus du node
parent au-delà de l'index du node enfant alors place les contenus
restant après le dernier node enfant.)
This commit is contained in:
pablo rodriguez 2022-11-15 09:00:37 +01:00
parent c6e048f262
commit 07ee6e11d8
27 changed files with 271 additions and 21 deletions

View File

@ -14,6 +14,6 @@
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/zip4j-1.2.7.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/git/analyseWriter/MEPTL/miglayout15-swing.jar"/>
<classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar" sourcepath="/cXML"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

Binary file not shown.

5
bin/.gitignore vendored
View File

@ -1,6 +1 @@
/fenetres/
/MEPTL/
/resources/
/documentation analyseWriter V4.pdf
/documentation.pdf
/list/

Binary file not shown.

BIN
bin/documentation.pdf Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,158 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
inkscape:export-ydpi="51.200001"
inkscape:export-xdpi="51.200001"
inkscape:export-filename="evaluertouslesstylesparagraphesmini.png"
sodipodi:docname="evaluertouslesstylesparagraphes.svg"
inkscape:version="1.2.1 (9c6d41e410, 2022-07-14)"
id="svg8"
version="1.1"
viewBox="0 0 11.90625 11.90625"
height="45"
width="45"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<defs
id="defs2">
<pattern
id="EMFhbasepattern"
patternUnits="userSpaceOnUse"
width="6"
height="6"
x="0"
y="0" />
</defs>
<sodipodi:namedview
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:window-height="1009"
inkscape:window-width="1920"
units="px"
inkscape:guide-bbox="true"
showguides="true"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="layer1"
inkscape:document-units="mm"
inkscape:cy="32.065537"
inkscape:cx="3.8964098"
inkscape:zoom="7.8277187"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:pagecheckerboard="0"
inkscape:showpageshadow="2"
inkscape:deskcolor="#d1d1d1">
<sodipodi:guide
id="guide25"
orientation="0,-1"
position="94.049365,180.07197"
inkscape:locked="false" />
<sodipodi:guide
position="8.9572181,11.534441"
orientation="0,-1"
id="guide4043"
inkscape:locked="false" />
<sodipodi:guide
position="5.8813432,7.9515537"
orientation="0,-1"
id="guide4083"
inkscape:locked="false" />
<sodipodi:guide
position="-4.2589037,4.1320607"
orientation="0,-1"
id="guide315"
inkscape:locked="false" />
<sodipodi:guide
position="1.0787715,2.8911402"
orientation="0,-1"
id="guide373"
inkscape:locked="false" />
<sodipodi:guide
position="15.108968,5.3488904"
orientation="0,-1"
id="guide377"
inkscape:locked="false" />
<sodipodi:guide
position="11.558135,1.7718565"
orientation="1,0"
id="guide428"
inkscape:locked="false" />
</sodipodi:namedview>
<metadata
id="metadata5">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
</cc:Work>
</rdf:RDF>
</metadata>
<g
id="layer1"
inkscape:groupmode="layer"
inkscape:label="Calque 1">
<path
style="fill:#00ff00;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 2.9068707,0.371809 H 8.9572181 L 11.390877,3.9546963 6.0841481,9.9374418 0.54081313,3.9546963 Z"
id="path3908"
sodipodi:nodetypes="cccccc" />
<text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:9.61631px;line-height:1.25;font-family:Algerian;-inkscape-font-specification:Algerian;text-align:center;text-anchor:middle;fill:#000000;stroke-width:0.240409"
x="6.4307361"
y="7.1444883"
id="text2541"
transform="scale(0.98648787,1.0136972)"><tspan
sodipodi:role="line"
id="tspan2539"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Algerian;-inkscape-font-specification:Algerian;fill:#000000;stroke-width:0.240409"
x="6.4307361"
y="7.1444883">P</tspan></text>
<g
id="g923"
transform="matrix(1.0352696,0,0,1.0658949,-0.43470013,7.1496941)"
style="stroke-width:0.772273">
<rect
style="fill:#00bf00;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:0.0501977;stroke-linecap:round;stroke-linejoin:round;stroke-opacity:1"
id="rect10"
width="3.8382711"
height="3.7594025"
x="0.92013353"
y="0.34176376"
ry="0.56339979"
rx="0.5800662" />
<path
style="fill:#ffffff;stroke:none;stroke-width:0.20433px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="M 1.4619106,1.7500935 C 1.3627577,2.4034195 1.7869697,2.7038331 2.3820759,3.4752278 2.7236407,3.2105071 3.8437643,1.6082077 4.3539528,0.68451321 3.7444013,1.2569625 3.3467309,1.6796751 2.3752981,2.7432214 1.891109,2.378332 1.7782083,2.0571129 1.4619106,1.7500935 Z"
id="path16"
sodipodi:nodetypes="ccccc" />
</g>
<path
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 8.0029652,7.7741893 3.5551698,0"
id="path371"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 6.9022618,9.0151097 4.6558732,10e-8"
id="path375"
sodipodi:nodetypes="cc" />
<path
style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 9.0822998,6.5573594 2.4758352,2e-7"
id="path379"
sodipodi:nodetypes="cc" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B

View File

@ -33,7 +33,7 @@ public class commandes {
public static node nodeCSV = null;
//**version
public static String version ="V4.3.0"; // La version actuelle
public static String version ="V4.3.1"; // La version actuelle
public static String branch = "Origin";
public static String Annee ="2022";

View File

@ -38,7 +38,9 @@ public class analyseFichier {
nodouverture.setNomElt("ouverture");
nodouverture.setAttributs(nodSujet.getAttributs());
nodouverture.getAttributs().put("dossier",a.getLectDossiers().getEC().getListeNomDossier().get(indexStudent));
nodouverture.getAttributs().put("filename", a.getLectDossiers().getEC().getListeFichierodt().get(indexStudent));
if(a.getLectDossiers().getEC().getListeFichierodt().get(indexStudent)!=null) {
nodouverture.getAttributs().put("filename", a.getLectDossiers().getEC().getListeFichierodt().get(indexStudent));
}
if(nodSujet.getAttributs().get("analysis_filename")!=null) nodouverture.getAttributs().put("filenameAnalyse", nodSujet.getAttributs().get("analysis_filename"));
if(nodStudent.getAttributs().get("producteur")!=null) nodouverture.getAttributs().put("producteur", nodStudent.getAttributs().get("producteur"));
if(nodStudent.getAttributs().get("dureeEdition")!=null) nodouverture.getAttributs().put("dureeEdition", nodStudent.getAttributs().get("dureeEdition"));

View File

@ -348,9 +348,13 @@ public class afficheText extends JEditorPane {
System.out.println( "Affichage information du fichier d'analyse" );
String v = commandes.analyse_version;
if(v.isEmpty()) v = commandes.version;
StringBuilder text = new StringBuilder();
text.append(baliseStyle.balise());
text.append("<hr><h1><u>INFORMATIONS</u><h1><hr><br>");
text.append("<hr><h1><u>INFORMATIONS</u></h1><p>Fichier d'analyse créé avec la version : " + v+ "</p><hr><br>");
text.append("<h3>Le titre de l'exercice est : <u>" + commandes.analyse_titre+"</u></h3>");
text.append("<p>Le sujet (metaSujet) est : <b>" + commandes.analyse_metaSujet+"</b></p>");
text.append("<p>L'auteur de l'exercice est : <b>" + commandes.analyse_auteur+"</b></p>");

View File

@ -285,6 +285,9 @@ public class attributs extends JFrame {
for(int i = 0 ; i<Leslabels.size();i++) {
if(listeAttributWriterValeurPasModifiable.isModifiable(Leslabels.get(i).getText())) {Lesvaleurs.get(i).setEnabled(false);}
if(listeAttributWriterPasEvaluableAvecCodeEvaluateur.isEvaluable(Leslabels.get(i).getText())) {Lesevaluer.get(i).setEnabled(false);Lespoints.get(i).setEnabled(false);}
// Important
//exception avec text:section et son attribut text:name qui doit être évaluable
if(nod.getNomElt().equals("text:section") && Leslabels.get(i).getText().equals("text:name")) {Lesvaleurs.get(i).setEnabled(true);Lesevaluer.get(i).setEnabled(true);Lespoints.get(i).setEnabled(true);}
}
//*******************

View File

@ -75,6 +75,7 @@ import fenetres.create_act.actEvaluerStyleFalse;
import fenetres.create_act.actEvaluerStyleTrue;
import fenetres.create_act.actEvaluerTousEnfantsFalse;
import fenetres.create_act.actEvaluerTousEnfantsTrue;
import fenetres.create_act.actEvaluerTousLesStylesParagraphesTrue;
import fenetres.create_act.actExit;
import fenetres.create_act.actExpandAll;
import fenetres.create_act.actExpandNode;
@ -450,7 +451,11 @@ public final class create extends JFrame {
mnPourFeedback.addSeparator();
mnPourFeedback.add(mnAddMenuNiveauSup1);
//Menu Evaluer tous les styles dans une page
JMenu mnEvaluerStylesParagraphes = new JMenu("Evaluer tous les styles des paragraphes.");
mnEvaluerStylesParagraphes.setIcon(new ImageIcon(create.class.getResource("/resources/evaluertouslesstylesparagraphesmini.png")));
mnEvaluerStylesParagraphes.add( new actEvaluerTousLesStylesParagraphesTrue());
//***************************
//** Menu node niveau = 1 ***
@ -524,6 +529,8 @@ public final class create extends JFrame {
mnPopupTree.add(mnEvalNumeroPage);
mnPopupTree.addSeparator();
mnPopupTree.add(mnEvalNumeroAbsoluePage);
mnPopupTree.addSeparator();
mnPopupTree.add(mnEvaluerStylesParagraphes);
}
if(nod.getNomElt().equals("text:user-defined") && nod.chemin().contains("structurepage")) {
mnPopupTree.addSeparator();
@ -660,6 +667,10 @@ public final class create extends JFrame {
toolBarPrincipal.add(buttonLoadFile);
JButton btnNewFichierAnalyse = toolBarPrincipal.add( new actNewFichierAnalyse() );
btnNewFichierAnalyse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnNewFichierAnalyse.setIcon(new ImageIcon(create.class.getResource("/resources/fichierODF.png")));
btnNewFichierAnalyse.setHideActionText(true);
toolBarPrincipal.add(btnNewFichierAnalyse);
@ -672,11 +683,19 @@ public final class create extends JFrame {
toolBarPrincipal.addSeparator();
JButton btnAfficheInformationFichierAnalyse = toolBarPrincipal.add( new actAfficheInformationFichierAnalyse() );
btnAfficheInformationFichierAnalyse.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnAfficheInformationFichierAnalyse.setIcon(new ImageIcon(create.class.getResource("/resources/fichierAnalyseInfo.png")));
btnAfficheInformationFichierAnalyse.setHideActionText(true);
toolBarPrincipal.add(btnAfficheInformationFichierAnalyse);
JButton btnNodeFichier = toolBarPrincipal.add( new actNodeFichier() );
btnNodeFichier.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnNodeFichier.setIcon(new ImageIcon(create.class.getResource("/resources/nodeFichier.png")));
btnNodeFichier.setHideActionText(true);
toolBarPrincipal.add(btnNodeFichier);
@ -732,6 +751,10 @@ public final class create extends JFrame {
JButton btnAttribut = new JButton(new actAttribut());
btnAttribut.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnAttribut.setText("");
btnAttribut.setIcon(new ImageIcon(create.class.getResource("/resources/attribut.png")));
toolBarPrincipal.add(btnAttribut);

View File

@ -0,0 +1,48 @@
package fenetres.create_act;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.swing.AbstractAction;
import javax.swing.Action;
import MEPTL.commandes;
import cXML.node;
public class actEvaluerTousLesStylesParagraphesTrue extends AbstractAction{
/**
*
*/
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Evaluer tous les styles de paragraphe." );
putValue( Action.SHORT_DESCRIPTION, "Evaluer tous les style:name des paragraphes text:p" );
}
@Override
public void actionPerformed(ActionEvent e) {
node nod = (node) fenetres.create.getSelectNode().getUserObject();
for(int i =0 ; i < nod.getNodes().size(); i++) {
if(nod.getNodes().get(i).getNomElt().equals("text:p")) {
nod.getNodes().get(i).getAttributs().put("analyseStyle", "true");
nod.getNodes().get(i).getAttributs().put("evaluer", "true");
//***************************************************************************************************************
//** Place l'attribut EvaluerATraversAnalyseStyle=true au style qui doit être évaluer à travers d'analyseStyle **
//** S'il y a des attributs évaluer avec alors change par **
//***************************************************************************************************************
node nodStyle = commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nod.getNodes().get(i).getAttributs().get("text:style-name"));
if(nodStyle!=null) {
nodStyle.getAttributs().put("EvaluerATraversAnalyseStyle", "true");
nodStyle.evaluerTrue();
nodStyle.changeLesCodesEvaluateursVersCodeATraversAnalyseStyle();
}
}
}
fenetres.create.getTree().repaint();
}
}

View File

@ -67,6 +67,13 @@ public class actNewFichierAnalyse extends AbstractAction{
commandes.sujet = ecritureSujet.nodePourEcritureSujet(commandes.sujet,b,0);
// try {
// Run.ecritureNodeEnXML(commandes.sujet , commandes.nameSujet+".xml",commandes.path,"Sujet");
// } catch (IOException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes");

View File

@ -364,6 +364,10 @@ public class evaluate extends JFrame {
toolBar.addSeparator();
JButton btnEvaluerLesFichiers = toolBar.add(actEvaluate);
btnEvaluerLesFichiers.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
btnEvaluerLesFichiers.setHideActionText(true);
JButton btnFichierCSV = toolBar.add(actChargeListeEtudiantCSV );

View File

@ -25,15 +25,6 @@ public class evaluerLesFichiersEtudiants implements Runnable{
public evaluerLesFichiersEtudiants(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.txt=txt;
this.txt.setContentType("text/plain");
}
@ -161,7 +152,15 @@ public class evaluerLesFichiersEtudiants implements Runnable{
} catch (IOException e1) {
e1.printStackTrace();
}
//a.ecritureNodeEnXML(nodStudent, a.getLectDossiers().getEC().getListeNomDossier().get(i),"",false,""); //écriture du node de l'étudiant
//Ecriture du node fichier de l'étudiant
// try {
// Run.ecritureNodeEnXML(nodStudent, a.getLectDossiers().getEC().getListeNomDossier().get(i),commandes.path,"Sujet");
// } catch (IOException e1) {
// // TODO Auto-generated catch block
// e1.printStackTrace();
// }
//**********************************
//** Analyse des fichiers student **

View File

@ -77,6 +77,8 @@ public class filechooserXML extends JFileChooser {
//node.node2(targetString);
commandes.sujet = new node(targetString.toString().replace("\t","").replace("\r", "").replace("\n", ""));
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start"); //historique des modification
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes");

View File

@ -39,7 +39,7 @@ public class descriptionNode {
if(nameNode.equals("sections")) descriptionNode = descriptionNode + "<p>C'est le node parent de tous les nodes contenant les section dans le document.<br>"
+ "Si ce node est évalué alors il apparaîtra dans les feedbacks des étudiants comme une partie principale avec un lien de menu.</p>";
if(nameNode.equals("page")) descriptionNode = descriptionNode + "<p>Ce node est celui d'une page. Il contient les paragarphes, les images, etc...</p>";
if(nameNode.equals("page")) descriptionNode = descriptionNode + "<p>Ce node est celui d'une page dans la structure du document. Il contient les paragraphes, les images, les sections, ...</p>";
@ -49,6 +49,11 @@ public class descriptionNode {
if(nameNode.equals("text:line-break")) descriptionNode = descriptionNode + "<p>Ce node est celui d'un retour à la ligne.</p>";
if(nameNode.equals("style:paragraph-properties")) descriptionNode = descriptionNode + "<p>Ce node tous les propriétés concernant le paragraphe.</p>";
if(nameNode.equals("style:text-properties")) descriptionNode = descriptionNode + "<p>Ce node tous les formats concernant le texte du paragraphe.</p>";
if(nameNode.equals("loext:graphic-properties")) descriptionNode = descriptionNode + "<p>Spécifie les propriétés de mise en forme des éléments de graphique, de dessin, de graphique et de cadre.</p>";
if(nameNode.equals("style:style")) descriptionNode = descriptionNode + "<p>Spécifie les propriétés de mise en forme des styles des paragraphes, des caractères, des formatages directs.</p>";
if(nameNode.equals("style:master-page")) descriptionNode = descriptionNode + "<p>Spécifie les propriétés de mise en forme d'une page.</p>";
if(nameNode.equals("text:section")) descriptionNode = descriptionNode + "<p>Spécifie le nom de la section, la condition de masquage, le contenu textuel, ...</p>";
if(nameNode.equals("text:span")) descriptionNode = descriptionNode + "<p>Formatage local des caractères, vous pouvez analyser le style Tx.</p>";
return descriptionNode;

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 914 B