package evaluer; import java.util.ArrayList; import java.util.Enumeration; import MEPTL.meptl; import cXML.Run; import cXML.node; public class analyseLesNodesPrincipaux { /** * Analyse du node bibliographies. * @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 ** //******************************************************** 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(jnumerotationchapitre.
* @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 ** //******************************************************************* 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 ** //******************************************** 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 frames. * @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 ** //***************************************************** 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 ** //******************************************** 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 office:meta. * @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 sujet = a.Applatir(nodSujetMeta.getNodes(), new ArrayList()); //*************************** //** initialise les points ** //*************************** evaluation.initiliseLesPoints(); //*********************************************************************** //** Parcours les nodes enfants du node ou autres ** //*********************************************************************** for(int i = 0 ; i < sujet.size(); i++) { node nodSujet = sujet.get(i); String namenode = nodSujet.getNomElt(); //***************************** //** 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 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 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 sections * @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 ** //******************************************************* 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 = 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 = 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 sequences. * @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 ** //************************************************************* 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 = 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
** //*********************************************** 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 tableaux * @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 ** //****************************************************** for(int i = 0 ; i < nodSujetTableaux.getNodes().size(); i++) { 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 ** //*************************************************** 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); // // les enfants du premier niveau du node // for(int j = 0 ; j < tableSujet.getNodes().size();j++ ) { //niveau 2 // // node nodSujet = tableSujet.getNodes().get(j); // String nameNode = nodSujet.getNomElt(); // node nodStudent = null; // // if(tableauStudent!=null) nodStudent = rechercherUnNodeStudent.rechercheLeNodeEnCascade(nameNode,nodSujet,null,null,tableauStudent,a); // // //insère un saut si titre pas vide et saut=true // tableau=addNodeSautTitre(nodSujet, tableau); // // // // analyse attribut et contenu des enfants du premier niveau // tableau = analyseLesAttributEtContenuDuNode(nodStudent, nodSujet, tableau, "ana:tableau",nameNode); // // // for(int k = 0 ; k < nodSujet.getNodes().size();k++) { //niveau 3 // node nod2Sujet = nodSujet.getNodes().get(k); // String nameNode2 = nod2Sujet.getNomElt(); // node nod2Student = null; // // if(tableauStudent!=null) nod2Student = rechercherUnNodeStudent.rechercheLeNodeEnCascade(nameNode2,nod2Sujet,null,tableauStudent,nodStudent,a); // // //insère un saut si titre pas vide et saut=true // tableau=addNodeSautTitre(nod2Sujet, tableau); // // // analyse attribut et contenu des enfants du second niveau // tableau = analyseLesAttributEtContenuDuNode(nod2Student, nod2Sujet, tableau, "ana:tableau",nameNode2 ); // // // for(int l = 0 ; l < nod2Sujet.getNodes().size();l++) { //niveau 4 // node nod3Sujet = nod2Sujet.getNodes().get(l); // String nameNode3 = nod3Sujet.getNomElt(); // node nod3Student = null; // // if(tableauStudent!=null) nod3Student = rechercherUnNodeStudent.rechercheLeNodeEnCascade(nameNode3,nod3Sujet,tableauStudent,nodStudent,nod2Student,a); // // //insère un saut si titre pas vide et saut=true // tableau=addNodeSautTitre(nod3Sujet, tableau); // // // analyse attribut et contenu des enfants du second niveau // tableau = analyseLesAttributEtContenuDuNode(nod3Student, nod3Sujet, tableau, "ana:tableau", nameNode3); // // // for(int m = 0 ; m < nod3Sujet.getNodes().size();m++) { //niveau 5 // node nod4Sujet = nod3Sujet.getNodes().get(m); // String nameNode4 = nod4Sujet.getNomElt(); // node nod4Student = null; // // if(tableauStudent!=null) nod4Student = rechercherUnNodeStudent.rechercheLeNodeEnCascade(nameNode4,nod4Sujet,nodStudent,nod2Student,nod3Student,a); // // //insère un saut si titre pas vide et saut=true // tableau=addNodeSautTitre(nod4Sujet, tableau); // // // analyse attribut et contenu des enfants du second niveau // tableau = analyseLesAttributEtContenuDuNode(nod4Student, nod4Sujet, tableau, "ana:tableau", nameNode4); // } // } // } // } //**************************************************************** //** 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 tableillustrations. * @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++) { //text:illustration-index-sourceIllustrations 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); //********************************************* //** analyse les attributs des nodes ** //********************************************* table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt()); //**************************************************************** //** Parcours les nodes enfants du node ** //**************************************************************** for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(j ** //********************************************* table = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tableillustration", nodSujet.getNomElt()); //************************************************************************************** //** Parcours les nodes enfants du node ** //************************************************************************************** for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(jtablematieres. * @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++) { 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 = evaluationAttribut.evalLesAttributEtContenuDuNode(nodStudent, nodSujet, table, "ana:tablematiere", nodSujet.getNomElt()); //**************************************************************** //** Parcours les nodes enfants du node ** //**************************************************************** for(int j =0 ; j < nodSujet.getNodes().size();j++) { if(nodStudent!=null) { if(jstyle:page. * @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++) { 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 = 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 style:paragraph. * @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 ** //****************************************************** 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 = 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.
* La structure de l'étudiant est comparé avec la structure du sujet.
* Le node d'analyse est retourné.
* Le nom du node analysé pour cette partie est page puis ana:page.
*
* @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 ** //******************************************************** 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 = 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); //******************************************** //** analyse les attributs des nodes ** //******************************************** page = evaluationAttribut.evalLesAttributEtContenuDuNode(pageStudent, pageSujet, page, "ana:page",pageSujet.getNomElt()); //************************************ //** analyse tous les nodes enfants ** //************************************ page = analyseLesNodesEnfants.nodeNext(page, "ana:page", pageStudent, null, 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; } }