Пример #1
0
        public override double CalculatePoints()
        {
            QuestionOpen q = (QuestionOpen)Question;

            if (q.Answers != null)
            {
                double t = 0;
                double x = 0;
                foreach (AnswerOpen a in q.Answers)
                {
                    if (Answer.ToLower().Contains(a.Keyword.ToLower()))
                    {
                        x++;
                    }
                    t++;
                }
                return(x / t);
            }
            else
            {
                return(0);
            }
        }
Пример #2
0
 public AnswerOpen(int id, QuestionOpen questionOpen, string keyword)
 {
     Id           = id;
     QuestionOpen = questionOpen;
     Keyword      = keyword;
 }