Example #1
0
        /*******************************/

        /*Constructeur:Sert à initialiser les variables numChapitre numeroExo et id_exercice
         * et d'afficher le score du dernier essai*/
        public StartExoWindow(int numChapitre, int numeroExo, int id_exercice)
        {
            App.mainWindow.Hide();
            InitializeComponent();
            /*Initialisation des variables*/
            this.numChapitre = numChapitre;
            this.numeroExo   = numeroExo;
            this.id_exercice = id_exercice;
            /*****************************/
            /*Reccupération du score de l'exercice courant de la BDD utilisant le id_exercice.*/
            this.score = exercice.RecupererScore(id_exercice);
            /********************************************************************************/
            /*Ouverture Du ficher xml qui contient la descriptions des exercices*/
            monFichier.Load("StartExerciceDescriptionFile.xml");
            /*******************************************************************/
            /*Affichage de la description de l'exercice dont le numero est egal à numeroExo*/
            path = "//Description/Exercice";
            DescriptionParagraph.Inlines.Add(new Run(monFichier.SelectSingleNode(path + numeroExo).InnerText));
            /******************************************************************************/
            /*Affichage du score non nul et d'un commentaire:Voulez vous refaire*/
            if (score != 0)
            {
                CommentTBlk.Inlines.Add(new Run(" لقد تحصلت على العلامة " + score + " في اخر محاولة."));
                CommentTBlk.Inlines.Add(new LineBreak());
                CommentTBlk.Inlines.Add(new Run("هل تريد المحاولة مرة اخرى؟ "));
            }
            image.Source = GetImage("StartImage" + numeroExo + ".png");
            /**************************************************************************/
        }
Example #2
0
        private int Choix;//variable qui indique si on veut quitter l'app ou pas.
        /*Constructeur:sert à initialiser la variable choix selon le choix de l'utilisateur:il veut quitter ou pas*/
        public FenetreAffichageScoreTestFinal(int Choix)
        {   /*Initialser les variables*/
            this.Choix = Choix;
            this.Score = exercice.RecupererScore(13);
            /**************************/
            App.mainWindow.Opacity = 0.5f;
            InitializeComponent();
            /*Condition d'acces au bonus du test final*/
            if (Score > 20)
            {
                Bonus.IsEnabled = true;
            }
            if (Choix == 1)
            {
                DescriptionTB.Inlines.Add(new Run("  للاسف , انتهى الوقت"));
                DescriptionTB.Inlines.Add(new LineBreak());
            }
            else if (Choix == 2)
            {
                DescriptionTB.Inlines.Add(new Run("احسنت ! , لقد انهيت الاختبار."));
                DescriptionTB.Inlines.Add(new LineBreak());
            }

            DescriptionTB.Inlines.Add(new Run(" العلامة:  " + Score * 20 / Total + " /" + 20));
            /*********************************************************************/
            /*Affichage des étoiles selon le score obtenu*/
            comment = Score * 100 / Total;
            /*Si score<33%:on affiche une étoile*/
            if ((comment < 33) && (comment > 0))
            {
                img        = this.FindName("image1") as Image;
                img.Source = GetImage("Images/star.png");
            }
            /********************************/
            /*Si 33%<score<66%: on affiche deux étoiles*/
            else if (comment < 66)
            {
                for (int i = 1; i <= 2; i++)
                {
                    img        = this.FindName("image" + i) as Image;
                    img.Source = GetImage("Images/star.png");
                }
            }
            /********************************/
            /*Si score>66% : on affiche 3étoiles*/
            else
            {
                for (int i = 1; i <= 3; i++)
                {
                    img        = this.FindName("image" + i) as Image;
                    img.Source = GetImage("Images/star.png");
                }
            }
            /********************************/
        }
Example #3
0
 public InterfaceBonus()
 {
     InitializeComponent();
     Animations.AddSound(2);
     if (exercice.RecupererScore(13) >= 20)
     {
         btnMemoryGame.IsEnabled = true;
     }
     else
     {
         btnMemoryGame.IsEnabled = false;
     }
 }
Example #4
0
 /*Constructeur: sert à initialiser definir le commentaire a afficher
  * selon si le temps est ecoulé ou pas*/
 public EndExoTestFinal(int Choix, int Score)
 {
     Score = exercice.RecupererScore(13) + Score;
     exercice.sauvegarderScore(13, Score);
     App.mainWindow.Opacity = 0.5f;
     InitializeComponent();
     Animations.AddSound(2);//Ajout du son
     /*Le temps est ecoulé*/
     if (Choix == 1)
     {
         CommentParagraph.Inlines.Clear();
         CommentParagraph.Inlines.Add(new Run("  للاسف , انتهى الوقت"));
     }
     /*************************/
     /*Il reste encore du temps*/
     else if (Choix == 2)
     {   /*Affichage d'un petit commentaire qui oriente l'éléve quoi faire*/
         CommentParagraph.Inlines.Clear();
         CommentParagraph.Inlines.Add(new Run("احسنت ! , لقد اكملت التمرين."));
         CommentParagraph.Inlines.Add(new LineBreak());
         CommentParagraph.Inlines.Add(new Run("اضغط على الزر اسفله لاختيار التمرين التالي."));
     }
     /********************************/
 }