Example #1
0
        // Affichage de la réponse selon si elle est juste ou non
        private void AfficherReponse(string reponseJoueur)
        {
            Objet_PictureBox.Hide();
            Zone_PictureBox.Hide();
            Bouton1_Button.Hide();
            Bouton2_Button.Hide();
            Bouton3_Button.Hide();

            List <string> erreurJoueur = this.test.VerifierReponse(reponseJoueur, this.compteurSerie * 5 + this.compteurQuestion);

            // Cas où le joueur n’a pas commis d’erreur
            if (erreurJoueur.Count == 0)
            {
                TestResultat_Form resultat = new TestResultat_Form("OK ! Vous avez choisi le bon bouton !");

                if (resultat.ShowDialog() == DialogResult.OK)
                {
                    resultat.Close();
                    this.PasserQuestionSuivante();
                }
            }

            // Cas où le joueur a fait une erreur
            else
            {
                TestResultat_Form resultat = new TestResultat_Form(this.test.AfficherErreur(erreurJoueur));

                if (resultat.ShowDialog() == DialogResult.OK)
                {
                    resultat.Close();
                    this.PasserQuestionSuivante();
                }
            }
        }
Example #2
0
        // Affichage de l’image et des boutons
        private void AfficherQuestion()
        {
            Progression_Label.Text = "Série : " + (this.compteurSerie + 1) + "    –    Question : " + (this.compteurQuestion + 1);

            Objet_PictureBox.ImageLocation = "..\\..\\..\\EMACApp\\AppImages\\Test_2\\" + this.test.imagesSeries[this.compteurSerie][this.compteurQuestion];
            Objet_PictureBox.Show();
            Zone_PictureBox.Show();
            Bouton3_Button.Show();

            if (compteurQuestion != 0)
            {
                Bouton2_Button.Show();
                Bouton1_Button.Show();
            }

            // Démarrage et affichage du chronomètre en mode difficile
            if (this.test.difficulte)
            {
                this.decompte       = this.test.intervalle;
                Decompte_Label.Text = this.decompte.ToString();
                Chrono_Panel.Show();
                Decompte_Label.Show();
                Decompte_Timer.Start();
                AfficherQuestion_Timer.Start();
            }
        }
Example #3
0
        // Affichage du résultat (proportion de bonnes réponses du joueur)
        private void AfficherResultat()
        {
            // Masquage de la dernière question
            Zone_PictureBox.Hide();
            Egal_Label.Hide();
            Progression_Label.Hide();
            Operation_Label.Hide();
            Reponse_TextBox.Hide();
            Valider_Button.Hide();

            Resultat_Label.Text = "Vous avez un taux de réussite de " + this.test.CalculerResultat() + " % !";
            Resultat_Label.Show();
            Terminer_Button.Show();
        }
Example #4
0
        // Masquage de l’interface permettant à l’utilisateur de choisir l’opération sur laquelle il veut se tester
        // Affichage de l’interface permettant à l’utilisateur de répondre à la première question
        private void ChangerInterface()
        {
            Choix_Label.Hide();
            Addition_Button.Hide();
            Soustraction_Button.Hide();
            Multiplication_Button.Hide();
            Division_Button.Hide();

            Zone_PictureBox.Show();
            Egal_Label.Show();
            Progression_Label.Show();
            Operation_Label.Show();
            Reponse_TextBox.Show();
            Valider_Button.Show();
        }