public static string getWinner() { // Check that all the questions have been answered if (AllQuestionsAnswered()) { Turtles turtle = nameResult(); ClearResponses(); return(turtle.ToString()); } else { return(""); } }
public void ScoreQuiz() { // No more questions left. Score the quiz. int Result_Turtle_Points = 0; string Result_Turtle = ""; foreach (Turtles turtle in Turtles.All) { if (turtle.Points > Result_Turtle_Points) { Result_Turtle = turtle.Name; Result_Turtle_Points = turtle.Points; } } Turtles.ResetPoints(); QuizQuestion.ResetQuestions(); string Image_Name = Result_Turtle.ToLower() + ".png"; Banner.Source = Image_Name; Banner.IsVisible = true; TurtleName.Text = "You're " + Result_Turtle + "!"; }