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); } }
public void SaveExamAnswer(int userId, int examId, int questionId, int answer) { examDal.SaveExamAnswer(userId, examId, questionId, answer); }