public ActionResult QuestionLimit() { TempData["Prof"] = ""; ViewBag.Departments = ExamDALC.GetProfs(); ViewBag.ParentCategories = ExamDALC.GetCategories().Where(r => r.Item3 == 0).ToList(); return(View()); }
public ActionResult GetResult(int TicketId) { var result = ExamDALC.GetResult(TicketId); return(Json(new { result }, JsonRequestBehavior.AllowGet)); }
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()); }
public ActionResult _ApproveQuestions(int[] ids) { bool result = ExamDALC.ApproveQuestion(ids); if (result) { ViewBag.questions = ExamDALC.GetQuestions(); return(PartialView("_QuestionTable")); } else { return(null); } }
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 })); }
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)); } }
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)); }
public void SetVariant(string ticketDetailId, string variant) => ExamDALC.SetVariant(ticketDetailId, variant);
public JsonResult GetSubCategories(int id) { var subCategories = ExamDALC.GetCategories().Where(row => row.Item3 == id).ToList(); return(Json(new { data = subCategories }, JsonRequestBehavior.AllowGet)); }
public JsonResult GetCounts(int profId, int subId) => Json(ExamDALC.GetCounts(profId, subId), JsonRequestBehavior.AllowGet);
public JsonResult GetFeedback(int id) => Json(ExamDALC.GetFeedback(id), JsonRequestBehavior.AllowGet);
public JsonResult DeleteDepart(int id) => Json(ExamDALC.DeleteDepart(id), JsonRequestBehavior.AllowGet);
public JsonResult UpdateCategory(int id, string text) => Json(ExamDALC.UpdateCategory(id, text), JsonRequestBehavior.AllowGet);
public ActionResult GetQuestion(int id) { var question = ExamDALC.GetQuestion(id).Select(row => MapToQuestionViewModel(row)).ToList(); return(Json(new { question = question }, JsonRequestBehavior.AllowGet)); }
public JsonResult AddQuesLimit(int count, int limit, string subId, string parentId, array[] array) => Json(ExamDALC.AddQuesLimit(count, limit, subId, parentId, array), JsonRequestBehavior.AllowGet);
public JsonResult DeleteCategory(int id) => Json(ExamDALC.DeleteCategory(id), JsonRequestBehavior.AllowGet);
public JsonResult Feedback(string text, int id) => Json(ExamDALC.Feedback(text, id), JsonRequestBehavior.AllowGet);