コード例 #1
0
 public ActionResult QuestionLimit()
 {
     TempData["Prof"]         = "";
     ViewBag.Departments      = ExamDALC.GetProfs();
     ViewBag.ParentCategories = ExamDALC.GetCategories().Where(r => r.Item3 == 0).ToList();
     return(View());
 }
コード例 #2
0
        public ActionResult GetResult(int TicketId)
        {
            var result = ExamDALC.GetResult(TicketId);


            return(Json(new
            {
                result
            }, JsonRequestBehavior.AllowGet));
        }
コード例 #3
0
        public ActionResult Insert()
        {
            var referer    = Request.ServerVariables["http_referer"];
            var categoreis = ExamDALC.GetCategories();

            ViewBag.parentCategories = categoreis.Where(row => row.Item3 == 0).OrderBy(row => row.Item1).ToList();
            ViewBag.subCategories    = categoreis.Where(row => row.Item3 == 1).ToList();
            ViewBag.questions        = ExamDALC.GetQuestions();
            return(View());
        }
コード例 #4
0
        public ActionResult _ApproveQuestions(int[] ids)
        {
            bool result = ExamDALC.ApproveQuestion(ids);

            if (result)
            {
                ViewBag.questions = ExamDALC.GetQuestions();
                return(PartialView("_QuestionTable"));
            }
            else
            {
                return(null);
            }
        }
コード例 #5
0
        public JsonResult GetProfs(string parent)
        {
            int id = 0;
            List <Tuple <int, string, int, string> > profs;

            try
            {
                id    = int.Parse(parent);
                profs = ExamDALC.GetProfs(id);
            }
            catch
            {
                profs = new List <Tuple <int, string, int, string> >();
            }
            return(Json(new { profs = profs, JsonRequestBehavior.AllowGet }));
        }
コード例 #6
0
        public ActionResult Finish(Answer[] answers, int TicketId, string Time)
        {
            var  time   = Time.Split(':');
            int  minute = int.Parse(time[0]);
            bool status = TicketDALC.Finish(answers, minute, TicketId);

            if (status)
            {
                var result = ExamDALC.GetResult(TicketId);

                return(Json(new
                {
                    result
                }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                return(Json(status, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #7
0
        public ActionResult Insert(ExamViewModel model)
        {
            var categoreis = ExamDALC.GetCategories();

            if (!ModelState.IsValid)
            {
                ViewBag.parentCategories = categoreis.Where(row => row.Item3 == 0).ToList();
                ViewBag.subCategories    = categoreis.Where(row => row.Item3 == 1).ToList();
                ViewBag.questions        = ExamDALC.GetQuestions();
                return(View());
            }
            bool   result  = false;
            string message = "";

            result  = ExamDALC.InsertQuestion(MaptoExamDomainModel(model));
            message = result ? model.ID > 0 ? "#successE" : "#successI" : "#error";
            //var categoreis = ExamDALC.GetCategories();
            ViewBag.parentCategories = categoreis.Where(row => row.Item3 == 0).ToList();
            ViewBag.subCategories    = categoreis.Where(row => row.Item3 == 1).ToList();
            ViewBag.questions        = ExamDALC.GetQuestions();
            return(new RedirectResult(Url.Action("Insert", "Exam") + message));
        }
コード例 #8
0
 public void SetVariant(string ticketDetailId, string variant) => ExamDALC.SetVariant(ticketDetailId, variant);
コード例 #9
0
        public JsonResult GetSubCategories(int id)
        {
            var subCategories = ExamDALC.GetCategories().Where(row => row.Item3 == id).ToList();

            return(Json(new { data = subCategories }, JsonRequestBehavior.AllowGet));
        }
コード例 #10
0
 public JsonResult GetCounts(int profId, int subId) => Json(ExamDALC.GetCounts(profId, subId), JsonRequestBehavior.AllowGet);
コード例 #11
0
 public JsonResult GetFeedback(int id) => Json(ExamDALC.GetFeedback(id), JsonRequestBehavior.AllowGet);
コード例 #12
0
 public JsonResult DeleteDepart(int id) => Json(ExamDALC.DeleteDepart(id), JsonRequestBehavior.AllowGet);
コード例 #13
0
 public JsonResult UpdateCategory(int id, string text) => Json(ExamDALC.UpdateCategory(id, text), JsonRequestBehavior.AllowGet);
コード例 #14
0
        public ActionResult GetQuestion(int id)
        {
            var question = ExamDALC.GetQuestion(id).Select(row => MapToQuestionViewModel(row)).ToList();

            return(Json(new { question = question }, JsonRequestBehavior.AllowGet));
        }
コード例 #15
0
 public JsonResult AddQuesLimit(int count, int limit, string subId, string parentId, array[] array)
 => Json(ExamDALC.AddQuesLimit(count, limit, subId, parentId, array), JsonRequestBehavior.AllowGet);
コード例 #16
0
 public JsonResult DeleteCategory(int id) => Json(ExamDALC.DeleteCategory(id), JsonRequestBehavior.AllowGet);
コード例 #17
0
 public JsonResult Feedback(string text, int id) => Json(ExamDALC.Feedback(text, id), JsonRequestBehavior.AllowGet);