示例#1
0
        public ActionResult AddQuestion(ViewQuizVM viewQuizModel)
        {
            //Take data from viewQuizVM and put it in the following VM
            AddQuestionVM addQuestionModel = new AddQuestionVM();

            return(View("AddQuestion", addQuestionModel));
        }
示例#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));
        }
示例#3
0
        public ActionResult CreateMultipleChoice(CreateMultipleChoiceVM multipleChoiceModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateMultipleChoice", multipleChoiceModel));
            }

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

            return(RedirectToAction("ViewQuiz", viewQuizModel));
        }
示例#4
0
        public ActionResult CreateTrueFalse(CreateTrueFalseVM trueFalseModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateTrueFalse", trueFalseModel));
            }

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

            return(RedirectToAction("ViewQuiz", viewQuizModel));
        }
示例#5
0
        public ActionResult CreateQuiz(CreateQuizVM quizModel)
        {
            if (!ModelState.IsValid)
            {
                return(View("CreateQuiz", quizModel));
            }

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

            return(RedirectToAction("Index", "Questions", viewQuizModel));
        }
示例#6
0
        // GET: Questions
        public ActionResult Index(ViewQuizVM viewQuizModel)
        {
            //show list of questions for a certain quiz

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