public ActionResult CreateAnswer(string questionGuid, AnswerViewModel answer)
        {
            var testAnswer = _mapper.Map <TestAnswer>(answer);

            _lowLevelTestManagementService.CreateAnswerForQuestion(questionGuid, testAnswer);
            return(RedirectToAction("TestManagement", "Admin"));
        }
Exemple #2
0
        public ActionResult CreateAnswer(string questionGuid, AnswerViewModel answer)
        {
            if (!ModelState.IsValid)
            {
                return(View(answer));
            }
            var testAnswer = _mapper.Map <TestAnswer>(answer);

            _lowLevelTestManagementService.CreateAnswerForQuestion(answer.Guid, testAnswer);

            return(RedirectToAction("GetQuestionsByTestGuid", "Testing", new { testGuid = questionGuid }));
        }
Exemple #3
0
        public ActionResult CreateAnswer(string questionGuid, ModelAndInfo <AnswerViewModel> model)
        {
            if (!ModelState.IsValid)
            {
                return(View(model));
            }
            if (questionGuid == null)
            {
                return(HttpNotFound());
            }

            var testAnswer = _mapper.Map <TestAnswer>(model.TransferModel);

            _lowLevelTestManagementService.CreateAnswerForQuestion(questionGuid, testAnswer);

            return(RedirectToAction(actionName: "GetAnswersByQuestionGuid",
                                    controllerName: "Test",
                                    routeValues: new
            {
                QuestionGuid = questionGuid
            }));
        }
Exemple #4
0
        public void CreateAnswer(string questionGuid, AnswerViewModel answer)
        {
            var testAnswer = _mapper.Map <TestAnswer>(answer);

            _lowLevelTestManagementService.CreateAnswerForQuestion(questionGuid, testAnswer);
        }