MAJ restructuration des packages

This commit is contained in:
pablo rodriguez 2022-06-16 16:45:48 +02:00
parent 4dc71a239b
commit 4507b65fe9
108 changed files with 1458 additions and 1163 deletions

Binary file not shown.

Binary file not shown.

5
bin/.gitignore vendored
View File

@ -8,3 +8,8 @@
/piedpagenon.png
/piedpagenon.svg
/piedpagenonmini.png
/list/
/evalnamesequence.png
/evalnamesequence.svg
/evalnamesequencemini.png
/evaluer/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
icons/evalnamesequence.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 991 B

318
icons/evalnamesequence.svg Normal file
View File

@ -0,0 +1,318 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="C:\Users\pabr6\git\analyseWriter\MEPTL\icons\evalnamesequence.png"
sodipodi:docname="evalnamesequence.svg"
inkscape:version="1.1.2 (b8e25be833, 2022-02-05)"
id="svg8"
version="1.1"
viewBox="0 0 12.7 12.7"
height="48"
width="48"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:xlink="http://www.w3.org/1999/xlink"
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">
<linearGradient
id="k"
gradientTransform="matrix(7.99974,0,0,7.9977797,-863.30581,-7811.3988)"
gradientUnits="userSpaceOnUse"
x1="122.75008"
x2="111.74973"
xlink:href="#b"
y1="991.62115"
y2="977.11713" />
<linearGradient
id="b">
<stop
offset="0"
stop-color="#0369a3"
id="stop7" />
<stop
offset="1"
stop-color="#1c99e0"
id="stop9" />
</linearGradient>
<linearGradient
id="j"
gradientUnits="userSpaceOnUse"
x1="108.00134"
x2="20.001341"
y1="122"
y2="6"
gradientTransform="translate(10.661607,-2.6314354)">
<stop
offset="0"
stop-color="#e6e6e6"
id="stop35" />
<stop
offset="1"
stop-color="#fff"
id="stop37" />
</linearGradient>
<linearGradient
id="i"
gradientUnits="userSpaceOnUse"
x1="108.00134"
x2="20.001341"
xlink:href="#b"
y1="130"
y2="14"
gradientTransform="translate(12)" />
<linearGradient
id="h"
gradientTransform="matrix(4.4999,0,0,3.66665,-930.97741,2199.6564)"
gradientUnits="userSpaceOnUse"
x2="0"
y1="-581.63782"
y2="-578.63782">
<stop
offset="0"
stop-color="#63bbee"
id="stop29" />
<stop
offset="1"
stop-color="#aadcf7"
id="stop31" />
</linearGradient>
<linearGradient
id="g"
gradientTransform="matrix(-4.19983,0,0,3.9111,1552.9405,-4523.1636)"
gradientUnits="userSpaceOnUse"
x2="0"
xlink:href="#a"
y1="1173"
y2="1178" />
<linearGradient
id="a">
<stop
offset="0"
stop-color="#666"
id="stop2" />
<stop
offset="1"
stop-color="#333"
id="stop4" />
</linearGradient>
<linearGradient
id="f"
gradientTransform="matrix(4.19983,0,0,3.9111,-1380.9394,-4521.9436)"
gradientUnits="userSpaceOnUse"
x2="0"
xlink:href="#a"
y1="1173"
y2="1178" />
<linearGradient
id="e"
gradientTransform="matrix(1.19997,0,0,1.22222,-269.19161,858.5534)"
gradientUnits="userSpaceOnUse"
x2="0"
y1="-629.66907"
y2="-635.54944">
<stop
offset="0"
stop-color="#18a303"
id="stop22" />
<stop
offset="1"
stop-color="#106802"
id="stop24" />
</linearGradient>
<linearGradient
id="d"
gradientTransform="matrix(4.19983,0,0,3.9111,-1380.9394,-4517.0536)"
gradientUnits="userSpaceOnUse"
x2="0"
y1="1173"
y2="1178">
<stop
offset="0"
stop-color="#0369a3"
id="stop17" />
<stop
offset="1"
stop-color="#023f62"
id="stop19" />
</linearGradient>
<linearGradient
id="c"
gradientTransform="matrix(0,0.791084,-1.28,0,1511.6005,-282.0136)"
gradientUnits="userSpaceOnUse"
x1="445.69522"
x2="441.38797"
y1="1103.5776"
y2="1099.8198">
<stop
offset="0"
stop-color="#e9b913"
id="stop12" />
<stop
offset="1"
stop-color="#ff0"
id="stop14" />
</linearGradient>
<linearGradient
id="k-5"
gradientTransform="matrix(7.3290847,0,0,7.3272888,-782.49722,-7149.5485)"
gradientUnits="userSpaceOnUse"
x1="122.75008"
x2="111.74973"
xlink:href="#b"
y1="991.62115"
y2="977.11713" />
</defs>
<sodipodi:namedview
inkscape:window-maximized="1"
inkscape:window-y="-8"
inkscape:window-x="-8"
inkscape:window-height="1009"
inkscape:window-width="1920"
inkscape:guide-bbox="true"
showguides="true"
units="px"
showgrid="false"
inkscape:document-rotation="0"
inkscape:current-layer="g14476"
inkscape:document-units="mm"
inkscape:cy="-19.88752"
inkscape:cx="-87.199126"
inkscape:zoom="1.9610288"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
borderopacity="1.0"
bordercolor="#666666"
pagecolor="#ffffff"
id="base"
inkscape:pagecheckerboard="0"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
inkscape:snap-midpoints="true"
inkscape:object-paths="true"
inkscape:snap-global="true">
<sodipodi:guide
position="-26.994731,11.64171"
orientation="0.70710678,-0.70710678"
id="guide1406" />
<sodipodi:guide
position="-26.994731,11.64171"
orientation="-0.70710678,-0.70710678"
id="guide1408" />
<sodipodi:guide
position="-17.088584,14.205202"
orientation="1,0"
id="guide1429" />
<sodipodi:guide
position="-12.345242,31.386514"
orientation="0,-1"
id="guide2283" />
</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"
transform="translate(-1.1301771,-2.0290664)">
<g
id="g941"
transform="translate(10.112644,5.4757388)">
<g
id="g14476"
transform="matrix(0.09394189,0,0,0.09394189,8.4128076,3.1183643)">
<g
id="g5418"
transform="translate(-0.00235905,280.45744)"
style="fill:#008080" />
<g
id="g7902"
transform="matrix(0.17079764,0,0,0.17079764,-80.837441,6.6639784)">
<rect
style="fill:#00ff00;fill-opacity:1;stroke:#000000;stroke-width:8.14334;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
id="rect5408"
width="733.90546"
height="180.24489"
x="-576.65417"
y="-355.08484"
ry="53.224285"
transform="translate(-0.00235842,280.45743)" />
<path
id="path5410"
style="fill:#00ff00;fill-opacity:1;stroke:#000000;stroke-width:1.95101;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
d="m -120.57031,-101.73242 c -10.46929,0 -18.89844,8.429144 -18.89844,18.898436 v 49.392578 L -102.02734,4 -64.585938,-33.441406 v -49.392578 c 0,-10.469292 -8.429146,-18.898436 -18.898437,-18.898436 z"
transform="matrix(2.8164574,0,0,2.8164574,-185.17294,210.57342)" />
<path
style="fill:#008080;stroke:#000000;stroke-width:38.3216;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m -316.58418,-268.79969 c 20.107,0 389.214046,0 389.214046,0"
id="path5412"
transform="translate(-0.00235842,280.45743)" />
<text
xml:space="preserve"
style="font-size:211.128px;line-height:1.25;font-family:pop;-inkscape-font-specification:pop;text-align:center;text-anchor:middle;fill:#000000;stroke-width:3.95865"
x="-464.28439"
y="-178.92361"
id="text5416"
transform="matrix(1.0477567,0,0,0.95442005,-0.00235842,280.45743)"><tspan
sodipodi:role="line"
id="tspan5414"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:211.128px;font-family:pop;-inkscape-font-specification:'pop Bold';fill:#000000;stroke-width:3.95865"
x="-464.28439"
y="-178.92361">2</tspan></text>
<g
id="g5406"
style="fill:#008000">
<rect
style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:8.14334;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
id="rect2066"
width="733.90546"
height="180.24489"
x="-576.65417"
y="-355.08484"
ry="53.224285" />
<path
id="rect1214"
style="fill:#ffff00;fill-opacity:1;stroke:#000000;stroke-width:1.95101;stroke-linecap:round;stroke-linejoin:round;paint-order:fill markers stroke;stop-color:#000000"
d="m -120.57031,-101.73242 c -10.46929,0 -18.89844,8.429144 -18.89844,18.898436 v 49.392578 L -102.02734,4 -64.585938,-33.441406 v -49.392578 c 0,-10.469292 -8.429146,-18.898436 -18.898437,-18.898436 z"
transform="matrix(2.8164574,0,0,2.8164574,-185.17058,-69.884018)" />
<path
style="fill:#008000;stroke:#000000;stroke-width:38.3216;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m -316.58418,-268.79969 c 20.107,0 389.214046,0 389.214046,0"
id="path2318" />
<text
xml:space="preserve"
style="font-size:211.128px;line-height:1.25;font-family:pop;-inkscape-font-specification:pop;text-align:center;text-anchor:middle;fill:#000000;stroke-width:3.95865"
x="-464.28439"
y="-178.92361"
id="text3829"
transform="scale(1.0477567,0.95442006)"><tspan
sodipodi:role="line"
id="tspan3827"
style="font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;font-size:211.128px;font-family:pop;-inkscape-font-specification:'pop Bold';fill:#000000;stroke-width:3.95865"
x="-464.28439"
y="-178.92361">1</tspan></text>
</g>
</g>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 608 B

View File

@ -5,6 +5,7 @@ import java.util.ArrayList;
import cXML.node;
import evaluer.evaluation;
/**
*
@ -264,12 +265,12 @@ public class HTML {
String Tst = nod.getNodes().get(k).getAttributs().get("resultat");
String Key = outils.traduction.get(nod.getNodes().get(k).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut")));
String Key = evaluation.traduction.get(nod.getNodes().get(k).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut")));
if(Key==null) Key = nod.getNodes().get(k).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut"));
if(Key==null) Key = nod.getNodes().get(k).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("attribut"));
String valueStudent = nod.getNodes().get(k).getAttributs().get("valueStudent");
String valueSujet = outils.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("valueSujet"));
String valueSujet = evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getAttributs().get("valueSujet"));
int niveau = Integer.valueOf(nod.getNodes().get(k).getAttributs().get("niveau"));
code = code + HTML.Table(Tst, Key, valueStudent, valueSujet, niveau);
@ -284,10 +285,10 @@ public class HTML {
if(!nod.getNodes().get(k).getNodes().get(l).getNomElt().equals("saut")){
String Tst = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("resultat");
String Key2 = outils.traduction.get(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut")));
if(Key2==null) Key2 = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut"));
String Key2 = evaluation.traduction.get(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut")));
if(Key2==null) Key2 = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("elt") + " " + evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("attribut"));
String valueStudent = nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueStudent");
String valueSujet = outils.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueSujet"));
String valueSujet = evaluation.withoutCodeAndPoint(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("valueSujet"));
int niveau = Integer.valueOf(nod.getNodes().get(k).getNodes().get(l).getAttributs().get("niveau"));
code = code + HTML.Table(Tst, Key2, valueStudent, valueSujet, niveau);
@ -344,7 +345,7 @@ public class HTML {
T1=T1+T.get(i)+"<br/>\r";
}
for(int i=0; i<S.size(); i++) {
T2=T2+outils.withoutPoint(S.get(i))+"<br/>\r";
T2=T2+evaluation.withoutPoint(S.get(i))+"<br/>\r";
}
String color = "#32cd32"; //vert

View File

@ -345,7 +345,8 @@ public class ecritureSujet {
* @return
*/
public static boolean listeDesNodesByRecherche(String nameNode) {
if(nameNode.contains("text:")) return true;
if(nameNode.contains("text:p")) return true;
if(nameNode.contains("text:span")) return true;
if(nameNode.equals("draw:text-box")) return true;
return false;
}

View File

@ -10,27 +10,19 @@ import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
//import java.text.DateFormat;
import java.text.DecimalFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
//import java.time.LocalDateTime;
//import java.time.format.DateTimeFormatter;
//import java.time.format.FormatStyle;
import java.util.ArrayList;
import java.util.Date;
import java.util.Dictionary;
import java.util.Enumeration;
import java.util.Hashtable;
//import java.util.regex.Matcher;
import java.util.regex.Pattern;
import javax.xml.parsers.ParserConfigurationException;
import org.xml.sax.SAXException;
import cXML.node;
import calcul.listeAttributsAnalyseWriter;
import calcul.formatDateWriter;
import evaluer.analyseFichier;
import evaluer.evaluation;
import cXML.Run;
import cXML.Run.UserStatus;
import net.lingala.zip4j.exception.ZipException;
@ -255,7 +247,7 @@ public class meptl {
if(!verificationFichierAnalyse.erreur) {
// Run.ecritureNodeEnXML(nodStudent, "fichier student","",false,""); //écriture du node nodStudent de l'étudiant
node ana = analyse(nodStudent, commandes.sujet, i, a);
node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a);
//**************************************************
//** Ecriture des fichiers d'analyse des students **
@ -274,15 +266,7 @@ public class meptl {
}
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, false), retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),commandes.analyse_size,commandes.analyse_nameZip);
a.AddStreamToZip(feedbacks.feedback(ana, verif, true, false), retourneLeNomDuFeedback(a.getLectDossiers().getEC().getListeNomFichierFeedBack().get(i),ana, verif),commandes.analyse_size,commandes.analyse_nameZip);
} catch (ZipException e) {
e.printStackTrace();
} catch (IOException e) {
@ -560,11 +544,7 @@ public class meptl {
nodstyleparagraphe.addNode(a.NodesAyantAttribut(nodstyle, "style:family","text"));
nodstyleparagraphe = ajouteValeurLesValeursDuStyleParagraphParent(nodstyleparagraphe);
nodstyleparagraphe = ajouteValeurParDefautAuStyleParagraph(nodstyleparagraphe);
// // le node des styles de formatage direct
// node nodstyleformatage = new node();
// nodstyleformatage.setNomElt("style:formatagedirect");
// nodstyleformatage.addNode(a.NodesAyantAttribut(nodstyle, "style:family","text")); //c'est redondant puisque déjà présent dans style:paragraph
//Le node numérotation des chapitres
node nodnumerochapitre = new node();
@ -1183,7 +1163,7 @@ public class meptl {
//***********************************************************************
//** chargement du node translation qui se trouve dans le node setting **
//***********************************************************************
outils.chargeTraduction(commandes.sujet.retourneFirstEnfantsByName("translation"));
evaluation.chargeTraduction(commandes.sujet.retourneFirstEnfantsByName("translation"));
//************************************************
//** Charge les nouvelles tolérances pour texte **
@ -1325,7 +1305,7 @@ public class meptl {
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);
node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a);
//**************************************************
//** Ecriture des fichiers d'analyse des students **
@ -1393,155 +1373,6 @@ public class meptl {
}
/**
* Début de l'analyse par comparaison du node étudiant avec le node sujet.
* @param nodStudent, le node étudiant.
* @param nodSujet, le node sujet.
* @param indexStudent, index de l'étudiant
* @param a, objet Run de la class cXML
* @return le node analyse contenant toute l'analyse.
*/
public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) {
// initialisation des nodes d'analyse
node erreurs = new node();
node nodmeta = new node();
node nodpage = new node();
node nodparagraph = new node();
node nodsequence = new node();
node nodnumerochapitre = new node();
node nodframes = new node();
node nodsections = new node();
node nodtableaux = new node();
node nodbiblio = new node();
node nodtablematieres = new node();
node nodtableillustrations = new node();
node nodstructurepage = new node();
// ouverture
node nodouverture = new node();
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(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"));
if(nodStudent.getAttributs().get("dateModification")!=null) nodouverture.getAttributs().put("dateModification", nodStudent.getAttributs().get("dateModification"));
nodouverture.getAttributs().put("patch", a.getPatch());
if(nodSujet.getAttributs().get("historiquePresent")!=null) nodouverture.getAttributs().put("historiquePresent", nodSujet.getAttributs().get("historiquePresent"));
if(nodSujet.getAttributs().get("controleDateCreation")!=null) nodouverture.getAttributs().put("controleDateCreation", nodSujet.getAttributs().get("controleDateCreation"));
if(nodSujet.getAttributs().get("presenceMetaSujet")!=null) nodouverture.getAttributs().put("presenceMetaSujet", nodSujet.getAttributs().get("presenceMetaSujet"));
if(nodSujet.getAttributs().get("baremeABC")!=null) nodouverture.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC"));
nodouverture.setClose(true);
//Body et note (par défaut valeur nulle)
node nodbodyetnotation = new node();
nodbodyetnotation.setNomElt("bodyetnotation");
nodbodyetnotation.getAttributs().put("note", "0");
nodbodyetnotation.getAttributs().put("commentaire", "");
nodbodyetnotation.getAttributs().put("proportioncorrect", "0");
nodbodyetnotation.getAttributs().put("baremeABC", "false");
if(nodSujet.getAttributs().get("baremeABC")!=null) nodbodyetnotation.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC"));
nodbodyetnotation.setClose(true);
//Le menu
node nodmenu = new node();
nodmenu.setNomElt("menu");
nodmenu = retourneNodeMenu(nodSujet, nodmenu, 0, 0);
nodmenu.setClose(true);
// verification de la métadonnées Sujet
erreurs = retourneNodeErreur(nodStudent, nodSujet, a);
// verification si au moins une erreur alors l'analyse est terminée
if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))){
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage, nodSujet.getContenu().get(0));
}
// analyse Meta
if(nodSujet.retourneFirstEnfantsByName("office:meta").getNomElt().equals("office:meta")) {
nodmeta = analyseLesNodesPrincipaux.analyseLesMeta(nodStudent.retourneFirstEnfantsByName("office:meta"), nodSujet.retourneFirstEnfantsByName("office:meta"), a, nodmenu);
}
// analyse les pages (nécessaire d'avoir aussi les styles de paragraphes)
if(nodSujet.retourneFirstEnfantsByName("style:page").getNomElt().equals("style:page")) {
if(nodSujet.containElementByName("style:paragraph")) {
nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,nodSujet.retourneFirstEnfantsByName("style:paragraph"),nodStudent.retourneFirstEnfantsByName("style:paragraph"));
}else {
nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,null,null);
}
}
// analyse les paragraphes
if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) {
nodparagraph = analyseLesNodesPrincipaux.analyseParagraph(nodStudent.retourneFirstEnfantsByName("style:paragraph"), nodSujet.retourneFirstEnfantsByName("style:paragraph"), a, nodmenu);
}
// analyse les variables de séquence
if(nodSujet.retourneFirstEnfantsByName("sequences").getNomElt().equals("sequences")) {
nodsequence = analyseLesNodesPrincipaux.analyseLesSequences(nodStudent.retourneFirstEnfantsByName("sequences"), nodSujet.retourneFirstEnfantsByName("sequences"), a, nodmenu);
}
// analyse de la numérotation des chapitres
if(nodSujet.retourneFirstEnfantsByName("numerotationchapitre").getNomElt().equals("numerotationchapitre")) {
nodnumerochapitre = analyseLesNodesPrincipaux.analyseLaNumerotationChapitre(nodStudent.retourneFirstEnfantsByName("numerotationchapitre"), nodSujet.retourneFirstEnfantsByName("numerotationchapitre"), a, nodmenu);
}
// analyse les frames
if(nodSujet.retourneFirstEnfantsByName("frames").getNomElt().equals("frames")) {
nodframes = analyseLesNodesPrincipaux.analyseLesFrames(nodStudent.retourneFirstEnfantsByName("frames"), nodSujet.retourneFirstEnfantsByName("frames"), a, nodmenu);
}
// analyse des sections
if(nodSujet.retourneFirstEnfantsByName("sections").getNomElt().equals("sections")) {
nodsections = analyseLesNodesPrincipaux.analyseLesSections(nodStudent.retourneFirstEnfantsByName("sections"), nodSujet.retourneFirstEnfantsByName("sections"), a, nodmenu);
}
// analyse les tableaux
if(nodSujet.retourneFirstEnfantsByName("tableaux").getNomElt().equals("tableaux")) {
nodtableaux = analyseLesNodesPrincipaux.analyseLesTableaux(nodStudent.retourneFirstEnfantsByName("tableaux"), nodSujet.retourneFirstEnfantsByName("tableaux"), a, nodmenu);
}
// analyse la bibliographie de LibreOffice
if(nodSujet.retourneFirstEnfantsByName("biblio").getNomElt().equals("biblio")) {
nodbiblio = analyseLesNodesPrincipaux.analyseLaBiblio(nodStudent.retourneFirstEnfantsByName("biblio"), nodSujet.retourneFirstEnfantsByName("biblio"), a, nodmenu);
}
// analyse des tables des matières
if(nodSujet.retourneFirstEnfantsByName("tablematieres").getNomElt().equals("tablematieres")) {
nodtablematieres = analyseLesNodesPrincipaux.analyseLesTablesMatieres(nodStudent.retourneFirstEnfantsByName("tablematieres"), nodSujet.retourneFirstEnfantsByName("tablematieres"), a, nodmenu);
}
// analyse des tables illustrations
if(nodSujet.retourneFirstEnfantsByName("tableillustrations").getNomElt().equals("tableillustrations")) {
nodtableillustrations = analyseLesNodesPrincipaux.analyseLesTablesIllustrations(nodStudent.retourneFirstEnfantsByName("tableillustrations"), nodSujet.retourneFirstEnfantsByName("tableillustrations"), a, nodmenu);
}
// analyse la structure du document
if(nodSujet.retourneFirstEnfantsByName("structurepage").getNomElt().equals("structurepage")) {
node nodSujetParagraphs = null;
if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) nodSujetParagraphs = nodSujet.retourneFirstEnfantsByName("style:paragraph");
node nodStudentParagraphs = nodStudent.retourneFirstEnfantsByName("style:paragraph");
nodstructurepage = analyseLesNodesPrincipaux.analyseStructurePage(nodStudent.retourneFirstEnfantsByName("structurepage"), nodSujet.retourneFirstEnfantsByName("structurepage"), a, nodmenu,nodSujetParagraphs, nodStudentParagraphs );
}
// retourne le node analyse assemblé et calcul de la note avec le barème
if(nodSujet.getContenu().size()>0) {
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,nodSujet.getContenu().get(0));
}else {
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,"");
}
}
/**
* Les erreurs dans le fichier étudiant : erreur de métadonnées Sujet, date de création pour identifier le fichier à analyser.
@ -1649,9 +1480,6 @@ public class meptl {
erreurs.getAttributs().put("manqueHistorique", "false");
manqueHistorique = false;
}
if( manqueMetaSujet == false && manqueValeurMetaSujet == false && manqueCreationDate == false && manqueValeurCreationDate == false
&& manqueHistorique == false && manqueInitialCreator == false) {
@ -1660,530 +1488,14 @@ public class meptl {
erreurs.getAttributs().put("oneError", "true");
}
erreurs.setClose(true);
return erreurs;
}
/**
* Assemblage du node annalyse à partir des différents nodes de l'analyse.<br>
* <br>
* @param nodouverture
* @param nodbodyetnotation
* @param nodmenu
* @param erreurs
* @param nodmeta
* @param nodpage
* @param nodparagraph
* @param nodsequence
* @param nodnumerochapitre
* @param nodframes
* @param nodsections
* @param nodtableaux
* @param nodbiblio
* @param nodtablematieres
* @param nodtableillustrations
* @param nodstructurepage
* @return
*/
public static node clotureNodeAnalyse(node nodouverture, node nodbodyetnotation, node nodmenu, node erreurs, node nodmeta, node nodpage,
node nodparagraph, node nodsequence, node nodnumerochapitre, node nodframes, node nodsections, node nodtableaux, node nodbiblio, node nodtablematieres,
node nodtableillustrations, node nodstructurepage, String texteCommentaire) {
node nodanalyse = new node();
//recalcul les points pour les placer dans le node nodbodyetnotation
double notefrom = 20; // valeur par défaut
double progression = 1; // valeur par défaut
boolean baremeABC = false;
if(nodouverture!=null) if(nodouverture.isClose()) {
if(nodouverture.getAttributs().get("notefrom")!=null) {
try {
notefrom = Math.abs(Double.valueOf(nodouverture.getAttributs().get("notefrom")));
}catch (Exception e) {
System.out.println("The \"noteFrom\" attribute of the analyze file cannot be converted to a \"double\".");
System.out.println("Value of notefrom = 20.");
}
}
if(nodouverture.getAttributs().get("progression")!=null) {
try {
progression = Math.abs(Double.valueOf(nodouverture.getAttributs().get("progression")));
}catch (Exception e) {
System.out.println("The \"progression\" attribute of the analyze file cannot be converted to \"double\".");
System.out.println("Value of progression = 1.");
}
}
if(nodouverture.getAttributs().get("baremeABC")!=null) {
try {
baremeABC = Boolean.valueOf(nodouverture.getAttributs().get("baremeABC"));
}catch (Exception e) {
System.out.println("The \"baremeABC\" attribute of the analyze file cannot be converted to \"boolean\".");
System.out.println("Value of baremeABC = false.");
}
}
}
double pointmeta = 0; double pointmetatotal = 0 ; double poidsmeta = 0;
if(nodmeta!=null) if(nodmeta.isClose()) {
if(nodmeta.getAttributs().get("pointgagner")!=null) pointmeta = Double.valueOf(nodmeta.getAttributs().get("pointgagner"));
if(nodmeta.getAttributs().get("pointtotal")!=null) pointmetatotal = Double.valueOf(nodmeta.getAttributs().get("pointtotal"));
if(nodmeta.getAttributs().get("poids")!=null) try{poidsmeta = Math.abs(Double.valueOf(nodmeta.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointpage = 0; double pointpagetotal = 0 ; double poidspage = 0;
if(nodpage!=null) if(nodpage.isClose()) {
if(nodpage.getAttributs().get("pointgagner")!=null) pointpage = Double.valueOf(nodpage.getAttributs().get("pointgagner"));
if(nodpage.getAttributs().get("pointtotal")!=null) pointpagetotal = Double.valueOf(nodpage.getAttributs().get("pointtotal"));
if(nodpage.getAttributs().get("poids")!=null) try{poidspage = Math.abs(Double.valueOf(nodpage.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointparagraph = 0; double pointparagraphtotal = 0 ; double poidsparagraph = 0;
if(nodparagraph!=null) if(nodparagraph.isClose()) {
if(nodparagraph.getAttributs().get("pointgagner")!=null) pointparagraph = Double.valueOf(nodparagraph.getAttributs().get("pointgagner"));
if(nodparagraph.getAttributs().get("pointtotal")!=null) pointparagraphtotal = Double.valueOf(nodparagraph.getAttributs().get("pointtotal"));
if(nodparagraph.getAttributs().get("poids")!=null) try{Math.abs(poidsparagraph = Double.valueOf(nodparagraph.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointsequence = 0; double pointsequencetotal = 0 ; double poidssequence = 0;
if(nodsequence!=null) if(nodsequence.isClose()) {
if(nodsequence.getAttributs().get("pointgagner")!=null) pointsequence = Double.valueOf(nodsequence.getAttributs().get("pointgagner"));
if(nodsequence.getAttributs().get("pointtotal")!=null) pointsequencetotal = Double.valueOf(nodsequence.getAttributs().get("pointtotal"));
if(nodsequence.getAttributs().get("poids")!=null) try{poidssequence = Math.abs(Double.valueOf(nodsequence.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointnumerotation = 0; double pointnumerotationtotal = 0 ; double poidsnumerotation = 0;
if(nodnumerochapitre!=null) if(nodnumerochapitre.isClose()) {
if(nodnumerochapitre.getAttributs().get("pointgagner")!=null) pointnumerotation = Double.valueOf(nodnumerochapitre.getAttributs().get("pointgagner"));
if(nodnumerochapitre.getAttributs().get("pointtotal")!=null) pointnumerotationtotal = Double.valueOf(nodnumerochapitre.getAttributs().get("pointtotal"));
if(nodnumerochapitre.getAttributs().get("poids")!=null) try{poidsnumerotation = Math.abs(Double.valueOf(nodnumerochapitre.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointframe = 0; double pointframetotal = 0 ; double poidsframe = 0;
if(nodframes!=null) if(nodframes.isClose()) {
if(nodframes.getAttributs().get("pointgagner")!=null) pointframe = Double.valueOf(nodframes.getAttributs().get("pointgagner"));
if(nodframes.getAttributs().get("pointtotal")!=null) pointframetotal = Double.valueOf(nodframes.getAttributs().get("pointtotal"));
if(nodframes.getAttributs().get("poids")!=null) try{poidsframe = Math.abs(Double.valueOf(nodframes.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointsection = 0; double pointsectiontotal = 0 ; double poidssection = 0;
if(nodsections!=null) if(nodsections.isClose()) {
if(nodsections.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodsections.getAttributs().get("pointgagner"));
if(nodsections.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodsections.getAttributs().get("pointtotal"));
if(nodsections.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodsections.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtableau = 0; double pointtableautotal = 0 ; double poidstableau = 0;
if(nodtableaux!=null) if(nodtableaux.isClose()) {
if(nodtableaux.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodtableaux.getAttributs().get("pointgagner"));
if(nodtableaux.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodtableaux.getAttributs().get("pointtotal"));
if(nodtableaux.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodtableaux.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointbiblio = 0; double pointbibliototal = 0 ; double poidsbiblio = 0;
if(nodbiblio!=null) if(nodbiblio.isClose()) {
if(nodbiblio.getAttributs().get("pointgagner")!=null) pointbiblio = Double.valueOf(nodbiblio.getAttributs().get("pointgagner"));
if(nodbiblio.getAttributs().get("pointtotal")!=null) pointbibliototal = Double.valueOf(nodbiblio.getAttributs().get("pointtotal"));
if(nodbiblio.getAttributs().get("poids")!=null) try{poidsbiblio = Math.abs(Double.valueOf(nodbiblio.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtablematieres = 0; double pointtablematierestotal = 0 ; double poidstablematieres = 0;
if(nodtablematieres!=null) if(nodtablematieres.isClose()) {
if(nodtablematieres.getAttributs().get("pointgagner")!=null) pointtablematieres = Double.valueOf(nodtablematieres.getAttributs().get("pointgagner"));
if(nodtablematieres.getAttributs().get("pointtotal")!=null) pointtablematierestotal = Double.valueOf(nodtablematieres.getAttributs().get("pointtotal"));
if(nodtablematieres.getAttributs().get("poids")!=null) try{poidstablematieres = Math.abs(Double.valueOf(nodtablematieres.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtableillustration = 0; double pointtableillustrationtotal = 0 ; double poidstableillustration = 0;
if(nodtableillustrations!=null) if(nodtableillustrations.isClose()) {
if(nodtableillustrations.getAttributs().get("pointgagner")!=null) pointtableillustration = Double.valueOf(nodtableillustrations.getAttributs().get("pointgagner"));
if(nodtableillustrations.getAttributs().get("pointtotal")!=null) pointtableillustrationtotal = Double.valueOf(nodtableillustrations.getAttributs().get("pointtotal"));
if(nodtableillustrations.getAttributs().get("poids")!=null) try{poidstableillustration = Math.abs(Double.valueOf(nodtableillustrations.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointstructure = 0; double pointstructuretotal = 0 ; double poidsstructure = 0;
if(nodstructurepage!=null) if(nodstructurepage.isClose()) {
if(nodstructurepage.getAttributs().get("pointgagner")!=null) pointstructure = Double.valueOf(nodstructurepage.getAttributs().get("pointgagner"));
if(nodstructurepage.getAttributs().get("pointtotal")!=null) pointstructuretotal = Double.valueOf(nodstructurepage.getAttributs().get("pointtotal"));
if(nodstructurepage.getAttributs().get("poids")!=null) try{poidsstructure = Math.abs(Double.valueOf(nodstructurepage.getAttributs().get("poids")));}catch (Exception e) { };
}
double proportionCorrect = 0 ;
double poidsTotal = 0;
double pointsTotal = 0;
double pointgagner = 0;
double note = 0 ;
proportionCorrect = (poidsmeta*pointmeta + poidspage*pointpage + poidsparagraph*pointparagraph + poidssequence*pointsequence + poidsnumerotation*pointnumerotation + poidsframe*pointframe + poidsbiblio*pointbiblio + poidstablematieres*pointtablematieres + poidstableillustration*pointtableillustration + poidsstructure*pointstructure + poidssection*pointsection + poidstableau*pointtableau)
/ (poidsmeta*pointmetatotal + poidspage*pointpagetotal + poidsparagraph*pointparagraphtotal + poidssequence*pointsequencetotal + poidsnumerotation*pointnumerotationtotal + poidsframe*pointframetotal + poidsbiblio*pointbibliototal + poidstablematieres*pointtablematierestotal + poidstableillustration*pointtableillustrationtotal + poidsstructure*pointstructuretotal + poidssection*pointsectiontotal + poidstableau*pointtableautotal);
poidsTotal = poidsmeta + poidspage + poidsparagraph + poidssequence + poidsnumerotation + poidsframe + poidsbiblio + poidstablematieres + poidstableillustration + poidsstructure + poidssection + poidstableau;
pointsTotal = pointmetatotal + pointpagetotal + pointparagraphtotal + pointsequencetotal + pointnumerotationtotal + pointframetotal + pointbibliototal + pointtablematierestotal + pointtableillustrationtotal + pointstructuretotal + pointsectiontotal;
pointgagner = pointmeta + pointpage + pointparagraph + pointsequence + pointnumerotation + pointframe + pointsection + pointtableau + pointbiblio + pointtablematieres + pointtableillustration + pointstructure;
note = Math.pow(proportionCorrect, progression)*notefrom;
DecimalFormat df = new DecimalFormat("###.##");
nodbodyetnotation.getAttributs().put("proportioncorrect", df.format(proportionCorrect*100) + "%");
nodbodyetnotation.getAttributs().put("note", df.format(note));
nodbodyetnotation.getAttributs().put("pointstotal", String.valueOf(pointsTotal));
nodbodyetnotation.getAttributs().put("poidstotal", String.valueOf(poidsTotal));
nodbodyetnotation.getAttributs().put("pointgagner", String.valueOf(pointgagner));
if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))) {
nodbodyetnotation.getAttributs().put("proportioncorrect", "0%");
nodbodyetnotation.getAttributs().put("note", "0.00");
proportionCorrect = 0.00;
}
// si bareme ABC (5 intervalles A, B, C, D, E de 20%)
if(baremeABC) {
double intervalle1 = Math.pow(0.2, 1/progression) ;
double intervalle2 = Math.pow(0.4, 1/progression) ;
double intervalle3 = Math.pow(0.6, 1/progression) ;
double intervalle4 = Math.pow(0.8, 1/progression) ;
nodbodyetnotation.getAttributs().put("BorneE", String.valueOf(intervalle1));
nodbodyetnotation.getAttributs().put("BorneD", String.valueOf(intervalle2));
nodbodyetnotation.getAttributs().put("BorneC", String.valueOf(intervalle3));
nodbodyetnotation.getAttributs().put("BorneB", String.valueOf(intervalle4));
nodbodyetnotation.getAttributs().put("BorneA", "1.00");
if(proportionCorrect<intervalle1) nodbodyetnotation.getAttributs().put("noteABC", "E");
if(proportionCorrect>=intervalle1 && proportionCorrect<intervalle2) nodbodyetnotation.getAttributs().put("noteABC", "D");
if(proportionCorrect>=intervalle2 && proportionCorrect<intervalle3) nodbodyetnotation.getAttributs().put("noteABC", "C");
if(proportionCorrect>=intervalle3 && proportionCorrect<intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "B");
if(proportionCorrect>=intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "A");
}
nodanalyse.ajouteEnfant(nodouverture);
nodanalyse.ajouteEnfant(nodbodyetnotation);
nodanalyse.ajouteEnfant(nodmenu);
nodanalyse.ajouteEnfant(erreurs);
nodanalyse.ajouteEnfant(nodmeta);
nodanalyse.ajouteEnfant(nodpage);
nodanalyse.ajouteEnfant(nodparagraph);
nodanalyse.ajouteEnfant(nodsequence);
nodanalyse.ajouteEnfant(nodnumerochapitre);
nodanalyse.ajouteEnfant(nodframes);
nodanalyse.ajouteEnfant(nodsections);
nodanalyse.ajouteEnfant(nodtableaux);
nodanalyse.ajouteEnfant(nodbiblio);
nodanalyse.ajouteEnfant(nodtablematieres);
nodanalyse.ajouteEnfant(nodtableillustrations);
nodanalyse.ajouteEnfant(nodstructurepage);
node nodfermeturebodyHTML = new node();
nodfermeturebodyHTML.setNomElt("fermeture");
nodfermeturebodyHTML.setClose(true);
nodanalyse.getNodes().add(nodfermeturebodyHTML);
nodanalyse.setNomElt("analyse");
nodanalyse.setContenu(texteCommentaire);
nodanalyse.setClose(true);
return nodanalyse;
}
/**
* Analyse tous les attributs et les contenus d'un node.<br>
* Les attributs et les contenus doivent posséder la carcatère ou .<br>
* <br>
* @param nodeStudent : le node de l'étudiant.
* @param sujet : le node du sujet
* @param retour : le node à retourner avec les enfants nommés nameItem.
* @param nameItem : le nom des nodes enfants.
* @param nameElt : le nom de l'élément (node) analysé.
* @return le node <b>retour</b> avec tous les nodes enfants <b>nameItem</b> contenant les différentes analyse.
*/
public static node evalLesAttributEtContenuDuNode(node nodeStudent, node sujet, node retour, String nameItem, String nameElt) {
Enumeration<String> key = sujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if( sujet.getAttributs().get(k).contains("")){
if(nodeStudent!=null) {
String valueAttributStudent = nodeStudent.getAttributs().get(k);
String valueAttributSujet = sujet.getAttributs().get(k);
node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt);
retour.getNodes().add(item);
}else {
String valueAttributStudent = "null";
String valueAttributSujet = sujet.getAttributs().get(k);
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt);
retour.getNodes().add(item);
}
}
// evaluer avec evalNameNode, evalNameCreator, evalNameInitialCreator, evalEntetePasActive, evalPiedPagePasActive
if(!sujet.getAttributs().get(k).equals("0")) {
if(k.equals("evalNameNode") && !sujet.getAttributs().get(k).equals("0")) {
if(nodeStudent!=null) {
retour = evaluNameNode(retour,nodeStudent, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt());
}else {
retour = evaluNameNode(retour,null, sujet.getNomElt(), sujet.getAttributs().get("evalNameNode"),sujet.getNomElt());
}
}
if(k.equals("evalNameCreator") && sujet.getNomElt().equals("dc:creator")) {
if(nodeStudent!=null) {
retour = evaluNameCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameCreator"),"Editeur");
}else {
retour = evaluNameCreator(retour,null, "Pas trouvé l'auteur", sujet.getAttributs().get("evalNameCreator"),"Editeur");
}
}
if(k.equals("evalNameInitialCreator") && sujet.getNomElt().equals("meta:initial-creator")) {
if(nodeStudent!=null) {
retour = evalNameInitialCreator(retour,nodeStudent, nodeStudent.getContenu().get(0), sujet.getAttributs().get("evalNameInitialCreator"),"Créateur");
}else {
retour = evalNameInitialCreator(retour,null, "Pas trouvé le créateur", sujet.getAttributs().get("evalNameInitialCreator"),"Créateur");
}
}
if(k.equals("evalEntetePasActive") && sujet.getNomElt().equals("style:header-style")) {
if(nodeStudent!=null) {
int nbA=0;
int nbAs=0;
String reponseSujet = "oui";
String reponseStudent = "oui";
Enumeration<String> key1 = sujet.getAttributs().keys();
while(key1.hasMoreElements()) {
String k1 = key1.nextElement();
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++;
}
if(nbA==0) reponseSujet = "non";
key1 = nodeStudent.getAttributs().keys();
while(key1.hasMoreElements()) {
String k1 = key1.nextElement();
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++;
}
if(nbAs==0)reponseStudent = "non";
retour = evaluEntetePasActive(retour,reponseStudent,reponseSujet,sujet.getAttributs().get("evalEntetePasActive"),"Entete");
}else {
retour = evaluEntetePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Entete");
}
}
if(k.equals("evalPiedPagePasActive") && sujet.getNomElt().equals("style:footer-style")) {
if(nodeStudent!=null) {
int nbA=0;
int nbAs=0;
String reponseSujet = "oui";
String reponseStudent = "oui";
Enumeration<String> key1 = sujet.getAttributs().keys();
while(key1.hasMoreElements()) {
String k1 = key1.nextElement();
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbA++;
}
if(nbA==0) reponseSujet = "non";
key1 = nodeStudent.getAttributs().keys();
while(key1.hasMoreElements()) {
String k1 = key1.nextElement();
if(listeAttributsAnalyseWriter.isAttributAnalyseWriter(k1)) nbAs++;
}
if(nbAs==0)reponseStudent = "non";
retour = evaluPiedPagePasActive(retour,reponseStudent,reponseSujet , sujet.getAttributs().get("evalEntetePasActive"),"Pied page");
}else {
retour = evaluPiedPagePasActive(retour,null, "Pas trouvé le node de l'étudiant", sujet.getAttributs().get("evalEntetePasActive"),"Pied page");
}
}
}
}
//avec l'attribut allContent="strict1", allContent="strictSansEspace1" et allContent="environ1"
// il faut ajouter une méthode pour ignorer la casse
if(sujet.getAttributs().get("allContent")!=null) if(!sujet.getAttributs().get("allContent").isEmpty()){
String points ="‽0";
if(sujet.getAttributs().get("allContent").contains("strict")) points = sujet.getAttributs().get("allContent").replace("strict", "");
if(sujet.getAttributs().get("allContent").contains("strictSansEspace")) points = sujet.getAttributs().get("allContent").replace("strictSansEspace", "≡‽");
if(sujet.getAttributs().get("allContent").contains("environ")) points = sujet.getAttributs().get("allContent").replace("environ", "¢‽");
String testPoint = points.substring(points.indexOf("")+1, points.length());
boolean pasDeProblem = true;
boolean pointSupAUn = false;
try {
if(Integer.valueOf(testPoint)>=1) pointSupAUn=true;
}catch (Exception e) {
System.out.println("Dans le node " + sujet.getNomElt() + ".\nIl y a un problème avec la valeur de l'attribut allContent=\"" + sujet.getAttributs().get("allContent") + "\"");
System.out.println(e.toString());
pasDeProblem=false;
}
if(pasDeProblem && pointSupAUn) {
String allContentSujet = outils.withoutCodeAndPointPourRechercheContenuExact(sujet.retourneLesContenusEnfants("")) + points;
String allContentStudent = "null";
if( nodeStudent!=null) allContentStudent = nodeStudent.retourneLesContenusEnfants("");
node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", allContentStudent, allContentSujet, nameElt);
retour.getNodes().add(item);
}
}
// analyse le contenu du node avec tous les nodes sauf "text:sequence"
if(sujet.contenuEvaluer() && !sujet.getNomElt().equals("text:sequence")) {
String contenuStudent ="";
if(nodeStudent!=null) if(nodeStudent.getContenu().size()>0) contenuStudent = nodeStudent.getContenu().get(0);
String contenuSujet = sujet.getContenu().get(0);
node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", contenuStudent, contenuSujet, nameElt);
retour.getNodes().add(item);
}
// analyse le contenu du node text:sequence et tous les enfants text:change (lorsque les légendes sont modifiées)
if(sujet.contenuEvaluer() && sujet.getNomElt().equals("text:sequence")) {
String contenuStudent ="";
if(nodeStudent!=null) if(nodeStudent.getContenu().size()>0) contenuStudent = nodeStudent.getContenu().get(0); //contenuStudent = nodeStudent.retourneLesContenusEnfants("text:change");
String contenuSujet = sujet.getContenu().get(0);
node item = retourneNoteAvecResultatsAnalyse(nameItem,"Contenu textuel", contenuStudent, contenuSujet, nameElt);
retour.getNodes().add(item);
}
return retour;
}
/**
* Retourne le node avec les résultats de la comparaison entre les deux valeurs (étudiant et sujet).<br>
* <br>
* @param nameNode
* @param Tst (résultat de la comparaison)
* @param property
* @param valueAttributStudent
* @param valueAttributSujet
* @return
*/
public static node retourneNoteAvecResultatsAnalyse(String nameNode, String property, String valueStudent, String valueSujet, String nameElt) {
String Tst = outils.Compare(valueStudent, valueSujet);
int niveau = 3;
if(Tst.contains("Correct")) niveau = 1;
if(Tst.contains("Erreur")) niveau = 2;
valueStudent = outils.remplaceCaracteresCodageAttribut(valueStudent);
valueSujet = outils.remplaceCaracteresCodageAttribut(valueSujet);
node item = new node(nameNode, Tst, property , valueStudent, valueSujet, niveau, outils.getPointEnJeu(),nameElt);
return item;
}
/**
* Analyse tous les attributs des nodes <style:style>.<br>
* Formatage direct des styles de paragraphe.</br>
* Les attributs doivent contenir le code .<br>
* <br>
* @param nodeStudent : le node de l'étudiant.
* @param sujet : le node du sujet
* @param retour : le node à retourner avec les enfants nommés nameItem.
* @param nameItem : le nom des nodes enfants.
* @param nameElt : le nom de l'élément (node) analysé.
* @return le node <b>retour</b> avec tous les nodes enfants <b>nameItem</b> contenant les différentes analyse.
*/
public static node evalLesAttributAnalyseStyle(node nodeStyleParagraphStudent, node nodeStyleParagraphSujet, node retour, String nameItem, String nameElt) {
Enumeration<String> key = nodeStyleParagraphSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(nodeStyleParagraphSujet.getAttributs().get(k).contains("") || nodeStyleParagraphSujet.getAttributs().get(k).contains("")){
if(nodeStyleParagraphStudent!=null) {
String valueAttributStudent = nodeStyleParagraphStudent.getAttributs().get(k);
String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,nameElt);
retour.getNodes().add(item);
}else {
String valueAttributStudent = "null";
String valueAttributSujet = nodeStyleParagraphSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,nameElt);
retour.getNodes().add(item);
}
}
}
if(nodeStyleParagraphStudent!=null) {
if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) {
node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties");
node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties");
key = propertiesSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(propertiesSujet.getAttributs().get(k).contains("") || propertiesSujet.getAttributs().get(k).contains("")){
if(propertiesStudent!=null) {
String valueAttributStudent = propertiesStudent.getAttributs().get(k);
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties");
retour.getNodes().add(item);
}else {
String valueAttributStudent = "null";
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties");
retour.getNodes().add(item);
}
}
}
}
}else {
node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties");
key = propertiesSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(propertiesSujet.getAttributs().get(k).contains("") || propertiesSujet.getAttributs().get(k).contains("")){
String valueAttributStudent = "null";
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties");
retour.getNodes().add(item);
}
}
}
if(nodeStyleParagraphStudent!=null) {
if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) {
node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties");
node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties");
key = propertiesSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(propertiesSujet.getAttributs().get(k).contains("") || propertiesSujet.getAttributs().get(k).contains("")){
if(propertiesStudent!=null) {
String valueAttributStudent = propertiesStudent.getAttributs().get(k);
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties");
retour.getNodes().add(item);
}else {
String valueAttributStudent = "null";
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties");
retour.getNodes().add(item);
}
}
}
}
}else {
node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties");
key = propertiesSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(propertiesSujet.getAttributs().get(k).contains("") || propertiesSujet.getAttributs().get(k).contains("")){
String valueAttributStudent = "null";
String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("", "");
node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties");
retour.getNodes().add(item);
}
}
}
return retour;
}
/**
* Retourne le nom du fichier de l'étudiant pour le Zip pour Moodle.<br>
* </br>
@ -2480,7 +1792,7 @@ public class meptl {
dccreator = nodDateCreator.getContenu().get(0);
}
Date DcDate1 = DateLibreOffice(dcdate1);
Date DcDate1 = formatDateWriter.DateLibreOffice(dcdate1);
if(DateMini==null) DateMini = DcDate1; // Amorçage de la date premère date de modification
if(DateMini!=null && DateMini.after(DcDate1)) DateMini = DcDate1; //recherche la première date de modification
@ -2981,29 +2293,7 @@ public class meptl {
return note;
}
/**
*
* @param libreoffice_date
* @return
*/
private static Date DateLibreOffice(String libreoffice_date){
boolean contientHeure = false;
if(libreoffice_date.contains("T")) {
libreoffice_date=libreoffice_date.replace("T", " ");
contientHeure=true;
}
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date d = null;
if(!contientHeure) simpledateformat = new SimpleDateFormat("yyyy-MM-dd");
try {
d = simpledateformat.parse(libreoffice_date);
}catch(ParseException e) {
e.printStackTrace();
}
return d;
}
/**
@ -3219,108 +2509,7 @@ public class meptl {
/**
* Evalue le nom du node
*
* @param retour : le node retour qui contient l'item ajouté
* @param nodStudent : le node Student qui peut être null
* @param nameNode : le nom du node
* @param point : les points
* @param nameElt : le nom de l'élément
* @return
*/
private static node evaluNameNode(node retour, node nodStudent, String nameNode, String point, String nameElt) {
node item = null;
if(nodStudent!=null) {
item = retourneNoteAvecResultatsAnalyse(nameNode,"name", nodStudent.getNomElt(),nameNode + "" +point, nameElt );
}else {
outils.IncrementPointTotal(Integer.valueOf(point));
item = new node(nameNode, "Erreur", "Nom du node" , "null", nameNode, 2, outils.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;
}
/**
* Si le node style:header-style ne possède pas d'attribut alors l'entete n'est pas activé.<br>
* Le nombre d'attribut est null.
* @param retour
* @param nodStudent
* @param nameNode
* @param point
* @param nameElt
* @return
*/
private static node evaluEntetePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) {
node item = null;
if(nbAttributStudent!=null) {
item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "" +point, nameElt );
}else {
outils.IncrementPointTotal(Integer.valueOf(point));
item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, outils.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;
}
private static node evaluPiedPagePasActive(node retour, String nbAttributStudent, String nbAttribut, String point, String nameElt) {
node item = null;
if(nbAttributStudent!=null) {
item = retourneNoteAvecResultatsAnalyse(nbAttribut,"active", nbAttributStudent,nbAttribut + "" +point, nameElt );
}else {
outils.IncrementPointTotal(Integer.valueOf(point));
item = new node(nbAttribut, "Erreur", "active" , "null", nbAttribut, 2, outils.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;
}
/**
* Evalue le champ auteur (éditeur).
* @param retour
* @param nodStudent
* @param nameCreator
* @param point
* @param nameElt
* @return
*/
private static node evaluNameCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) {
node item = null;
if(nodStudent!=null) {
item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getAttributs().get("creator"),nameCreator + "↑‽" +point, nameElt );
}else {
outils.IncrementPointTotal(Integer.valueOf(point));
item = new node(nameCreator, "Erreur", "Nom du l'éditeur" , "null", nameCreator, 2, outils.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;
}
/**
* Evalue le nom de l'auteur (créteur ou premier auteur)
* @param retour
* @param nodStudent
* @param nameCreator
* @param point
* @param nameElt
* @return
*/
private static node evalNameInitialCreator(node retour, node nodStudent, String nameCreator, String point, String nameElt) {
node item = null;
if(nodStudent!=null) {
item = retourneNoteAvecResultatsAnalyse(nameCreator,"name", nodStudent.getContenu().get(0),nameCreator + "↑‽" +point, nameElt );
}else {
outils.IncrementPointTotal(Integer.valueOf(point));
item = new node(nameCreator, "Erreur", "Nom du créateur" , "null", nameCreator, 2, outils.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;
}
}

View File

@ -3,6 +3,7 @@ package MEPTL;
import cXML.Run;
import cXML.node;
import evaluer.evaluation;
/**
*
@ -170,7 +171,7 @@ public class rechercherUnNodeStudent {
node nodStudent = null;
if(nodSujet.getAttributs().get("recherche_contenu_exact").equals("true")) {
if(!nodSujet.retourneLesContenusEnfants("").isEmpty()) {
String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants(""));
String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants(""));
if(nod2Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod2Student.getNodes(), valueAttribut, nodSujet.getNomElt());
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt());
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt());
@ -199,7 +200,7 @@ public class rechercherUnNodeStudent {
// if(nod2Student!=null) System.out.println("nod2Student "+ nod2Student.toString() + " contenu=" + nod2Student.retourneLesContenusEnfants(""));
String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants(""));
String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.retourneLesContenusEnfants(""));
// System.out.println("Contenu recherché = " + valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneLeNodeByContentPlusProche(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt(),0.5,null);
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneLeNodeByContentPlusProche(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt(),0.5,null);
@ -258,28 +259,28 @@ public class rechercherUnNodeStudent {
String nameNodeEnfantSujet = nodEnfantSujet.getNomElt();
if(nameNodeEnfantSujet.equals("text:user-defined")) {
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name"));
if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:user-defined", "text:name", valueAttribut);
}
if(nameNodeEnfantSujet.equals("text:conditional-text")) {
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition"));
if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:conditional-text", "text:condition", valueAttribut);
}
if(nameNodeEnfantSujet.equals("text:database-display")) {
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name"));
if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:database-display", "text:column-name", valueAttribut);
}
if(nameNodeEnfantSujet.equals("text:date")) {
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed"));
if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue(nameNodeSujet,"text:date", "text:fixed", valueAttribut);
@ -317,28 +318,28 @@ public class rechercherUnNodeStudent {
// //si le node "text:p" contient un "text:user-defined" alors le recherche par le "text:name" de ce node "text:user-defined"
// if(nodSujet.containElementByName("text:user-defined")) {
// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name"));
// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:user-defined").getAttributs().get("text:name"));
// if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut);
// if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut);
// if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:user-defined", "text:name", valueAttribut);
// }
// //si le node "text:p" contient un "text:conditional-text" alors le recherche par le "text:condition" de ce node "text:conditional-text"
// if(nodSujet.containElementByName("text:conditional-text")) {
// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition"));
// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:conditional-text").getAttributs().get("text:condition"));
// if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut);
// if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut);
// if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:conditional-text", "text:condition", valueAttribut);
// }
// //si le node "text:p" contient un "text:database-display" alors le recherche par le "text:column-name" de ce node "text:database-display"
// if(nodSujet.containElementByName("text:database-display")) {
// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name"));
// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:database-display").getAttributs().get("text:column-name"));
// if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut);
// if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut);
// if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:database-display", "text:column-name", valueAttribut);
// }
// //si le node "text:p" contient un "text:date" alors le recherche par le "text:fixed" de ce node "text:date"
// if(nodSujet.containElementByName("text:date")) {
// String valueAttribut = outils.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed"));
// String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.retourneFirstEnfantsByName("text:date").getAttributs().get("text:fixed"));
// if(nod2Student!=null) if(nodStudent==null) nodStudent = nod2Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut);
// if(nod1Student!=null) if(nodStudent==null) nodStudent = nod1Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut);
// if(nod0Student!=null) if(nodStudent==null) nodStudent = nod0Student.retourneFirstNodeByNameContainsNodeByNameAndAttributValue("text:p","text:date", "text:fixed", valueAttribut);
@ -367,7 +368,7 @@ public class rechercherUnNodeStudent {
//** Recherche par contenu
if(!nodSujet.getContenu().isEmpty()) {
String valueAttribut = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getContenu().get(0));
String valueAttribut = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getContenu().get(0));
if(nod2Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod2Student.getNodes(), valueAttribut, nodSujet.getNomElt());
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod1Student.getNodes(), valueAttribut, nodSujet.getNomElt());
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByFindContentExact(nod0Student.getNodes(), valueAttribut, nodSujet.getNomElt());
@ -399,7 +400,7 @@ public class rechercherUnNodeStudent {
*/
private static node findDrawFrame(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
String nameDraw = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("draw:name"));
String nameDraw = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("draw:name"));
System.out.println("recherche image ou cadre ="+ nameDraw);
//recherche par le nom de l'objet draw:name par défaut
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValueNetTexte(nod2Student, nameNode, "draw:name", nameDraw);
@ -409,7 +410,7 @@ public class rechercherUnNodeStudent {
if(nodStudent!=null) return nodStudent;
if(nodSujet.getAttributs().get("recherche_anchor-page-number")!=null) if(nodSujet.getAttributs().get("recherche_anchor-page-number").equalsIgnoreCase("true")) {
String AncragePage = outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("text:anchor-page-number"));
String AncragePage = evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("text:anchor-page-number"));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:anchor-page-number", AncragePage);
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:anchor-page-number", AncragePage);
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:anchor-page-number", AncragePage);
@ -430,7 +431,7 @@ public class rechercherUnNodeStudent {
*/
private static node findTextConditional(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:condition"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:condition"));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:condition", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:condition", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:condition", valueAttribut);
@ -450,9 +451,9 @@ public class rechercherUnNodeStudent {
*/
private static node findByTextName(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:name", outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:name", evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:name")));
return nodStudent;
}
@ -469,7 +470,7 @@ public class rechercherUnNodeStudent {
*/
private static node findTextDate(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:fixed"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:fixed"));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:fixed", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:fixed", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:fixed", valueAttribut);
@ -510,7 +511,7 @@ public class rechercherUnNodeStudent {
*/
private static node findDataBase(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
String valueAttribut = outils.withoutCodeAndPoint(nodSujet.getAttributs().get("text:column-name"));
String valueAttribut = evaluation.withoutCodeAndPoint(nodSujet.getAttributs().get("text:column-name"));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "text:column-name", valueAttribut);
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "text:column-name", valueAttribut);
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "text:column-name", valueAttribut);
@ -553,9 +554,9 @@ public class rechercherUnNodeStudent {
*/
private static node findTable(String nameNode, node nodSujet,node nod0Student, node nod1Student, node nod2Student, Run a) {
node nodStudent = null;
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "table:name", outils.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
if(nod2Student!=null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod2Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
if(nod1Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod1Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
if(nod0Student!=null) if(nodStudent==null) nodStudent = a.retourneFirstNodeByNameAttributValue(nod0Student, nameNode, "table:name", evaluation.withoutCodeAndPointPourRechercheContenuExact(nodSujet.getAttributs().get("table:name")));
return nodStudent;
}

View File

@ -8,6 +8,7 @@ import java.util.regex.Pattern;
import cXML.Run;
import cXML.node;
import evaluer.evaluation;
/**
*
@ -780,7 +781,7 @@ public class verificationFichierAnalyse {
if(!nod.getContenu().isEmpty()) if( nod.getContenu().contains("") ) {
if(nod.getAttributs().get("evaluer")!=null) {
if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")) {
if( outils.NetTexte(nod.getContenu().get(0)).length() <=3 ) {
if( evaluation.NetTexte(nod.getContenu().get(0)).length() <=3 ) {
System.out.println();
System.out.println("**-** ERREUR dans le fichier d'analyse, le node \"" + nod.getNomElt() + "\".");
System.out.println("Le contenu du node est : " + nod.getContenu());

View File

@ -12,11 +12,11 @@ import java.util.stream.Collectors;
import javax.swing.JEditorPane;
import MEPTL.commandes;
import MEPTL.outils;
import cXML.node;
import calcul.calculIntervalleBaremeABCDE;
import calcul.calculNotesProgression;
import calcul.listeAttributsAnalyseWriter;
import evaluer.evaluation;
import list.listeAttributsAnalyseWriter;
public class afficheText extends JEditorPane {
@ -51,6 +51,7 @@ public class afficheText extends JEditorPane {
String imageAtraversAnalyseStyle= "<img src="+afficheText.class.getResource("/resources/atraversanalysestylemini.png").toString()+">";
String imageEntetePasActive= "<img src="+afficheText.class.getResource("/resources/entetenonmini.png").toString()+">";
String imagePiedPagePasActive= "<img src="+afficheText.class.getResource("/resources/piedpagenonmini.png").toString()+">";
String imageEvalNameSequence= "<img src="+afficheText.class.getResource("/resources/evalnamesequencemini.png").toString()+">";
StringBuilder sb = new StringBuilder();
@ -67,7 +68,7 @@ public class afficheText extends JEditorPane {
sb.append("<h2>Nom du style : " + nod.getAttributs().get("style:name")+ "</h2><br>");
}
if(nod.getNomElt().equals("draw:frame")) {
sb.append("<h2>Nom du frame : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("draw:name"))+ "</h2><br>");
sb.append("<h2>Nom du frame : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("draw:name"))+ "</h2><br>");
}
if(nod.getNomElt().equals("style:master-page")) {
if(nod.getAttributs().get("style:display-name")!=null) {
@ -77,8 +78,8 @@ public class afficheText extends JEditorPane {
}
}
if(nod.getNomElt().equals("page")) {
sb.append("<h2>Numero absolue de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numeroabsolue"))
+ " - Numerotation de la page : " + outils.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numero"))+ "</h2><br>");
sb.append("<h2>Numero absolue de la page : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numeroabsolue"))
+ " - Numerotation de la page : " + evaluation.withoutCodeAndPointPourRechercheContenuExact(nod.getAttributs().get("numero"))+ "</h2><br>");
}
@ -166,6 +167,9 @@ public class afficheText extends JEditorPane {
if(Lesattributsdunode.get(i).equals("evalPiedPagePasActive") && !nod.getAttributs().get(Lesattributsdunode.get(i)).equals("0")) {
sb.append("<li class=\"p4\">"+imagePiedPagePasActive + " <b>" + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
}
if(Lesattributsdunode.get(i).equals("evalNameSequence") && !nod.getAttributs().get(Lesattributsdunode.get(i)).equals("0")) {
sb.append("<li class=\"p4\">"+imageEvalNameSequence + " <b>" + Lesattributsdunode.get(i) + " = \"" + nod.getAttributs().get(Lesattributsdunode.get(i))+"\"</b></li>");
}

View File

@ -9,10 +9,10 @@ import javax.swing.border.EmptyBorder;
import MEPTL.commandes;
import cXML.node;
import calcul.listeAttributWriterPasEvaluableAvecCodeEvaluateur;
import calcul.listeAttributWriterValeurPasModifiable;
import calcul.listeAttributsAnalyseWriter;
import calcul.listeNodeFormatageDirectDeWriter;
import list.listeAttributWriterPasEvaluableAvecCodeEvaluateur;
import list.listeAttributWriterValeurPasModifiable;
import list.listeAttributsAnalyseWriter;
import list.listeNodeFormatageDirectDeWriter;
import java.awt.FlowLayout;
import java.util.ArrayList;

View File

@ -46,8 +46,8 @@ import MEPTL.verificationFichierAnalyse;
import cXML.Run;
import cXML.node;
import calcul.calculNombrePointEvaluation;
import calcul.listeAttributsAnalyseWriter;
import calcul.listeNodeFormatageDirectDeWriter;
import list.listeAttributsAnalyseWriter;
import list.listeNodeFormatageDirectDeWriter;
import java.awt.event.InputEvent;
import javax.swing.JToggleButton;
@ -282,8 +282,6 @@ public class create extends JFrame {
mnRechercheContenuPlusProcheVoisin.addSeparator();
mnRechercheContenuPlusProcheVoisin.add(actRechercheContenuPlusProcheVoisinfalse);
//Menu analyseStyle (évaluer le style du paragraphe)
JMenu mnAnalyseStyle = new JMenu("Evaluer le style");
mnAnalyseStyle.setIcon(new ImageIcon(create.class.getResource("/resources/evaluerstylemini.png")));
@ -298,10 +296,10 @@ public class create extends JFrame {
mnevalEntetePasActive.add(actEvalEnteteActive);
//Menu evalPiedPagePasActive (pour les style:footer-style)
JMenu mnevalPiedPagePasActive = new JMenu("Pied page pas activé");
mnevalPiedPagePasActive.setIcon(new ImageIcon(create.class.getResource("/resources/piedpagenonmini.png")));
mnevalPiedPagePasActive.add(actEvalPiedPagePasActive);
mnevalPiedPagePasActive.add(actEvalPiedPageActive);
JMenu mnEvalPiedPagePasActive = new JMenu("Pied page pas activé");
mnEvalPiedPagePasActive.setIcon(new ImageIcon(create.class.getResource("/resources/piedpagenonmini.png")));
mnEvalPiedPagePasActive.add(actEvalPiedPagePasActive);
mnEvalPiedPagePasActive.add(actEvalPiedPageActive);
//Menu Evaluer présence d'un node pour les nodes de niveau > 1
JMenu mnEvalNameNode = new JMenu("Evaluer la présence du node");
@ -309,6 +307,13 @@ public class create extends JFrame {
mnEvalNameNode.add(actEvalNameNodeOui);
mnEvalNameNode.add(actEvalNameNodeNon);
//Menu evalNameSequence (pour les text:sequence-decl)
JMenu mnEvalNameSequence = new JMenu("Evaluer le nom de la séquence");
mnEvalNameSequence.setIcon(new ImageIcon(create.class.getResource("/resources/evalnamesequencemini.png")));
mnEvalNameSequence.add(actEvalNameSequenceOui);
mnEvalNameSequence.add(actEvalNameSequenceNon);
//Menue Recherche par le numéro de la page ancrer
JMenu mnRechercheParNumeroPageAncrer = new JMenu("Recherche par le numéro de la page");
mnRechercheParNumeroPageAncrer.setIcon(new ImageIcon(create.class.getResource("/resources/rechercheancragepagemini.png")));
@ -377,7 +382,11 @@ public class create extends JFrame {
}
if(nod.getNomElt().equals("style:footer-style")) {
mnNiveauSup1.addSeparator();
mnNiveauSup1.add(mnevalPiedPagePasActive);
mnNiveauSup1.add(mnEvalPiedPagePasActive);
}
if(nod.getNomElt().equals("text:sequence-decl")) {
mnNiveauSup1.addSeparator();
mnNiveauSup1.add(mnEvalNameSequence);
}
@ -1178,6 +1187,70 @@ public class create extends JFrame {
}
};
/**
* Evalue le nom de la séquence
*/
private AbstractAction actEvalNameSequenceOui = new AbstractAction() {
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Oui, combien de point?" );
putValue( Action.SHORT_DESCRIPTION, "Evaluer le nom de la séquence" );
}
@Override public void actionPerformed( ActionEvent e ) {
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
node nod = (node) selectNode.getUserObject();
int point = 0;
if(nod.getAttributs().get("evalNameSequence")!=null) {
point = Integer.valueOf(nod.getAttributs().get("evalNameSequence"));
}
String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point);
if(!a.isEmpty()) {
try {
point = Integer.valueOf(a);
if(point<=0) {
nod.getAttributs().put("evalNameSequence", String.valueOf(0));
textNodeSelect.setText(balisestyles());
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.<br>Cependant,la valeur a été modifiée.<br>evalNameSequence=0.</h2>");
}else {
nod.getAttributs().put("evalNameSequence", String.valueOf(point));
}
} catch (Exception e2) {
textNodeSelect.setText(balisestyles());
textNodeSelect.setText("<h2>Erreur la valeur doit être un nombre entier.<br>L'attribut n'a pas été modifiée.</h2>");
}
}
textNodeSelect.refreshAffichage(nod);
}
};
/**
* Supprime l'évaluation du nom de la séquence.
*/
private AbstractAction actEvalNameSequenceNon = new AbstractAction() {
private static final long serialVersionUID = 1L;
{
putValue( Action.NAME, "Supprime évaluer le nom de la séquence" );
putValue( Action.SHORT_DESCRIPTION, "Supprime l'évaluation du nom de la séquence." );
}
@Override public void actionPerformed( ActionEvent e ) {
DefaultMutableTreeNode selectNode = (DefaultMutableTreeNode) tree.getSelectionPath().getLastPathComponent();
node nod = (node) selectNode.getUserObject();
nod.supprimeAttribut("evalNameSequence");
textNodeSelect.refreshAffichage(nod);
}
};
/**
* Supprime l'attribut evalEntetePasActive
@ -2445,7 +2518,7 @@ public class create extends JFrame {
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change");
commandes.sujetSauvegarde = commandes.sujet.clone();

View File

@ -14,6 +14,7 @@ import MEPTL.verificationFichierAnalyse;
import cXML.Run;
import cXML.node;
import calcul.calculIntervalleBaremeABCDE;
import evaluer.analyseFichier;
import net.lingala.zip4j.exception.ZipException;
public class evaluerLesFichiersEtudiants implements Runnable{
@ -168,7 +169,7 @@ public class evaluerLesFichiersEtudiants implements Runnable{
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);
node ana = analyseFichier.analyse(nodStudent, commandes.sujet, i, a);
//**************************************************
//** Ecriture des fichiers d'analyse des students **

View File

@ -78,6 +78,7 @@ public class filechooserXML extends JFileChooser {
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-start"); //historique des modification
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change-end");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:tracked-changes");
commandes.sujet.supprimeTousLesNodesEnfantWithThisName("text:change");
commandes.sujetSauvegarde = commandes.sujet.clone();
@ -89,13 +90,7 @@ public class filechooserXML extends JFileChooser {
// 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());
} catch (UnsupportedEncodingException e1) {
e1.printStackTrace();

View File

@ -1,5 +1,8 @@
package calcul;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -16,4 +19,29 @@ public class formatDateWriter {
return false;
}
/**
*
* @param libreoffice_date
* @return
*/
public static Date DateLibreOffice(String libreoffice_date){
boolean contientHeure = false;
if(libreoffice_date.contains("T")) {
libreoffice_date=libreoffice_date.replace("T", " ");
contientHeure=true;
}
SimpleDateFormat simpledateformat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
Date d = null;
if(!contientHeure) simpledateformat = new SimpleDateFormat("yyyy-MM-dd");
try {
d = simpledateformat.parse(libreoffice_date);
}catch(ParseException e) {
e.printStackTrace();
}
return d;
}
}

View File

@ -0,0 +1,374 @@
package evaluer;
import java.text.DecimalFormat;
import MEPTL.meptl;
import cXML.Run;
import cXML.node;
public class analyseFichier {
/**
* Début de l'analyse par comparaison du node étudiant avec le node sujet.
* @param nodStudent, le node étudiant.
* @param nodSujet, le node sujet.
* @param indexStudent, index de l'étudiant
* @param a, objet Run de la class cXML
* @return le node analyse contenant toute l'analyse.
*/
public static node analyse(node nodStudent, node nodSujet, Integer indexStudent, Run a) {
// initialisation des nodes d'analyse
node erreurs = new node();
node nodmeta = new node();
node nodpage = new node();
node nodparagraph = new node();
node nodsequence = new node();
node nodnumerochapitre = new node();
node nodframes = new node();
node nodsections = new node();
node nodtableaux = new node();
node nodbiblio = new node();
node nodtablematieres = new node();
node nodtableillustrations = new node();
node nodstructurepage = new node();
// ouverture
node nodouverture = new node();
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(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"));
if(nodStudent.getAttributs().get("dateModification")!=null) nodouverture.getAttributs().put("dateModification", nodStudent.getAttributs().get("dateModification"));
nodouverture.getAttributs().put("patch", a.getPatch());
if(nodSujet.getAttributs().get("historiquePresent")!=null) nodouverture.getAttributs().put("historiquePresent", nodSujet.getAttributs().get("historiquePresent"));
if(nodSujet.getAttributs().get("controleDateCreation")!=null) nodouverture.getAttributs().put("controleDateCreation", nodSujet.getAttributs().get("controleDateCreation"));
if(nodSujet.getAttributs().get("presenceMetaSujet")!=null) nodouverture.getAttributs().put("presenceMetaSujet", nodSujet.getAttributs().get("presenceMetaSujet"));
if(nodSujet.getAttributs().get("baremeABC")!=null) nodouverture.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC"));
nodouverture.setClose(true);
//Body et note (par défaut valeur nulle)
node nodbodyetnotation = new node();
nodbodyetnotation.setNomElt("bodyetnotation");
nodbodyetnotation.getAttributs().put("note", "0");
nodbodyetnotation.getAttributs().put("commentaire", "");
nodbodyetnotation.getAttributs().put("proportioncorrect", "0");
nodbodyetnotation.getAttributs().put("baremeABC", "false");
if(nodSujet.getAttributs().get("baremeABC")!=null) nodbodyetnotation.getAttributs().put("baremeABC", nodSujet.getAttributs().get("baremeABC"));
nodbodyetnotation.setClose(true);
//Le menu
node nodmenu = new node();
nodmenu.setNomElt("menu");
nodmenu = meptl.retourneNodeMenu(nodSujet, nodmenu, 0, 0);
nodmenu.setClose(true);
// verification de la métadonnées Sujet
erreurs = meptl.retourneNodeErreur(nodStudent, nodSujet, a);
// verification si au moins une erreur alors l'analyse est terminée
if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))){
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage, nodSujet.getContenu().get(0));
}
// analyse Meta
if(nodSujet.retourneFirstEnfantsByName("office:meta").getNomElt().equals("office:meta")) {
nodmeta = analyseLesNodesPrincipaux.analyseLesMeta(nodStudent.retourneFirstEnfantsByName("office:meta"), nodSujet.retourneFirstEnfantsByName("office:meta"), a, nodmenu);
}
// analyse les pages (nécessaire d'avoir aussi les styles de paragraphes)
if(nodSujet.retourneFirstEnfantsByName("style:page").getNomElt().equals("style:page")) {
if(nodSujet.containElementByName("style:paragraph")) {
nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,nodSujet.retourneFirstEnfantsByName("style:paragraph"),nodStudent.retourneFirstEnfantsByName("style:paragraph"));
}else {
nodpage = analyseLesNodesPrincipaux.analysePage(nodStudent.retourneFirstEnfantsByName("style:page"), nodSujet.retourneFirstEnfantsByName("style:page"), a, nodmenu,null,null);
}
}
// analyse les paragraphes
if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) {
nodparagraph = analyseLesNodesPrincipaux.analyseParagraph(nodStudent.retourneFirstEnfantsByName("style:paragraph"), nodSujet.retourneFirstEnfantsByName("style:paragraph"), a, nodmenu);
}
// analyse les variables de séquence
if(nodSujet.retourneFirstEnfantsByName("sequences").getNomElt().equals("sequences")) {
nodsequence = analyseLesNodesPrincipaux.analyseLesSequences(nodStudent.retourneFirstEnfantsByName("sequences"), nodSujet.retourneFirstEnfantsByName("sequences"), a, nodmenu);
}
// analyse de la numérotation des chapitres
if(nodSujet.retourneFirstEnfantsByName("numerotationchapitre").getNomElt().equals("numerotationchapitre")) {
nodnumerochapitre = analyseLesNodesPrincipaux.analyseLaNumerotationChapitre(nodStudent.retourneFirstEnfantsByName("numerotationchapitre"), nodSujet.retourneFirstEnfantsByName("numerotationchapitre"), a, nodmenu);
}
// analyse les frames
if(nodSujet.retourneFirstEnfantsByName("frames").getNomElt().equals("frames")) {
nodframes = analyseLesNodesPrincipaux.analyseLesFrames(nodStudent.retourneFirstEnfantsByName("frames"), nodSujet.retourneFirstEnfantsByName("frames"), a, nodmenu);
}
// analyse des sections
if(nodSujet.retourneFirstEnfantsByName("sections").getNomElt().equals("sections")) {
nodsections = analyseLesNodesPrincipaux.analyseLesSections(nodStudent.retourneFirstEnfantsByName("sections"), nodSujet.retourneFirstEnfantsByName("sections"), a, nodmenu);
}
// analyse les tableaux
if(nodSujet.retourneFirstEnfantsByName("tableaux").getNomElt().equals("tableaux")) {
nodtableaux = analyseLesNodesPrincipaux.analyseLesTableaux(nodStudent.retourneFirstEnfantsByName("tableaux"), nodSujet.retourneFirstEnfantsByName("tableaux"), a, nodmenu);
}
// analyse la bibliographie de LibreOffice
if(nodSujet.retourneFirstEnfantsByName("biblio").getNomElt().equals("biblio")) {
nodbiblio = analyseLesNodesPrincipaux.analyseLaBiblio(nodStudent.retourneFirstEnfantsByName("biblio"), nodSujet.retourneFirstEnfantsByName("biblio"), a, nodmenu);
}
// analyse des tables des matières
if(nodSujet.retourneFirstEnfantsByName("tablematieres").getNomElt().equals("tablematieres")) {
nodtablematieres = analyseLesNodesPrincipaux.analyseLesTablesMatieres(nodStudent.retourneFirstEnfantsByName("tablematieres"), nodSujet.retourneFirstEnfantsByName("tablematieres"), a, nodmenu);
}
// analyse des tables illustrations
if(nodSujet.retourneFirstEnfantsByName("tableillustrations").getNomElt().equals("tableillustrations")) {
nodtableillustrations = analyseLesNodesPrincipaux.analyseLesTablesIllustrations(nodStudent.retourneFirstEnfantsByName("tableillustrations"), nodSujet.retourneFirstEnfantsByName("tableillustrations"), a, nodmenu);
}
// analyse la structure du document
if(nodSujet.retourneFirstEnfantsByName("structurepage").getNomElt().equals("structurepage")) {
node nodSujetParagraphs = null;
if(nodSujet.retourneFirstEnfantsByName("style:paragraph").getNomElt().equals("style:paragraph")) nodSujetParagraphs = nodSujet.retourneFirstEnfantsByName("style:paragraph");
node nodStudentParagraphs = nodStudent.retourneFirstEnfantsByName("style:paragraph");
nodstructurepage = analyseLesNodesPrincipaux.analyseStructurePage(nodStudent.retourneFirstEnfantsByName("structurepage"), nodSujet.retourneFirstEnfantsByName("structurepage"), a, nodmenu,nodSujetParagraphs, nodStudentParagraphs );
}
// retourne le node analyse assemblé et calcul de la note avec le barème
if(nodSujet.getContenu().size()>0) {
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,nodSujet.getContenu().get(0));
}else {
return clotureNodeAnalyse(nodouverture, nodbodyetnotation, nodmenu, erreurs, nodmeta, nodpage, nodparagraph, nodsequence, nodnumerochapitre, nodframes, nodsections, nodtableaux, nodbiblio, nodtablematieres, nodtableillustrations, nodstructurepage,"");
}
}
/**
* Assemblage du node analyse à partir des différents nodes de l'analyse.<br>
* <br>
* @param nodouverture
* @param nodbodyetnotation
* @param nodmenu
* @param erreurs
* @param nodmeta
* @param nodpage
* @param nodparagraph
* @param nodsequence
* @param nodnumerochapitre
* @param nodframes
* @param nodsections
* @param nodtableaux
* @param nodbiblio
* @param nodtablematieres
* @param nodtableillustrations
* @param nodstructurepage
* @return
*/
public static node clotureNodeAnalyse(node nodouverture, node nodbodyetnotation, node nodmenu, node erreurs, node nodmeta, node nodpage,
node nodparagraph, node nodsequence, node nodnumerochapitre, node nodframes, node nodsections, node nodtableaux, node nodbiblio, node nodtablematieres,
node nodtableillustrations, node nodstructurepage, String texteCommentaire) {
node nodanalyse = new node();
//recalcul les points pour les placer dans le node nodbodyetnotation
double notefrom = 20; // valeur par défaut
double progression = 1; // valeur par défaut
boolean baremeABC = false;
if(nodouverture!=null) if(nodouverture.isClose()) {
if(nodouverture.getAttributs().get("notefrom")!=null) {
try {
notefrom = Math.abs(Double.valueOf(nodouverture.getAttributs().get("notefrom")));
}catch (Exception e) {
System.out.println("The \"noteFrom\" attribute of the analyze file cannot be converted to a \"double\".");
System.out.println("Value of notefrom = 20.");
}
}
if(nodouverture.getAttributs().get("progression")!=null) {
try {
progression = Math.abs(Double.valueOf(nodouverture.getAttributs().get("progression")));
}catch (Exception e) {
System.out.println("The \"progression\" attribute of the analyze file cannot be converted to \"double\".");
System.out.println("Value of progression = 1.");
}
}
if(nodouverture.getAttributs().get("baremeABC")!=null) {
try {
baremeABC = Boolean.valueOf(nodouverture.getAttributs().get("baremeABC"));
}catch (Exception e) {
System.out.println("The \"baremeABC\" attribute of the analyze file cannot be converted to \"boolean\".");
System.out.println("Value of baremeABC = false.");
}
}
}
double pointmeta = 0; double pointmetatotal = 0 ; double poidsmeta = 0;
if(nodmeta!=null) if(nodmeta.isClose()) {
if(nodmeta.getAttributs().get("pointgagner")!=null) pointmeta = Double.valueOf(nodmeta.getAttributs().get("pointgagner"));
if(nodmeta.getAttributs().get("pointtotal")!=null) pointmetatotal = Double.valueOf(nodmeta.getAttributs().get("pointtotal"));
if(nodmeta.getAttributs().get("poids")!=null) try{poidsmeta = Math.abs(Double.valueOf(nodmeta.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointpage = 0; double pointpagetotal = 0 ; double poidspage = 0;
if(nodpage!=null) if(nodpage.isClose()) {
if(nodpage.getAttributs().get("pointgagner")!=null) pointpage = Double.valueOf(nodpage.getAttributs().get("pointgagner"));
if(nodpage.getAttributs().get("pointtotal")!=null) pointpagetotal = Double.valueOf(nodpage.getAttributs().get("pointtotal"));
if(nodpage.getAttributs().get("poids")!=null) try{poidspage = Math.abs(Double.valueOf(nodpage.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointparagraph = 0; double pointparagraphtotal = 0 ; double poidsparagraph = 0;
if(nodparagraph!=null) if(nodparagraph.isClose()) {
if(nodparagraph.getAttributs().get("pointgagner")!=null) pointparagraph = Double.valueOf(nodparagraph.getAttributs().get("pointgagner"));
if(nodparagraph.getAttributs().get("pointtotal")!=null) pointparagraphtotal = Double.valueOf(nodparagraph.getAttributs().get("pointtotal"));
if(nodparagraph.getAttributs().get("poids")!=null) try{Math.abs(poidsparagraph = Double.valueOf(nodparagraph.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointsequence = 0; double pointsequencetotal = 0 ; double poidssequence = 0;
if(nodsequence!=null) if(nodsequence.isClose()) {
if(nodsequence.getAttributs().get("pointgagner")!=null) pointsequence = Double.valueOf(nodsequence.getAttributs().get("pointgagner"));
if(nodsequence.getAttributs().get("pointtotal")!=null) pointsequencetotal = Double.valueOf(nodsequence.getAttributs().get("pointtotal"));
if(nodsequence.getAttributs().get("poids")!=null) try{poidssequence = Math.abs(Double.valueOf(nodsequence.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointnumerotation = 0; double pointnumerotationtotal = 0 ; double poidsnumerotation = 0;
if(nodnumerochapitre!=null) if(nodnumerochapitre.isClose()) {
if(nodnumerochapitre.getAttributs().get("pointgagner")!=null) pointnumerotation = Double.valueOf(nodnumerochapitre.getAttributs().get("pointgagner"));
if(nodnumerochapitre.getAttributs().get("pointtotal")!=null) pointnumerotationtotal = Double.valueOf(nodnumerochapitre.getAttributs().get("pointtotal"));
if(nodnumerochapitre.getAttributs().get("poids")!=null) try{poidsnumerotation = Math.abs(Double.valueOf(nodnumerochapitre.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointframe = 0; double pointframetotal = 0 ; double poidsframe = 0;
if(nodframes!=null) if(nodframes.isClose()) {
if(nodframes.getAttributs().get("pointgagner")!=null) pointframe = Double.valueOf(nodframes.getAttributs().get("pointgagner"));
if(nodframes.getAttributs().get("pointtotal")!=null) pointframetotal = Double.valueOf(nodframes.getAttributs().get("pointtotal"));
if(nodframes.getAttributs().get("poids")!=null) try{poidsframe = Math.abs(Double.valueOf(nodframes.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointsection = 0; double pointsectiontotal = 0 ; double poidssection = 0;
if(nodsections!=null) if(nodsections.isClose()) {
if(nodsections.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodsections.getAttributs().get("pointgagner"));
if(nodsections.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodsections.getAttributs().get("pointtotal"));
if(nodsections.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodsections.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtableau = 0; double pointtableautotal = 0 ; double poidstableau = 0;
if(nodtableaux!=null) if(nodtableaux.isClose()) {
if(nodtableaux.getAttributs().get("pointgagner")!=null) pointsection = Double.valueOf(nodtableaux.getAttributs().get("pointgagner"));
if(nodtableaux.getAttributs().get("pointtotal")!=null) pointsectiontotal = Double.valueOf(nodtableaux.getAttributs().get("pointtotal"));
if(nodtableaux.getAttributs().get("poids")!=null) try{poidssection = Math.abs(Double.valueOf(nodtableaux.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointbiblio = 0; double pointbibliototal = 0 ; double poidsbiblio = 0;
if(nodbiblio!=null) if(nodbiblio.isClose()) {
if(nodbiblio.getAttributs().get("pointgagner")!=null) pointbiblio = Double.valueOf(nodbiblio.getAttributs().get("pointgagner"));
if(nodbiblio.getAttributs().get("pointtotal")!=null) pointbibliototal = Double.valueOf(nodbiblio.getAttributs().get("pointtotal"));
if(nodbiblio.getAttributs().get("poids")!=null) try{poidsbiblio = Math.abs(Double.valueOf(nodbiblio.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtablematieres = 0; double pointtablematierestotal = 0 ; double poidstablematieres = 0;
if(nodtablematieres!=null) if(nodtablematieres.isClose()) {
if(nodtablematieres.getAttributs().get("pointgagner")!=null) pointtablematieres = Double.valueOf(nodtablematieres.getAttributs().get("pointgagner"));
if(nodtablematieres.getAttributs().get("pointtotal")!=null) pointtablematierestotal = Double.valueOf(nodtablematieres.getAttributs().get("pointtotal"));
if(nodtablematieres.getAttributs().get("poids")!=null) try{poidstablematieres = Math.abs(Double.valueOf(nodtablematieres.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointtableillustration = 0; double pointtableillustrationtotal = 0 ; double poidstableillustration = 0;
if(nodtableillustrations!=null) if(nodtableillustrations.isClose()) {
if(nodtableillustrations.getAttributs().get("pointgagner")!=null) pointtableillustration = Double.valueOf(nodtableillustrations.getAttributs().get("pointgagner"));
if(nodtableillustrations.getAttributs().get("pointtotal")!=null) pointtableillustrationtotal = Double.valueOf(nodtableillustrations.getAttributs().get("pointtotal"));
if(nodtableillustrations.getAttributs().get("poids")!=null) try{poidstableillustration = Math.abs(Double.valueOf(nodtableillustrations.getAttributs().get("poids")));}catch (Exception e) { };
}
double pointstructure = 0; double pointstructuretotal = 0 ; double poidsstructure = 0;
if(nodstructurepage!=null) if(nodstructurepage.isClose()) {
if(nodstructurepage.getAttributs().get("pointgagner")!=null) pointstructure = Double.valueOf(nodstructurepage.getAttributs().get("pointgagner"));
if(nodstructurepage.getAttributs().get("pointtotal")!=null) pointstructuretotal = Double.valueOf(nodstructurepage.getAttributs().get("pointtotal"));
if(nodstructurepage.getAttributs().get("poids")!=null) try{poidsstructure = Math.abs(Double.valueOf(nodstructurepage.getAttributs().get("poids")));}catch (Exception e) { };
}
double proportionCorrect = 0 ;
double poidsTotal = 0;
double pointsTotal = 0;
double pointgagner = 0;
double note = 0 ;
proportionCorrect = (poidsmeta*pointmeta + poidspage*pointpage + poidsparagraph*pointparagraph + poidssequence*pointsequence + poidsnumerotation*pointnumerotation + poidsframe*pointframe + poidsbiblio*pointbiblio + poidstablematieres*pointtablematieres + poidstableillustration*pointtableillustration + poidsstructure*pointstructure + poidssection*pointsection + poidstableau*pointtableau)
/ (poidsmeta*pointmetatotal + poidspage*pointpagetotal + poidsparagraph*pointparagraphtotal + poidssequence*pointsequencetotal + poidsnumerotation*pointnumerotationtotal + poidsframe*pointframetotal + poidsbiblio*pointbibliototal + poidstablematieres*pointtablematierestotal + poidstableillustration*pointtableillustrationtotal + poidsstructure*pointstructuretotal + poidssection*pointsectiontotal + poidstableau*pointtableautotal);
poidsTotal = poidsmeta + poidspage + poidsparagraph + poidssequence + poidsnumerotation + poidsframe + poidsbiblio + poidstablematieres + poidstableillustration + poidsstructure + poidssection + poidstableau;
pointsTotal = pointmetatotal + pointpagetotal + pointparagraphtotal + pointsequencetotal + pointnumerotationtotal + pointframetotal + pointbibliototal + pointtablematierestotal + pointtableillustrationtotal + pointstructuretotal + pointsectiontotal;
pointgagner = pointmeta + pointpage + pointparagraph + pointsequence + pointnumerotation + pointframe + pointsection + pointtableau + pointbiblio + pointtablematieres + pointtableillustration + pointstructure;
note = Math.pow(proportionCorrect, progression)*notefrom;
DecimalFormat df = new DecimalFormat("###.##");
nodbodyetnotation.getAttributs().put("proportioncorrect", df.format(proportionCorrect*100) + "%");
nodbodyetnotation.getAttributs().put("note", df.format(note));
nodbodyetnotation.getAttributs().put("pointstotal", String.valueOf(pointsTotal));
nodbodyetnotation.getAttributs().put("poidstotal", String.valueOf(poidsTotal));
nodbodyetnotation.getAttributs().put("pointgagner", String.valueOf(pointgagner));
if(Boolean.valueOf(erreurs.getAttributs().get("oneError"))) {
nodbodyetnotation.getAttributs().put("proportioncorrect", "0%");
nodbodyetnotation.getAttributs().put("note", "0.00");
proportionCorrect = 0.00;
}
// si bareme ABC (5 intervalles A, B, C, D, E de 20%)
if(baremeABC) {
double intervalle1 = Math.pow(0.2, 1/progression) ;
double intervalle2 = Math.pow(0.4, 1/progression) ;
double intervalle3 = Math.pow(0.6, 1/progression) ;
double intervalle4 = Math.pow(0.8, 1/progression) ;
nodbodyetnotation.getAttributs().put("BorneE", String.valueOf(intervalle1));
nodbodyetnotation.getAttributs().put("BorneD", String.valueOf(intervalle2));
nodbodyetnotation.getAttributs().put("BorneC", String.valueOf(intervalle3));
nodbodyetnotation.getAttributs().put("BorneB", String.valueOf(intervalle4));
nodbodyetnotation.getAttributs().put("BorneA", "1.00");
if(proportionCorrect<intervalle1) nodbodyetnotation.getAttributs().put("noteABC", "E");
if(proportionCorrect>=intervalle1 && proportionCorrect<intervalle2) nodbodyetnotation.getAttributs().put("noteABC", "D");
if(proportionCorrect>=intervalle2 && proportionCorrect<intervalle3) nodbodyetnotation.getAttributs().put("noteABC", "C");
if(proportionCorrect>=intervalle3 && proportionCorrect<intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "B");
if(proportionCorrect>=intervalle4) nodbodyetnotation.getAttributs().put("noteABC", "A");
}
nodanalyse.ajouteEnfant(nodouverture);
nodanalyse.ajouteEnfant(nodbodyetnotation);
nodanalyse.ajouteEnfant(nodmenu);
nodanalyse.ajouteEnfant(erreurs);
nodanalyse.ajouteEnfant(nodmeta);
nodanalyse.ajouteEnfant(nodpage);
nodanalyse.ajouteEnfant(nodparagraph);
nodanalyse.ajouteEnfant(nodsequence);
nodanalyse.ajouteEnfant(nodnumerochapitre);
nodanalyse.ajouteEnfant(nodframes);
nodanalyse.ajouteEnfant(nodsections);
nodanalyse.ajouteEnfant(nodtableaux);
nodanalyse.ajouteEnfant(nodbiblio);
nodanalyse.ajouteEnfant(nodtablematieres);
nodanalyse.ajouteEnfant(nodtableillustrations);
nodanalyse.ajouteEnfant(nodstructurepage);
node nodfermeturebodyHTML = new node();
nodfermeturebodyHTML.setNomElt("fermeture");
nodfermeturebodyHTML.setClose(true);
nodanalyse.getNodes().add(nodfermeturebodyHTML);
nodanalyse.setNomElt("analyse");
nodanalyse.setContenu(texteCommentaire);
nodanalyse.setClose(true);
return nodanalyse;
}
}

View File

@ -1,6 +1,8 @@
package MEPTL;
package evaluer;
import cXML.node;
import MEPTL.meptl;
import MEPTL.rechercherUnNodeStudent;
import cXML.Run;
public class analyseLesNodesEnfants {
@ -66,7 +68,7 @@ public class analyseLesNodesEnfants {
//**************************************************************
//** Analyse attribut et contenu du node enfant de l'étudiant **
//**************************************************************
PourAnalyse = meptl.evalLesAttributEtContenuDuNode(nodStudentCorrespondantAuNodSujet, nodEnfantSujet, PourAnalyse, nomDuNodePourAnalyse,nameNode);
PourAnalyse = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudentCorrespondantAuNodSujet, nodEnfantSujet, PourAnalyse, nomDuNodePourAnalyse,nameNode);
//*******************************
//** méthode analyseStyle=true **
@ -139,7 +141,7 @@ public class analyseLesNodesEnfants {
//**************************************************************
//** Analyse attribut et contenu du node enfant de l'étudiant **
//**************************************************************
PourAnalyse = meptl.evalLesAttributAnalyseStyle(StyleParagraphStudent, StyleParagraphSujet, PourAnalyse, nomDuNodePourAnalyse,"style:style");
PourAnalyse = evaluationAttribut.evalLesAttributAnalyseStyle(StyleParagraphStudent, StyleParagraphSujet, PourAnalyse, nomDuNodePourAnalyse,"style:style");
}
}

View File

@ -1,8 +1,9 @@
package MEPTL;
package evaluer;
import java.util.ArrayList;
import java.util.Enumeration;
import MEPTL.meptl;
import cXML.Run;
import cXML.node;
@ -32,7 +33,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//********************************************************
//** Parcours les nodes enfants du node <structurepage> **
@ -40,9 +41,9 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetBiblio.getNodes().size(); i++) {
if(nodSujetBiblio.getNodes().get(i).getNomElt().equals("text:bibliography")) {
node nodSujetBibio = nodSujetBiblio.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String nomDeLaBiblio = outils.withoutCodeAndPoint(nodSujetBibio.getAttributs().get("text:name"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaBiblio = evaluation.withoutCodeAndPoint(nodSujetBibio.getAttributs().get("text:name"));
node biblio = new node();
biblio.setNomElt("biblio");
biblio.getAttributs().put("namebiblio", nomDeLaBiblio);
@ -58,47 +59,47 @@ public class analyseLesNodesPrincipaux {
biblio = meptl.addNodeSautTitre(nodSujetBibio,biblio,nodmenu,a);
String TitreTable = outils.withoutCodeAndPoint(nodSujetBibio.retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
String TitreTable = evaluation.withoutCodeAndPoint(nodSujetBibio.retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetBiblio, "text:index-body"), TitreTable);
node nodStudent = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodStudentBiblio, "text:index-body"), TitreTable);
biblio = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, biblio, "ana:biblio", nodSujet.getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, biblio, "ana:biblio", nodSujet.getNomElt());
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
biblio = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
if(k<nodStudent.getNodes().get(j).getNodes().size()) {
biblio = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}else {
biblio = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
biblio = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
}
}else {
biblio = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
biblio = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
biblio.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
biblio.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
biblio.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
biblio.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodbiblio.getNodes().add(biblio);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodbiblio.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodbiblio.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodbiblio.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodbiblio.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodbiblio.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodbiblio.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodbiblio.setClose(true);
return nodbiblio;
}
@ -127,7 +128,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//*******************************************************************
//** Parcours les nodes enfants du node <text:outline-level-style> **
@ -135,9 +136,9 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetNumerotation.getNodes().size(); i++) {
if(nodSujetNumerotation.getNodes().get(i).getNomElt().equals("text:outline-level-style")) {
node numerotationSujet = nodSujetNumerotation.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String levelnumrotation = outils.withoutCodeAndPoint(nodSujetNumerotation.getNodes().get(i).getAttributs().get("text:level"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String levelnumrotation = evaluation.withoutCodeAndPoint(nodSujetNumerotation.getNodes().get(i).getAttributs().get("text:level"));
node numerotation = new node();
numerotation.setNomElt("numerotation");
numerotation.getAttributs().put("level", levelnumrotation);
@ -162,7 +163,7 @@ public class analyseLesNodesPrincipaux {
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
numerotation = meptl.evalLesAttributEtContenuDuNode(numerotationStudent, numerotationSujet, numerotation, "ana:numerotation",numerotationSujet.getNomElt());
numerotation = evaluationAttribut.evalLesAttributEtContenuDuNode(numerotationStudent, numerotationSujet, numerotation, "ana:numerotation",numerotationSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -172,8 +173,8 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
numerotation.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
numerotation.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
numerotation.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
numerotation.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodnumerotations.getNodes().add(numerotation);
}
@ -182,9 +183,9 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodnumerotations.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodnumerotations.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodnumerotations.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodnumerotations.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodnumerotations.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodnumerotations.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodnumerotations.setClose(true);
return nodnumerotations;
@ -214,7 +215,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//*****************************************************
//** Parcours les nodes enfants du node <draw:frame> **
@ -222,9 +223,9 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetFrames.getNodes().size(); i++) {
if(nodSujetFrames.getNodes().get(i).getNomElt().equals("draw:frame")) {
node frameSujet = nodSujetFrames.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String nomDuFrame = outils.withoutCodeAndPoint(frameSujet.getAttributs().get("draw:name"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDuFrame = evaluation.withoutCodeAndPoint(frameSujet.getAttributs().get("draw:name"));
node frame = new node();
frame.setNomElt("frame");
frame.getAttributs().put("nameframe", nomDuFrame);
@ -247,7 +248,7 @@ public class analyseLesNodesPrincipaux {
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
frame = meptl.evalLesAttributEtContenuDuNode(frameStudent, frameSujet, frame, "ana:frame",frameSujet.getNomElt());
frame = evaluationAttribut.evalLesAttributEtContenuDuNode(frameStudent, frameSujet, frame, "ana:frame",frameSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -257,17 +258,17 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
frame.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
frame.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
frame.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
frame.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodframes.getNodes().add(frame);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodframes.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodframes.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodframes.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodframes.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodframes.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodframes.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodframes.setClose(true);
return nodframes;
}
@ -298,7 +299,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//***********************************************************************
//** Parcours les nodes enfants du node <meta:user-defined> ou autres **
@ -328,8 +329,8 @@ public class analyseLesNodesPrincipaux {
//*******************************
//** Recherche le node Student **
//*******************************
node nodStudent = a.retourneFirstNodeByNameAttributContainsValueNetTexte(nodStudentMeta, namenode,k,outils.withoutCodeAndPointPourRechercheContenuExact(valueOfAttribut));
nodmeta = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, nodmeta, "ana:meta", namenode);
node nodStudent = a.retourneFirstNodeByNameAttributContainsValueNetTexte(nodStudentMeta, namenode,k,evaluation.withoutCodeAndPointPourRechercheContenuExact(valueOfAttribut));
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, nodmeta, "ana:meta", namenode);
}
}
}else {
@ -340,12 +341,12 @@ public class analyseLesNodesPrincipaux {
if(NStudent!=null) {
if(!NStudent.isEmpty()) {
nodmeta = meptl.evalLesAttributEtContenuDuNode(NStudent.get(0), sujet.get(i), nodmeta, "ana:meta", namenode);
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(NStudent.get(0), sujet.get(i), nodmeta, "ana:meta", namenode);
}else {
nodmeta = meptl.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
}
}else {
nodmeta = meptl.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
}
}
@ -355,9 +356,9 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodmeta.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodmeta.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodmeta.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodmeta.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodmeta.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodmeta.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodmeta.setClose(true);
return nodmeta;
}
@ -386,7 +387,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//*******************************************************
//** Parcours les nodes enfants du node <text:section> **
@ -394,9 +395,9 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetSections.getNodes().size(); i++) {
if(nodSujetSections.getNodes().get(i).getNomElt().equals("text:section")) {
node sectionSujet = nodSujetSections.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String nomDeLaSection = outils.withoutCodeAndPoint(sectionSujet.getAttributs().get("text:name"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaSection = evaluation.withoutCodeAndPoint(sectionSujet.getAttributs().get("text:name"));
node section = new node();
section.setNomElt("section");
@ -420,7 +421,7 @@ public class analyseLesNodesPrincipaux {
//***********************************************
//** analyse les attributs des nodes <section> **
//***********************************************
section = meptl.evalLesAttributEtContenuDuNode(sectionStudent, sectionSujet, section, "ana:section",sectionSujet.getNomElt());
section = evaluationAttribut.evalLesAttributEtContenuDuNode(sectionStudent, sectionSujet, section, "ana:section",sectionSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -431,8 +432,8 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
section.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
section.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
section.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
section.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodsections.getNodes().add(section);
}
@ -441,9 +442,9 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodsections.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodsections.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodsections.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodsections.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodsections.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodsections.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodsections.setClose(true);
return nodsections;
@ -473,7 +474,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//*************************************************************
//** Parcours les nodes enfants du node <text:sequence-decl> **
@ -481,9 +482,9 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetSequence.getNodes().size(); i++) {
if(nodSujetSequence.getNodes().get(i).getNomElt().equals("text:sequence-decl")) {
node seqSujet = nodSujetSequence.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String nomSequence = outils.withoutCodeAndPoint(seqSujet.getAttributs().get("text:name"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomSequence = evaluation.withoutCodeAndPoint(seqSujet.getAttributs().get("text:name"));
node seq = new node();
seq.setNomElt("sequence");
seq.getAttributs().put("name", nomSequence);
@ -511,22 +512,22 @@ public class analyseLesNodesPrincipaux {
//***********************************************
//** analyse les attributs des nodes <section> **
//***********************************************
seq = meptl.evalLesAttributEtContenuDuNode(seqStudent, seqSujet, seq, "ana:seq",seqSujet.getNomElt());
seq = evaluationAttribut.evalLesAttributEtContenuDuNode(seqStudent, seqSujet, seq, "ana:seq",seqSujet.getNomElt());
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
seq.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
seq.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
seq.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
seq.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodseq.getNodes().add(seq);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodseq.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodseq.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodseq.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodseq.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodseq.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodseq.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodseq.setClose(true);
return nodseq;
}
@ -556,17 +557,17 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//******************************************************
//** Parcours les nodes enfants du node <table:table> **
//******************************************************
for(int i = 0 ; i < nodSujetTableaux.getNodes().size(); i++) {
if(nodSujetTableaux.getNodes().get(i).getNomElt().equals("table:table")) {
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node tableSujet = nodSujetTableaux.getNodes().get(i);
String nomDeLaTable = outils.withoutCodeAndPoint(tableSujet.getAttributs().get("table:name"));
String nomDeLaTable = evaluation.withoutCodeAndPoint(tableSujet.getAttributs().get("table:name"));
node tableau = new node();
tableau.setNomElt("tableau");
@ -590,7 +591,7 @@ public class analyseLesNodesPrincipaux {
//***************************************************
//** analyse les attributs des nodes <table:table> **
//***************************************************
tableau = meptl.evalLesAttributEtContenuDuNode(tableauStudent, tableSujet, tableau, "ana:tableau",tableSujet.getNomElt());
tableau = evaluationAttribut.evalLesAttributEtContenuDuNode(tableauStudent, tableSujet, tableau, "ana:tableau",tableSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -661,17 +662,17 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
tableau.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
tableau.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
tableau.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
tableau.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodtableaux.getNodes().add(tableau);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodtableaux.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodtableaux.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodtableaux.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodtableaux.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodtableaux.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodtableaux.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodtableaux.setClose(true);
return nodtableaux;
@ -701,16 +702,16 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
for(int i = 0 ; i < nodSujetTableI.getNodes().size(); i++) {
if(nodSujetTableI.getNodes().get(i).getNomElt().equals("text:illustration-index")) {
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node table = new node();
table.setNomElt("tableillustrations");
String TitreTable = outils.withoutCodeAndPoint(nodSujetTableI.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
String TitreTable = evaluation.withoutCodeAndPoint(nodSujetTableI.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetTableI, "text:index-body"), TitreTable);
//*****************************
@ -731,7 +732,7 @@ public class analyseLesNodesPrincipaux {
//*********************************************
//** analyse les attributs des nodes <table> **
//*********************************************
table = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt());
//****************************************************************
//** Parcours les nodes enfants du node <text:illustration-index> **
@ -739,38 +740,38 @@ public class analyseLesNodesPrincipaux {
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
table = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
if(k<nodStudent.getNodes().get(j).getNodes().size()) {
table = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
}
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
table.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
table.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
table.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
table.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodTablesMs.getNodes().add(table);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodTablesMs.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodTablesMs.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodTablesMs.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodTablesMs.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodTablesMs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodTablesMs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodTablesMs.setClose(true);
return nodTablesMs;
@ -800,16 +801,16 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
for(int i = 0 ; i < nodSujetTableM.getNodes().size(); i++) {
if(nodSujetTableM.getNodes().get(i).getNomElt().equals("text:table-of-content")) {
node table = new node();
table.setNomElt("tablematiere");
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String TitreTable = outils.withoutCodeAndPoint(nodSujetTableM.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String TitreTable = evaluation.withoutCodeAndPoint(nodSujetTableM.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetTableM, "text:index-body"), TitreTable);
@ -831,7 +832,7 @@ public class analyseLesNodesPrincipaux {
//*********************************************
//** analyse les attributs des nodes <table> **
//*********************************************
table = meptl.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt());
//****************************************************************
//** Parcours les nodes enfants du node <text:table-of-content> **
@ -839,21 +840,21 @@ public class analyseLesNodesPrincipaux {
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
table = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j), nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
if(k<nodStudent.getNodes().get(j).getNodes().size()) {
table = meptl.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent.getNodes().get(j).getNodes().get(k), nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
}
}else {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
for(int k=0; k<nodSujet.getNodes().get(j).getNodes().size();k++) {
table = meptl.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}
@ -861,8 +862,8 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
table.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
table.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
table.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
table.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodTablesMs.getNodes().add(table);
}
@ -870,9 +871,9 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodTablesMs.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodTablesMs.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodTablesMs.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodTablesMs.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodTablesMs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodTablesMs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodTablesMs.setClose(true);
return nodTablesMs;
@ -901,7 +902,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//****************************************
//** Analyse tous les style:master-page **
@ -910,9 +911,9 @@ public class analyseLesNodesPrincipaux {
if(nodSujetPage.getNodes().get(i).getNomElt().equals("style:master-page")) {
node pageSujet = nodSujetPage.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
String nomDeLaPage = outils.withoutCodeAndPoint(pageSujet.getAttributs().get("style:name"));
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaPage = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("style:name"));
node page = new node();
page.setNomElt("page");
page.getAttributs().put("name", nomDeLaPage);
@ -935,7 +936,7 @@ public class analyseLesNodesPrincipaux {
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
page = meptl.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
//**********************************************
//** Analyse de tous les autres nodes enfants **
@ -945,17 +946,17 @@ public class analyseLesNodesPrincipaux {
//*****************************************************************
//** Insère les attributs des points dans les nodes de l'analyse **
//*****************************************************************
page.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
page.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
page.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
page.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodpages.getNodes().add(page);
}
}
//*****************************************************************
//** Insère les attributs des points dans les nodes de l'analyse **
//*****************************************************************
nodpages.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodpages.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodpages.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodpages.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodpages.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodpages.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodpages.setClose(true);
return nodpages;
}
@ -983,17 +984,17 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//******************************************************
//** Parcours les nodes enfants du node <style:style> **
//******************************************************
for(int i = 0 ; i < nodSujetParagraph.getNodes().size(); i++) {
if(nodSujetParagraph.getNodes().get(i).getNomElt().equals("style:style")) {
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node paragraphSujet = nodSujetParagraph.getNodes().get(i);
String nomDuParagraph = outils.withoutCodeAndPoint(paragraphSujet.getAttributs().get("style:name"));
String nomDuParagraph = evaluation.withoutCodeAndPoint(paragraphSujet.getAttributs().get("style:name"));
node paragraph = new node();
paragraph.setNomElt("paragraph");
paragraph.getAttributs().put("name", nomDuParagraph);
@ -1016,7 +1017,7 @@ public class analyseLesNodesPrincipaux {
//*************************************************
//** analyse les attributs des nodes <paragraph> **
//*************************************************
paragraph = meptl.evalLesAttributEtContenuDuNode(paragraphStudent, paragraphSujet, paragraph, "ana:paragraph",paragraphSujet.getNomElt());
paragraph = evaluationAttribut.evalLesAttributEtContenuDuNode(paragraphStudent, paragraphSujet, paragraph, "ana:paragraph",paragraphSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -1026,17 +1027,17 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
paragraph.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
paragraph.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
paragraph.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
paragraph.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodparagraphs.getNodes().add(paragraph);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodparagraphs.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodparagraphs.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodparagraphs.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodparagraphs.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodparagraphs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodparagraphs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodparagraphs.setClose(true);
return nodparagraphs;
}
@ -1071,7 +1072,7 @@ public class analyseLesNodesPrincipaux {
//***************************
//** initialise les points **
//***************************
outils.initiliseLesPoints();
evaluation.initiliseLesPoints();
//********************************************************
//** Parcours les nodes enfants du node <structurepage> **
@ -1079,12 +1080,12 @@ public class analyseLesNodesPrincipaux {
for(int i = 0 ; i < nodSujetS.getNodes().size(); i++) {
if(nodSujetS.getNodes().get(i).getNomElt().equals("page")) {
node pageSujet = nodSujetS.getNodes().get(i);
int pointDebut = outils.getPointsClass();
int pointTotalDebut = outils.getPointTotal();
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaPage = outils.withoutCodeAndPoint(pageSujet.getAttributs().get("style:master-page-name"));
String nomDeLaPage = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("style:master-page-name"));
if(nomDeLaPage==null) nomDeLaPage="Défaut";
String numeroabsolue = outils.withoutCodeAndPoint(pageSujet.getAttributs().get("numeroabsolue"));
String numeroabsolue = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("numeroabsolue"));
node page = new node();
page.setNomElt("page");
page.getAttributs().put("namepage", nomDeLaPage);
@ -1108,7 +1109,7 @@ public class analyseLesNodesPrincipaux {
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
page = meptl.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
@ -1118,17 +1119,17 @@ public class analyseLesNodesPrincipaux {
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
page.getAttributs().put("point", String.valueOf(outils.getPointsClass()-pointDebut));
page.getAttributs().put("pointTotal", String.valueOf(outils.getPointTotal()-pointTotalDebut));
page.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
page.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodSpages.getNodes().add(page);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
nodSpages.getAttributs().put("pointgagner",String.valueOf(outils.getPointsClass()));
nodSpages.getAttributs().put("pointtotal",String.valueOf(outils.getPointTotal()));
nodSpages.getAttributs().put("proportioncorrect",String.valueOf(outils.getProportionCorrect()));
nodSpages.getAttributs().put("pointgagner",String.valueOf(evaluation.getPointsClass()));
nodSpages.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodSpages.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodSpages.setClose(true);
return nodSpages;

View File

@ -1,4 +1,4 @@
package MEPTL;
package evaluer;
import java.util.ArrayList;
@ -7,6 +7,8 @@ import java.util.Hashtable;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import MEPTL.HTML;
import MEPTL.commandes;
import cXML.node;
import calcul.StringSimilarity;
/**
@ -14,7 +16,7 @@ import calcul.StringSimilarity;
* @author pablo rodriguez
*
*/
public class outils {
public class evaluation {
public static Dictionary<String, String> traduction = new Hashtable<String, String>();
@ -104,7 +106,7 @@ public class outils {
* Compare les chaînes de caractères A et sujet en fonction des 8 fonctions ¢ ¦ ×<br>
*
* @param A le texte de l'étudiant.
* @param Sujet le tetxte du sujet.
* @param Sujet le texte du sujet.
* @return Une chaine de caractère contenant "Correct" ou "Erreur".
*/
public static String Compare(String A, String Sujet ) {
@ -808,7 +810,7 @@ public class outils {
* @param A
* @return
*/
static String remplaceCaracteresCodageAttribut(String A) {
public static String remplaceCaracteresCodageAttribut(String A) {
if(A!=null) {
A = A.replace("_20_", " ");
A = A.replace("_26_", "&");
@ -817,137 +819,7 @@ public class outils {
}
// /**
// * Nettoyage (suppression) des caractères spéciaux
// * @param A
// * @return
// */
// static String NetTexte21(String A) {
// if (A!=null) {
// A=A.toLowerCase().trim();
//
// ArrayList<Integer> table1 = new ArrayList<Integer>();
// byte[] V = A.getBytes();
//
// byte[] W = new byte[V.length];
// int c =0;
// for(int i = 0 ; i < V.length;i++) {
// if(V[i]>0) {
// //if (V[i]!=63 && V[i]!=-128 && V[i]!=-103) { //63 les accents é ; -128 le symbole -30,-128,-103 l'apostrophe
// W[c]=V[i];
// table1.add((int) W[c]);
// c++;
// }
// }
// try {
// A = new String(W,"UTF-8");
//
// } catch (UnsupportedEncodingException e) {
// // TODO Auto-generated catch block
// e.printStackTrace();
// }
//
// A=A.replace("@", "");
// A=A.replace("?", "");
// A=A.replace("!", "");
// A=A.replace("α", "");
// A=A.replace("β", "");
// A=A.replace("γ", "");
// A=A.replace("δ", "");
// A=A.replace("ε", "");
// A=A.replace("σ", "");
// A=A.replace("τ", "");
// A=A.replace("ζ", "");
// A=A.replace("η", "");
// A=A.replace("θ", "");
// A=A.replace("ι", "");
// A=A.replace("", "");
// A=A.replace("'", "");
//
// A=A.replace(" ", "");
// A=A.replace("'", "");
// A=A.replace("«", "");
// A=A.replace("»", "");
// A=A.replace("&apos;", "");
// A=A.replace("d&apos;", "");
//
//
// A=A.replace("", "");
// A=A.replace("e", "");
// A=A.replace("é", "");
// A=A.replace("", ""); // pas le même encodage
//
// A=A.replace("è", "");
// A=A.replace("", ""); // pas le même encodage
// A=A.replace("ê", "");
//
//
// A=A.replace("o", "");
// A=A.replace("ô", "");
//
// A=A.replace("a", "");
// A=A.replace("â", "");
// A=A.replace("", ""); // pas le même encodage
//
// A=A.replace("à", "");
// A=A.replace("", ""); // pas le même encodage
//
// A=A.replace("u", "");
// A=A.replace("ù", "");
// A=A.replace("û", "");
//
// A=A.replace("c", "");
// A=A.replace("ç", "");
//
// A=A.replace("i", "");
// A=A.replace("î", "");
// A=A.replace("ï", "");
// A=A.replace("", ""); // pas le même encodage
//
// A=A.replace("0", "");
// A=A.replace("1", "");
// A=A.replace("2", "");
// A=A.replace("3", "");
// A=A.replace("4", "");
// A=A.replace("5", "");
// A=A.replace("6", "");
// A=A.replace("7", "");
// A=A.replace("8", "");
// A=A.replace("9", "");
//
//
// A=A.replace(":", "");
// A=A.replace("-", "");
// A=A.replace(".", "");
// A=A.replace(",", "");
// A=A.replace("_", "");
// A=A.replace("_", "");
// A=A.replace("(", "");
// A=A.replace(")", "");
// A=A.replace("\"", "");
// A=A.replace("+", "");
// A=A.replace("Œ", "");
// A=A.replace("œ", "");
// A=A.replace("oe", "");
// A=A.replace("\r", "");
// A=A.replace("\n", "");
// A=A.replace("\t", "");
// A=A.replace("/", "");
// A=A.replace("(", "");
// A=A.replace(")", "");
// A=A.replace(" ","");
//
//
//
// A=A.trim();
//
// }
// return A;
// }
public static int getPointsClass() {
return pointsClass;

Some files were not shown because too many files have changed in this diff Show More