예제 #1
0
        public void UpdateIcon()
        {
            int scoredQuestions = inspection.scores.Count(s => s.question.section == section);

            if (scoredQuestions == 0)
            {
                Icon = InspectionHelper.EmptyCircleFileName;
            }
            else if (scoredQuestions == section.AllScorableQuestions().Count)
            {
                Icon = InspectionHelper.CheckmarkFileName;
            }
            else
            {
                Icon = InspectionHelper.HalfCircleFileName;
            }

            /*int scoredQuestions = Children.Cast<QuestionPage>().Count(p => p.HasScore);
             * if (scoredQuestions == 0)
             * {
             *      Icon = InspectionHelper.EmptyCircleFileName;
             * }
             * else if (scoredQuestions == Children.Count)
             * {
             *      Icon = InspectionHelper.CheckmarkFileName;
             * }
             * else
             * {
             *      Icon = InspectionHelper.HalfCircleFileName;
             * }*/
        }
예제 #2
0
 public void UpdateIcon(bool answered)
 {
     ((PartPage)CurrentPage).UpdateIcon(answered);
     if (!answered)
     {
         Icon = "TabIconGreenNoBG.png";
         return;
     }
     if (section.AllScorableQuestions().Count == inspection.scores.Count(s => s.question.section == section))
     {
         Icon = "Checkmark2.png";
     }
 }
예제 #3
0
 public SectionWithPartsPage(SectionModel section, Inspection inspection)
 {
     this.section    = section;
     this.inspection = inspection;
     Title           = section.ShortTitle;
     if (section.AllScorableQuestions().Count == inspection.scores.Count(s => s.question.section == section))
     {
         Icon = "Checkmark2.png";
     }
     else
     {
         Icon = "TabIconGreenNoBG.png";
     }
 }
예제 #4
0
        public void AutoAdvance(Question question)
        {
            List <Question> questions = section.AllScorableQuestions();

            if (question.Id == questions.Last().Id)
            {
                //I could just do nothing, or I could go to the next section.  Or, like, go to the scores page.
                return;
            }
            else
            {
                int index = questions.IndexOf(question);
                this.CurrentPage = this.Children.ElementAt(index + 1);
            }
        }
예제 #5
0
        public void UpdateIcon()
        {
            ((PartPage)CurrentPage).UpdateIcon();
            int scoredQuestions = inspection.scores.Count(s => s.question.section == section);

            if (scoredQuestions == 0)
            {
                Icon = InspectionHelper.EmptyCircleFileName;
            }
            else if (scoredQuestions == section.AllScorableQuestions().Count)
            {
                Icon = InspectionHelper.CheckmarkFileName;
            }
            else
            {
                Icon = InspectionHelper.HalfCircleFileName;
            }
        }
예제 #6
0
        public SectionNoPartsPage(SectionModel section, Inspection inspection)
        {
            this.section    = section;
            this.inspection = inspection;
            Title           = section.ShortTitle;
            if (section.AllScorableQuestions().Count == inspection.scores.Count(s => s.question.section == section))
            {
                Icon = "Checkmark2.png";
            }
            else
            {
                Icon = "TabIconGreenNoBG.png";
            }

            /*foreach (Question question in section.Questions)
             * {
             *      QuestionPage page = new QuestionPage(question);
             *      Children.Add(page);
             * }*/
        }
예제 #7
0
        public SectionNoPartsPage(SectionModel section, Inspection inspection, InspectionPage parentPage)
        {
            this.section    = section;
            this.inspection = inspection;
            this.parentPage = parentPage;
            Title           = section.ShortTitle;
            int scoredQuestions = inspection.scores.Count(s => s.question.section == section);

            if (section.AllScorableQuestions().Count == scoredQuestions)
            {
                Icon = InspectionHelper.CheckmarkFileName;
            }
            else if (scoredQuestions > 0)
            {
                Icon = InspectionHelper.HalfCircleFileName;
            }
            else
            {
                Icon = InspectionHelper.EmptyCircleFileName;
            }
        }