Skip to content
Snippets Groups Projects
Commit d13f33ae authored by FELIX ANTOINE's avatar FELIX ANTOINE :flag_fr:
Browse files

Merge branch of Antoine T into 'master' branch

Ajout de l'appréciation.

See merge request !9
parents feba7878 0594bd4d
Branches
1 merge request!9Ajout de la appreciation
......@@ -14,30 +14,90 @@ namespace psychorientation
{
}
public void ajouterEleve(Eleve e)
public void AjouterEleve(Eleve e)
{
this.listEleve.Add(e);
}
public void supprimerEleve(Eleve e)
public void SupprimerEleve(Eleve e)
{
this.listEleve.Remove(e);
}
public void supprimerEleve(int indice)
public void SupprimerEleve(int indice)
{
this.listEleve.RemoveAt(indice);
}
public List<Eleve> getListEleve()
public List<Eleve> GetListEleve()
{
return this.listEleve;
}
public Eleve getEleve(int indice)
public Eleve GetEleve(int indice)
{
return this.listEleve[indice];
}
public double GetMoyenneClasse()
{
double res = -1;
if (this.listEleve.Count > 0)
{
foreach (Eleve el in this.listEleve)
{
res += el.GetMoyenne();
}
}
return res / this.listEleve.Count;
}
public double GetCompetenceClasse()
{
double res = -1;
if (this.listEleve.Count > 0)
{
foreach (Eleve el in this.listEleve)
{
res += el.GetCompetence();
}
}
return res / this.listEleve.Count;
}
public double GetEffortClasse()
{
double res = -1;
if (this.listEleve.Count > 0)
{
foreach (Eleve el in this.listEleve)
{
res += el.GetEffort();
}
}
return res / this.listEleve.Count;
}
public void FaireControle(string nom)
{
foreach (Eleve e in this.listEleve)
{
e.AjouterNote(nom);
}
}
public double GetAppreciationClasse()
{
double res = -1;
if (this.listEleve.Count > 0)
{
foreach (Eleve el in this.listEleve)
{
res += el.GetAppreciation();
}
}
return res / this.listEleve.Count;
}
}
}
......@@ -39,6 +39,8 @@
this.pnlCompetence = new System.Windows.Forms.Panel();
this.lblEffort = new System.Windows.Forms.Label();
this.lblCompetence = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.lblMoyenne = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
......@@ -56,7 +58,7 @@
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(43, 105);
this.label1.Location = new System.Drawing.Point(60, 96);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(50, 13);
this.label1.TabIndex = 1;
......@@ -65,7 +67,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(52, 145);
this.label2.Location = new System.Drawing.Point(69, 136);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 2;
......@@ -74,7 +76,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(17, 186);
this.label3.Location = new System.Drawing.Point(34, 177);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(76, 13);
this.label3.TabIndex = 3;
......@@ -83,7 +85,7 @@
// lblClasse
//
this.lblClasse.AutoSize = true;
this.lblClasse.Location = new System.Drawing.Point(99, 105);
this.lblClasse.Location = new System.Drawing.Point(116, 96);
this.lblClasse.Name = "lblClasse";
this.lblClasse.Size = new System.Drawing.Size(35, 13);
this.lblClasse.TabIndex = 4;
......@@ -93,7 +95,7 @@
//
this.panel1.BackColor = System.Drawing.Color.Silver;
this.panel1.Controls.Add(this.pnlEffort);
this.panel1.Location = new System.Drawing.Point(99, 140);
this.panel1.Location = new System.Drawing.Point(116, 131);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(139, 26);
this.panel1.TabIndex = 5;
......@@ -110,7 +112,7 @@
//
this.panel2.BackColor = System.Drawing.Color.Silver;
this.panel2.Controls.Add(this.pnlCompetence);
this.panel2.Location = new System.Drawing.Point(99, 182);
this.panel2.Location = new System.Drawing.Point(116, 173);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(139, 26);
this.panel2.TabIndex = 6;
......@@ -126,7 +128,7 @@
// lblEffort
//
this.lblEffort.AutoSize = true;
this.lblEffort.Location = new System.Drawing.Point(255, 144);
this.lblEffort.Location = new System.Drawing.Point(272, 144);
this.lblEffort.Name = "lblEffort";
this.lblEffort.Size = new System.Drawing.Size(0, 13);
this.lblEffort.TabIndex = 7;
......@@ -134,16 +136,35 @@
// lblCompetence
//
this.lblCompetence.AutoSize = true;
this.lblCompetence.Location = new System.Drawing.Point(254, 189);
this.lblCompetence.Location = new System.Drawing.Point(271, 189);
this.lblCompetence.Name = "lblCompetence";
this.lblCompetence.Size = new System.Drawing.Size(0, 13);
this.lblCompetence.TabIndex = 8;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 215);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(98, 13);
this.label4.TabIndex = 9;
this.label4.Text = "Moyenne général : ";
//
// lblMoyenne
//
this.lblMoyenne.AutoSize = true;
this.lblMoyenne.Location = new System.Drawing.Point(116, 215);
this.lblMoyenne.Name = "lblMoyenne";
this.lblMoyenne.Size = new System.Drawing.Size(35, 13);
this.lblMoyenne.TabIndex = 10;
this.lblMoyenne.Text = "label5";
//
// InterfaceInfoEleve
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.lblMoyenne);
this.Controls.Add(this.label4);
this.Controls.Add(this.lblCompetence);
this.Controls.Add(this.lblEffort);
this.Controls.Add(this.panel2);
......@@ -176,5 +197,7 @@
private System.Windows.Forms.Panel pnlCompetence;
private System.Windows.Forms.Label lblEffort;
private System.Windows.Forms.Label lblCompetence;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblMoyenne;
}
}
......@@ -37,13 +37,23 @@ namespace psychorientation
lblClasse.Text = listClasse[eleve.getClasse()];
lblEffort.Text = eleve.getEffort().ToString();
lblCompetence.Text = eleve.getCompetence().ToString();
double moyenne = eleve.getMoyenne();
if (moyenne == -1)
{
lblMoyenne.Text="Pas encore d'évaluation";
}
else
{
lblMoyenne.Text = eleve.getMoyenne().ToString()+"/20";
}
MajPanel(pnlCompetence,eleve.getCompetence());
MajPanel(pnlEffort, eleve.getEffort());
}
private void MajPanel(Panel p, double valeur)
{
int val = (int)valeur;
p.Size = new Size(val * 133 / 100, p.Height);
p.Size = new Size(val * 133 / 10, p.Height);
}
}
}
......@@ -14,7 +14,7 @@ namespace psychorientation
private int orientation = 0;
private int id;
private List<Note> listNote = new List<Note>();
private double appreciation;
public Eleve(int id)
{
......@@ -32,63 +32,90 @@ namespace psychorientation
this.competence = competence;
this.effort = effort;
this.orientation = orientation;
this.appreciation = CalculerAppreciation();
}
public void setClasse(int classe)
public void SetClasse(int classe)
{
this.classe = classe;
}
public void setOrientation(int orientation)
public void SetOrientation(int orientation)
{
this.orientation = orientation;
}
public void setEffort(double effort)
public void SetEffort(double effort)
{
this.effort = effort;
}
public void setCompetence(double competence)
public void SetCompetence(double competence)
{
this.competence = competence;
}
public double getCompetence()
public double GetCompetence()
{
return this.competence;
}
public List<Note> getListNote()
public List<Note> GetListNote()
{
return this.listNote;
}
public int getId()
public int GetId()
{
return this.id;
}
public int getClasse()
public int GetClasse()
{
return this.classe;
}
public int getOrientation()
public int GetOrientation()
{
return this.orientation;
}
public double getEffort()
public double GetEffort()
{
return this.effort;
}
public double GetAppreciation()
{
return this.appreciation;
}
public double GetMoyenne()
{
double res = -1;
if (this.listNote.Count > 0)
{
foreach(Note n in listNote)
{
res += n.getNote();
}
}
return res/ this.listNote.Count;
}
public void ajouterNote(string nom, double note)
public void AjouterNote(string nom)
{
Note n = new Note(nom, note, this.competence, this.effort);
Note n = new Note(nom,CalculerNote() , this.competence, this.effort);
this.listNote.Add(n);
}
private double CalculerNote()
{
return (this.effort * Config.GetInstance().GetCoeffEffortEcrit() + this.competence * Config.GetInstance().GetCoeffCompetenceEcrit());
}
private double CalculerAppreciation()
{
return (this.effort * Config.GetInstance().GetCoeffEffortOral() + this.competence * Config.GetInstance().GetCoeffCompetenceOral());
}
}
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment