示例#1
0
        public ActionResult CreateQuestion(string testGuid, QuestionViewModel question)
        {
            var testQuestion = _mapper.Map <TestQuestion>(question);

            _lowLevelTestManagementService.CreateQuestionForTest(testGuid, testQuestion);
            return(RedirectToAction("TestManagement", "Admin"));
        }
示例#2
0
        public ActionResult CreateQuestion(string testGuid, QuestionViewModel question)
        {
            if (ModelState.IsValid)
            {
                if (testGuid != null && question != null)
                {
                    var testQuestion = _mapper.Map <TestQuestion>(question);
                    _lowLevelTestManagementService.CreateQuestionForTest(testGuid, testQuestion);

                    return(RedirectToAction("GetQuestionsByTestGuid", "Testing",
                                            new
                    {
                        TestGuid = testGuid
                    }));
                }
                return(HttpNotFound());
            }
            return(View(question));
        }
示例#3
0
        public ActionResult CreateQuestion(string testGuid, ModelAndInfo <QuestionViewModel> model)
        {
            if (ModelState.IsValid)
            {
                if (testGuid != null)
                {
                    var testQuestion = _mapper.Map <TestQuestion>(model.TransferModel);
                    _lowLevelTestManagementService.CreateQuestionForTest(testGuid, testQuestion);

                    return(RedirectToAction(actionName: "GetQuestionsByTestGuid",
                                            controllerName: "Test",
                                            routeValues: new
                    {
                        TestGuid = testGuid
                    }));
                }
                return(HttpNotFound());
            }
            return(View(model));
        }
示例#4
0
        public void CreateQuestion(string testGuid, QuestionViewModel question)
        {
            var testQuestion = _mapper.Map <TestQuestion>(question);

            _lowLevelTestManagementService.CreateQuestionForTest(testGuid, testQuestion);
        }