Exemple #1
0
        protected virtual string GetGoal(StudentMetricAssessmentHistoricalModel model, List <StudentMetricAssessmentHistorical> data)
        {
            var stripLines     = model.ChartData.StripLines;
            var firstStripLine = stripLines.FirstOrDefault();

            return(firstStripLine != null ? firstStripLine.Tooltip : null);
        }
Exemple #2
0
        public virtual StudentMetricAssessmentHistoricalModel Get(StudentMetricAssessmentHistoricalRequest request)
        {
            var metricVariantId    = request.MetricVariantId;
            var schoolId           = request.SchoolId;
            var studentUSI         = request.StudentUSI;
            var metricMetadataNode = _metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(schoolId, metricVariantId);
            var metricId           = metricMetadataNode.MetricId;
            var labelType          = string.Empty;

            if (String.IsNullOrEmpty(metricMetadataNode.DisplayName))
            {
                throw new ArgumentNullException(string.Format("Metric Display Name is null for metric variant Id:{0}", metricVariantId));
            }

            var chartId = String.Format("{0}_{1}_{2}", schoolId, studentUSI, metricVariantId);

            var model = new StudentMetricAssessmentHistoricalModel
            {
                StudentUSI     = studentUSI,
                DrillDownTitle = string.Empty,
                ChartData      =
                {
                    ChartId                    = chartId,
                    OverviewChartIsEnabled     = false,
                    ShowMouseOverToolTipOnLeft = false,
                    YAxisMaxValue              = 1.0
                }
            };

            var data = GetData(studentUSI, metricId);

            if (data.Count == 0)
            {
                return(model);
            }

            var metadata = GetMetaData(studentUSI, metricId);

            if (metadata != null)
            {
                model.ChartData.Context     = metadata.Context;
                model.ChartData.SubContext  = metadata.SubContext;
                model.ChartData.DisplayType = metadata.DisplayType;
                labelType = metadata.LabelType;
            }

            model.ChartData.StripLines.AddRange(GetStripLines(studentUSI, metricId, metricVariantId, schoolId, metricMetadataNode.Format));

            model.ChartData.Goal = GetGoal(model, data);

            model.ChartData.SeriesCollection.AddRange(GetChartSeries(data, metricMetadataNode, labelType));

            model.ChartData.YAxisLabels.AddRange(GetYAxisLabels(labelType));

            return(model);
        }
        public virtual StudentMetricAssessmentHistoricalModel Get(StudentMetricAssessmentHistoricalRequest request)
        {
            var metricVariantId = request.MetricVariantId;
            var schoolId = request.SchoolId;
            var studentUSI = request.StudentUSI;
            var metricMetadataNode = _metricNodeResolver.GetMetricNodeForStudentFromMetricVariantId(schoolId, metricVariantId);
            var metricId = metricMetadataNode.MetricId;
            var labelType = string.Empty;

            if (String.IsNullOrEmpty(metricMetadataNode.DisplayName))
                throw new ArgumentNullException(string.Format("Metric Display Name is null for metric variant Id:{0}", metricVariantId));

            var chartId = String.Format("{0}_{1}_{2}", schoolId, studentUSI, metricVariantId);

            var model = new StudentMetricAssessmentHistoricalModel
            {
                StudentUSI = studentUSI,
                DrillDownTitle = string.Empty,
                ChartData =
                {
                    ChartId = chartId,
                    OverviewChartIsEnabled = false,
                    ShowMouseOverToolTipOnLeft = false,
                    YAxisMaxValue = 1.0
                }
            };

            var data = GetData(studentUSI, metricId);

            if (data.Count == 0)
                return model;

            var metadata = GetMetaData(studentUSI, metricId);

            if (metadata != null)
            {
                model.ChartData.Context = metadata.Context;
                model.ChartData.SubContext = metadata.SubContext;
                model.ChartData.DisplayType = metadata.DisplayType;
                labelType = metadata.LabelType;
            }

            model.ChartData.StripLines.AddRange(GetStripLines(studentUSI, metricId, metricVariantId, schoolId, metricMetadataNode.Format));

            model.ChartData.Goal = GetGoal(model, data);

            model.ChartData.SeriesCollection.AddRange(GetChartSeries(data, metricMetadataNode, labelType));

            model.ChartData.YAxisLabels.AddRange(GetYAxisLabels(labelType));

            return model;
        }
 protected virtual string GetGoal(StudentMetricAssessmentHistoricalModel model, List<StudentMetricAssessmentHistorical> data)
 {
     var stripLines = model.ChartData.StripLines;
     var firstStripLine = stripLines.FirstOrDefault();
     return firstStripLine != null ? firstStripLine.Tooltip : null;
 }
 protected override void ExecuteTest()
 {
     var service = new StudentMetricAssessmentHistoricalService(_studentMetricAssessmentHistorical, _studentMetricAssessmentHistoricalMetaData, _metricGoalProvider, _metricInstanceSetKeyResolver, _metricNodeResolver);
     _actualModel = service.Get(new StudentMetricAssessmentHistoricalRequest
     {
         StudentUSI = SuppliedStudentUsi,
         SchoolId = SuppliedSchoolId,
         MetricVariantId = SuppliedMetricVariantId
     });
 }