Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
No results found
Show changes
......@@ -13,7 +13,7 @@ namespace psychorientation
public enum TypeMessage
{
INFORMATION,NOTATION
INFORMATION,NOTATION,RESULTAT
}
public partial class Message : Form
......@@ -27,6 +27,16 @@ namespace psychorientation
int reponseInt = 0;
double reponseDouble = 0;
bool effortScoreRouge = false;
bool moyenneScoreRouge = false;
bool competenceScoreRouge = false;
double effortScore;
double competenceScore;
double moyenneScore;
double effortLimite;
double competenceLimite;
double moyenneLimite;
public Message(string messageAffiche,string titreAffiche,TypeMessage typeMessage)
{
......@@ -36,6 +46,19 @@ namespace psychorientation
titre = titreAffiche;
}
public void setParamRes(double effortInitial, double competenceInitial, double moyenneInitiale, double effortFinal, double competenceFinal, double moyenneFinale)
{
effortScore = Math.Round(100 * (effortFinal - effortInitial) / effortInitial, 1);
competenceScore = Math.Round(100 * (competenceFinal - competenceInitial) / competenceInitial, 1);
moyenneScore = Math.Round(100 * (moyenneFinale - moyenneInitiale) / moyenneInitiale, 1);
effortLimite = Math.Round(100 * ((10 - effortInitial) / 3) / effortInitial, 1);
competenceLimite = Math.Round(100 * ((10 - competenceInitial) / 4) / competenceInitial, 1);
moyenneLimite = 0;
effortScoreRouge = effortFinal > ((10 - effortInitial) / 3) + effortInitial;
competenceScoreRouge = competenceFinal > ((10 - competenceInitial) / 4) + competenceInitial;
moyenneScoreRouge = moyenneFinale > moyenneInitiale;
}
public bool getReponseBool
{
get { return reponseBool; }
......@@ -60,10 +83,12 @@ namespace psychorientation
private void Message_Load(object sender, EventArgs e)
{
lblMessage.Text = message;
lblScore.Text = message;
lblTitre.Text = titre;
switch (typeMessage)
{
case TypeMessage.INFORMATION:
lblMessage.Visible = true;
this.Size = new Size(986, 347);
Button b = new Button();
b.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
......@@ -75,7 +100,51 @@ namespace psychorientation
b.Click += new System.EventHandler(this.b_Click);
this.Controls.Add(b);
break;
case TypeMessage.RESULTAT:
lblCompetence.Visible = true;
lblEffort.Visible = true;
lblMoyenen.Visible = true;
lblScore.Visible = true;
lblCompetence.Text = "L'évolution des compétences de vos élèves est de : " + competenceScore + " % pour " + competenceLimite + " % nécessaires.";
lblEffort.Text = "L'évolution des efforts de vos élèves est de : " + effortScore + " % pour " + effortLimite + " % nécessaires.";
lblMoyenen.Text = "L'évolution des moyennes de vos élèves est de : " + moyenneScore + " % pour " + moyenneLimite + " % nécessaires.";
if (!effortScoreRouge)
{
lblEffort.ForeColor = Color.Red;
}
else
{
lblEffort.ForeColor = Color.Green;
}
if (!competenceScoreRouge)
{
lblCompetence.ForeColor = Color.Red;
}
else
{
lblCompetence.ForeColor = Color.Green;
}
if (!moyenneScoreRouge)
{
lblMoyenen.ForeColor = Color.Red;
}
else
{
lblMoyenen.ForeColor = Color.Green;
}
this.Size = new Size(986, 347);
Button bh = new Button();
bh.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
bh.Location = new System.Drawing.Point(784, 284);
bh.Size = new System.Drawing.Size(190, 51);
bh.TabIndex = 2;
bh.Text = "Valider";
bh.UseVisualStyleBackColor = true;
bh.Click += new System.EventHandler(this.b_Click);
this.Controls.Add(bh);
break;
case TypeMessage.NOTATION:
lblMessage.Visible = true;
this.Size = new Size(986, 347);
Button bu = new Button();
bu.Font = new System.Drawing.Font("Microsoft Sans Serif", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
......@@ -122,5 +191,10 @@ namespace psychorientation
this.reponseDouble = (double)tb.Value;
tag.Text= "Type de cours visant à aider les élèves de compétence : " + this.reponseDouble;
}
private void lblMoyenen_Click(object sender, EventArgs e)
{
}
}
}
......@@ -19,7 +19,7 @@ namespace psychorientation.Properties {
// à l'aide d'un outil, tel que ResGen ou Visual Studio.
// Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
// avec l'option /str ou régénérez votre projet VS.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
......@@ -80,6 +80,36 @@ namespace psychorientation.Properties {
}
}
/// <summary>
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap paternFeuille {
get {
object obj = ResourceManager.GetObject("paternFeuille", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap paternFeuille1 {
get {
object obj = ResourceManager.GetObject("paternFeuille1", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap prof2 {
get {
object obj = ResourceManager.GetObject("prof2", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Recherche une ressource localisée de type System.Drawing.Bitmap.
/// </summary>
......
......@@ -124,13 +124,22 @@
<data name="grp" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\grp.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="paternFeuille" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\bin\Debug\images\patern\paternFeuille.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="sortir" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\sortir.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="passer" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\passer.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="prof2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\prof2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="salleV11" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\salleV11.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="paternFeuille1" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\paternFeuille.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
psychorientation/psychorientation/Resources/paternFeuille.png

12.4 KiB

psychorientation/psychorientation/Resources/prof2.png

5.01 KiB

......@@ -16,6 +16,7 @@ namespace psychorientation
private List<Note> listeNotes = new List<Note>();
private double appreciation;
private static Random r = new Random();
public Eleve(int id)
{
......@@ -24,7 +25,7 @@ namespace psychorientation
this.competence = Eleve.r.NextDouble()*10;
this.effort = Eleve.r.NextDouble()*10;
this.orientation = 0;
this.appreciation=CalculerAppreciation();
this.appreciation=CalculerAppreciation(1);
}
public Eleve(int id,int classe, double competence, double effort, int orientation)
......@@ -34,7 +35,7 @@ namespace psychorientation
this.competence = competence;
this.effort = effort;
this.orientation = orientation;
this.appreciation = CalculerAppreciation();
this.appreciation = CalculerAppreciation(1);
}
public void SetClasse(int classe)
{
......@@ -124,7 +125,7 @@ namespace psychorientation
{
double note = CalculerNote(coeff);
double note_convenable = 10 + (competence - 5);
double note_convenable = 10 + (competence - 5);//((competence + effort) / 2 - 5);
if (effort > 5)
{
if (note >= note_convenable)
......@@ -144,10 +145,10 @@ namespace psychorientation
}
else
{
effort += 0.25;
effort -= 0.25;
}
}
if (effort < 0) { effort = 0; }
else if (effort > 10) { effort = 10; }
......@@ -160,9 +161,9 @@ namespace psychorientation
return (this.effort * (2 - coeff) + this.competence * coeff);
}
private double CalculerAppreciation()
private double CalculerAppreciation(double coeff)
{
return (this.effort * Config.GetInstance().GetCoeffEffortOral() + this.competence * Config.GetInstance().GetCoeffCompetenceOral());
return (this.effort * (2 - coeff) + this.competence * coeff);
}
}
}
......@@ -50,7 +50,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Config.cs" />
<Compile Include="Eleve.cs" />
<Compile Include="InterfaceClasse.cs">
<SubType>Form</SubType>
......@@ -150,5 +149,14 @@
<ItemGroup>
<None Include="Resources\salleV11.png" />
</ItemGroup>
<ItemGroup>
<None Include="bin\Debug\images\patern\paternFeuille.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\prof2.png" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\paternFeuille.png" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
\ No newline at end of file