コード例 #1
0
ファイル: Program.cs プロジェクト: BilgeTad/Softwaredesign
        public void ChooseQuestionType(int score)
        {
            Console.WriteLine("Which type of question do you want to answer?");
            string type = Console.ReadLine();

            if (type == "QuizSingle")
            {
                quizSingle.Show();
                QuizSingle.AnswerQuizSingle(score);
            }

            if (type == "QuizMultiple")
            {
                //multipleElements.Show();
                QuizMultiple.AnswerQuizMultiple(score);
            }

            if (type == "QuizBinary")
            {
                binaryElements.Show();
                QuizBinary.AnswerQuizBinary(score);
            }

            if (type == "QuizGuess")
            {
                QuizGuess.AnswerQuizGuess(score);
            }

            if (type == "QuizFree")
            {
                freeElements.Show();
                QuizFree.AnswerQuizFree(score);
            }
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: BilgeTad/Softwaredesign
        public static void CreateNewQuiz()
        {
            Quizelement QuizSingle = new QuizSingle();

            QuizSingle.question = "Who was the first Chancellor of the Federal Republic of Germany?";
            QuizSingle.answers.Add(new Answer("1) Barack Obama", false));
            QuizSingle.answers.Add(new Answer("2) Helmut Kohl", false));
            QuizSingle.answers.Add(new Answer("3) Konrad Adenauer", true));
            QuizSingle.answers.Add(new Answer("4) Angela Merkel", false));
            question.Add(QuizSingle);

            quizelementsList.Add(new QuizMultiple("Which of the following countries aren't part of the European Union?", new Answer[] {
                new Answer("1) Croatia", false),
                new Answer("2) Serbia", true),
                new Answer("3) Germany", false),
                new Answer("4) Turkey", true)
            }));
            quizelementsList.Add(new QuizBinary("Istanbul is the Capital of Turkey?", false));
            quizelementsList.Add(new QuizFree("Zu welcher Gruppe der Elementarteilchen gehört das Elektron?", "Leptonen"));
        }