Ejemplo n.º 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 });
        }
Ejemplo n.º 2
0
        public void AddNewAnswerLayer(int offset, QuizAnswerLayer answerLayer)
        {
            var layerViewModel = new Layer(this, lessonModel, answerLayer);

            Layers.Add(new KeyValuePair <int, Layer>(offset, layerViewModel));
            CurrentLayerIndex = Layers.Count - 1; // Select the last Layer (which is the Answer Layer)
            CurrentLayer.DisplayChart();          // Compile Chart for the Layer
        }
Ejemplo n.º 3
0
        public override int AddAnswerLayer(string name, bool isRenameable = false, bool isHideable = true,
                                           bool isDeletable = false, bool isShareable = false, bool isInkable = true)
        {
            var layer = new QuizAnswerLayer(this, name,
                                            (Processing as QuizProcessing).GetResults() as Collection <KeyValuePair <int, int> >, isRenameable,
                                            isHideable, isDeletable, isShareable, isInkable);

            Layers.Add(layer);
            AnswerLayer = layer;
            return(layer.UID);
        }