Example #1
0
 /// <summary>
 /// Initialize a question with an image.
 /// </summary>
 /// <param name="imageUri">The Universal Resource Identifier for the image.</param>
 /// <param name="text">The string that represents the question.</param>
 /// <param name="correctAnswer">The correct answer to the question.</param>
 public Question(string imageUri, string text, Answer correctAnswer)
 {
     ImageURI      = imageUri;
     Text          = text;
     CorrectAnswer = correctAnswer;
 }
Example #2
0
 /// <summary>
 /// Initialize an empty question.
 /// </summary>
 public Question()
 {
     ImageURI      = string.Empty;
     Text          = string.Empty;
     CorrectAnswer = string.Empty;
 }
Example #3
0
 /// <summary>
 /// Initialize a question with a preset correct answer.
 /// </summary>
 /// <param name="text">The string that represents the question.</param>
 /// <param name="correctAnswer">The correct answer to the question.</param>
 public Question(string text, Answer correctAnswer)
 {
     ImageURI      = string.Empty;
     Text          = text;
     CorrectAnswer = correctAnswer;
 }
Example #4
0
 /// <summary>
 /// Determines whether the answer submitted by the user
 /// is the correct answer to the question.
 /// </summary>
 /// <param name="userAnswer">The answer submitted by the user.</param>
 /// <returns>Whether or not the user was correct.</returns>
 public bool IsUserGuessCorrect(Answer userAnswer) => userAnswer == CorrectAnswer;