Пример #1
0
 public QuizViewModel()
 {
     MathQuestions = QuestionDetailsData.GetMathsQuestions();
     GKQuestions   = QuestionDetailsData.GetGeneralKnowledgeQuestions();
     _questionNum  = 0;
     MathQuestions.ForEach(m => m.Answer = "");
     GKQuestions.ForEach(g => g.Answer   = "");
 }
Пример #2
0
        public static List <QuizModel> GetGkResult(List <QuizModel> quizzes)
        {
            List <QuizModel> inCorrectAns = new List <QuizModel>();
            var ansData = QuestionDetailsData.GetGeneralKnowledgeQuestions();

            foreach (var q in quizzes)
            {
                if (!ansData.Any(m => m.Answer.ToLower().Trim() == q.Answer.ToLower().Trim() &&
                                 m.Question.ToLower().Trim() == q.Question.ToLower().Trim()))
                {
                    inCorrectAns.Add(q);
                }
            }
            return(inCorrectAns);
        }