예제 #1
0
        public static void askAllQuestions(Quizelement quizelements)
        {
            int counter = 0;
            int frage   = 1;

            quizelements.Show();
            Console.Write("\nBitte eine Antwort wählen: ");

            int AnswerChoice = int.Parse(Console.ReadLine()) - 1;

            if (quizelements.answers[AnswerChoice].IsAnswerCorrect())
            {
                counter++;
                Console.Write("\nRichtig!\n");
            }

            else
            {
                Console.Write("\nFalsch\n");
            }
            currentQuizelement++;
            frage++;
            Console.WriteLine();
            Console.WriteLine(counter + "von" + (frage - 1) + " Fragen richtig beantwortet.");
        }
예제 #2
0
 public static void SolveAQuestion(Quizelement quizelement)
 {
     Console.Clear();
     quizelement.ShowQuestion();
     Console.Write("\nYour choice: ");
     if (quizelement.answers[Int32.Parse(Console.ReadLine()) - 1].isTrue())
     {
         score += 10;
         Console.Write("\nRight Answer! 10 Points to Gryffindor!");
     }
     else
     {
         Console.Write("\nWrong Answer. Sorry for that, bro!");
     }
     currentQuizelement++;
 }