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