示例#1
0
        public void ChooseQuestionType(int score)
        {
            Console.WriteLine("Welchen Fragetyp willst du beantworten?");
            string type = Console.ReadLine();

            if (type == "QuizSingle")
            {
                QuizSingle single = new QuizSingle();
                single.AnswerQuizSingle(score);
            }
            if (type == "QuizMultiple")
            {
                QuizMultiple multiple = new QuizMultiple();
                multiple.AnswerQuizMultiple(score);
            }
            if (type == "QuizBinary")
            {
                QuizBinary binary = new QuizBinary();
                binary.AnswerQuizBinary(score);
            }
            if (type == "QuizGuess")
            {
                QuizGuess guess = new QuizGuess();
                guess.AnswerQuizGuess(score);
            }
            if (type == "QuizFree")
            {
                QuizFree free = new QuizFree();
                free.AnswerQuizFree(score);
            }
        }
示例#2
0
        public static void AddNewGuessQuiz(int score)
        {
            Console.WriteLine("Wie lautet die Frage?\n");
            string userQuestion = Console.ReadLine();

            Console.WriteLine("Wie lautet die Antwort?\n");
            int       userAnswer = int.Parse(Console.ReadLine());
            QuizGuess guess      = new QuizGuess();

            guess.question = userQuestion;
            guess.answer   = userAnswer;
            QuizGuess.ShowQuestionAndCheckIfGuessIsCorrect(guess.question, guess.answer, score);
        }
示例#3
0
        public static void PlayTheGame(int score)
        {
            Console.Clear();
            Console.WriteLine("Was für eine Frage möchtest Du beantworten? \n\n1. Normales Quiz \n2. Multiple Choice \n3. Ja/Nein Frage \n4. Zahlen raten \n5. Freitextantworten");
            int questionType = Convert.ToInt32(Console.ReadLine());

            switch (questionType)
            {
            case 1:
                QuizSingle single = new QuizSingle();
                single.question = "Wer war der erste Bundeskanzler der BRD?";
                single.answers  = new string[] { "1. Barrack Obama", "2. Helmut Kohl", "3. Konrad Adenauer", "4. Angela Merkel" };
                single.correct  = 3;
                QuizSingle.ShowQuestionAndCheckIfSingleIsCorrect(single.question, single.answers, single.correct, score);
                break;

            case 2:
                QuizMultiple multiple = new QuizMultiple();
                multiple.question = "Was ist alles ein Säugetier?";
                multiple.answers  = new string[] { "1. Wal", "2. Delphin", "3. Spinne", "4. Kuh" };
                multiple.correct  = new string[] { "1", "2", "4" };
                QuizMultiple.ShowQuestionAndCheckIfMultipleIsCorrect(multiple.question, multiple.answers, multiple.correct, score);
                break;

            case 3:
                QuizBinary binary = new QuizBinary();
                binary.question = "Ist Berlin die Hauptstadt von Deutschland?";
                binary.answer   = "Ja";
                QuizBinary.ShowQuestionAndCheckIfBinaryIsCorrect(binary.question, binary.answer, score);
                break;

            case 4:
                QuizGuess guess = new QuizGuess();
                guess.question = "Wie viele Tage hat ein Jahr?\n";
                guess.answer   = 365;
                QuizGuess.ShowQuestionAndCheckIfGuessIsCorrect(guess.question, guess.answer, score);
                break;

            case 5:
                QuizFree free = new QuizFree();
                free.question = "Welcher Torwart wird auch Titan genannt?\n";
                free.answer   = "Oliver Kahn";
                QuizFree.ShowQuestionAndCheckIfFreeIsCorrect(free.question, free.answer, score);
                break;

            default:
                Console.WriteLine("Sorry! There are no questions left. Your score is: " + score);
                break;
            }
        }