From 9f83b3dae45d0643c3b0d4d7ff7284e09f77d186 Mon Sep 17 00:00:00 2001 From: Nelson Jovel Date: Tue, 5 Mar 2024 22:31:56 -0800 Subject: [PATCH] fix: add pre-k to list of grades --- .../analyze/graph/column/grade/p_k.rb | 33 +++++++++++++++++++ .../analyze/graph/students_by_grade.rb | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 app/presenters/analyze/graph/column/grade/p_k.rb diff --git a/app/presenters/analyze/graph/column/grade/p_k.rb b/app/presenters/analyze/graph/column/grade/p_k.rb new file mode 100644 index 00000000..9c3e4aaa --- /dev/null +++ b/app/presenters/analyze/graph/column/grade/p_k.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +module Analyze + module Graph + module Column + module Grade + class PK < GroupedBarColumnPresenter + include Analyze::Graph::Column::Grade::ScoreForGrade + include Analyze::Graph::Column::Grade::GradeCount + def label + %w[Pre-K] + end + + def basis + "student" + end + + def show_irrelevancy_message? + false + end + + def show_insufficient_data_message? + false + end + + def grade + -1 + end + end + end + end + end +end diff --git a/app/presenters/analyze/graph/students_by_grade.rb b/app/presenters/analyze/graph/students_by_grade.rb index 3fb113d4..c39126f8 100644 --- a/app/presenters/analyze/graph/students_by_grade.rb +++ b/app/presenters/analyze/graph/students_by_grade.rb @@ -34,6 +34,7 @@ module Analyze end CFR = { + -1 => PK, 0 => Zero, 1 => One, 2 => Two, @@ -51,3 +52,4 @@ module Analyze end end end +