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; * }*/ }
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"; } }
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"; } }
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); } }
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; } }
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); * }*/ }
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; } }