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 = "How long does the 30-year war last??"; multiple.answers = new string[] { "1. 10950", "2. 30", "3. 4643356", "4. 262800" }; 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 = "Is Gandalf a wizard?"; binary.answer = "Yes"; 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 = "What does Gandalf say to the Balrok on the bridge of Kazad-dum?\n"; free.answer = "You shall not pass"; 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 AddNewFreeQuiz(int score) { Console.WriteLine("Write your question?\n"); string userQuestion = Console.ReadLine(); Console.WriteLine("Write answer/s\n"); string userAnswer = Console.ReadLine(); QuizFree free = new QuizFree(); free.question = userQuestion; free.answer = userAnswer; QuizFree.ShowQuestionAndCheckIfFreeIsCorrect(free.question, free.answer, score); QuizFree.Serialize(userQuestion, userAnswer, score); }