public AnswerKeyOpticalForm(AnswerKeyOpticalForm form, char booklet) : base(form, booklet) { IncorrectEliminationRate = form.IncorrectEliminationRate; Sections = new List <AnswerKeyOpticalFormSection>(); ScoreFormulas = form.ScoreFormulas; }
public void UpdateCorrectAnswers(AnswerKeyOpticalForm answerKeyOpticalForm) { foreach (var answerKeyOpticalFormSection in answerKeyOpticalForm.Sections) { Sections .FirstOrDefault(s => s.LessonName == answerKeyOpticalFormSection.LessonName) ?.UpdateAnswers(answerKeyOpticalFormSection); } }
public void SetFromScanOutput(ScanOutput scanOutput, AnswerKeyOpticalForm answerKeyOpticalForm) { ScanOutput = scanOutput; foreach (var answerKeyOpticalFormSection in answerKeyOpticalForm .Sections .Where(s => s.FormPart == scanOutput.FormPart)) { var studentOpticalFormSection = new StudentOpticalFormSection(answerKeyOpticalFormSection); for (var i = 0; i < answerKeyOpticalFormSection.Answers.Count; i++) { var correctAnswer = answerKeyOpticalFormSection.Answers.ElementAt(i); var questionAnswer = new QuestionAnswer(i + 1, scanOutput.Next()); questionAnswer.SetCorrectAnswer(correctAnswer); studentOpticalFormSection.Answers.Add(questionAnswer); } scanOutput.Skip(answerKeyOpticalFormSection.MaxQuestionCount - answerKeyOpticalFormSection.Answers.Count); Sections.Add(studentOpticalFormSection); } }