Example #1
0
        public bool CheckAnswer(string answer)
        {
            return(answer.ToLower().Contains(CorrectAnswer.ToLower()) && (!(answer.ToLower().Contains("true") && answer.ToLower().Contains("false"))));

            /*above line is to remove case sensitivity in answers and make it so answers that contain the answer (like a duck instead of duck) still work while
             * While still disallowing the use of both true and false in the same answer to buypass the true false questions*/
        }
Example #2
0
 internal virtual void Grade()
 {
     if (UserInput.ToLower() == CorrectAnswer.ToLower())
     {
         IsCorrect = true;
     }
     else
     {
         IsCorrect = false;
     }
 }