analyseWriter/src/evaluer/analyseLesNodesPrincipaux.java

1205 lines
58 KiB
Java

package evaluer;
import java.util.ArrayList;
import java.util.Enumeration;
import MEPTL.meptl;
import cXML.Run;
import cXML.node;
import calcul.calculNombrePointEvaluation;
public class analyseLesNodesPrincipaux {
/**
* Analyse du node <b>bibliographies</b>.
* @param nodStudentBiblio
* @param nodSujetBiblio
* @param a
* @param nodmenu
* @return
*/
public static node analyseLaBiblio(node nodStudentBiblio, node nodSujetBiblio, Run a, node nodmenu) {
node nodbiblio = new node();
nodbiblio.setNomElt("bibliographies");
nodbiblio.setAttributs(nodSujetBiblio.getAttributs());//ajoute tous les attributs du sujet
nodbiblio.setContenu(nodSujetBiblio.getContenu());//ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "biblio")!=null) {
nodbiblio.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "biblio").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//********************************************************
//** Parcours les nodes enfants du node <structurepage> **
//********************************************************
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 = 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);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
biblio = meptl.addSaut(nodSujetBibio,biblio);
//*********************
//** Ajoute un titre **
//*********************
biblio = meptl.addNodeSautTitre(nodSujetBibio,biblio,nodmenu,a);
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 = 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 = 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 = 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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
biblio = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), biblio, "ana:biblio", nodSujet.getNodes().get(j).getNomElt());
}
}else {
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 = 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(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(evaluation.getPointsClass()));
nodbiblio.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodbiblio.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodbiblio.setClose(true);
return nodbiblio;
}
/**
* Analyse du node <b>numerotationchapitre</b>.</br>
* @param nodStudentNumerotation
* @param nodSujetNumerotation
* @param a
* @param nodmenu
* @return
*/
public static node analyseLaNumerotationChapitre(node nodStudentNumerotation, node nodSujetNumerotation, Run a, node nodmenu) {
node nodnumerotations = new node();
nodnumerotations.setNomElt("numerotationchapitre");
nodnumerotations.setAttributs(nodSujetNumerotation.getAttributs());//ajoute tous les attributs du sujet
nodnumerotations.setContenu(nodSujetNumerotation.getContenu()); //ajoute le commantaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "numerotationchapitre")!=null) {
nodnumerotations.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "numerotationchapitre").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//*******************************************************************
//** Parcours les nodes enfants du node <text:outline-level-style> **
//*******************************************************************
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 = 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);
if(nodSujetNumerotation.getNodes().get(i).getAttributs().get("titre")!=null) numerotation.getAttributs().put("titre", nodSujetNumerotation.getNodes().get(i).getAttributs().get("titre"));
//*****************************
//** Ajoute un saut de ligne **
//*****************************
numerotation = meptl.addSaut(numerotationSujet,numerotation);
//*********************
//** Ajoute un titre **
//*********************
numerotation = meptl.addNodeSautTitre(numerotationSujet,numerotation,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node numerotationStudent = a.retourneFirstNodeByNameAttributValue(nodStudentNumerotation, "text:outline-level-style", "text:level", levelnumrotation);
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
numerotation = evaluationAttribut.evalLesAttributEtContenuDuNode(numerotationStudent, numerotationSujet, numerotation, "ana:numerotation",numerotationSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
numerotation = analyseLesNodesEnfants.nodeNext(numerotation, "ana:numerotation", numerotationStudent, null, null, numerotationSujet, null, null, nodmenu,a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
numerotation.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
numerotation.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodnumerotations.getNodes().add(numerotation);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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;
}
/**
* Analyse du node <b>frames</b>.
* @param nodStudentFrames
* @param nodSujetframes
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesFrames(node nodStudentFrames, node nodSujetFrames, Run a, node nodmenu) {
node nodframes = new node();
nodframes.setNomElt("frames");
nodframes.setAttributs(nodSujetFrames.getAttributs()); //ajoute tous les attributs du sujet
nodframes.setContenu(nodSujetFrames.getContenu()); //ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "frames")!=null) {
nodframes.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "frames").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//*****************************************************
//** Parcours les nodes enfants du node <draw:frame> **
//*****************************************************
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 = 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);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
frame = meptl.addSaut(frameSujet,frame);
//*********************
//** Ajoute un titre **
//*********************
frame = meptl.addNodeSautTitre(frameSujet,frame,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node frameStudent = a.retourneFirstNodeByNameAttributValue(nodStudentFrames, "draw:frame", "draw:name", nomDuFrame);
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
frame = evaluationAttribut.evalLesAttributEtContenuDuNode(frameStudent, frameSujet, frame, "ana:frame",frameSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
frame = analyseLesNodesEnfants.nodeNext(frame, "ana:frame", frameStudent, null, null, frameSujet, null, null, nodmenu,a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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(evaluation.getPointsClass()));
nodframes.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodframes.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodframes.setClose(true);
return nodframes;
}
/**
* Analyse du node <b>office:meta</b>.
* @param nodStudentMeta
* @param nodSujetMeta
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesMeta(node nodStudentMeta, node nodSujetMeta, Run a, node nodmenu) {
node nodmeta = new node();
nodmeta.setNomElt("meta");
nodmeta.setAttributs(nodSujetMeta.getAttributs());
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "office:meta")!=null) {
nodmeta.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "office:meta").getAttributs().get("id"));
}
//Applatir le node sujetMeta
ArrayList<node> sujet = a.Applatir(nodSujetMeta.getNodes(), new ArrayList<node>());
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//***********************************************************************
//** Parcours les nodes enfants du node <meta:user-defined> ou autres **
//***********************************************************************
for(int i = 0 ; i < sujet.size(); i++) {
node nodSujet = sujet.get(i);
String namenode = nodSujet.getNomElt();
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujet.getAttributs().get("evaluer")==null) continue;
if(!nodSujet.getAttributs().get("evaluer").equals("true")) continue;
//*****************************
//** Ajoute un saut de ligne **
//*****************************
nodmeta = meptl.addSaut(nodSujet,nodmeta);
//*********************
//** Ajoute un titre **
//*********************
nodmeta = meptl.addNodeSautTitre(nodSujet,nodmeta,nodmenu,a);
// parcours les attributs du node "meta:user-defined"
if(namenode.equals("meta:user-defined")) {
Enumeration<String> key = nodSujet.getAttributs().keys();
while(key.hasMoreElements()) {
String k = key.nextElement();
if(nodSujet.getAttributs().get(k).contains("")){
String valueOfAttribut = nodSujet.getAttributs().get(k);
//*******************************
//** Recherche le node Student **
//*******************************
node nodStudent = a.retourneFirstNodeByNameAttributContainsValueNetTexte(nodStudentMeta, namenode,k,evaluation.withoutCodeAndPointPourRechercheContenuExact(valueOfAttribut));
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, nodmeta, "ana:meta", namenode);
}
}
}else {
//*******************************
//** Recherche le node Student **
//*******************************
ArrayList<node> NStudent = a.retourneNames(nodStudentMeta, namenode);
if(NStudent!=null) {
if(!NStudent.isEmpty()) {
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(NStudent.get(0), sujet.get(i), nodmeta, "ana:meta", namenode);
}else {
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
}
}else {
nodmeta = evaluationAttribut.evalLesAttributEtContenuDuNode(null, sujet.get(i), nodmeta, "ana:meta", namenode);
}
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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;
}
/**
* Analyse du node <b>sections</b>
* @param nodStudentSections
* @param nodSujetSections
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesSections(node nodStudentSections, node nodSujetSections, Run a, node nodmenu) {
node nodsections = new node();
nodsections.setNomElt("sections");
nodsections.setAttributs(nodSujetSections.getAttributs()); //ajoute tous les attributs du sujet
nodsections.setContenu(nodSujetSections.getContenu()); //ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "sections")!=null) {
nodsections.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "sections").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//*******************************************************
//** Parcours les nodes enfants du node <text:section> **
//*******************************************************
for(int i = 0 ; i < nodSujetSections.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetSections.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetSections.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetSections.getNodes().get(i).getNomElt().equals("text:section")) {
node sectionSujet = nodSujetSections.getNodes().get(i);
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaSection = evaluation.withoutCodeAndPoint(sectionSujet.getAttributs().get("text:name"));
node section = new node();
section.setNomElt("section");
section.getAttributs().put("namesection", nomDeLaSection);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
section = meptl.addSaut(sectionSujet,section);
//*********************
//** Ajoute un titre **
//*********************
section = meptl.addNodeSautTitre(sectionSujet,section,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node sectionStudent = a.retourneFirstNodeByNameAttributValue(nodStudentSections, "text:section", "text:name", nomDeLaSection);
//***********************************************
//** analyse les attributs des nodes <section> **
//***********************************************
section = evaluationAttribut.evalLesAttributEtContenuDuNode(sectionStudent, sectionSujet, section, "ana:section",sectionSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
section = analyseLesNodesEnfants.nodeNext(section, "ana:section", sectionStudent, null, null, sectionSujet, null, null,nodmenu, a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
section.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut));
section.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut));
nodsections.getNodes().add(section);
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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;
}
/**
* Analyse du node <b>sequences</b>.
* @param nodStudentSequence
* @param nodSujetSequence
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesSequences(node nodStudentSequence, node nodSujetSequence, Run a, node nodmenu) {
node nodseq = new node();
nodseq.setNomElt("sequences");
nodseq.setAttributs(nodSujetSequence.getAttributs());
nodseq.setContenu(nodSujetSequence.getContenu()); //ajoute le commentaire
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "sequences")!=null) {
nodseq.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "sequences").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//*************************************************************
//** Parcours les nodes enfants du node <text:sequence-decl> **
//*************************************************************
for(int i = 0 ; i < nodSujetSequence.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetSequence.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetSequence.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetSequence.getNodes().get(i).getNomElt().equals("text:sequence-decl")) {
node seqSujet = nodSujetSequence.getNodes().get(i);
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);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
seq = meptl.addSaut(seqSujet,seq);
//*********************
//** Ajoute un titre **
//*********************
seq = meptl.addNodeSautTitre(seqSujet,seq,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node seqStudent = a.retourneFirstNodeByNameAttributValue(nodStudentSequence, "text:sequence-decl", "text:name", nomSequence);
//*********************
//** Ajoute un titre **
//*********************
seq = meptl.addNodeSautTitre(seqSujet, seq,nodmenu,a);
//***********************************************
//** analyse les attributs des nodes <section> **
//***********************************************
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(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(evaluation.getPointsClass()));
nodseq.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodseq.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodseq.setClose(true);
return nodseq;
}
/**
* Analyse du node <b>tableaux</b>
* @param nodStudentSections
* @param nodSujetSections
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesTableaux(node nodStudentTableaux, node nodSujetTableaux, Run a, node nodmenu) {
node nodtableaux = new node();
nodtableaux.setNomElt("tableaux");
nodtableaux.setAttributs(nodSujetTableaux.getAttributs()); //ajoute tous les attributs du sujet
nodtableaux.setContenu(nodSujetTableaux.getContenu()); //ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tableau")!=null) {
nodtableaux.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tableau").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//******************************************************
//** Parcours les nodes enfants du node <table:table> **
//******************************************************
for(int i = 0 ; i < nodSujetTableaux.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetTableaux.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetTableaux.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetTableaux.getNodes().get(i).getNomElt().equals("table:table")) {
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node tableSujet = nodSujetTableaux.getNodes().get(i);
String nomDeLaTable = evaluation.withoutCodeAndPoint(tableSujet.getAttributs().get("table:name"));
node tableau = new node();
tableau.setNomElt("tableau");
tableau.getAttributs().put("nametableau", nomDeLaTable);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
tableau = meptl.addSaut(tableSujet,tableau);
//*********************
//** Ajoute un titre **
//*********************
tableau = meptl.addNodeSautTitre(tableSujet,tableau,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node tableauStudent = a.retourneFirstNodeByNameAttributValue(nodStudentTableaux, "table:table", "table:name", nomDeLaTable);
//***************************************************
//** analyse les attributs des nodes <table:table> **
//***************************************************
tableau = evaluationAttribut.evalLesAttributEtContenuDuNode(tableauStudent, tableSujet, tableau, "ana:tableau",tableSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
tableau = analyseLesNodesEnfants.nodeNext(tableau, "ana:tableau", tableauStudent, null, null, tableSujet, null, null,nodmenu, a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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(evaluation.getPointsClass()));
nodtableaux.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodtableaux.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodtableaux.setClose(true);
return nodtableaux;
}
/**
* Analyse du node <b>tableillustrations</b>.
* @param nodStudentTableI
* @param nodSujetTableI
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesTablesIllustrations(node nodStudentTableI, node nodSujetTableI, Run a, node nodmenu) {
node nodTablesMs = new node();
nodTablesMs.setNomElt("tableillustrations");
nodTablesMs.setAttributs(nodSujetTableI.getAttributs());//ajoute tous les attributs du sujet
nodTablesMs.setContenu(nodSujetTableI.getContenu());//ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tableillustrations")!=null) {
nodTablesMs.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tableillustrations").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
for(int i = 0 ; i < nodSujetTableI.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetTableI.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetTableI.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetTableI.getNodes().get(i).getNomElt().equals("text:illustration-index")) {
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node table = new node();
table.setNomElt("tableillustrations");
String TitreTable = evaluation.withoutCodeAndPoint(nodSujetTableI.getNodes().get(i).retourneFirstEnfantsByName("text:index-title").retourneLesContenusEnfants(""));
node nodSujet = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodSujetTableI, "text:index-body"), TitreTable);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
table = meptl.addSaut(nodSujet,table);
//*********************
//** Ajoute un titre **
//*********************
table = meptl.addNodeSautTitre(nodSujet,table,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node nodStudent = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodStudentTableI, "text:index-body"), TitreTable);
if(nodStudent==null) if(nodStudentTableI!=null) if(nodStudentTableI.getNodes().size()>0) nodStudent = nodStudentTableI.getNodes().get(0);
//*********************************************
//** analyse les attributs des nodes <table> **
//*********************************************
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt());
//****************************************************************
//** Parcours les nodes enfants du node <text:illustration-index> **
//****************************************************************
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
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 = 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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
}
}else {
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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}
//*******************************
//** Recherche le node Student **
//*******************************
nodSujet = nodSujet.getParent().retourneFirstEnfantsByName("text:illustration-index-sourceIllustrations");
if(nodStudent!=null) {
nodStudent = nodStudent.getParent().retourneFirstEnfantsByName("text:illustration-index-sourceIllustrations");
//*********************************************
//** analyse les attributs des nodes <table> **
//*********************************************
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt());
//**************************************************************************************
//** Parcours les nodes enfants du node <text:illustration-index-sourceIllustrations> **
//**************************************************************************************
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
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 = 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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tableillustration", nodSujet.getNodes().get(j).getNomElt());
}
}else {
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 = 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(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(evaluation.getPointsClass()));
nodTablesMs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodTablesMs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodTablesMs.setClose(true);
return nodTablesMs;
}
/**
* Analyse du node <b>tablematieres</b>.
* @param nodStudentTableM
* @param nodSujetTableM
* @param a
* @param nodmenu
* @return
*/
public static node analyseLesTablesMatieres(node nodStudentTableM, node nodSujetTableM, Run a, node nodmenu) {
node nodTablesMs = new node();
nodTablesMs.setNomElt("tablematieres");
nodTablesMs.setAttributs(nodSujetTableM.getAttributs());//ajoute tous les attributs du sujet
nodTablesMs.setContenu(nodSujetTableM.getContenu());//ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tablematieres")!=null) {
nodTablesMs.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "tablematieres").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
for(int i = 0 ; i < nodSujetTableM.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetTableM.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetTableM.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetTableM.getNodes().get(i).getNomElt().equals("text:table-of-content")) {
node table = new node();
table.setNomElt("tablematiere");
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);
nodSujet = nodSujet.getParent();
//*****************************
//** Ajoute un saut de ligne **
//*****************************
table = meptl.addSaut(nodSujet,table);
//*********************
//** Ajoute un titre **
//*********************
table = meptl.addNodeSautTitre(nodSujet,table,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node nodStudent = a.retourneFirstNodeParagrapheContain(a.retourneNames(nodStudentTableM, "text:index-body"), TitreTable);
if(nodStudent!=null) nodStudent = nodStudent.getParent();
//*********************************************
//** analyse les attributs des nodes <table> **
//*********************************************
table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt());
//****************************************************************
//** Parcours les nodes enfants du node <text:table-of-content> **
//****************************************************************
for(int j =0 ; j < nodSujet.getNodes().size();j++) {
if(nodStudent!=null) {
if(j<nodStudent.getNodes().size()) {
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 = 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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}else {
table = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNomElt());
}
}else {
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 = evaluationAttribut.evalLesAttributEtContenuDuNode(null, nodSujet.getNodes().get(j).getNodes().get(k), table, "ana:tablematiere", nodSujet.getNodes().get(j).getNodes().get(k).getNomElt());
}
}
}
//*****************************************************************
//** Insère les attributs des points dans les nodes de l'analyse **
//*****************************************************************
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 nodes de l'analyse **
//*****************************************************************
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;
}
/**
* Analyse du node <b>style:page</b>.
* @param nodStudentPage
* @param nodSujetPage
* @param a
* @param nodmenu
* @return
*/
public static node analysePage(node nodStudentPage, node nodSujetPage, Run a, node nodmenu, node nodSujetParagraphes, node nodStudentParagraphes) {
node nodpages = new node();
nodpages.setNomElt("pages");
nodpages.setAttributs(nodSujetPage.getAttributs());
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "style:page")!=null) {
nodpages.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "style:page").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//****************************************
//** Analyse tous les style:master-page **
//****************************************
for(int i = 0 ; i < nodSujetPage.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetPage.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetPage.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetPage.getNodes().get(i).getNomElt().equals("style:master-page")) {
node pageSujet = nodSujetPage.getNodes().get(i);
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);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
page = meptl.addSaut(pageSujet,page);
//*********************
//** Ajoute un titre **
//*********************
page = meptl.addNodeSautTitre(pageSujet,page,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node pageStudent = a.retourneFirstNodeByNameAttributValue(nodStudentPage, "style:master-page", "style:name", nomDeLaPage);
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
//**********************************************
//** Analyse de tous les autres nodes enfants **
//**********************************************
page=analyseLesNodesEnfants.nodeNext(page, "ana:page", pageStudent, null, null, pageSujet, nodSujetParagraphes, nodStudentParagraphes, nodmenu,a);
//*****************************************************************
//** Insère les attributs des points dans les nodes de l'analyse **
//*****************************************************************
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(evaluation.getPointsClass()));
nodpages.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodpages.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodpages.setClose(true);
return nodpages;
}
/**
* Analyse du node <b>style:paragraph</b>.
* @param nodStudentParagraph
* @param nodSujetParagraph
* @param a
* @param nodmenu
* @return
*/
public static node analyseParagraph(node nodStudentParagraph, node nodSujetParagraph, Run a, node nodmenu) {
node nodparagraphs = new node();
nodparagraphs.setNomElt("paragraphs");
nodparagraphs.setAttributs(nodSujetParagraph.getAttributs());
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "style:paragraph")!=null) {
nodparagraphs.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "style:paragraph").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//******************************************************
//** Parcours les nodes enfants du node <style:style> **
//******************************************************
for(int i = 0 ; i < nodSujetParagraph.getNodes().size(); i++) {
if(nodSujetParagraph.getNodes().get(i).getAttributs().get("evaluer")!=null) {
if(nodSujetParagraph.getNodes().get(i).getAttributs().get("evaluer").equals("true")) {
if(nodSujetParagraph.getNodes().get(i).getNomElt().equals("style:style")) {
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
node paragraphSujet = nodSujetParagraph.getNodes().get(i);
String nomDuParagraph = evaluation.withoutCodeAndPoint(paragraphSujet.getAttributs().get("style:name"));
node paragraph = new node();
paragraph.setNomElt("paragraph");
paragraph.getAttributs().put("name", nomDuParagraph);
//********************************************************************************************
//** Ajoute l'information si le style est evaluer à travers evalStyle dans la structurepage **
//********************************************************************************************
if(paragraphSujet.getAttributs().get("EvaluerATraversAnalyseStyle")!=null)if(paragraphSujet.getAttributs().get("EvaluerATraversAnalyseStyle").equals("true")) {
paragraph.getAttributs().put("EvaluerATraversAnalyseStyle", "true");
}
//*****************************
//** Ajoute un saut de ligne **
//*****************************
paragraph = meptl.addSaut(paragraphSujet,paragraph);
//*********************
//** Ajoute un titre **
//*********************
paragraph = meptl.addNodeSautTitre(paragraphSujet,paragraph,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node paragraphStudent = a.retourneFirstNodeByNameAttributValue(nodStudentParagraph, "style:style", "style:name", nomDuParagraph);
//*************************************************
//** analyse les attributs des nodes <paragraph> **
//*************************************************
paragraph = evaluationAttribut.evalLesAttributEtContenuDuNode(paragraphStudent, paragraphSujet, paragraph, "ana:paragraph",paragraphSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
paragraph = analyseLesNodesEnfants.nodeNext(paragraph, "ana:paragraph", paragraphStudent, null, null, paragraphSujet, null, null, nodmenu,a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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(evaluation.getPointsClass()));
nodparagraphs.getAttributs().put("pointtotal",String.valueOf(evaluation.getPointTotal()));
nodparagraphs.getAttributs().put("proportioncorrect",String.valueOf(evaluation.getProportionCorrect()));
nodparagraphs.setClose(true);
return nodparagraphs;
}
/**
* Cette méthode permet d'analyse la structure du document.</br>
* La structure de l'étudiant est comparé avec la structure du sujet.</br>
* Le node d'analyse est retourné.</br>
* Le nom du node analysé pour cette partie est page puis ana:page.</br>
* <br>
* @param nodStudentS : node de la structure de l'étudiant.
* @param nodSujetS : node de la structure du sujet.
* @param a : Objet de la class cXML
* @param nodmenu : node menu.
* @param nodSujetParagraphs : node contenant l'ensemble des styles de paragraphe du sujet.
* @param nodStudentParagraphs : node contenant l'ensemble des styles de paragraphe de l'étudiant.
* @return : le node d'analyse de la structure.
*/
public static node analyseStructurePage(node nodStudentS, node nodSujetS, Run a, node nodmenu, node nodSujetParagraphs, node nodStudentParagraphs) {
node nodSpages = new node();
nodSpages.setNomElt("structurepage");
nodSpages.setAttributs(nodSujetS.getAttributs());
nodSpages.setContenu(nodSujetS.getContenu()); //ajoute le commentaire du sujet
//***************************************
//** Ajoute l'identifiant pour le menu **
//***************************************
if(a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "structurepage")!=null) {
nodSpages.getAttributs().put("id", a.retourneFirstNodeByNameAttributValue(nodmenu, "item", "name", "structurepage").getAttributs().get("id"));
}
//***************************
//** initialise les points **
//***************************
evaluation.initiliseLesPoints();
//********************************************************
//** Parcours les nodes enfants du node <structurepage> **
//********************************************************
for(int i = 0 ; i < nodSujetS.getNodes().size(); i++) {
//************************************
//** Analyser que les nodes évaluer **
//************************************
if(nodSujetS.getNodes().get(i).getAttributs().get("evaluer")==null) continue;
if(!nodSujetS.getNodes().get(i).getAttributs().get("evaluer").equals("true")) continue;
if(nodSujetS.getNodes().get(i).getNomElt().equals("page")) {
node pageSujet = nodSujetS.getNodes().get(i);
int pointDebut = evaluation.getPointsClass();
int pointTotalDebut = evaluation.getPointTotal();
String nomDeLaPage = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("style:master-page-name"));
if(nomDeLaPage==null) nomDeLaPage="Défaut";
String numeroabsolue = evaluation.withoutCodeAndPoint(pageSujet.getAttributs().get("numeroabsolue"));
node page = new node();
page.setNomElt("page");
page.getAttributs().put("namepage", nomDeLaPage);
page.getAttributs().put("numeroabsolue", numeroabsolue);
//*****************************
//** Ajoute un saut de ligne **
//*****************************
page = meptl.addSaut(pageSujet,page);
//*********************
//** Ajoute un titre **
//*********************
page = meptl.addNodeSautTitre(pageSujet,page,nodmenu,a);
//*******************************
//** Recherche le node Student **
//*******************************
node pageStudent = a.retourneFirstNodeByNameAttributValue(nodStudentS, "page", "numeroabsolue", numeroabsolue);
if(calculNombrePointEvaluation.calculNombreDepoint(pageSujet, 0)>0) {
//********************************************
//** analyse les attributs des nodes <page> **
//********************************************
page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt());
//************************************
//** analyse tous les nodes enfants **
//************************************
page = analyseLesNodesEnfants.nodeNext(page, "ana:page", pageStudent, nodStudentS, null, pageSujet, nodSujetParagraphs, nodStudentParagraphs,nodmenu, a);
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
int points = evaluation.getPointsClass()-pointDebut;
int pointTotal = evaluation.getPointTotal()-pointTotalDebut;
Double proportioncorrect = 0.0;
if(pointTotal>0) proportioncorrect = ( (double) points/ (double) pointTotal);
page.getAttributs().put("point", String.valueOf(points));
page.getAttributs().put("pointTotal", String.valueOf(pointTotal));
page.getAttributs().put("proportioncorrect", String.valueOf(proportioncorrect));
nodSpages.getNodes().add(page);
}
}
}
//****************************************************************
//** Insère les attributs des points dans les node de l'analyse **
//****************************************************************
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;
}
}