Exemplo n.º 1
0
 public ActionResult CreateTest(CreateTestViewModel newTest)
 {
     if (ModelState.IsValid)
     {
         testServices.CreateNewTest(newTest);
     }
     return(View());
 }
Exemplo n.º 2
0
        public ActionResult SaveTest(CreateTestViewModel newTest)
        {
            newTest.UserId = Convert.ToInt32(Session["CurrentUserID"]);
            int testId = 0;

            if (ModelState.IsValid)
            {
                testId = testServices.CreateNewTest(newTest);
            }
            TempData["TestId"] = testId;
            return(RedirectToAction("CreateQuestions", "Question"));
        }