Exemple #1
0
        public async Task <ActionResult> NotTakenAttendanceClasses(DateTime?date)
        {
            date = (date ?? SchoolLocator.Context.NowSchoolYearTime);
            var notTakenAttendanceClasses = await SchoolLocator.AttendanceService.GetNotTakenAttendanceClasses(date.Value);

            return(Json(ClassViewData.Create(notTakenAttendanceClasses)));
        }
        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 GradingTeacherClassSummaryViewData Create(ShortClassGradesSummary classGradesSummary)
        {
            var res = new GradingTeacherClassSummaryViewData {
                Class = ClassViewData.Create(classGradesSummary.Class)
            };
            var studentsGrades = classGradesSummary.Students.Where(x => x.Avg.HasValue).OrderBy(x => x.Avg)
                                 .ThenBy(x => x.Student.LastName)
                                 .ThenBy(x => x.Student.FirstName).ToList();
            var well    = new List <ShortStudentClassGradesSummary>();
            var trouble = new List <ShortStudentClassGradesSummary>();

            foreach (var studentGrades in studentsGrades)
            {
                if (studentGrades.Avg <= BAD_GRADE)
                {
                    trouble.Add(studentGrades);
                }
                else
                {
                    well.Add(studentGrades);
                }
            }
            int skip = well.Count - DEFAUL_STUDENTS_COUNT > 0 ? well.Count - DEFAUL_STUDENTS_COUNT : 0;

            res.AllStudents = ShortStudentGradingViewData.Create(studentsGrades);
            res.Trouble     = ShortStudentGradingViewData.Create(trouble.Take(DEFAUL_STUDENTS_COUNT).ToList());
            res.Well        = ShortStudentGradingViewData.Create(well.Skip(skip).Take(DEFAUL_STUDENTS_COUNT).ToList());
            return(res);
        }
Exemple #4
0
 protected ClassPeriodViewData(ClassPeriod classPeriod, Room room, ClassDetails classComplex)
     : base(classPeriod, room)
 {
     if (classComplex != null)
     {
         Class         = ClassViewData.Create(classComplex);
         StudentsCount = classComplex.StudentsCount;
     }
 }