public ActionResult DisplayQuiz(int id) { var model = quizService.GetQuizById(id); var testId = testService.AddTest(int.Parse(Session["UserId"].ToString()), id); Session["TestId"] = testId; return(View("~/Views/Quiz/Quiz.cshtml", model)); }
public ActionResult Create(Test test) { try { // TODO: Add insert logic here _testService.AddTest(test); return(RedirectToAction("Index")); } catch (Exception ex) { return(View()); } }
public async Task <ResponseOutput> AddTest([FromBody] TestInputModel test) { return(await _service.AddTest(test)); }