Пример #1
0
        public void SetCorrectAnswer(AnswerKeyQuestionAnswer answerKeyQuestionAnswer)
        {
            if (answerKeyQuestionAnswer == null)
            {
                return;
            }

            AssignProperties(answerKeyQuestionAnswer);

            if (ProcessCancelAction(answerKeyQuestionAnswer))
            {
                return;
            }

            SetResult();
        }
Пример #2
0
        private bool ProcessCancelAction(AnswerKeyQuestionAnswer answerKeyQuestionAnswer)
        {
            switch (answerKeyQuestionAnswer.QuestionAnswerCancelAction)
            {
            case QuestionAnswerCancelAction.CorrectForAll:
                Result = QuestionAnswerResult.Correct;
                return(true);

            case QuestionAnswerCancelAction.EmptyForAll:
                Result = QuestionAnswerResult.Empty;
                return(true);

            default:
                return(false);
            }
        }
Пример #3
0
 private void AssignProperties(AnswerKeyQuestionAnswer answerKeyQuestionAnswer)
 {
     SubjectId     = answerKeyQuestionAnswer.SubjectId;
     SubjectName   = answerKeyQuestionAnswer.SubjectName;
     CorrectAnswer = answerKeyQuestionAnswer.Answer;
 }