public void CheckButton(Button button)
        {
            int  buttonNo = button.TabIndex - 1;
            bool correct  = client.ValidateAnswer(q.Answers[buttonNo - 1]);

            if (correct)
            {
                button.BackColor = Color.Lime;
            }
            else
            {
                button.BackColor = Color.Red;
            }
        }
        public void CheckButton()
        {
            for (int i = 0; i < AnswerButtons.Count; i++)
            {
                bool correct = Client.ValidateAnswer(CurrentQuestion.Answers[i]);

                if (correct == true)
                {
                    AnswerButtons[i].BackColor = Color.Lime;
                }
                else
                {
                    AnswerButtons[i].BackColor = Color.Red;
                }
            }
        }
Example #3
0
        static void Main(string[] args)
        {
            ShowQuestion();
            int userAnswer = Convert.ToInt32(Console.ReadLine());

            //client.CheckPlayerAnswers()
            // work here


            bool val = client.ValidateAnswer(userAnswer);

            if (val == true)
            {
                Console.WriteLine("correct");
            }
            else
            {
                Console.WriteLine("incorrect");
            }

            Console.ReadLine();
        }