public AnswerResults IsAnswerCorrect(int answerId) { var searchedAnswer = _quizStorage.GetAnswerById(answerId); AnswerResults returnResult = new AnswerResults(); returnResult.IsCorrect = searchedAnswer.IsCorrect; return(returnResult); }
public AnswerResults CorrectAnswer(int questionId, int answerId) { var question = _quizRepo.GetQuestionById(questionId); AnswerResults results = new AnswerResults(); var selectedAnswer = question.Answers.First(a => a.AnswerId == answerId); if (selectedAnswer != null) { results.IsCorrect = selectedAnswer.IsCorrect; } return(results); }