// Cacher le chronomètre private void CacherChrono() { AfficherQuestion_Timer.Stop(); Decompte_Timer.Stop(); Chrono_Panel.Hide(); Decompte_Label.Hide(); }
// 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(); } }
// Affichage de la réponse dans le cas où on n’a pas répondu à temps public void AfficherQuestion_Timer_Tick(object sender, EventArgs e) { Decompte_Timer.Stop(); Chrono_Panel.Hide(); Decompte_Label.Hide(); AfficherQuestion_Timer.Stop(); this.AfficherReponse("0"); }
// Fermeture du formulaire private void TestAttention_Form_FormClosing(object sender, FormClosingEventArgs e) { if (this.test.difficulte) { AfficherQuestion_Timer.Stop(); Decompte_Timer.Stop(); } this.DialogResult = DialogResult.OK; }
// Appel de la fonction affichant la réponse private void Valider_Button_Click(object sender, EventArgs e) { // Masquage et arrêt du chronomètre if (this.test.difficulte) { Decompte_Timer.Stop(); Chrono_Panel.Hide(); Decompte_Label.Hide(); AfficherQuestion_Timer.Stop(); } this.AfficherReponse(Reponse_TextBox.Text); }
// Affichage de la question private void AfficherQuestion() { Progression_Label.Text = "Question " + (this.compteurQuestion + 1) + " sur " + this.test.questions.Count; Operation_Label.Text = this.test.questions[this.compteurQuestion]; Reponse_TextBox.Clear(); // 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(); } }