예제 #1
0
        private void AfficheQuestion(Question question)
        {
            string file;

            if (question.PieceJointe != null)
            {
                file             = "../../../DAL/images/" + question.PieceJointe;
                pictureBox.Image = Image.FromFile(file);
            }
            else
            {
                file             = "../../../DAL/images/ia.jpg";
                pictureBox.Image = Image.FromFile(file);
            }

            if (question != null) //par précaution on teste si la question est nulle mais normalement elle ne sera jamais nulle
            {
                btnValider.Text  = "Valider";
                txtQuestion.Text = question.Intitule;
                if (question.Type == Question.TypeQues.QCM)// pour les qcm
                {
                    if (question.Intitule == "Dijkstra")
                    {
                        btnValider.Enabled = false;
                        btnValider.Text    = "Suivant";
                        d = new Dijkstra(false);
                        d.Show();

                        compteur++;
                    }
                    else
                    {
                        if (question.Intitule == "A*")
                        {
                            btnValider.Enabled = false;
                            btnValider.Text    = "Suivant";
                            d = new Dijkstra(true);
                            d.Show();

                            compteur++;
                        }
                        else
                        {
                            CheckBox[] checkBoxes = new CheckBox[question.LesReponses.Count];
                            lesCheckBoxes = new CheckBox[question.LesReponses.Count];

                            for (int i = 0; i < question.LesReponses.Count; i++)
                            {
                                checkBoxes[i]          = new CheckBox();
                                checkBoxes[i].Location = new Point(69, 400 + i * 20);
                                checkBoxes[i].Font     = new Font("Calibri", 11, FontStyle.Regular, GraphicsUnit.Point, 0);
                                checkBoxes[i].Text     = alphabet[i] + ".  " + question.LesReponses[i].Intitule;
                                checkBoxes[i].AutoSize = true;
                                Controls.Add(checkBoxes[i]);
                                lesCheckBoxes[i] = checkBoxes[i];
                            }
                        }
                    }
                }

                if (question.Type == Question.TypeQues.saisieNum)// pour la saisie numérique
                {
                    NumBox.Show();
                    labelSaisie.Show();
                }
            }
        }
예제 #2
0
파일: Choix.cs 프로젝트: Kegee/projet-IA
        private void btnDijkstra_Click(object sender, EventArgs e)
        {
            Dijkstra exercice = new Dijkstra();

            exercice.Show();
        }