예제 #1
0
        public BarChart(QuizAnswerLayer answerLayer)
        {
            Title            = answerLayer.Content.Name;
            ParticipantCount = answerLayer.NbParticipants;
            Answers          = new ObservableCollection <AnswerData>();
            IsAnswered       = ((ExerciseContent)answerLayer.Content).HasBeenCollected;
            barChartModel    = answerLayer.BarChart;
            X = barChartModel.Position.X;
            Y = barChartModel.Position.Y;

            //Get data & process it
            foreach (var d in barChartModel.Answers)
            {
                Answers.Add(new AnswerData {
                    Category = "Réponse " + d.Key, Number = d.Value
                });
            }

            //Fixtures
            //Answers = new ObservableCollection<AnswerData>();
            //Answers.Add(new AnswerData() { Category = "Globalization", Number = 75 });
            //Answers.Add(new AnswerData() { Category = "Features", Number = 2 });
            //Answers.Add(new AnswerData() { Category = "ContentTypes", Number = 12 });
            //Answers.Add(new AnswerData() { Category = "Correctness", Number = 83 });
            //Answers.Add(new AnswerData() { Category = "Best Practices", Number = 29 });
        }
예제 #2
0
파일: BarChart.cs 프로젝트: aragoubi/Nine
        public BarChart(QuizAnswerLayer answerLayer)
        {
            Title = answerLayer.Content.Name;
            ParticipantCount = answerLayer.NbParticipants;
            Answers = new ObservableCollection<AnswerData>();
            IsAnswered = ((ExerciseContent) answerLayer.Content).HasBeenCollected;
            barChartModel = answerLayer.BarChart;
            X = barChartModel.Position.X;
            Y = barChartModel.Position.Y;

            //Get data & process it
            foreach (var d in barChartModel.Answers)
            {
                Answers.Add(new AnswerData {Category = "Réponse " + d.Key, Number = d.Value});
            }

            //Fixtures
            //Answers = new ObservableCollection<AnswerData>();
            //Answers.Add(new AnswerData() { Category = "Globalization", Number = 75 });
            //Answers.Add(new AnswerData() { Category = "Features", Number = 2 });
            //Answers.Add(new AnswerData() { Category = "ContentTypes", Number = 12 });
            //Answers.Add(new AnswerData() { Category = "Correctness", Number = 83 });
            //Answers.Add(new AnswerData() { Category = "Best Practices", Number = 29 });
        }