コード例 #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));
        }
コード例 #2
0
        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));
 }