Ejemplo n.º 1
0
        private void Wf_bt_start_Click(object sender, RoutedEventArgs e)
        {
            m_exam       = null;
            m_view.Phase = State.Answering;


            switch (m_view.CurrentQuestion.TestType)
            {
            case TypeTest.INTRUS:
                m_exam = new UC_ExamIntrus(m_view.CurrentQuestion.QuestionsIntrus);
                break;

            case TypeTest.ORDERBY:
                m_exam = new UC_ExamOrderBy(m_view.CurrentQuestion.QuestionsOrderedBy);
                break;

            case TypeTest.ORDERED:
                m_exam = new UC_ExamOrdered(m_view.CurrentQuestion.QuestionsOrdered);
                break;

            case TypeTest.QCM:
                m_exam = new UC_ExamQCM(m_view.CurrentQuestion.QuestionsQCM);
                break;

            case TypeTest.TRUE_FALSE:
                m_exam = new UC_ExamTrueFalse(m_view.CurrentQuestion.QuestionsTrueFalse);
                break;
            }

            if (m_exam != null)
            {
                WF_cc_questions.Content = m_exam;

                m_exam.Enabled(true);

                Wf_cd_CountDown.Start(m_view.CurrentQuestion.TimeLimite);

                Wf_bt_Next.IsEnabled  = true;
                Wf_bt_start.IsEnabled = false;
            }
            else
            {
                WF_cc_questions.Content = m_waiting;
            }
        }
Ejemplo n.º 2
0
        private void Wf_bt_Next_Click(object sender, RoutedEventArgs e)
        {
            if (m_view.Phase == State.Answering)
            {
                m_view.Phase = State.QuestionResult;
                Wf_cd_CountDown.Release();

                if (m_exam != null)
                {
                    if (m_exam.Validate())
                    {
                        m_view.CurrentQuestion.State = QuestionStat.GOOD;
                        WF_cc_questions.Content      = m_good;
                    }
                    else
                    {
                        m_view.CurrentQuestion.State = QuestionStat.FALSE;
                        WF_cc_questions.Content      = m_wrong;
                    }
                }
            }

            else if (m_view.Phase == State.QuestionResult)
            {
                if (m_view.IsLastQuestion)
                {
                    m_view.Phase = State.TestResult;
                    MessageBox.Show("Affichage des résultats !!");
                }
                else
                {
                    m_view.Phase            = State.Waiting;
                    WF_cc_questions.Content = m_waiting;
                    m_view.NextQuestion();

                    Wf_bt_Next.IsEnabled  = false;
                    Wf_bt_start.IsEnabled = true;
                }
            }
        }