public ActionResult AddQuestion(ViewQuizVM viewQuizModel) { //Take data from viewQuizVM and put it in the following VM AddQuestionVM addQuestionModel = new AddQuestionVM(); return(View("AddQuestion", addQuestionModel)); }
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)); }
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)); }
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)); }
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)); }
// GET: Questions public ActionResult Index(ViewQuizVM viewQuizModel) { //show list of questions for a certain quiz return(View("Index", viewQuizModel)); }