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); } }
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; } }
public static void AddNewMultipleQuiz(int score) { Console.WriteLine("Wie lautet die Frage?\n"); string userQuestion = Console.ReadLine(); Console.WriteLine("Wie lautet die Antworten?\n"); string userAnswers = Console.ReadLine(); Console.WriteLine("Welche Antworten sind die richtigen?\n"); string userCorrect = Console.ReadLine(); QuizMultiple multiple = new QuizMultiple(); multiple.question = userQuestion; multiple.answers = userAnswers.Split(","); multiple.correct = userCorrect.Split(','); QuizMultiple.ShowQuestionAndCheckIfMultipleIsCorrect(multiple.question, multiple.answers, multiple.correct, score); }