MAJ V4.4.1 (le scrollBar vezrtical ne se déplace plus en bas après

chargement d'un nouveau texte dans l'affichage. Amélioration de de la
méthode placement et de son affichage)
This commit is contained in:
pablo rodriguez 2022-12-21 17:54:28 +01:00
parent bba9b940a3
commit 512636efc6
81 changed files with 91 additions and 49 deletions

View File

@ -12,6 +12,6 @@
<classpathentry kind="lib" path="C:/Users/pabr6/git/analyseWriter/MEPTL/miglayout15-swing.jar"/>
<classpathentry kind="lib" path="jgoodies-forms-1.8.0.jar" sourcepath="jgoodies-forms-1.8.0-sources.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/Exportation documentation analyseWriter/plugins/documentation.analyseWriter_1.0.0.202212032022.jar"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar" sourcepath="/cXML"/>
<classpathentry kind="lib" path="C:/Users/pabr6/eclipse-workspace/cXML.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>

Binary file not shown.

Binary file not shown.

3
bin/.gitignore vendored
View File

@ -3,6 +3,3 @@
/evaluer/
/fenetres/
/list/
/resources/
/nocsvstudent.png
/nocsvstudentmini.png

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
bin/nocsvstudent.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

BIN
bin/nocsvstudentmini.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -123,6 +123,17 @@ public class evaluation {
if(pointEnJeu==0) return "Optionnel";
//Méthode de comparaison avec calcul de Levenshtein
if(Sujet!=null) if(Sujet.contains("")) {
if(A==null) return "Erreur : -" + pointString;
Sujet = Sujet.replace("", "");
if(TraitementDistanceDeLevenstein(A,Sujet).equals("Correct : ")) {
IncrementPointClass(pointEnJeu);
return "Correct : +" + pointString;
}
return "Erreur : -" + pointString;
}
// autre chose que null, none ou vide (analyse très simple) toutes les autres fonctions sont ignorées
if(Sujet!=null) if(Sujet.contains("")) {
if(A==null) return "Erreur : -" + pointString;
@ -314,7 +325,7 @@ public class evaluation {
point = Integer.valueOf(B.substring(B.indexOf("")+1,B.length()));
}catch (Exception e) {
commandes.message.append("<p>** ERREUR sur la ventillation des points : " + B + " **</p>");
System.out.println("ERREUR sur la ventillation des points : " +B);
System.out.println("ERREUR sur la ventillation des points : " + B);
e.getMessage();
}
}else {
@ -667,6 +678,19 @@ public class evaluation {
return "Erreur : ";
}
/**
*
* @param A
* @param Sujet
* @return
*/
private static String TraitementDistanceDeLevenstein(String A, String Sujet) {
if(cXML.StringSimilarity.similarity(A, Sujet)>commandes.tolerance_text) {
return "Correct : ";
}
return "Erreur : ";
}
/**
* Fonction OU contenant des ET contient le texte du node Sujet
* @param A

View File

@ -579,9 +579,9 @@ public class evaluationAttribut {
if(!A.isEmpty() && !B.isEmpty()) if(cXML.StringSimilarity.similarity(A, B)>0.92) calcul++;
if(calcul==1) {
retour = evaluationPlacement(retour,nodeStudent, sujet.retourneLesContenusEnfants(""), sujet.getAttributs().get("evalPlacement"),"Placement");
retour = evaluationPlacement(retour,B, A , sujet.getAttributs().get("evalPlacement"),"Placement");
}else {
retour = evaluationPlacement(retour,null, sujet.retourneLesContenusEnfants(""), sujet.getAttributs().get("evalPlacement"),"Placement");
retour = evaluationPlacement(retour,null, A , sujet.getAttributs().get("evalPlacement"),"Placement");
}
}else {
node nodeSujetAvant = sujet.retourneLeNodeFrereAvant();
@ -894,14 +894,14 @@ public class evaluationAttribut {
* @param nameElt
* @return
*/
private static node evaluationPlacement(node retour, node nodStudent, String contenuParagraph, String point, String nameElt) {
private static node evaluationPlacement(node retour, String contenuParagraphStudentAvant, String contenuParagraphSujetAvant, String point, String nameElt) {
node item = null;
if(nodStudent!=null) {
if(contenuParagraphStudentAvant!=null) {
//compare la même valeur "contenuParagraph" pour obtenir les points mais si un voisinage du contenu.
item = retourneNoteAvecResultatsAnalyse("Placement","avant", "Oui","Oui" + "" +point, nameElt );
item = retourneNoteAvecResultatsAnalyse("Placement","avant", contenuParagraphStudentAvant , contenuParagraphSujetAvant + "" +point, nameElt );
}else {
evaluation.IncrementPointTotal(Integer.valueOf(point));
item = new node("Placement", "Erreur : -"+ point, "avant" , "null", "non", 2, evaluation.getPointEnJeu(),nameElt);
item = new node("Placement", "Erreur : -"+ point, "avant" , "null", contenuParagraphSujetAvant , 2, evaluation.getPointEnJeu(),nameElt);
}
retour.getNodes().add(item);
return retour;

View File

@ -8,7 +8,10 @@ import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
import javax.swing.JEditorPane;
import javax.swing.text.DefaultCaret;
import MEPTL.commandes;
import cXML.node;
import calcul.calculIntervalleBaremeABCDE;
@ -25,12 +28,17 @@ public class afficheText extends JEditorPane {
private static final long serialVersionUID = 1L;
/**
* Raffraichie l'affichage de la fenête create lorsque selection d'un node.
* @param nod
*/
public void refreshAffichage(node nod) {
//Important pour l'affichage car affiche le texte toujours au début en haut de l'affichage.
DefaultCaret caret = (DefaultCaret) this.getCaret();
caret.setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
if(nod!=null) {
setContentType("text/html");
node nodeParent = nod.getParent();
@ -323,8 +331,9 @@ public class afficheText extends JEditorPane {
setText("<html>"+sb.toString()+"</html>");
}
if(nod==null) {
}else {
setText("");
}

View File

@ -91,7 +91,6 @@ public final class create extends JFrame {
private JPanel panelPrincipal;
private static create instance;
/**
* Création de la fenêtre.</br>
*/
@ -176,6 +175,8 @@ public final class create extends JFrame {
}
this.setExtendedState(MAXIMIZED_BOTH);
rightScrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
// orig = (Point) rightScrollPane.getViewport().getViewPosition().clone();
ListenerAction();

View File

@ -114,6 +114,8 @@ if(nod!=null) {
JPopupMenu mnPopupTree = new JPopupMenu();
mnPopupTree.add( mnEvaluer());
if(nod.getLevel()==1 ) {
mnPopupTree.addSeparator();
mnPopupTree.add(new actCoefficient());
mnPopupTree.addSeparator();
mnPopupTree.add(mnNiveau1());
}
@ -606,8 +608,6 @@ if(nod!=null) {
private JMenu mnNiveau1 () {
JMenu mnNiveau1 = new JMenu("Pour représentation & coefficient");
mnNiveau1.setIcon( new ImageIcon(create.class.getResource("/resources/feedbackmini.png"))); ///resources/attributanalysewritermini.png
mnNiveau1.add(new actCoefficient());
mnNiveau1.addSeparator();
mnNiveau1.add(mnSautNiveau1());
mnNiveau1.addSeparator();
mnNiveau1.add(mnTitreNiveau1());

View File

@ -4,8 +4,12 @@ import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.Action;
import javax.swing.Box;
import javax.swing.ImageIcon;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextField;
import cXML.node;
import fenetres.baliseStyle;
@ -34,23 +38,31 @@ public class actCoefficient extends AbstractAction{
}
}
String a = JOptionPane.showInputDialog(null,"Quel est le coefficient de cette partie de l'évaluation?",poids);
if(!a.isEmpty()) {
try {
poids = Double.valueOf(a);
if(poids<=0) {
nod.poids(Double.valueOf(1));
JTextField poidsField = new JTextField(8);
poidsField.setText(String.valueOf(poids));
JPanel myPanel = new JPanel();
myPanel.add(new JLabel("Coef. :"));
myPanel.add(Box.createHorizontalStrut(2)); // a spacer
myPanel.add(poidsField);
int result = JOptionPane.showConfirmDialog(null, myPanel, "Saisissez le coefficient", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
try {
poids = Double.valueOf(poidsField.getText());
if(poids<=0) {
nod.poids(Double.valueOf(1));
fenetres.create.getTextNodeSelect().setText(baliseStyle.balise());
fenetres.create.getTextNodeSelect().setText("<h2>Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.<br>Cependant,la valeur a été modifiée.<br>poids=1.</h2>");
}else {
nod.poids(Double.valueOf(poids));
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
}
} catch (Exception e2) {
fenetres.create.getTextNodeSelect().setText(baliseStyle.balise());
fenetres.create.getTextNodeSelect().setText("<h2>Erreur la valeur doit être un nombre entier POSITIF supérieur à zéro.<br>Cependant,la valeur a été modifiée.<br>poids=1.</h2>");
}else {
nod.poids(Double.valueOf(poids));
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
fenetres.create.getTextNodeSelect().setText("<h2>Erreur la valeur doit être un nombre entier.<br>La valeur n'a pas été modifiée.</h2>");
}
} catch (Exception e2) {
fenetres.create.getTextNodeSelect().setText(baliseStyle.balise());
fenetres.create.getTextNodeSelect().setText("<h2>Erreur la valeur doit être un nombre entier.<br>La valeur n'a pas été modifiée.</h2>");
}
}
}

View File

@ -32,7 +32,7 @@ public class actEvalEnteteActive extends AbstractAction{
String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point);
if(!a.isEmpty()) {
if(a!=null)if(!a.isEmpty()) {
try {
point = Integer.valueOf(a);
if(point<=0) {
@ -47,6 +47,7 @@ public class actEvalEnteteActive extends AbstractAction{
fenetres.create.getTextNodeSelect().setText("<h2>Erreur la valeur doit être un nombre entier.<br>L'attribut n'a pas été modifiée.</h2>");
}
}
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
}

View File

@ -34,7 +34,7 @@ public class actEvalPlacementParagrapheOui extends AbstractAction{
String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point);
if(!a.isEmpty()) {
if(a!=null) if(!a.isEmpty()) {
try {
point = Integer.valueOf(a);
if(point<=0) {

View File

@ -33,7 +33,7 @@ public class actEvaluerNomDuStyleHeriteTrue extends AbstractAction{
String a = JOptionPane.showInputDialog(null,"Quel est le nombre de point?",point);
if(!a.isEmpty()) {
if(a!=null) if(!a.isEmpty()) {
try {
point = Integer.valueOf(a);
if(point<=0) {

View File

@ -30,17 +30,17 @@ public class actTitre1 extends AbstractAction{
titre = nod.getAttributs().get("titre1");
}
JTextField xField = new JTextField(30);
xField.setText(titre);
JTextField titreField = new JTextField(30);
titreField.setText(titre);
JPanel myPanel = new JPanel();
myPanel.add(new JLabel("Titre :"));
myPanel.add(Box.createHorizontalStrut(2)); // a spacer
myPanel.add(xField);
myPanel.add(titreField);
int result = JOptionPane.showConfirmDialog(null, myPanel, "Saisissez votre titre 1 ", JOptionPane.OK_CANCEL_OPTION);
if (result == JOptionPane.OK_OPTION) {
nod.titre1(xField.getText());
nod.titre1(titreField.getText());
fenetres.create.getTextNodeSelect().refreshAffichage(nod);
}

View File

@ -130,10 +130,6 @@ public class evaluate extends JFrame {
lblImageDossierEtudiant = new JLabel(imgDossierEtudiant);
panelWest.add(lblImageDossierEtudiant, "flowx,cell 0 2,alignx center,aligny center");
chckbxfichiersEtudiants = new JCheckBox("<HTML>Les fichiers des étudiants<BR><b>ne sont pas</b> dans des dossiers nominatifs<HTML>");
chckbxfichiersEtudiants.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
@ -390,8 +386,10 @@ public class evaluate extends JFrame {
public static evaluate getInstance() {
if (instance == null) {
instance = new evaluate();
}else {
instance.setVisible(true);
}
instance.setVisible(true);
if(commandes.fichierAnalyseValide) {
txtpnmessages.afficheChargementFichierAnalyse();
}else {