Пример #1
0
        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());
            }
        }
Пример #3
0
 public async Task <ResponseOutput> AddTest([FromBody] TestInputModel test)
 {
     return(await _service.AddTest(test));
 }