internal Quiz() { Name = GameHelpers.GetAnswer("Enter name for this Quiz: "); Questions = new List <Question>(); UserChoices = new List <Answer>(); Correct = 0.00; }
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(); }
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())))); } }
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(); }
protected string MakeQuestionName() { Console.Clear(); return(GameHelpers.GetAnswer("Please enter the question: ")); }
private Question DetermineQuestionType() { return(MakeQuestionType(GameHelpers.GetAnswer("What kind of question do you want this question to be:", QuestionTypesStringVersion))); }