コード例 #1
0
ファイル: QuizWindow.cs プロジェクト: Kulawy/TestoTeacher
        private void button_ok_Click(object sender, EventArgs e)
        {
            checkTheAnswer(actualQuestion);
            checkToRemove(actualQuestion);
            if (questionProvider.questionsCount() > 0)
            {
                //int myRandomInt = rnd.Next(questionProvider.questionsCount() - 1);
                Question newQuestion = questionProvider.getQuestion(rnd.Next(questionProvider.questionsCount()));
                if ((questionProvider.questionsCount() > 0) && newQuestion.Equals(actualQuestion))
                {
                    newQuestion = questionProvider.getQuestion(rnd.Next(questionProvider.questionsCount()));
                }
                actualQuestion = newQuestion;
                checkedListBox_answers.Items.Clear();
                fillContent(actualQuestion);
            }
            else
            {
                MessageBox.Show("Gratulations you Pass");
                this.Close();
            }

            //actualQuestion = questionProvider.getQuestion(rnd.Next(questionProvider.questionsCount() - 1))
            //fillContent(actualQuestion);
        }
コード例 #2
0
ファイル: QuizWindow.cs プロジェクト: Kulawy/TestoTeacher
        // METODY POMOCNICZE

        private void initialization()
        {
            questionProvider       = QuestionProvider.GetInstance();
            beginingQuestionsCount = questionProvider.questionsCount();

            if (questionProvider.questionsCount() <= 0)
            {
                MessageBox.Show("Pleas load file with correct content");
            }
            else
            {
                quizLogicService = new QuizLogic();
                actualQuestion   = questionProvider.getQuestion(rnd.Next(questionProvider.questionsCount() - 1));
                fillContent(actualQuestion);
            }
        }
コード例 #3
0
ファイル: MainMenuWindow.cs プロジェクト: Kulawy/TestoTeacher
 private void button_resume_Click(object sender, EventArgs e)
 {
     if (questionProvider.questionsCount() > 0)
     {
         this.Hide();
         quizWindow.Show();
     }
     else
     {
         MessageBox.Show("What you want to resume?");
     }
 }