コード例 #1
0
        private void Bvalidate_Click(object sender, EventArgs e)
        {
            XmlReader doc = XmlReader.Create("../../listeQuestions.xml");

            bool valide = false;

            while (doc.Read())
            {
                if (doc.GetAttribute("id") == "" + index)
                {
                    if (Verifier(doc, Rep1))
                    {
                        if (Verifier(doc, Rep2))
                        {
                            if (Verifier(doc, Rep3))
                            {
                                if (Verifier(doc, Rep4))
                                {
                                    valide = true;
                                    points = CalculPoint();
                                }
                            }
                        }
                    }
                }
            }
            if (valide)
            {
                Suivant();
            }

            else
            {
                AlerteFaux.Show();
                Bvalidate.Hide();
                TextComment.Show();
                Lcomment.Show();
                TexteExplication.Show();
                Bcontinu.Show();
            }
        }
コード例 #2
0
        private void Affiche()
        {
            if (numeroQuestion == 0)
            {
                index = NumeroQuestion();
            }

            XmlReader doc = XmlReader.Create("../../listeQuestions.xml");

            numeroQuestion++;

            NumeroQuest.Text = "Question n°" + numeroQuestion;

            Bcontinu.Hide();
            Bvalidate.Show();
            PictureBox.SendToBack();

            while (doc.Read())
            {
                if (doc.GetAttribute("id") == "" + index)
                {
                    Intitule.Text = doc.GetAttribute("value");

                    doc.Read();
                    doc.Read();
                    Rep1.Text = doc.GetAttribute("value");

                    doc.Read();
                    doc.Read();
                    Rep2.Text = doc.GetAttribute("value");

                    doc.Read();
                    doc.Read();
                    Rep3.Text = doc.GetAttribute("value");

                    doc.Read();
                    doc.Read();
                    Rep4.Text = doc.GetAttribute("value");

                    doc.Read();
                    doc.Read();
                    TexteExplication.Text = doc.GetAttribute("value");
                }
            }

            if (index == 6)
            {
                PictureBox.Image = Images.Rotation;
                PictureBox.Show();
            }

            if (index == 14)
            {
                PictureBox.Image = Images.Tableau;
                PictureBox.Show();
            }

            if (index == 15 || index == 16)
            {
                PictureBox.Image = Images.Texte;
                PictureBox.Show();
            }

            if (index == 17)
            {
                PictureBox.Image = Images.TexteAllumette;
                PictureBox.Show();
                montrerImage = new ShowImgSupplementaire();
                montrerImage.Show();
                montrerImage.pictureBox.Image = Images.arbre;
            }

            if (index == 18)
            {
                PictureBox.Image = Images.ArbreDecision;
                PictureBox.Show();
            }

            if (index == 19)
            {
                PictureBox.Image = Images.ReseauBayesien;
                PictureBox.Show();
            }

            if (index == 20)
            {
                PictureBox.Image = Images.MatriceAdj;
                PictureBox.Show();
                montrerImage = new ShowImgSupplementaire();
                montrerImage.Show();
                montrerImage.pictureBox.Image = Images.Graphe;
            }

            if (index == 23)
            {
                PictureBox.Image = Images.Negamax;
                PictureBox.Show();
            }
        }