コード例 #1
0
        public PreQualifiedQuestionTemplateEditModel GetbyId(long id)
        {
            var template = _preQualificationTestTemplateRepository.GetById(id);

            if (template == null)
            {
                return new PreQualifiedQuestionTemplateEditModel {
                           Questions = new PreQualifiedQuestionEditModel[] { }
                }
            }
            ;

            var question            = _preQualificationQuestionRepository.GetByTestId(template.TestId);
            var selectedQuestionIds = _preQualificationTestTemplateRepository.GetQuestionIdsByTemplateId(id);
            var dependentTestIds    = _preQualificationTemplateDependentTestRepository.GetByTemplateId(id).Select(x => x.TestId);

            return(_preQualifiedQuestionTemplateFactory.CreateEditModel(template, question, selectedQuestionIds, dependentTestIds));
        }
コード例 #2
0
        public JsonResult GetQuestionByTestId(long testId)
        {
            var questions = _preQualificationQuestionRepository.GetByTestId(testId);

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