示例#1
0
 internal Quiz()
 {
     Name        = GameHelpers.GetAnswer("Enter name for this Quiz: ");
     Questions   = new List <Question>();
     UserChoices = new List <Answer>();
     Correct     = 0.00;
 }
示例#2
0
        private static void PlayAgain(Game game)
        {
            string choice       = GameHelpers.GetAnswer("Do you want to play again ?", game);
            Option pickedOption = game.Options.Find(option => option.ID.Equals(int.Parse(choice)));

            game.IsRunning = pickedOption.Name.Equals("Yes");
            Console.Clear();
        }
示例#3
0
 private void StartQuiz()
 {
     foreach (Question question in Questions)
     {
         string choice = GameHelpers.GetAnswer("Question: ", question);
         UserChoices.Add(question.Answers.Find(answer => answer.ID.Equals(int.Parse(choice))));
         //UNDER CONSTRUCTION
         //IList<char> choices = ChooseAnswer(question;
         //var query = choices.SelectMany(
         //    choice => question.Answers.Where(
         //        answer => answer.ID.Equals(int.Parse(choice.ToString()))));
     }
 }
示例#4
0
        protected virtual void SetCorrectAnswer()
        {
            int    answer        = int.Parse(GameHelpers.GetAnswer(string.Format("Question: {0}\n\nChoose which of the following answers are correct: ", Name), Answers));
            Answer correctAnswer = (Answers.Find(individualAnswer => individualAnswer.ID.Equals(answer)));

            correctAnswer.IsCorrectAnswer = true;
            ////Testing for correct answer being chosen
            //foreach (Answer singleAnswer in Answers)
            //{
            //    Console.WriteLine("Correct? => {0}", singleAnswer.IsCorrectAnswer);
            //}
            //Console.Write("To continue, press ENTER");
            //Console.Read();
        }
示例#5
0
 protected string MakeQuestionName()
 {
     Console.Clear();
     return(GameHelpers.GetAnswer("Please enter the question: "));
 }
示例#6
0
 private Question DetermineQuestionType()
 {
     return(MakeQuestionType(GameHelpers.GetAnswer("What kind of question do you want this question to be:", QuestionTypesStringVersion)));
 }