public static Result Verify(ClientAnswerMain client, Test original) { int RightQuestins = 0; int Wrong = 0; foreach (ClientQuestion cq in client.Questions.Values) { if (cq.Type == QuestionType.SingleChoice) { if(cq.Answers[0].Data == original.Questions[cq.ID].RightAnswers[0].Data) { RightQuestins++; } else { Wrong++; } } if (cq.Type == QuestionType.MultiChoice) { //------ } } Result res = new Result(RightQuestins, Wrong); return res; }
public static ClientAnswerMain Parse(XElement ans) { ClientAnswerMain res = new ClientAnswerMain(); res.Name = ans.Attribute("Name").Value; foreach (XElement question in ans.Element("Questions").Elements()) { ClientQuestion q = ClientQuestion.Parse(question); res.Questions.Add(q.ID, q); } return res; }