** La variable notefrom ne peut être convertie en double. **
"); commandes.message.append("La valeur de notefrom est alors automatique de 20.
"); 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) { commandes.message.append("** La variable progression ne peut être convertie en double. **
"); commandes.message.append("La valeur du coef. de progression est alors automatique de 1.
"); 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) { commandes.message.append("** La variable baremeABC ne peut être convertie en boolean. **
"); commandes.message.append("La valeur de baremeABC est alors automatique de false.
"); 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