diff --git a/psychorientation/psychorientation/Config.cs b/psychorientation/psychorientation/Config.cs index f7dcb873bac01ceee1816f04d7c5df74ee2989ba..8a504f87b97d2f7d937c3508f20733f4c87f88e0 100644 --- a/psychorientation/psychorientation/Config.cs +++ b/psychorientation/psychorientation/Config.cs @@ -45,7 +45,7 @@ namespace psychorientation public double GetCoeffCompetenceEcrit() { - return this.coeffCompetenceOral; + return this.coeffCompetenceEcrit; } public double GetCoeffEffortEcrit() diff --git a/psychorientation/psychorientation/GestionnaireEleve.cs b/psychorientation/psychorientation/GestionnaireEleve.cs index 9ee450348c4cd42c0d90ae0f581707843b071de5..902c3a8dadb12e02b2e799d7fcf42d0a336f74ba 100644 --- a/psychorientation/psychorientation/GestionnaireEleve.cs +++ b/psychorientation/psychorientation/GestionnaireEleve.cs @@ -39,41 +39,44 @@ namespace psychorientation public double GetMoyenneClasse() { - double res = -1; + double res = 0; if (this.listeEleves.Count > 0) { foreach (Eleve el in this.listeEleves) { res += el.GetMoyenne(); } + res /= this.listeEleves.Count; } - return res / this.listeEleves.Count; + return res; } public double GetCompetenceClasse() { - double res = -1; + double res = 0; if (this.listeEleves.Count > 0) { foreach (Eleve el in this.listeEleves) { res += el.GetCompetence(); } + res /= this.listeEleves.Count; } - return res / this.listeEleves.Count; + return res; } public double GetEffortClasse() { - double res = -1; + double res = 0; if (this.listeEleves.Count > 0) { foreach (Eleve el in this.listeEleves) { res += el.GetEffort(); } + res /= this.listeEleves.Count; } - return res / this.listeEleves.Count; + return res; } public void FaireControle(string nom) @@ -86,15 +89,16 @@ namespace psychorientation public double GetAppreciationClasse() { - double res = -1; + double res = 0; if (this.listeEleves.Count > 0) { foreach (Eleve el in this.listeEleves) { res += el.GetAppreciation(); } + res /= this.listeEleves.Count; } - return res / this.listeEleves.Count; + return res; } } diff --git a/psychorientation/psychorientation/InterfaceClasse.Designer.cs b/psychorientation/psychorientation/InterfaceClasse.Designer.cs index 0d4b7bccb4296bb46d8bf812490e1bc9f335ebb9..954308696ad106a15b9a79667acab627e8f450e0 100644 --- a/psychorientation/psychorientation/InterfaceClasse.Designer.cs +++ b/psychorientation/psychorientation/InterfaceClasse.Designer.cs @@ -32,8 +32,12 @@ this.lblDate = new System.Windows.Forms.Label(); this.pb_sortir = new System.Windows.Forms.PictureBox(); this.lblClasse = new System.Windows.Forms.Label(); + this.lblMoyenne = new System.Windows.Forms.Label(); + this.lblCompetence = new System.Windows.Forms.Label(); + this.lblEffort = new System.Windows.Forms.Label(); this.pnlListeEleve = new System.Windows.Forms.Panel(); this.lblListeEleve = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.pb_action_suivante)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pb_sortir)).BeginInit(); this.pnlListeEleve.SuspendLayout(); @@ -88,6 +92,43 @@ this.lblClasse.TabIndex = 4; this.lblClasse.Text = "Chargement..."; // + + // lblMoyenne + // + this.lblMoyenne.AutoSize = true; + this.lblMoyenne.BackColor = System.Drawing.Color.Transparent; + this.lblMoyenne.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblMoyenne.ForeColor = System.Drawing.Color.White; + this.lblMoyenne.Location = new System.Drawing.Point(544, 154); + this.lblMoyenne.Name = "lblMoyenne"; + this.lblMoyenne.Size = new System.Drawing.Size(101, 18); + this.lblMoyenne.TabIndex = 5; + this.lblMoyenne.Text = "Chargement..."; + // + // lblCompetence + // + this.lblCompetence.AutoSize = true; + this.lblCompetence.BackColor = System.Drawing.Color.Transparent; + this.lblCompetence.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblCompetence.ForeColor = System.Drawing.Color.White; + this.lblCompetence.Location = new System.Drawing.Point(544, 175); + this.lblCompetence.Name = "lblCompetence"; + this.lblCompetence.Size = new System.Drawing.Size(101, 18); + this.lblCompetence.TabIndex = 6; + this.lblCompetence.Text = "Chargement..."; + // + // lblEffort + // + this.lblEffort.AutoSize = true; + this.lblEffort.BackColor = System.Drawing.Color.Transparent; + this.lblEffort.Font = new System.Drawing.Font("Microsoft Sans Serif", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.lblEffort.ForeColor = System.Drawing.Color.White; + this.lblEffort.Location = new System.Drawing.Point(544, 196); + this.lblEffort.Name = "lblEffort"; + this.lblEffort.Size = new System.Drawing.Size(101, 18); + this.lblEffort.TabIndex = 7; + this.lblEffort.Text = "Chargement..."; + // pnlListeEleve // this.pnlListeEleve.AutoScroll = true; @@ -116,7 +157,13 @@ this.BackgroundImage = global::psychorientation.Properties.Resources.salleV11; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.ClientSize = new System.Drawing.Size(1357, 783); + + this.Controls.Add(this.lblEffort); + this.Controls.Add(this.lblCompetence); + this.Controls.Add(this.lblMoyenne); + this.Controls.Add(this.pnlListeEleve); + this.Controls.Add(this.lblClasse); this.Controls.Add(this.pb_sortir); this.Controls.Add(this.lblDate); @@ -144,8 +191,14 @@ private System.Windows.Forms.Label lblDate; private System.Windows.Forms.PictureBox pb_sortir; private System.Windows.Forms.Label lblClasse; + + private System.Windows.Forms.Label lblMoyenne; + private System.Windows.Forms.Label lblCompetence; + private System.Windows.Forms.Label lblEffort; + private System.Windows.Forms.Panel pnlListeEleve; private System.Windows.Forms.Label lblListeEleve; + } } diff --git a/psychorientation/psychorientation/InterfaceClasse.cs b/psychorientation/psychorientation/InterfaceClasse.cs index fde9287facf96f09b3f659732a2f06fadedb3795..5adeda927eb0691f518c15251d4222a487c02556 100644 --- a/psychorientation/psychorientation/InterfaceClasse.cs +++ b/psychorientation/psychorientation/InterfaceClasse.cs @@ -24,18 +24,20 @@ namespace psychorientation private void Form1_Load(object sender, EventArgs e) { - lblDate.Text = libelle.Mois(moisActuel % 12); - lblClasse.Text=libelle.Niveau(anneeActuelle); - - for(int i = 1; i < 5; i++) + for (int i = 1; i < 3; i++) { gestEleve.AjouterEleve(new Eleve(i)); } - Libelle lib = new Libelle(); + gestEleve.AjouterEleve(new Eleve(3,0,10.0,10.0,0)); + lblDate.Text = libelle.Mois(moisActuel % 12); + lblClasse.Text=libelle.Niveau(anneeActuelle); + lblEffort.Text = "Effort de la classe : " + Math.Round(gestEleve.GetEffortClasse(),1).ToString(); + lblCompetence.Text = "Competence de la classe : " + Math.Round(gestEleve.GetCompetenceClasse(),1).ToString(); + lblMoyenne.Text = "Moyenne de la classe : " + Math.Round(gestEleve.GetMoyenneClasse(),1).ToString(); - List<Eleve> listEleve = gestEleve.GetListeEleves(); + Libelle lib = new Libelle(); int y = 20; - foreach (Eleve eleve in listEleve) + foreach (Eleve eleve in gestEleve.GetListeEleves()) { InterfaceInfoEleve ii = new InterfaceInfoEleve(); ii.setParam(eleve); @@ -60,12 +62,16 @@ namespace psychorientation } Message mControle = new Message("C'est la fin du mois, comme chaque mois, les eleves vont passer un contrôle, à vous de choisir le niveau de compétence de votre enseignement.", "Début", TypeMessage.NOTATION); mControle.ShowDialog(); - foreach(Eleve el in gestEleve.GetListeEleves()) { + el.AjouterNote("Controle " +lblClasse.Text+" "+lblDate.Text); el.Progression(mControle.getReponseDouble); } + lblEffort.Text = "Effort de la classe : " + Math.Round(gestEleve.GetEffortClasse(), 1).ToString(); + lblCompetence.Text = "Competence de la classe : " + Math.Round(gestEleve.GetCompetenceClasse(), 1).ToString(); + lblMoyenne.Text = "Moyenne de la classe : " + Math.Round(gestEleve.GetMoyenneClasse(), 1).ToString(); + ActualiserEleveCoter(); // Passe au mois suivant. moisActuel++; @@ -103,10 +109,23 @@ namespace psychorientation private void Pb_liste_eleves_Click(object sender, EventArgs e) { - ListeEleve le = new ListeEleve(); + ListeEleve le = new ListeEleve(gestEleve); le.Show(); } + private void ActualiserEleveCoter() + { + foreach(Control c in pnlListeEleve.Controls) + { + if (c is InterfaceInfoEleve) + { + InterfaceInfoEleve iie = (InterfaceInfoEleve)c; + iie.actualiser(); + } + + } + } + private void InterfaceClasse_SizeChanged(object sender, EventArgs e) { PictureBox pb1 = pb_action_suivante; diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs index 0e046c5cc0bb491e9e339e65db5f3573f76662fe..41e6cda668dff235309f84497353bc69c7c6f1cd 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.Designer.cs @@ -69,6 +69,7 @@ // label2 // this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(3, 108); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(41, 13); @@ -79,7 +80,9 @@ // label3 // this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(3, 150); + this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(76, 13); this.label3.TabIndex = 3; @@ -137,7 +140,7 @@ // lblEffort // this.lblEffort.AutoSize = true; - this.lblEffort.Location = new System.Drawing.Point(272, 144); + this.lblEffort.Location = new System.Drawing.Point(79, 107); this.lblEffort.Name = "lblEffort"; this.lblEffort.Size = new System.Drawing.Size(0, 13); this.lblEffort.TabIndex = 7; @@ -145,7 +148,7 @@ // lblCompetence // this.lblCompetence.AutoSize = true; - this.lblCompetence.Location = new System.Drawing.Point(271, 189); + this.lblCompetence.Location = new System.Drawing.Point(78, 152); this.lblCompetence.Name = "lblCompetence"; this.lblCompetence.Size = new System.Drawing.Size(0, 13); this.lblCompetence.TabIndex = 8; @@ -186,7 +189,9 @@ this.Controls.Add(this.label1); this.Controls.Add(this.lblEleve); this.Name = "InterfaceInfoEleve"; + this.Size = new System.Drawing.Size(223, 216); + this.Load += new System.EventHandler(this.InterfaceInfoEleve_Load); this.Click += new System.EventHandler(this.InterfaceInfoEleve_Click); this.panel1.ResumeLayout(false); diff --git a/psychorientation/psychorientation/InterfaceInfoEleve.cs b/psychorientation/psychorientation/InterfaceInfoEleve.cs index 80c58fe08949cc9194abfca92bcb834b735599ec..9e1a28478a6352014e0170b424e0f0824bbaae47 100644 --- a/psychorientation/psychorientation/InterfaceInfoEleve.cs +++ b/psychorientation/psychorientation/InterfaceInfoEleve.cs @@ -29,13 +29,13 @@ namespace psychorientation actualiser(); } - private void actualiser() + public void actualiser() { Libelle lib = new Libelle(); lblEleve.Text = "Eleve n°" + eleve.GetId(); lblClasse.Text = lib.Niveau(eleve.GetClasse()); - lblEffort.Text = eleve.GetEffort().ToString(); - lblCompetence.Text = eleve.GetCompetence().ToString(); + lblEffort.Text = Math.Round(eleve.GetEffort(),1).ToString() ; + lblCompetence.Text = Math.Round(eleve.GetCompetence(),1).ToString(); double moyenne = eleve.GetMoyenne(); if (moyenne == -1) { diff --git a/psychorientation/psychorientation/ListeEleve.cs b/psychorientation/psychorientation/ListeEleve.cs index aedca0a59ff99066a4c3464440c87206f5ef2614..2c6dba31484735011c4c344b81464ce10a240bcf 100755 --- a/psychorientation/psychorientation/ListeEleve.cs +++ b/psychorientation/psychorientation/ListeEleve.cs @@ -12,15 +12,17 @@ namespace psychorientation { public partial class ListeEleve : Form { - public ListeEleve() + GestionnaireEleve gestEleve; + public ListeEleve(GestionnaireEleve el) { InitializeComponent(); + gestEleve = el; } private void ListeEleve_Load(object sender, EventArgs e) { - GestionnaireEleve gestEleve = new GestionnaireEleve(); + Libelle lib = new Libelle(); // TEST diff --git a/psychorientation/psychorientation/Message.cs b/psychorientation/psychorientation/Message.cs index 670dfd3c25e204ef8f4d7333a5de3614b1447fa4..2483ee623faff545034b609e297bd5cfc99f23dd 100644 --- a/psychorientation/psychorientation/Message.cs +++ b/psychorientation/psychorientation/Message.cs @@ -94,14 +94,16 @@ namespace psychorientation l.Location = new System.Drawing.Point(10, 279); l.Size = new System.Drawing.Size(477, 20); l.TabIndex = 5; - l.Text = "Type de notation visant à aider les eleves de competence :"; - this.Controls.Add(l); + TrackBar tb = new TrackBar(); tb.Location = new System.Drawing.Point(533, 279); tb.Size = new System.Drawing.Size(184, 45); tb.Tag = l; + tb.Value = 5; tb.Scroll += new System.EventHandler(tb_Scroll); tb.TabIndex = 3; + l.Text = "Type de notation visant à aider les eleves de competence : "+tb.Value; + this.Controls.Add(l); this.Controls.Add(tb); break; } diff --git a/psychorientation/psychorientation/eleve.cs b/psychorientation/psychorientation/eleve.cs index d2660fee09e7c319b2cc0c9e42a7bdf45d21bede..1f2d64c0269d7cb5f01444734b4f20c44f25bf69 100644 --- a/psychorientation/psychorientation/eleve.cs +++ b/psychorientation/psychorientation/eleve.cs @@ -20,9 +20,10 @@ namespace psychorientation { this.id = id; this.classe = 0; - this.competence = 10; - this.effort = 10; + this.competence = 5; + this.effort = 5; this.orientation = 0; + this.appreciation=CalculerAppreciation(); } public Eleve(int id,int classe, double competence, double effort, int orientation) @@ -88,7 +89,7 @@ namespace psychorientation public double GetMoyenne() { - if (this.listeNotes.Count == 0) {return -1;} + if (this.listeNotes.Count == 0) {return 0;} double res = 0; if (this.listeNotes.Count > 0) { @@ -110,10 +111,22 @@ namespace psychorientation if (competence < 0) { competence = 0; } else if (competence > 10) { competence = 10; } - if (t_competence != typeEducation) - this.effort += Math.Min(Math.Max(((1 / Math.Abs(t_competence - typeEducation)) - (1.0 / 3)) * 3, -1), 1) * 0.5; + var diff = Math.Abs(competence - effort); + if (diff < 3.0) + { + this.effort += Math.Pow(0.5, diff + 1); + } else - this.effort += 0.5; + { + if (diff >= 6) + { + this.effort -= 0.5; + } + else + { + this.effort -= 0.125 * (diff - 3); + } + } if (effort < 0) { effort = 0; } else if (effort > 10) { effort = 10; }