public ActionResult GetQuestionsByTestGuid(string testGuid) { if (testGuid != null) { var questionViewModelList = _getInfoService .GetTestByGuid(testGuid) ?.TestQuestions .Select(q => _advancedMapper.MapTestQuestion(q)) .ToList(); return(View(questionViewModelList)); } return(RedirectToAction("TestManagement", "Admin")); }
public ActionResult GetQuestionsByTestGuid(string testGuid) { if (testGuid != null) { var questionViewModelList = _getInfoService .GetTestByGuid(testGuid) ?.TestQuestions .Select(q => _advancedMapper.MapTestQuestion(q)) .ToList(); var models = new ListModelAndInfo <QuestionViewModel> { TransferModel = questionViewModelList, Guid = testGuid }; return(View(models)); } return(HttpNotFound()); }
public JsonResult GetQuestionsByTestGuid(string testGuid) { var questionViewModelList = _getInfoService .GetTestByGuid(testGuid) ?.TestQuestions .Select(q => _advancedMapper.MapTestQuestion(q)) .ToList(); return(Json(questionViewModelList, JsonRequestBehavior.AllowGet)); }