Example #1
0
        public ActionResult Panorama(int classId, ClassProfilePanoramaSetting settings, IList <int> selectedStudents)
        {
            if (!Context.Claims.HasPermission(ClaimInfo.VIEW_PANORAMA))
            {
                throw new ChalkableSecurityException("You are not allowed to view class panorama");
            }

            if (settings.AcadYears == null)
            {
                settings = SchoolLocator.PanoramaSettingsService.Get <ClassProfilePanoramaSetting>(classId);
            }

            if (settings.AcadYears.Count == 0)
            {
                throw new ChalkableException("School years is required parameter");
            }

            var classDetails            = SchoolLocator.ClassService.GetClassDetailsById(classId);
            var standardizedTestDetails = SchoolLocator.StandardizedTestService.GetListOfStandardizedTestDetails();
            var panorama     = SchoolLocator.ClassService.Panorama(classId, settings.AcadYears, settings.StandardizedTestFilters);
            var gradingScale = SchoolLocator.GradingScaleService.GetClassGradingScaleRanges(classId);

            var classStudents = SchoolLocator.StudentService.GetClassStudentsDetails(classId, true);

            var panoramaViewData = ClassPanoramaViewData.Create(classDetails, standardizedTestDetails,
                                                                panorama, gradingScale, classStudents, selectedStudents, Context.NowSchoolTime);

            panoramaViewData.FilterSettings = ClassProfilePanoramaSettingsViewData.Create(settings);

            return(Json(panoramaViewData));
        }
Example #2
0
        public ActionResult RestorePanoramaSettings(int classId)
        {
            if (!Context.Claims.HasPermission(ClaimInfo.VIEW_PANORAMA))
            {
                throw new ChalkableSecurityException("You are not allowed to change panorama settings");
            }

            var settings = SchoolLocator.PanoramaSettingsService.Restore <ClassProfilePanoramaSetting>(classId);

            return(Json(ClassProfilePanoramaSettingsViewData.Create(settings)));
        }