public void UpdateAnswers(AnswerKeyOpticalFormSection section) { foreach (var answer in section.Answers) { Answers .FirstOrDefault(a => a.QuestionNo == answer.QuestionNo) ?.SetCorrectAnswer(answer); } }
public StudentOpticalFormSection(AnswerKeyOpticalFormSection section) : this() { MaxQuestionCount = section.MaxQuestionCount; ListOrder = section.ListOrder; FormPart = section.FormPart; LessonName = section.LessonName; LessonId = section.LessonId; }
public AnswerKeyOpticalFormSection(AnswerKeyOpticalFormSection answerKeyOpticalFormSection) : this() { LessonName = answerKeyOpticalFormSection.LessonName; LessonId = answerKeyOpticalFormSection.LessonId; ListOrder = answerKeyOpticalFormSection.ListOrder; MaxQuestionCount = answerKeyOpticalFormSection.MaxQuestionCount; FormPart = answerKeyOpticalFormSection.FormPart; }
public void AddEmptySection(AnswerKeyOpticalFormSection answerKeyOpticalFormSection) { var section = new StudentOpticalFormSection(answerKeyOpticalFormSection) { Answers = answerKeyOpticalFormSection.Answers .Select(a => new QuestionAnswer(a.QuestionNo, QuestionAnswer.Empty)) .ToList(), }; Sections.Add(section); }