diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs index 5ab86d950..17954d93e 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTaskService.cs @@ -354,13 +354,13 @@ namespace IRaCIS.Application.Services IsPublicPage = firstData.IsPublicPage, }; - var pageGroupList = newPageQusetionList.Where(x =>x.IsPage|| (x.ParentId == null&&x.PageName.IsNullOrEmpty())).ToList(); + var pageGroupList = newPageQusetionList.Where(x =>x.Type =="group"|| (x.ParentId == null&&x.GroupName.IsNullOrEmpty())).ToList(); pageGroupList.ForEach(x => { this.FindChildQuestion(x, newPageQusetionList); }); - page.Childrens = pageGroupList; + page.Childrens = pageGroupList.Where(x=> !(x.Type == "group"&&x.Childrens.Count()==0)).ToList(); groupList.Add(page); } @@ -371,13 +371,13 @@ namespace IRaCIS.Application.Services { qusetionList = qusetionList.Where(x => x.ReadingCriterionPageId == null).ToList(); - groupList = qusetionList.Where(x => x.IsPage || (x.ParentId == null && x.PageName.IsNullOrEmpty())).ToList(); + groupList = qusetionList.Where(x => x.Type == "group" || (x.ParentId == null && x.GroupName.IsNullOrEmpty())).ToList(); groupList.ForEach(x => { this.FindChildQuestion(x, qusetionList); }); - + groupList= groupList.Where(x => !(x.Type == "group" && x.Childrens.Count() == 0)).ToList(); result.SinglePage = groupList; @@ -540,7 +540,7 @@ namespace IRaCIS.Application.Services [NonDynamicMethod] public void FindChildQuestion(GetTrialReadingQuestionOutDto trialReadingQuestion, List questionlists) { - trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId||(trialReadingQuestion.IsPage&&x.ParentId==null&&x.GroupName==trialReadingQuestion.GroupName)).ToList(); + trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.ReadingQuestionTrialId||(trialReadingQuestion.Type == "group"&&x.Type != "group" && x.ParentId==null&&x.GroupName==trialReadingQuestion.GroupName)).ToList(); if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0) { trialReadingQuestion.Childrens.ForEach(x =>