Example #1
0
        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);
        }
Example #2
0
 public PartialViewResult RenderInfoPiece(Guid infoGuid, int index)
 {
     ViewBag.InfoIndex = index;
     InfoModel info = new InfosRepository().GetInfoById(infoGuid);
     return PartialView("~/Views/Test/_InfoPiecePartial.cshtml", info);
 }
Example #3
0
 public JsonResult PreviewInfo(Guid infoGuid)
 {
     InfoModel info = new InfosRepository().GetInfoById(infoGuid);
     return Json(info.StrippedBody, JsonRequestBehavior.AllowGet);
 }
Example #4
0
 public PartialViewResult SearchInfo(string query)
 {
     List<InfoModel> info = new InfosRepository().GetInfos();
     return PartialView("~/Views/Test/_InfoSearchPartialView.cshtml", info);
 }