public static ClassGradingBoxesViewData Create(IList <GradingPeriod> gradingPeriods,
                                                TeacherClassGrading gradingSummary, IList <ClaimInfo> claims)
 {
     return(new ClassGradingBoxesViewData
     {
         GradingPeriods = gradingPeriods.Select(GradingPeriodViewData.Create).ToList(),
         CurrentGradingBox = GradingClassSummaryViewData.Create(gradingSummary, claims)
     });
 }
        public static GradingClassSummaryViewData Create(TeacherClassGrading gradingSummary, IList <ClaimInfo> claims)
        {
            if (gradingSummary == null)
            {
                return(null);
            }

            return(Create(gradingSummary.Announcements, gradingSummary.GradingPeriod,
                          gradingSummary.AnnouncementTypes, gradingSummary.Avg, claims));
        }
Example #3
0
        private async Task <ClassGradingBoxesViewData> PrepareClassGradingBoxes(int classId)
        {
            var syId                           = GetCurrentSchoolYearId();
            var gradingPeriods                 = SchoolLocator.GradingPeriodService.GetGradingPeriodsDetailsByClassId(classId);
            var currentGradingPeriod           = CurrentGradingPeriodFromList(gradingPeriods, Context.NowSchoolYearTime.Date);
            TeacherClassGrading gradingSummary = null;

            if (currentGradingPeriod != null)
            {
                gradingSummary = await SchoolLocator.GradingStatisticService.GetClassGradingSummary(classId, currentGradingPeriod);
            }
            return(ClassGradingBoxesViewData.Create(gradingPeriods, gradingSummary, Context.Claims));
        }