Пример #1
0
 public void SaveExamAnswer(StoreAnswer storeAnswer)
 {
     try
     {
         int correctAnswer = questionDal.GetQuestionAnswerByQuestionId(storeAnswer.QuestionId);
         if (storeAnswer.Answer == correctAnswer)
         {
             storeAnswer.AnswerScore = 1;
         }
         else
         {
             storeAnswer.AnswerScore = 0;
         }
         examDal.SaveExamAnswer(storeAnswer);
     }
     catch (SqlException sqlException)
     {
         log.Error(sqlException.StackTrace);
         throw new FaultException <DBException>(new DBException(), Constants.ServerError);
     }
 }
Пример #2
0
 public void SaveExamAnswer(int userId, int examId, int questionId, int answer)
 {
     examDal.SaveExamAnswer(userId, examId, questionId, answer);
 }