Exemple #1
0
        public ActionResult CreateShortAnswer(AddQuestionVM addQuestionModel)
        {
            //take data out of parameter passed in from AddQuestion view and assign to the following VM
            CreateShortAnswerVM shortAnswerModel = new CreateShortAnswerVM();

            return(View("CreateShortAnswer", shortAnswerModel));
        }
Exemple #2
0
        public ActionResult CreateShortAnswer(CreateShortAnswerVM shortAnswerModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateShortAnswer", shortAnswerModel));
            }

            //Add values from shortAnswerModel to viewQuizModel
            ViewQuizVM viewQuizModel = new ViewQuizVM();

            return(RedirectToAction("Index", viewQuizModel));
        }