public static StudentSummaryViewData Create(StudentSummaryInfo studentSummary, Room room, ClassDetails currentClass, IList <ClassDetails> classes , IList <StudentCustomAlertDetail> customAlerts, IList <StudentHealthCondition> healthConditions, IList <StudentHealthFormInfo> studentHealthForms, bool isStudent = false) { var res = new StudentSummaryViewData(studentSummary.StudentInfo, room, customAlerts, healthConditions, studentHealthForms) { ClassesSection = ClassViewData.Create(classes), AttendanceBox = StudentHoverBoxViewData <TotalAbsencesPerClassViewData> .Create(studentSummary.DailyAttendance, studentSummary.Attendances, classes), DisciplineBox = StudentHoverBoxViewData <DisciplineTypeSummaryViewData> .Create(studentSummary.InfractionSummaries, studentSummary.TotalDisciplineOccurrences), GradesBox = StudentHoverBoxViewData <StudentSummaryGradeViewData> .Create(studentSummary.StudentAnnouncements), RanksBox = studentSummary.ClassRank != null ? StudentHoverBoxViewData <StudentSummaryRankViewData> .Create(studentSummary.ClassRank) : null, CurrentClassName = NO_CLASS_SCHEDULED, }; if (currentClass != null) { res.CurrentClassName = currentClass.Name; } res.CurrentAttendanceLevel = studentSummary.CurrentAttendanceLevel; if (isStudent) { ClearAlertsForStudent(res); } return(res); }
public static StudentHoverBoxViewData <StudentSummaryRankViewData> Create(ClassRankInfo rankInfo) { var res = new StudentHoverBoxViewData <StudentSummaryRankViewData>(); var rank = rankInfo.Rank; res.IsPassing = true; res.Title = rank.HasValue ? string.Format("{0} of {1}", rankInfo.Rank, rankInfo.ClassSize) : ""; return(res); }
public static StudentHoverBoxViewData <DisciplineTypeSummaryViewData> Create(IList <InfractionSummaryInfo> infractionSummaryInfos, int totalDisciplineOccurrences) { var res = new StudentHoverBoxViewData <DisciplineTypeSummaryViewData> { Hover = DisciplineTypeSummaryViewData.Create(infractionSummaryInfos).OrderByDescending(x => x.Total).ToList(), Title = totalDisciplineOccurrences.ToString(CultureInfo.InvariantCulture) }; return(res); }
public static StudentHoverBoxViewData <StudentSummaryGradeViewData> Create(IList <StudentAnnouncement> studentAnnouncements) { var firstStudentAn = studentAnnouncements.FirstOrDefault(); var res = new StudentHoverBoxViewData <StudentSummaryGradeViewData> { Hover = StudentSummaryGradeViewData.Create(studentAnnouncements), }; if (!string.IsNullOrEmpty(firstStudentAn?.ScoreValue)) { res.Title = firstStudentAn.ScoreValue; res.IsPassing = firstStudentAn.NumericScore >= 65; } return(res); }
public static StudentHoverBoxViewData <TotalAbsencesPerClassViewData> Create(DailyAbsenceSummaryInfo dailyAbsenceSummary , IList <ShortStudentClassAttendanceSummary> attendances, IList <ClassDetails> classDetailses) { var res = new StudentHoverBoxViewData <TotalAbsencesPerClassViewData> { Hover = TotalAbsencesPerClassViewData.Create(attendances, classDetailses), }; decimal totalAbsencesCount = 0; if (dailyAbsenceSummary != null && dailyAbsenceSummary.Absences.HasValue) { totalAbsencesCount += dailyAbsenceSummary.Absences.Value; // Excluded tardies because of Jonathan Whitehurst's comment on CHLK-3184 } //totalAbsencesCount += res.Hover.Sum(x => x.Absences); res.Title = totalAbsencesCount.ToString(CultureInfo.InvariantCulture); return(res); }
public static StudentInfoViewData Create(PersonDetails student, StudentDetailsInfo studentDetails, StudentSummaryInfo studentSummary, IList <ClassDetails> studentClasses, ClassDetails currentClass, Room currentRoom, int currentSchoolYearId) { var res = Create(student); res.DisplayName = studentDetails.DisplayName(includeMiddleName: true); var gradeLevels = student.StudentSchoolYears .OrderBy(x => x.SchoolYearRef) .Select(x => IdNameViewData <int> .Create(x.GradeLevelRef, x.GradeLevel.Name)) .ToList(); var currentStudentSchoolYear = student.StudentSchoolYears.FirstOrDefault(x => x.SchoolYearRef == currentSchoolYearId); if (currentStudentSchoolYear != null) { res.GradeLevel = gradeLevels.First(x => x.Id == currentStudentSchoolYear.GradeLevelRef); } res.IsHispanic = studentDetails.IsHispanic; res.HasMedicalAlert = studentDetails.HasMedicalAlert; res.IsAllowedInetAccess = studentDetails.IsAllowedInetAccess; res.SpecialInstructions = studentDetails.SpecialInstructions; res.SpEdStatus = studentDetails.SpEdStatus; res.IsIEPActive = studentDetails.IsIEPActive; res.IsTitle1Eligible = studentDetails.StudentSchool.IsTitle1Eligible; res.Section504 = !string.IsNullOrWhiteSpace(studentDetails.Section504Qualification) && studentDetails.Section504Qualification.Trim() != "NA"; res.IsHomeless = studentDetails.IsHomeless; res.IsImmigrant = studentDetails.IsImmigrant; res.Language = studentDetails.Language != null ? IdNameViewData <int> .Create(studentDetails.Language.Id, studentDetails.Language.Name) : null; res.Nationality = studentDetails.Country != null ? IdNameViewData <int> .Create(studentDetails.Country.Id, studentDetails.Country.Name) : null; res.Ethnicity = studentDetails.Ethnicity != null ? EthnicityViewData.Create(studentDetails.Ethnicity) : null; res.Lep = studentDetails.LimitedEnglishRef.HasValue; res.LimitedEnglishId = studentDetails.LimitedEnglishRef; res.IsForeignExchange = studentDetails.IsForeignExchange; res.StateIdNumber = studentDetails.StateIdNumber; res.AlternateStudentNumber = studentDetails.AltStudentNumber; res.StudentNumber = studentDetails.StudentNumber; res.OriginalEnrollmentDate = studentDetails.OriginalEnrollmentDate; res.IsRetained = student.StudentSchoolYears.First(x => x.SchoolYearRef == currentSchoolYearId).IsRetained; res.Counselor = studentDetails.Counselor != null ? ShortPersonViewData.Create(studentDetails.Counselor) : null; res.AttendanceBox = StudentHoverBoxViewData <TotalAbsencesPerClassViewData> .Create(studentSummary.DailyAttendance, studentSummary.Attendances, studentClasses); res.DisciplineBox = StudentHoverBoxViewData <DisciplineTypeSummaryViewData> .Create(studentSummary.InfractionSummaries, studentSummary.TotalDisciplineOccurrences); res.GradesBox = StudentHoverBoxViewData <StudentSummaryGradeViewData> .Create(studentSummary.StudentAnnouncements); res.CurrentAttandanceLevel = studentSummary.CurrentAttendanceLevel; res.CurrentClassName = NO_CLASS_SCHEDULED; if (currentClass != null) { res.CurrentClassName = currentClass.Name; } return(res); }