Esempio n. 1
0
        public static ClassPanoramaViewData Create(ClassDetails cClass, IList <StandardizedTestDetails> standardizedTests, ClassPanorama panorama,
                                                   IList <GradingScaleRange> gradingScaleRanges, IList <StudentDetailsInfo> classStudents, IList <int> selectedStudents, DateTime today)
        {
            var res = new ClassPanoramaViewData(cClass)
            {
                StandardizedTests             = standardizedTests.Select(x => StandardizedTestViewData.Create(x, x.Components, x.ScoreTypes)).ToList(),
                ClassDistributionSection      = ClassDistributionSectionViewData.Create(panorama.Grades, panorama.Absences, panorama.Infractions, gradingScaleRanges),
                StandardizedTestsStatsByClass = StandardizedTestStatsViewData.CreateForClass(panorama.StandardizedTests, standardizedTests),
                Students = new List <StudentStandardizedTestStats>()
            };

            classStudents = classStudents.OrderBy(x => x.FullName()).ToList();

            //Preparing students
            foreach (var student in classStudents)
            {
                var studentStats = StandardizedTestStatsViewData.CreateForStudent(student.Id, panorama.StandardizedTests, standardizedTests);
                var gradeAvg     = panorama.Grades?.FirstOrDefault(x => x.StudentId == student.Id)?.AverageGrade;
                var infractions  = panorama.Infractions?.FirstOrDefault(x => x.StudentId == student.Id)?.NumberOfInfractions;
                var absences     = panorama.Absences?.FirstOrDefault(x => x.StudentId == student.Id);

                res.Students.Add(StudentStandardizedTestStats.Create(student, gradeAvg, absences, infractions, studentStats));
            }

            if (selectedStudents == null || selectedStudents.Count == 0)
            {
                return(res);
            }

            var selected = panorama.StandardizedTests?.Where(x => selectedStudents.Contains(x.StudentId));

            res.SelectStandardizedTestsStats = StandardizedTestStatsViewData.CreateForClass(selected?.ToList(), standardizedTests);

            return(res);
        }
Esempio n. 2
0
 public static StudentPanoramaViewData Create(int studentId, StudentPanoramaInfo panorama, StudentProfilePanoramaSetting settings, IList <StandardizedTestDetails> tests)
 {
     return(new StudentPanoramaViewData
     {
         StandardizedTestsStats = StandardizedTestStatsViewData.CreateForStudent(studentId, panorama.StandardizedTests, tests),
         Absences = panorama.DailyAbsences?.Select(StudentDailyAbsenceViewData.Create).OrderBy(x => x.Date).ToList(),
         DisciplineStats = panorama.Infractions?.Select(StudentInfractionViewData.Create).OrderBy(x => x.OccurrenceDate).ToList(),
         AttendanceStats = BuildAttendanceStats(panorama.DailyAbsences, panorama.AllSchoolDays),
         DailyDisciplineStats = BuildDisciplineStats(panorama.Infractions, panorama.AllSchoolDays),
         FilterSettings = settings,
         StandardizedTests = tests.Select(x => StandardizedTestViewData.Create(x, x.Components, x.ScoreTypes)).ToList(),
         Calendars = StudentPanoramaCalendarViewData.Create(panorama.DailyAbsences, panorama.Infractions, panorama.AllSchoolDays, panorama.SchoolYears)
     });
 }
        public ActionResult StandardizedTests()
        {
            var tests = SchoolLocator.StandardizedTestService.GetListOfStandardizedTestDetails();

            return(Json(tests.Select(x => StandardizedTestViewData.Create(x, x.Components, x.ScoreTypes))));
        }