diff --git a/.classpath b/.classpath index ea03344..7242b9c 100644 --- a/.classpath +++ b/.classpath @@ -14,6 +14,6 @@ - + diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..ee3fe2c --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,4 @@ +/calcul/ +/MEPTL/ +/evaluer/ +/fenetres/ diff --git a/bin/MEPTL/feedbacks.class b/bin/MEPTL/feedbacks.class index aa50383..de26b68 100644 Binary files a/bin/MEPTL/feedbacks.class and b/bin/MEPTL/feedbacks.class differ diff --git a/bin/MEPTL/meptl.class b/bin/MEPTL/meptl.class index c126dc7..79cc2ba 100644 Binary files a/bin/MEPTL/meptl.class and b/bin/MEPTL/meptl.class differ diff --git a/bin/calcul/calculNombrePointEvaluation.class b/bin/calcul/calculNombrePointEvaluation.class index ca8b252..a4df87b 100644 Binary files a/bin/calcul/calculNombrePointEvaluation.class and b/bin/calcul/calculNombrePointEvaluation.class differ diff --git a/bin/evaluer/analyseLesNodesEnfants.class b/bin/evaluer/analyseLesNodesEnfants.class index be79f28..43aebb3 100644 Binary files a/bin/evaluer/analyseLesNodesEnfants.class and b/bin/evaluer/analyseLesNodesEnfants.class differ diff --git a/bin/evaluer/analyseLesNodesPrincipaux.class b/bin/evaluer/analyseLesNodesPrincipaux.class index c8c9bc7..f98dee7 100644 Binary files a/bin/evaluer/analyseLesNodesPrincipaux.class and b/bin/evaluer/analyseLesNodesPrincipaux.class differ diff --git a/bin/evaluer/evaluationAttribut.class b/bin/evaluer/evaluationAttribut.class index 14514ed..d7257f3 100644 Binary files a/bin/evaluer/evaluationAttribut.class and b/bin/evaluer/evaluationAttribut.class differ diff --git a/src/MEPTL/feedbacks.java b/src/MEPTL/feedbacks.java index 632f14b..f77c0b4 100644 --- a/src/MEPTL/feedbacks.java +++ b/src/MEPTL/feedbacks.java @@ -520,17 +520,39 @@ public class feedbacks { // System.out.print("\t** Erreur menu, node : " + N.getNomElt()); } }else { - if(N.getAttributs().get("titre")!=null) { - fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre"),-1.0,"","", "",N.getAttributs().get("id"))); - } - if(N.getAttributs().get("titre1")!=null) { - fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre1"),-1.0,"","", "",N.getAttributs().get("id"))); - } - if(N.getAttributs().get("titre2")!=null) { - fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre2"),-1.0,"","", "",N.getAttributs().get("id"))); - } - if(N.getAttributs().get("titre3")!=null) { - fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre3"),-1.0,"","", "",N.getAttributs().get("id"))); + if(N.getParent()!=null) { + N.getAttributs().put("pointgagner",N.getParent().getAttributs().get("point")); + N.getAttributs().put("pointtotal",N.getParent().getAttributs().get("pointTotal")); + N.getAttributs().put("proportioncorrect",N.getParent().getAttributs().get("proportioncorrect")); + if(N.getAttributs().get("proportioncorrect")!=null) { + if(!N.getAttributs().get("proportioncorrect").equals("NaN")) { + if(N.getAttributs().get("titre")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(" ├ "+ N.getAttributs().get("titre"),Double.valueOf(N.getAttributs().get("proportioncorrect")),N.getAttributs().get("pointtotal") + " pt",N.getAttributs().get("pointgagner") + " pt", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre1")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(" ├ "+ N.getAttributs().get("titre1"),Double.valueOf(N.getAttributs().get("proportioncorrect")),N.getAttributs().get("pointtotal") + " pt",N.getAttributs().get("pointgagner") + " pt", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre2")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(" ├ "+ N.getAttributs().get("titre2"),Double.valueOf(N.getAttributs().get("proportioncorrect")),N.getAttributs().get("pointtotal") + " pt",N.getAttributs().get("pointgagner") + " pt", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre3")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(" ├ "+ N.getAttributs().get("titre3"),Double.valueOf(N.getAttributs().get("proportioncorrect")),N.getAttributs().get("pointtotal") + " pt",N.getAttributs().get("pointgagner") + " pt", "",N.getAttributs().get("id"))); + } + } + } + }else { + if(N.getAttributs().get("titre")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre"),-1.0,"","", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre1")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre1"),-1.0,"","", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre2")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre2"),-1.0,"","", "",N.getAttributs().get("id"))); + } + if(N.getAttributs().get("titre3")!=null) { + fichier.append(HTML.TablePointsSyntheseStyle(N.getAttributs().get("titre3"),-1.0,"","", "",N.getAttributs().get("id"))); + } } } } diff --git a/src/MEPTL/meptl.java b/src/MEPTL/meptl.java index 7dc4ca1..3a78428 100644 --- a/src/MEPTL/meptl.java +++ b/src/MEPTL/meptl.java @@ -1851,6 +1851,7 @@ public class meptl { node N = new node(); N.setNomElt("saut"); N.getAttributs().put("titre", nodSujet.getAttributs().get("titre")); + N.setParent(nodanalyse); N.setClose(true); nodanalyse.getNodes().add(N); if(nodSujet.getAttributs().get("addmenu")!=null) if(nodSujet.getAttributs().get("addmenu").equalsIgnoreCase("true")) { @@ -1864,6 +1865,7 @@ public class meptl { node N = new node(); N.setNomElt("saut"); N.getAttributs().put("titre1", nodSujet.getAttributs().get("titre1")); + N.setParent(nodanalyse); N.setClose(true); nodanalyse.getNodes().add(N); if(nodSujet.getAttributs().get("addmenu")!=null) if(nodSujet.getAttributs().get("addmenu").equalsIgnoreCase("true")) { @@ -1877,6 +1879,7 @@ public class meptl { node N = new node(); N.setNomElt("saut"); N.getAttributs().put("titre2", nodSujet.getAttributs().get("titre2")); + N.setParent(nodanalyse); N.setClose(true); nodanalyse.getNodes().add(N); if(nodSujet.getAttributs().get("addmenu")!=null) if(nodSujet.getAttributs().get("addmenu").equalsIgnoreCase("true")) { @@ -1890,6 +1893,7 @@ public class meptl { node N = new node(); N.setNomElt("saut"); N.getAttributs().put("titre3", nodSujet.getAttributs().get("titre3")); + N.setParent(nodanalyse); N.setClose(true); nodanalyse.getNodes().add(N); if(nodSujet.getAttributs().get("addmenu")!=null) if(nodSujet.getAttributs().get("addmenu").equalsIgnoreCase("true")) { diff --git a/src/calcul/calculNombrePointEvaluation.java b/src/calcul/calculNombrePointEvaluation.java index 896e701..2753f48 100644 --- a/src/calcul/calculNombrePointEvaluation.java +++ b/src/calcul/calculNombrePointEvaluation.java @@ -31,7 +31,8 @@ public class calculNombrePointEvaluation { public static int calculNombreDepoint(node nod, int point) { - if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equalsIgnoreCase("true")){ + if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equals("true")){ + if(nod.getAttributs().get("allContent")!=null) { Pattern pt = Pattern.compile("[0-9]{1,}$"); Matcher match= pt.matcher(nod.getAttributs().get("allContent")); @@ -42,7 +43,6 @@ public class calculNombrePointEvaluation { } catch (Exception e) { JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut allContent"); } - System.out.println("match point pour allcontent = " + s); } } @@ -70,46 +70,82 @@ public class calculNombrePointEvaluation { } } - Enumeration key = nod.getAttributs().keys(); - if(!nod.getNomElt().equals("structurepage")) { - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(nod.getAttributs().get(k).contains("‽")) { - Pattern pt = Pattern.compile("[0-9]{1,}$"); - Matcher match= pt.matcher(nod.getAttributs().get(k)); - if(match.find()) { - String s= match.group(); - try { - point = point + Integer.valueOf(s); - } catch (Exception e) { - JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut "+ k); - } - } - } - } - }else { - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(nod.getAttributs().get(k).contains("‽")||nod.getAttributs().get(k).contains("‼")) { - Pattern pt = Pattern.compile("[0-9]{1,}$"); - Matcher match= pt.matcher(nod.getAttributs().get(k)); - if(match.find()) { - String s= match.group(); - try { - point = point + Integer.valueOf(s); - } catch (Exception e) { - JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut "+ k); - } - } - } + if(nod.getAttributs().get("evalNamePage")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalNamePage")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalNamePage"); } } + + if(nod.getAttributs().get("evalNumeroPage")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalNumeroPage")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalNumeroPage"); + } + } + + if(nod.getAttributs().get("evalNumeroAbsoluePage")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalNumeroAbsoluePage")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalNumeroAbsoluePage"); + } + } + + if(nod.getAttributs().get("evalEntetePasActive")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalEntetePasActive")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalEntetePasActive"); + } + } + + if(nod.getAttributs().get("evalPiedPageActive")!=null) { + try { + point = point + Integer.valueOf(nod.getAttributs().get("evalPiedPageActive")); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut evalEntetePasActive"); + } + } + + //*********************************************** + //** Les points par la méthode analyseStyle ***** + //*********************************************** + if(nod.getAttributs().get("analyseStyle")!=null) { + if(nod.getAttributs().get("analyseStyle").equals("true")) { + String nomDuStyle = nod.getAttributs().get("text:style-name"); + point = calculNombreDepointDeAnalyseStyle(commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nomDuStyle), point); + } + } + + + Enumeration key = nod.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(nod.getAttributs().get(k).contains("‽")) { + Pattern pt = Pattern.compile("[0-9]{1,}$"); + Matcher match= pt.matcher(nod.getAttributs().get(k)); + if(match.find()) { + String s= match.group(); + try { + point = point + Integer.valueOf(s); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut "+ k); + } + } + } + } + for(int i = 0 ; i < nod.getNodes().size();i++) { if(nod.getNodes().get(i)!=null) { - point = calculNombreDepoint(nod.getNodes().get(i), point); + if(!nod.getNodes().get(i).getNomElt().equals("style:default-style")) { + point = calculNombreDepoint(nod.getNodes().get(i), point); + } } } } @@ -118,7 +154,90 @@ public class calculNombrePointEvaluation { } + /** + * Calcul les points d'un style évalué par la méthode analyseStyle.
+ * @param nod + * @param point + * @return + */ + private static int calculNombreDepointDeAnalyseStyle(node nod, int point) { + + if(nod.getAttributs().get("evaluer")!=null) if(nod.getAttributs().get("evaluer").equals("true")){ + + Enumeration key = nod.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(nod.getAttributs().get(k).contains("‼")) { + Pattern pt = Pattern.compile("[0-9]{1,}$"); + Matcher match= pt.matcher(nod.getAttributs().get(k)); + if(match.find()) { + String s= match.group(); + try { + point = point + Integer.valueOf(s); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut "+ k); + } + } + } + } + + if(nod.getNodes().size()>0) { + for(int i = 0 ; i < nod.getNodes().size();i++) { + point = calculNombreDepointDeAnalyseStyle(nod.getNodes().get(i), point); + } + } + +// //**************************** +// //*** Héritage d'un style **** +// //**************************** +// if(nod.getAttributs().get("style:parent-style-name")!=null) { +// String nomDuStyleParent = nod.getAttributs().get("style:parent-style-name"); +// Pattern p = Pattern.compile("^P[0-9]{1,}|^T[0-9]{1,}"); +// Matcher m = p.matcher(nod.getAttributs().get("style:name")); +// if(m.find()) { +// point = calculNombreDepointDepuisUnStyleDeAnalyseStyle(commandes.sujet.retourneFirstNodeByNameAndAttributValueExactStrict("style:style", "style:name", nomDuStyleParent), point); +// } +// } + } + + + return point; + + } - + /** + * Calcul les points d'un style évalué par la méthode analyseStyle et qui hérite du node nod.
+ * @param nod + * @param point + * @return + */ + @SuppressWarnings("unused") + private static int calculNombreDepointDepuisUnStyleDeAnalyseStyle(node nod, int point) { + + Enumeration key = nod.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(nod.getAttributs().get(k).contains("‼")||nod.getAttributs().get(k).contains("‽")) { + Pattern pt = Pattern.compile("[0-9]{1,}$"); + Matcher match= pt.matcher(nod.getAttributs().get(k)); + if(match.find()) { + String s= match.group(); + try { + point = point + Integer.valueOf(s); + } catch (Exception e) { + JOptionPane.showInternalMessageDialog(null, "Erreur dans la valeur de l'attribut "+ k); + } + } + } + } + + if(nod.getNodes().size()>0) { + for(int i = 0 ; i < nod.getNodes().size();i++) { + point = calculNombreDepointDepuisUnStyleDeAnalyseStyle(nod.getNodes().get(i), point); + } + } + + return point; + } } diff --git a/src/evaluer/analyseLesNodesEnfants.java b/src/evaluer/analyseLesNodesEnfants.java index 429a126..4cfed57 100644 --- a/src/evaluer/analyseLesNodesEnfants.java +++ b/src/evaluer/analyseLesNodesEnfants.java @@ -27,9 +27,20 @@ public class analyseLesNodesEnfants { for(int j = 0 ; j < nodSujet.getNodes().size();j++ ) { + nodEnfantSujet = nodSujet.getNodes().get(j); String nameNode = nodEnfantSujet.getNomElt(); + if(nodEnfantSujet.getAttributs().get("evaluer")!=null) { + if(!nodEnfantSujet.getAttributs().get("evaluer").equals("true")) { + continue; + } + }else { + continue; + } + + + //***************************** //** Ajoute un saut de ligne ** @@ -84,7 +95,7 @@ public class analyseLesNodesEnfants { //** méthode analyseStyle=true ** //******************************* if(nameNode.contains("text:") && nodEnfantSujet.getAttributs().get("analyseStyle")!=null && nodSujetParagraphs!=null) { - if(nodEnfantSujet.getAttributs().get("analyseStyle").equalsIgnoreCase("true")) { + if(nodEnfantSujet.getAttributs().get("analyseStyle").equals("true")) { PourAnalyse = analyseStyle(PourAnalyse, nomDuNodePourAnalyse, nodEnfantSujet,nodStudentCorrespondantAuNodSujet, nodSujetParagraphs,nodStudentParagraphes, nodmenu, a); } } @@ -118,16 +129,25 @@ public class analyseLesNodesEnfants { if(nodSujet.getAttributs().get("analyseStyle")!=null) { - if(nodSujet.getAttributs().get("analyseStyle").equalsIgnoreCase("true") && nodSujet.getAttributs().get("text:style-name")!=null) { + if(nodSujet.getAttributs().get("analyseStyle").equals("true") && nodSujet.getAttributs().get("text:style-name")!=null) { String NameStyleParagrapheSujet = nodSujet.getAttributs().get("text:style-name"); StyleParagraphSujet = nodSujetParagraphs.retourneFirstNodeStyleByValueAttribut("style:style", "style:name", NameStyleParagrapheSujet); } if(nodStudent!=null && StyleParagraphSujet!=null) { - if(nodStudent.getAttributs().get("text:style-name")!=null && StyleParagraphSujet!=null) { - String NameStyleParagrapheStudent = nodStudent.getAttributs().get("text:style-name"); - StyleParagraphStudent = nodStudentParagraphs.retourneFirstNodeStyleByValueAttribut("style:style", "style:name",NameStyleParagrapheStudent); + if(StyleParagraphSujet.getAttributs().get("evaluer")!=null) { + if(StyleParagraphSujet.getAttributs().get("evaluer").equals("true")) { + if(nodStudent.getAttributs().get("text:style-name")!=null && StyleParagraphSujet!=null) { + String NameStyleParagrapheStudent = nodStudent.getAttributs().get("text:style-name"); + StyleParagraphStudent = nodStudentParagraphs.retourneFirstNodeStyleByValueAttribut("style:style", "style:name",NameStyleParagrapheStudent); + } + }else { + return PourAnalyse; + } + }else { + return PourAnalyse; } + } // ajoute les valeurs par héritage. diff --git a/src/evaluer/analyseLesNodesPrincipaux.java b/src/evaluer/analyseLesNodesPrincipaux.java index 0d5f031..628ff36 100644 --- a/src/evaluer/analyseLesNodesPrincipaux.java +++ b/src/evaluer/analyseLesNodesPrincipaux.java @@ -1131,8 +1131,15 @@ public class analyseLesNodesPrincipaux { //**************************************************************** //** Insère les attributs des points dans les node de l'analyse ** //**************************************************************** + int points = evaluation.getPointsClass()-pointDebut; + int pointTotal = evaluation.getPointTotal()-pointTotalDebut; + double proportioncorrect = points/pointTotal; + page.getAttributs().put("point", String.valueOf(evaluation.getPointsClass()-pointDebut)); page.getAttributs().put("pointTotal", String.valueOf(evaluation.getPointTotal()-pointTotalDebut)); + page.getAttributs().put("proportioncorrect", String.valueOf(proportioncorrect)); + + nodSpages.getNodes().add(page); } } diff --git a/src/evaluer/evaluationAttribut.java b/src/evaluer/evaluationAttribut.java index 5176e1f..17de45a 100644 --- a/src/evaluer/evaluationAttribut.java +++ b/src/evaluer/evaluationAttribut.java @@ -13,15 +13,18 @@ public class evaluationAttribut { * Formatage direct des styles de paragraphe.
* Les attributs doivent contenir le code ‼.
*
- * @param nodeStudent : le node de l'étudiant. - * @param sujet : le node du sujet + * @param nodeStyleParagraphStudent : le node de l'étudiant. + * @param nodeStyleParagraphSujet : le node du sujet * @param retour : le node à retourner avec les enfants nommés nameItem. * @param nameItem : le nom des nodes enfants. * @param nameElt : le nom de l'élément (node) analysé. - * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyse. + * @return le node retour avec tous les nodes enfants nameItem contenant les différentes analyses. */ public static node evalLesAttributAnalyseStyle(node nodeStyleParagraphStudent, node nodeStyleParagraphSujet, node retour, String nameItem, String nameElt) { + if(nodeStyleParagraphSujet.getAttributs().get("evaluer")==null) return retour; + if(!nodeStyleParagraphSujet.getAttributs().get("evaluer").equals("true")) return retour; + Enumeration key = nodeStyleParagraphSujet.getAttributs().keys(); while(key.hasMoreElements()) { String k = key.nextElement(); @@ -43,36 +46,48 @@ public class evaluationAttribut { if(nodeStyleParagraphStudent!=null) { if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:paragraph-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:paragraph-properties") ) { node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:paragraph-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + if(propertiesStudent!=null) { + String valueAttributStudent = propertiesStudent.getAttributs().get(k); + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + } + } } + } } } }else { node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:paragraph-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); - retour.getNodes().add(item); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:paragraph-properties"); + retour.getNodes().add(item); + } + } + } } } @@ -80,49 +95,61 @@ public class evaluationAttribut { if(nodeStyleParagraphStudent!=null) { if(nodeStyleParagraphSujet.retourneEnfantsByNameExist("style:text-properties") && nodeStyleParagraphStudent.retourneEnfantsByNameExist("style:text-properties") ) { node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - if(propertiesStudent!=null) { - String valueAttributStudent = propertiesStudent.getAttributs().get(k); - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + node propertiesStudent = nodeStyleParagraphStudent.retourneFirstEnfantsByName("style:text-properties"); + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + if(propertiesStudent!=null) { + String valueAttributStudent = propertiesStudent.getAttributs().get(k); + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); - }else { - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); + node item = retourneNoteAvecResultatsAnalyse(nameItem,k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + }else { + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + } + } } + } } } }else { node propertiesSujet = nodeStyleParagraphSujet.retourneFirstEnfantsByName("style:text-properties"); - key = propertiesSujet.getAttributs().keys(); - while(key.hasMoreElements()) { - String k = key.nextElement(); - if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ - String valueAttributStudent = "null"; - String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); - - node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); - retour.getNodes().add(item); + if(propertiesSujet.getAttributs().get("evaluer")!=null) { + if(propertiesSujet.getAttributs().get("evaluer").equals("true")) { + + key = propertiesSujet.getAttributs().keys(); + while(key.hasMoreElements()) { + String k = key.nextElement(); + if(propertiesSujet.getAttributs().get(k).contains("‼") || propertiesSujet.getAttributs().get(k).contains("‽")){ + String valueAttributStudent = "null"; + String valueAttributSujet = propertiesSujet.getAttributs().get(k).replace("‼", "‽"); + + node item = retourneNoteAvecResultatsAnalyse(nameItem, k, valueAttributStudent, valueAttributSujet,"style:text-properties"); + retour.getNodes().add(item); + } + } + } } - } + } return retour; } /** * Analyse tous les attributs et les contenus d'un node.
- * Les attributs et les contenus doivent posséder la carcatère ‽ ou ‼.
+ * Les attributs et les contenus doivent posséder la caractère ‽ ou ‼.
*
* @param nodeStudent : le node de l'étudiant. * @param sujet : le node du sujet