public StyledQuestionnaireModel GetModel(Guid firstItemId)
        {
            var domainItem = DomainItemLocator
                             .Get <IStyledQuestionnaireOutputItem>(firstItemId);


            var model = new StyledQuestionnaireModel(
                domainItem.Id,
                domainItem.DisplayName);

            foreach (var pageId in domainItem.Pages)
            {
                var pageModel = CreatePageModel(pageId);
                model.Pages.Add(pageModel);
            }

            return(model);
        }
        public QuestionnaireModel GetModel(Guid id)
        {
            var questionnaire = DomainItemLocator
                                .Get <IQuestionnaireOutputItem>(id);

            var questions = questionnaire
                            .Questions
                            .Select(x => m_questionQueryService.GetQuestionModel(x.Id))
                            .ToList();

            var questionnaireModel = new QuestionnaireModel(id, questionnaire.DisplayName);

            foreach (var question in questions)
            {
                questionnaireModel.Questions.Add(question);
            }

            return(questionnaireModel);
        }
        public QuestionModel GetQuestionModel(Guid questionId)
        {
            var question = DomainItemLocator
                           .Get <IQuestionOutputItem>(questionId);

            var variable = DomainItemLocator
                           .Get <IQuestionNode>(question.Variable.Id);

            return(new QuestionModel(
                       question.Id,
                       question.Variable.Id,
                       question.QuestionText,
                       question.Visible,
                       question.ReadOnly,
                       question.QuestionType)
            {
                Value = question
                        .QuestionType
                        .GetValue(m_symbolTable, variable)
            });
        }
 public override IEnumerable <QuestionnaireOutputModel> GetAll()
 {
     return(DomainItemLocator
            .GetAll <IQuestionnaireOutputItem>()
            .Select(x => new QuestionnaireOutputModel(x.Id, x.DisplayName)));
 }
Example #5
0
 public override IEnumerable <QuestionnaireDefinitionModel> GetAll()
 {
     return(DomainItemLocator
            .GetAll <IQuestionnaireRootNode>()
            .Select(x => new QuestionnaireDefinitionModel(x.Id, x.DisplayName)));
 }