示例#1
0
        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"));
        }
示例#2
0
 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());
 }
示例#3
0
        public JsonResult GetQuestionsByTestGuid(string testGuid)
        {
            var questionViewModelList = _getInfoService
                                        .GetTestByGuid(testGuid)
                                        ?.TestQuestions
                                        .Select(q => _advancedMapper.MapTestQuestion(q))
                                        .ToList();

            return(Json(questionViewModelList, JsonRequestBehavior.AllowGet));
        }