public JsonResult GetInfoForQuestion(Guid testId, int questionIndex) { InfoModel info = new InfosRepository().GetInfoCreatedForTest(testId); var result = ""; if (info != null) { string body = info.Body; string pattern = String.Format(@"(<abbr[^>]* data-question-id=\""{0}\""[^>]*>(.*?)< *\/ *abbr *>)", questionIndex); Match mainRegex = new Regex(pattern).Match(body); Regex selectHtmlTags = new Regex("<[^>]*>"); result = "..." + mainRegex.Groups[1].Value + "..."; } return Json(result, JsonRequestBehavior.AllowGet); }
public PartialViewResult RenderInfoPiece(Guid infoGuid, int index) { ViewBag.InfoIndex = index; InfoModel info = new InfosRepository().GetInfoById(infoGuid); return PartialView("~/Views/Test/_InfoPiecePartial.cshtml", info); }
public JsonResult PreviewInfo(Guid infoGuid) { InfoModel info = new InfosRepository().GetInfoById(infoGuid); return Json(info.StrippedBody, JsonRequestBehavior.AllowGet); }
public PartialViewResult SearchInfo(string query) { List<InfoModel> info = new InfosRepository().GetInfos(); return PartialView("~/Views/Test/_InfoSearchPartialView.cshtml", info); }