Skip to content
Snippets Groups Projects
Commit 61237414 authored by TRITSCHBERGER ANTOINE's avatar TRITSCHBERGER ANTOINE
Browse files

Ajout de plein de fonction dans le gestionnaire et eleve

parent ec168ca8
Branches
1 merge request!9Ajout de la appreciation
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Psychorientation"; this.Text = "Psychorientation";
this.Load += new System.EventHandler(this.Form1_Load); this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false); this.ResumeLayout(false);
} }
......
...@@ -47,7 +47,7 @@ namespace psychorientation ...@@ -47,7 +47,7 @@ namespace psychorientation
TypeMessage tm = TypeMessage.INFORMATION; TypeMessage tm = TypeMessage.INFORMATION;
Message m = new Message(-1,"Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ","Début",tm); Message m = new Message(-1,"Bonjour apprenti prof, vous allez apprendre à éduquer des joueurs !! ","Début",tm);
m.ShowDialog(); // m.ShowDialog();
InterfaceInfoEleve ii = new InterfaceInfoEleve(); InterfaceInfoEleve ii = new InterfaceInfoEleve();
...@@ -55,7 +55,7 @@ namespace psychorientation ...@@ -55,7 +55,7 @@ namespace psychorientation
ii.Left = 0; ii.Left = 0;
ii.Top = 0; ii.Top = 0;
ii.BorderStyle = BorderStyle.Fixed3D; ii.BorderStyle = BorderStyle.Fixed3D;
this.Controls.Add(ii); //this.Controls.Add(ii);
} }
......
...@@ -39,5 +39,52 @@ namespace psychorientation ...@@ -39,5 +39,52 @@ namespace psychorientation
return this.listEleve[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);
}
}
} }
} }
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
this.pnlCompetence = new System.Windows.Forms.Panel(); this.pnlCompetence = new System.Windows.Forms.Panel();
this.lblEffort = new System.Windows.Forms.Label(); this.lblEffort = new System.Windows.Forms.Label();
this.lblCompetence = 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.panel1.SuspendLayout();
this.panel2.SuspendLayout(); this.panel2.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
...@@ -56,7 +58,7 @@ ...@@ -56,7 +58,7 @@
// label1 // label1
// //
this.label1.AutoSize = true; 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.Name = "label1";
this.label1.Size = new System.Drawing.Size(50, 13); this.label1.Size = new System.Drawing.Size(50, 13);
this.label1.TabIndex = 1; this.label1.TabIndex = 1;
...@@ -65,7 +67,7 @@ ...@@ -65,7 +67,7 @@
// label2 // label2
// //
this.label2.AutoSize = true; 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.Name = "label2";
this.label2.Size = new System.Drawing.Size(41, 13); this.label2.Size = new System.Drawing.Size(41, 13);
this.label2.TabIndex = 2; this.label2.TabIndex = 2;
...@@ -74,7 +76,7 @@ ...@@ -74,7 +76,7 @@
// label3 // label3
// //
this.label3.AutoSize = true; 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.Name = "label3";
this.label3.Size = new System.Drawing.Size(76, 13); this.label3.Size = new System.Drawing.Size(76, 13);
this.label3.TabIndex = 3; this.label3.TabIndex = 3;
...@@ -83,7 +85,7 @@ ...@@ -83,7 +85,7 @@
// lblClasse // lblClasse
// //
this.lblClasse.AutoSize = true; 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.Name = "lblClasse";
this.lblClasse.Size = new System.Drawing.Size(35, 13); this.lblClasse.Size = new System.Drawing.Size(35, 13);
this.lblClasse.TabIndex = 4; this.lblClasse.TabIndex = 4;
...@@ -93,7 +95,7 @@ ...@@ -93,7 +95,7 @@
// //
this.panel1.BackColor = System.Drawing.Color.Silver; this.panel1.BackColor = System.Drawing.Color.Silver;
this.panel1.Controls.Add(this.pnlEffort); 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.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(139, 26); this.panel1.Size = new System.Drawing.Size(139, 26);
this.panel1.TabIndex = 5; this.panel1.TabIndex = 5;
...@@ -110,7 +112,7 @@ ...@@ -110,7 +112,7 @@
// //
this.panel2.BackColor = System.Drawing.Color.Silver; this.panel2.BackColor = System.Drawing.Color.Silver;
this.panel2.Controls.Add(this.pnlCompetence); 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.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(139, 26); this.panel2.Size = new System.Drawing.Size(139, 26);
this.panel2.TabIndex = 6; this.panel2.TabIndex = 6;
...@@ -126,7 +128,7 @@ ...@@ -126,7 +128,7 @@
// lblEffort // lblEffort
// //
this.lblEffort.AutoSize = true; 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.Name = "lblEffort";
this.lblEffort.Size = new System.Drawing.Size(0, 13); this.lblEffort.Size = new System.Drawing.Size(0, 13);
this.lblEffort.TabIndex = 7; this.lblEffort.TabIndex = 7;
...@@ -134,16 +136,35 @@ ...@@ -134,16 +136,35 @@
// lblCompetence // lblCompetence
// //
this.lblCompetence.AutoSize = true; 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.Name = "lblCompetence";
this.lblCompetence.Size = new System.Drawing.Size(0, 13); this.lblCompetence.Size = new System.Drawing.Size(0, 13);
this.lblCompetence.TabIndex = 8; 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 // InterfaceInfoEleve
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 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.lblCompetence);
this.Controls.Add(this.lblEffort); this.Controls.Add(this.lblEffort);
this.Controls.Add(this.panel2); this.Controls.Add(this.panel2);
...@@ -176,5 +197,7 @@ ...@@ -176,5 +197,7 @@
private System.Windows.Forms.Panel pnlCompetence; private System.Windows.Forms.Panel pnlCompetence;
private System.Windows.Forms.Label lblEffort; private System.Windows.Forms.Label lblEffort;
private System.Windows.Forms.Label lblCompetence; private System.Windows.Forms.Label lblCompetence;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label lblMoyenne;
} }
} }
...@@ -37,13 +37,23 @@ namespace psychorientation ...@@ -37,13 +37,23 @@ namespace psychorientation
lblClasse.Text = listClasse[eleve.getClasse()]; lblClasse.Text = listClasse[eleve.getClasse()];
lblEffort.Text = eleve.getEffort().ToString(); lblEffort.Text = eleve.getEffort().ToString();
lblCompetence.Text = eleve.getCompetence().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(pnlCompetence,eleve.getCompetence());
MajPanel(pnlEffort, eleve.getEffort()); MajPanel(pnlEffort, eleve.getEffort());
} }
private void MajPanel(Panel p, double valeur) private void MajPanel(Panel p, double valeur)
{ {
int val = (int)valeur; int val = (int)valeur;
p.Size = new Size(val * 133 / 100, p.Height); p.Size = new Size(val * 133 / 10, p.Height);
} }
} }
} }
...@@ -83,12 +83,29 @@ namespace psychorientation ...@@ -83,12 +83,29 @@ namespace psychorientation
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); this.listNote.Add(n);
} }
private double calculerNote()
{
return this.effort*0.2+this.competence*1.8;
}
} }
} }
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