public ActionResult CreateAnswer(string questionGuid, AnswerViewModel answer) { var testAnswer = _mapper.Map <TestAnswer>(answer); _lowLevelTestManagementService.CreateAnswerForQuestion(questionGuid, testAnswer); return(RedirectToAction("TestManagement", "Admin")); }
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 })); }
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 })); }
public void CreateAnswer(string questionGuid, AnswerViewModel answer) { var testAnswer = _mapper.Map <TestAnswer>(answer); _lowLevelTestManagementService.CreateAnswerForQuestion(questionGuid, testAnswer); }