public CsvResult Get(EdFiDashboardContext context)
        {
            var learningStandards = _service.Get(new LearningStandardRequest()
            {
                StudentUSI = context.StudentUSI.GetValueOrDefault(),
                SchoolId = context.SchoolId.GetValueOrDefault(),
                MetricVariantId = context.MetricVariantId.GetValueOrDefault()
            });

            var export = new ExportAllModel();
            var rows = new List<ExportAllModel.Row>();
            
            foreach (var learningStandard in learningStandards)
            {
                var cells = new List<KeyValuePair<string, object>>()
                                {
                                    new KeyValuePair<string, object>("Learning Standard", learningStandard.LearningStandard),
                                    new KeyValuePair<string, object>("Description", learningStandard.Description),
                                };
                
                cells.AddRange(learningStandard.Assessments.Select(assessment => new KeyValuePair<string, object>(assessment.AssessmentTitle, assessment.Value)));

                rows.Add(new ExportAllModel.Row() { Cells = cells });
            }

            export.Rows = rows;

            return new CsvResult(export);
        }
        public virtual ActionResult Get(EdFiDashboardContext context, string demographic)
        {
            var menuModel = MenuService.Get(StudentDemographicMenuRequest.Create(context.SchoolId.GetValueOrDefault()));
            var model = new StudentDemographicListModel { MenuModel = menuModel };

            if (string.IsNullOrEmpty(demographic))
            {
                model.PageTitle = "Select demographic";
                model.Demographic = "Select demographic";
            }
            else
            {
                var schoolId = context.SchoolId.GetValueOrDefault();
                var sectionOrCohortId = context.SectionOrCohortId.GetValueOrDefault();
                var studentListType = context.StudentListType;

                demographic = FixDemographicNomenclature(demographic);
                var results = GetGridData(StudentDemographicListMetaRequest.Create(schoolId, sectionOrCohortId, studentListType, demographic));
                model.PageTitle = demographic + " Students";
                model.Demographic = demographic;
                model.PreviousNextSessionPage = results.PreviousNextSessionPage;
                model.ExportGridDataUrl = results.ExportGridDataUrl;
                model.ListType = ListType.StudentDemographic;

                model.GridData = new GridTable
                {
                    Columns = results.ListMetadata.GenerateHeader(),
                    SchoolId = schoolId,
                    WatchList = results.GridTable.WatchList
                };
            }
            return View(model);
        }
        public CsvResult Get(EdFiDashboardContext context)
        {
            var learningObjectives = _service.Get(new LearningObjectiveRequest()
            {
                StudentUSI = context.StudentUSI.GetValueOrDefault(),
                SchoolId = context.SchoolId.GetValueOrDefault(),
                MetricVariantId = context.MetricVariantId.GetValueOrDefault()
            });

            var orderedSkills = learningObjectives.LearningObjectiveSkills.OrderBy(los => los.SectionName).ThenBy(los => los.SkillName);

            var export = new ExportAllModel();
            var rows = new List<ExportAllModel.Row>();

            foreach (var skill in orderedSkills)
            {
                var cells = new List<KeyValuePair<string, object>>()
                                {
                                    new KeyValuePair<string, object>("Section Name", skill.SectionName),
                                    new KeyValuePair<string, object>("Skill Name", skill.SkillName),
                                };
                
                cells.AddRange(skill.SkillValues.Select(skillValue => new KeyValuePair<string, object>(skillValue.Title, skillValue.Value)));

                rows.Add(new ExportAllModel.Row() { Cells = cells });
            }

            export.Rows = rows;

            return new CsvResult(export);
        }
        public virtual ActionResult Get(EdFiDashboardContext context, string title)
        {
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();

            var historicalLearningObjChart = historicalLearningObjectiveService.Get(new HistoricalLearningObjectivesChartRequest()
                                                                                {
                                                                                    StudentUSI = context.StudentUSI.GetValueOrDefault(),
                                                                                    SchoolId = context.SchoolId.GetValueOrDefault(),
                                                                                    MetricVariantId = metricVariantId,
                                                                                    Title = title
                                                                                });

            var chartViewModel = new ChartViewModel
                                     {
                                         ChartData = historicalLearningObjChart,
                                         Width =  740,
                                         Height = 250,
                                         EachSeriesInNewChartArea = false,
                                         ChartType = SeriesChartType.Column,
                                         DisplayLegend = false,
                                         YMin = GetChartDisplayAxisYMin(metricVariantId),
                                         YMax = GetChartDisplayAxisYMax(metricVariantId),
                                         AxisYInterval = GetChartDisplayAxisYInterval(metricVariantId),
                                         AxisYLabelFormat = GetChartDisplayAxisYLabelFormat(metricVariantId),
                                         AxisYCustomLabels = GetChartDisplayAxisYCustomLabels(metricVariantId)
                                     };

            return View(chartViewModel);
        }
        public virtual ActionResult Get(EdFiDashboardContext context, string demographic)
        {
            var menuModel = MenuService.Get(StudentDemographicMenuRequest.Create(context.LocalEducationAgencyId.GetValueOrDefault(), context.StaffUSI.GetValueOrDefault()));
            var model = new StudentDemographicListModel { MenuModel = menuModel };

            if (string.IsNullOrEmpty(demographic) && !context.SectionOrCohortId.HasUsableValue())
            {
                model.Demographic = "Select demographic";
            }
            else
            {
                if (!string.IsNullOrWhiteSpace(demographic))
                    demographic = FixDemographicNomenclature(demographic);

                var localEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault();
                var sectionOrCohortId = context.SectionOrCohortId.GetValueOrDefault();
                var studentListType = context.StudentListType;

                if (studentListType == StudentListType.MetricsBasedWatchList.ToString())
                {
                    var selectedMenuOption = menuModel.WatchLists.FirstOrDefault(sc => sc.Url.Contains(EdFiDashboardContext.Current.RoutedUrl));
                    if (selectedMenuOption != null)
                    {
                        model.MenuModel.WatchLists.First(
                            sc =>
                                sc.Attribute == selectedMenuOption.Attribute && sc.Value == selectedMenuOption.Value &&
                                sc.Url == selectedMenuOption.Url).Selected = true;
                    }
                }
                else
                {
                    if (model.MenuModel.Ethnicity.FirstOrDefault(d => d.Attribute == demographic) != null)
                        model.MenuModel.Ethnicity.First(d => d.Attribute == demographic).Selected = true;

                    if (model.MenuModel.Gender.FirstOrDefault(d => d.Attribute == demographic) != null)
                        model.MenuModel.Gender.First(d => d.Attribute == demographic).Selected = true;

                    if (model.MenuModel.Indicator.FirstOrDefault(d => d.Attribute == demographic) != null)
                        model.MenuModel.Indicator.First(d => d.Attribute == demographic).Selected = true;

                    if (model.MenuModel.Program.FirstOrDefault(d => d.Attribute == demographic) != null)
                        model.MenuModel.Program.First(d => d.Attribute == demographic).Selected = true;

                    if (model.MenuModel.Race.FirstOrDefault(d => d.Attribute == demographic) != null)
                        model.MenuModel.Race.First(d => d.Attribute == demographic).Selected = true;
                }

                var results = GetGridData(StudentDemographicListMetaRequest.Create(localEducationAgencyId, sectionOrCohortId, studentListType, demographic));

                model.Demographic = demographic;
                model.GridData = results.GridTable;
                model.PreviousNextSessionPage = results.PreviousNextSessionPage;
                model.ExportGridDataUrl = results.ExportGridDataUrl;
                model.ListType = ListType.StudentDemographic;
            }

            return View(model);
        }
        public EdFiDashboardContext CreateEdFiDashboardContextFromDictionary(IDictionary<string, object> actionParameters)
        {
            var contextPropertyValues = GetContextPropertyValuesFromParameters(actionParameters);

            EdFiDashboardContext dashboardContext = new EdFiDashboardContext();

            foreach (var pair in contextPropertyValues)
                _contextPropertiesByName[pair.Key].SetValue(dashboardContext, pair.Value, null);

            return dashboardContext;
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var request = new ClassAbsencesRequest()
                              {
                                  SchoolId = context.SchoolId.GetValueOrDefault(),
                                  StudentUSI = context.StudentUSI.GetValueOrDefault()
                              };
            var model = classAbsencesService.Get(request);

            return View(model);
        }
        public ActionResult Get(EdFiDashboardContext context, string subjectArea)
        {
            var request = new CourseHistoryListRequest()
                              {
                                  StudentUSI = context.StudentUSI.GetValueOrDefault(),
                                  SchoolId = context.SchoolId.GetValueOrDefault()
                              };

            var model = service.Get(request);

            return View(model);
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            //IList<SchoolMetricModel> schoolMetrics = service.Get(new SchoolMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() });
            SchoolMetricTableModel schoolMetrics = service.Get(new SchoolMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() });


            var model = new GridTable
             {
                 MetricVariantId = context.MetricVariantId.GetValueOrDefault(),
                 Columns = schoolMetrics.ListMetadata.GenerateHeader(),
                 Rows = schoolMetrics.ListMetadata.GenerateRows(schoolMetrics.SchoolMetrics)
             };
            return View(model);
        }
        public ActionResult Get(EdFiDashboardContext context, string title)
        {
            var localEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault();
            var schoolId = context.SchoolId.GetValueOrDefault();
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();

            //TODO: this could be changed to the Serialized Request object.
            //Prepare the request.
            var request = "{ schoolId: " + schoolId + ", metricVariantId: " + metricVariantId + ", title: \"" + title + "\" }";
            var model = new HistoricalChartWithPeriodsModel(localEducationAgencyId,
                                                            metricVariantId,
                                                            EdFiDashboards.Site.School.Resource(schoolId, "HistoricalChartServices"),
                                                            "Get",
                                                            "Get",
                                                            request,
                                                            "Historical");
            return View(model);
        }
        private void SaveDashboardContextToCallContext(EdFiDashboardContext dashboardContext, ActionExecutingContext filterContext)
        {
            /*
             * mvc binder is missing the following values if they are not provided in the request parameter. therefore
             * we are helping binder go get the values from value providers and put them in dashboardContext.
             */

            // BTrabon 7/24/2014:
            // this change below is part of a fix where the form value provider
            // is returning a string array of one when calling the
            // EdFiGridExportController
            ResolveSchoolId(dashboardContext, filterContext);
			ResolveLocalEducationAgencyId(dashboardContext, filterContext);

	        SetRoutedUrl(filterContext, dashboardContext);

            CallContext.SetData(EdFiDashboardContext.CallContextKey, dashboardContext);
        }
        public ActionResult Get(EdFiDashboardContext context, int pageNumber, int pageSize, int? sortColumn, string sortDirection)
        {
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();
            var previousNextModel = previousNextSessionProvider.GetPreviousNextModel(Request.UrlReferrer, "StudentList", metricVariantId);
            var results = service.Get(StudentPriorYearMetricListRequest.Create(context.SchoolId.GetValueOrDefault(), context.LocalEducationAgencyId.GetValueOrDefault(), metricVariantId));
            var data = results.ListMetadata.GenerateRows(results.Students.ToList<StudentWithMetrics>(),
                                                         results.UniqueListId, pageNumber, pageSize, sortColumn, sortDirection);
            var model = new GridDataWithFootnotes
            {
                Rows = data.Item2,
                TotalRows = results.Students.Count
            };

            // TODO: GKM - Review use of int[][]
            previousNextSessionProvider.SetPreviousNextDataModel(previousNextModel, sortColumn, sortDirection, data.Item1.Select(x => new StudentSchoolIdentifier { StudentUSI = x[0], SchoolId = (int)x[1]}).ToList());

            return Json(model);
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            IList<SchoolPriorYearMetricModel> schoolMetrics = service.Get(new SchoolPriorYearMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() });


            var resolvedListId = metadataListIdResolver.GetListId(ListType.PriorYearSchoolMetricTable, SchoolCategory.None);
            var columnGroups = listMetadataProvider.GetListMetadata(resolvedListId);

            var model = new GridTable
            {
                MetricVariantId = context.MetricVariantId.GetValueOrDefault(),
                Columns = columnGroups.GenerateHeader(),
                Rows = columnGroups.GenerateRows((List<SchoolPriorYearMetricModel>)schoolMetrics)
            };

            
            return View(model);
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var schoolId = context.SchoolId.GetValueOrDefault();
            var localEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault();
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();
            var results = service.Get(StudentPriorYearMetricListRequest.Create(schoolId, localEducationAgencyId, metricVariantId));

            var model = new GridDataWithFootnotes
                            {
                                MetricFootnotes = results.MetricFootnotes,
                                Columns = results.ListMetadata.GenerateHeader(),
                                TotalRows = results.Students.Count,
                                EntityIds = results.Students.Select(x => x.StudentUSI).ToList(),
                                SchoolId = schoolId
                            };

            previousNextSessionProvider.RemovePreviousNextDataModel(context.MetricVariantId);
            return View(model);
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var serviceResult = service.Get(new GoalPlanningSchoolMetricTableRequest { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() });

            var model = new GoalPlanningSchoolMetricTableModel();
            var request = GoalPlanningSchoolListGetRequest.Create(context.LocalEducationAgencyId.GetValueOrDefault(), serviceResult.SchoolMetrics.Select(sm => new GoalPlanningSchoolListGetRequest.SchoolMetric { SchoolId = sm.SchoolId, MetricId = sm.MetricId }));
            model.GoalPlanning = goalPlanningService.Get(request);
            model.SchoolMetrics = request.SchoolMetrics.ToArray();
            var resolvedListId = metadataListIdResolver.GetListId(ListType.GoalPlanningSchoolMetricTable, SchoolCategory.None);

            var columnGroups = listMetadataProvider.GetListMetadata(resolvedListId);
            model.GridTable = new GridTable()
            {
                MetricVariantId = context.MetricVariantId.GetValueOrDefault(),
                Columns = columnGroups.GenerateHeader(),
                Rows = columnGroups.GenerateRows((List<GoalPlanningSchoolMetric>) serviceResult.GoalPlanningSchoolMetrics)
            };
            
            return View(model);
        }
        public CsvResult Get(EdFiDashboardContext context)
        {
            var schoolMetrics = _service.Get(new SchoolPriorYearMetricTableRequest() { MetricVariantId = context.MetricVariantId.GetValueOrDefault(), LocalEducationAgencyId = context.LocalEducationAgencyId.GetValueOrDefault() });
            var export = new ExportAllModel();
            var rows = new List<ExportAllModel.Row>();
            
            rows.AddRange(schoolMetrics.OrderBy(x => x.Name)
                .Select(schoolMetric => new ExportAllModel.Row()
                    {
                        Cells = new List<KeyValuePair<string, object>>
                        {
                            new KeyValuePair<string, object>("School", schoolMetric.Name),
                            new KeyValuePair<string, object>("Type", schoolMetric.SchoolCategory),
                            new KeyValuePair<string, object>("School Metric Value", schoolMetric.Value),
                            new KeyValuePair<string, object>("School Goal", schoolMetric.Goal),
                            new KeyValuePair<string, object>("Difference from Goal", schoolMetric.GoalDifference)
                        }
                    }));

            export.Rows = rows;

            return new CsvResult(export);
        }
示例#17
0
        protected void CreateEdFiDashboardContext(int? localEducationAgencyId, int? schoolId)
        {

            var dashboardContext = new EdFiDashboardContext();
            if (localEducationAgencyId.HasValue)
            {
                dashboardContext.LocalEducationAgencyId = localEducationAgencyId;
            }
            if (schoolId.HasValue)
            {
                dashboardContext.SchoolId = schoolId;
            }

            CallContext.SetData(EdFiDashboardContext.CallContextKey, dashboardContext);
        }
示例#18
0
 public ActionResult Get(EdFiDashboardContext context)
 {
     return View();
 }
示例#19
0
        protected void CreateEdFiDashboardContext(int localEducationAgencyId, int schoolId)
        {
            var dashboardContext = new EdFiDashboardContext
                                       {
                                           SchoolId = schoolId,
                                           LocalEducationAgencyId = localEducationAgencyId
                                       };

            CallContext.SetData(EdFiDashboardContext.CallContextKey, dashboardContext);
        }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var learningStandards = service.Get(new LearningStandardRequest()
            {
                StudentUSI = context.StudentUSI.GetValueOrDefault(),
                SchoolId = context.SchoolId.GetValueOrDefault(),
                MetricVariantId = context.MetricVariantId.GetValueOrDefault()
            });


            var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault() };
            if (learningStandards == null || learningStandards.Count == 0)
            {
                return View(model);
            }

            /*Preparing headers*/
            #region Headers
            model.Columns = new List<Column>{
				new Column { IsVisibleByDefault = true, IsFixedColumn = true,
                Children= new List<Column>{
						new ImageColumn{ Src = "LeftGrayCorner.png", IsVisibleByDefault=true, IsFixedColumn = true},
                        new TextColumn{ DisplayName = StudentExpectationsColumnHeading, IsVisibleByDefault=true, IsFixedColumn = true},
                    }
                },
				new TextColumn{DisplayName="Spacer",  IsVisibleByDefault=true, IsFixedColumn = true,
                    Children= new List<Column>{
                        new TextColumn{IsVisibleByDefault=true, IsFixedColumn = true},
                    }
				}
			};

            //For the Dynamic Columns (this is the Header which is empty "no text")
            var parentColumn = new TextColumn { DisplayName = BenchmarkAssessmentsColumnHeading, IsVisibleByDefault = true };
            foreach (var learningStandardAssessment in learningStandards[0].Assessments)
                parentColumn.Children.Add(new TextColumn { DisplayName = learningStandardAssessment.DateAdministration.ToString("MMMM d, yyyy"), Tooltip = learningStandardAssessment.AssessmentTitle, IsVisibleByDefault = true });

            model.Columns.Add(parentColumn);
            #endregion

            #region Rows
            foreach (var learningStandard in learningStandards)
            {
                var row = new List<object>();
                //First cells (Spacer,Expectation,Spacer)
                row.Add(new CellItem<double> { DV = "", V = 0 });
                row.Add(new ObjectiveTextCellItem<string> { O = learningStandard.LearningStandard + " " + learningStandard.Description, V = learningStandard.LearningStandard });
                //Spacer
                row.Add(new SpacerCellItem<double> { DV = "", V = 0 });

                foreach (var learningStandardAssessment in learningStandard.Assessments)
                {
                    var cell = new ObjectiveCellItem<int> { DV = "", V = -1 };
                    if (learningStandardAssessment.Administered)
                    {
                        cell.V = ChangeValueForSorting(learningStandardAssessment.MetricStateTypeId);
                        cell.ST = (learningStandardAssessment.MetricStateTypeId != null)
                                    ? learningStandardAssessment.MetricStateTypeId.Value
                                    : (int)MetricStateType.None;
                        cell.DV = learningStandardAssessment.Value;

                    }
                    row.Add(cell);
                }
                model.Rows.Add(row);
            }
            #endregion

            return View(model);
        }
	    	    private static void ResolveLocalEducationAgencyId(EdFiDashboardContext dashboardContext, ActionExecutingContext filterContext)
	    {
		    var resolvedLocalEducationAgencyId = ResolveKeyValue(filterContext, "localEducationAgencyId");
		    if (resolvedLocalEducationAgencyId != null)
		    {
			    int localEducationAgencyId;
			    if (int.TryParse(resolvedLocalEducationAgencyId.ToString(), out localEducationAgencyId))
				    dashboardContext.LocalEducationAgencyId = localEducationAgencyId;
			    else
				    dashboardContext.LocalEducationAgencyId = null;
		    }
		    else
		    {
			    dashboardContext.LocalEducationAgencyId = null;
		    }
	    }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var metricVariantId = context.MetricVariantId.GetValueOrDefault();
            var results = _service.Get(new StaffPriorYearMetricListRequest() { SchoolId = context.SchoolId.GetValueOrDefault(), MetricVariantId = metricVariantId });

            var model = new GridDataWithFootnotes { MetricFootnotes = results.MetricFootnotes };

            //Grouping headers and underlying columns.
            model.Columns = new List<Column> { 
                new Column{IsVisibleByDefault=true, 
                            IsFixedColumn=true,
                    Children= new List<Column>{
                        new  ImageColumn{ Src = "LeftGrayCorner.png", IsVisibleByDefault=true, IsFixedColumn = true },
                        new TextColumn{DisplayName="Staff", IsVisibleByDefault=true, IsFixedColumn = true},
                        new TextColumn{DisplayName="E-Mail", IsVisibleByDefault=true, IsFixedColumn = true},
                        new TextColumn{DisplayName= results.MetricValueLabel, IsVisibleByDefault=true, IsFixedColumn = true},
                    },
                },
                new TextColumn{DisplayName="Spacer", IsVisibleByDefault=true, IsFixedColumn = true,
                    Children= new List<Column>{new TextColumn{IsVisibleByDefault=true, IsFixedColumn = true}},
                },
                new TextColumn{DisplayName="EXPERIENCE",  IsVisibleByDefault=true,
                    Children= new List<Column>{
                        new TextColumn{DisplayName="Experience", IsVisibleByDefault=true},
                    },
                },
                new TextColumn{DisplayName="Spacer", IsVisibleByDefault=true,
                    Children= new List<Column>{new TextColumn{IsVisibleByDefault=true}},
                },
                new TextColumn{DisplayName="EDUCATION",  IsVisibleByDefault=true,
                    Children= new List<Column>{
                        new TextColumn{DisplayName="Education", IsVisibleByDefault=true},
                    },
                },
            };

            //Create the rows.
            foreach (var t in results.StaffMetrics)
            {
                var row = new List<object>();

                //First cells (Spacer, Staff, Email, Metric)
                row.Add(new CellItem<double> { DV = string.Empty, V = 0 });
                row.Add(new TeacherCellItem<string>
                {
                    V = t.Name,
                    DV = t.Name,
                    TId = t.StaffUSI,
                    LUId = results.UniqueListId,
                    CId = results.SchoolId,
                    Url = t.Href
                });
                row.Add(new EmailCellItem<string> { V = t.Email, M = t.Email });

                var cellType = typeof(CellItem<>).MakeGenericType(new Type[] { t.Value.GetType() });
                dynamic cellForMetricValue = Activator.CreateInstance(cellType);
                cellForMetricValue.V = t.Value;
                cellForMetricValue.DV = t.DisplayValue;
                row.Add(cellForMetricValue);

                //Spacer
                row.Add(new SpacerCellItem<double> { DV = string.Empty, V = 0 });
                row.Add(new YearsOfExperienceCellItem<int> { V = t.Experience, Y = t.Experience });
                //Spacer
                row.Add(new SpacerCellItem<double> { DV = string.Empty, V = 0 });
                row.Add(new HighestLevelOfEducationCellItem<string> { V = t.Education, E = t.Education });

                model.Rows.Add(row);
            }

            return View(model);
        }
        private bool TryFindDashboardContextInActionParameters(ActionExecutingContext filterContext, out EdFiDashboardContext dashboardContext)
        {
            dashboardContext =
                (from p in filterContext.ActionParameters
                 where p.Value is EdFiDashboardContext
                 select p.Value)
                    .FirstOrDefault() as EdFiDashboardContext;

            return (dashboardContext != null);
        }
	    private void SetRoutedUrl(ActionExecutingContext filterContext, EdFiDashboardContext dashboardContext)
        {
            string routedVirtualPath = filterContext.RouteData.Route.GetVirtualPath(filterContext.RequestContext, filterContext.RouteData.Values).VirtualPath; // i.e. "AllenISD"

            // Get the base URL with the trailing slash, if it exists
            string urlBase = requestUrlBaseProvider.GetRequestUrlBase(filterContext.RequestContext.HttpContext.Request);

            // Construct the URL that has been regenerated (i.e. a request for https://app/AllenISD/Overview will be shortened 
            // to https://app/AllenISD if "Overview" is defaulted, thereby making it possible to match with generated URLs on 
            // the menu items for determining correct menu selection)
            dashboardContext.RoutedUrl = (new Uri(urlBase + routedVirtualPath)).AbsolutePath;
        }
	    private static void ResolveSchoolId(EdFiDashboardContext dashboardContext, ActionExecutingContext filterContext)
	    {
		    var resolvedSchoolId = ResolveKeyValue(filterContext, "schoolId");
		    if (resolvedSchoolId != null)
		    {
			    int schoolId;
			    if (int.TryParse(resolvedSchoolId.ToString(), out schoolId))
				    dashboardContext.SchoolId = schoolId;
			    else
				    dashboardContext.SchoolId = null;
		    }
		    else
		    {
			    dashboardContext.SchoolId = null;
		    }
	    }
        public ActionResult Get(EdFiDashboardContext context)
        {
            var learningObjectives = service.Get(new LearningObjectiveRequest()
                                        {
                                            StudentUSI = context.StudentUSI.GetValueOrDefault(),
                                            SchoolId = context.SchoolId.GetValueOrDefault(),
                                            MetricVariantId = context.MetricVariantId.GetValueOrDefault()
                                        });


            var model = new GridTable { MetricVariantId = context.MetricVariantId.GetValueOrDefault() };

            if (learningObjectives == null || learningObjectives.AssessmentTitles.Count == 0)
            {
                return View(model);
            }

            var orderedAssessmentTitles = GetOrderedAssessmentTitles(learningObjectives.AssessmentTitles);

            #region Headers
            model.Columns = new List<Column>{
                new Column { IsVisibleByDefault = true, IsFixedColumn = true,
                Children= new List<Column>{
                        new ImageColumn{ Src = "LeftGrayCorner.png", IsVisibleByDefault=true, IsFixedColumn = true },
                        new TextColumn{ DisplayName = learningObjectives.InventoryName, IsVisibleByDefault=true, IsFixedColumn = true},
                    }
                },
                new TextColumn{DisplayName="Spacer",  IsVisibleByDefault=true, IsFixedColumn = true,
                    Children= new List<Column>{
                        new TextColumn{ IsVisibleByDefault=true, IsFixedColumn = true},
                    }
                }
            };

            //For the Dynamic Columns (this is the Header which is empty "no text")
            var parentColumn = new TextColumn { DisplayName = "Reading Assessments", IsVisibleByDefault = true };
            foreach (var learningObjectiveTitle in orderedAssessmentTitles)
            {
                parentColumn.Children.Add(new TextColumn { DisplayName = learningObjectiveTitle, IsVisibleByDefault = true });
            }

            model.Columns.Add(parentColumn);

            #endregion

            #region Rows

            var orderedLearningObjectives = learningObjectives.LearningObjectiveSkills.OrderBy(los => los.SectionName).ThenBy(los => los.SkillName);

            foreach (var learningObjectiveSection in orderedLearningObjectives)
            {
                var row = new List<object>();

                //Learning Objective section cell
                row.Add(new CellItem<double> { DV = "", V = 0 });
                row.Add(new ObjectiveTextCellItem<string> { O = string.Format("{0}: {1}", learningObjectiveSection.SectionName, learningObjectiveSection.SkillName), V = string.Format("{0}: {1}", learningObjectiveSection.SectionName, learningObjectiveSection.SkillName) });

                //Spacer
                row.Add(new SpacerCellItem<double> { DV = "", V = 0 });

                foreach (var learningObjectiveAssessmentTitle in orderedAssessmentTitles)
                {
                    var cell = new ObjectiveCellItem<int> { DV = "", V = -1 };

                    if (learningObjectiveSection.SkillValues.Any(skill => skill.Title == learningObjectiveAssessmentTitle))
                    {
                        var learningObjectiveSkill = learningObjectiveSection.SkillValues.Where(skill => skill.Title == learningObjectiveAssessmentTitle).First();

                        cell.V = ChangeValueForSorting(learningObjectiveSkill.MetricStateTypeId);
                        cell.ST = (learningObjectiveSkill.MetricStateTypeId != null) ? learningObjectiveSkill.MetricStateTypeId.Value : (int)MetricStateType.None;
                        cell.DV = learningObjectiveSkill.Value;
                    }

                    row.Add(cell);
                }

                model.Rows.Add(row);
            }
            #endregion

            return View(model);
        }