public QuestionResponse GetList([FromBody] string group) { int assessmentId = Auth.AssessmentForUser(); string applicationMode = GetApplicationMode(assessmentId); if (applicationMode.ToLower().StartsWith("questions")) { QuestionsManager qm = new QuestionsManager(assessmentId); QuestionResponse resp = qm.GetQuestionList(group); return(resp); } else { RequirementsManager rm = new RequirementsManager(assessmentId); QuestionResponse resp = rm.GetRequirementsList(); return(resp); } }
/// <summary> /// Returns questions/answers for current selected assessment /// </summary> /// <returns></returns> private List <AnalyticsQuestionAnswer> GetQuestionsAnswers() { int assessmentId = Auth.AssessmentForUser(); var questionsController = new QuestionsController(); string applicationMode = questionsController.GetApplicationMode(assessmentId); QuestionsManager qm = new QuestionsManager(assessmentId); if (applicationMode.ToLower().StartsWith("questions")) { QuestionResponse resp = qm.GetQuestionList("*"); return(qm.GetAnalyticQuestionAnswers(resp).OrderBy(x => x.QuestionId).ToList()); } else { RequirementsManager rm = new RequirementsManager(assessmentId); QuestionResponse resp = rm.GetRequirementsList(); return(qm.GetAnalyticQuestionAnswers(resp).OrderBy(x => x.QuestionId).ToList()); } }