Example #1
0
 public AnswerMultipleChoice(int id, QuestionMultipleChoice questionMultipleChoice, string answer, bool isAnswerCorrect)
 {
     Id = id;
     QuestionMultipleChoice = questionMultipleChoice;
     Answer          = answer;
     IsAnswerCorrect = isAnswerCorrect;
 }
        public override double CalculatePoints()
        {
            QuestionMultipleChoice q = (QuestionMultipleChoice)Question;
            double x = 0;

            foreach (AnswerMultipleChoice a in q.Answers)
            {
                if (Answer.Id == a.Id && a.IsAnswerCorrect)
                {
                    x = 1;
                }
            }
            return(x);
        }