mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-13 09:20:38 -07:00
Show partial data indicators on variance chart
This commit is contained in:
parent
8205578267
commit
aeb6a45a45
34 changed files with 176 additions and 6780 deletions
|
|
@ -5,10 +5,12 @@ class Measure < ActiveRecord::Base
|
|||
|
||||
has_many :survey_item_responses, through: :survey_items
|
||||
|
||||
scope :source_includes_survey_items, ->() { joins(:survey_items).uniq }
|
||||
scope :source_includes_survey_items, -> { joins(:survey_items).uniq }
|
||||
|
||||
def self.none_meet_threshold?(school:, academic_year:)
|
||||
none? { |measure| SurveyItemResponse.sufficient_data?(measure: measure, school: school, academic_year: academic_year) }
|
||||
none? do |measure|
|
||||
SurveyItemResponse.sufficient_data?(measure: measure, school: school, academic_year: academic_year)
|
||||
end
|
||||
end
|
||||
|
||||
def teacher_survey_items
|
||||
|
|
@ -27,4 +29,15 @@ class Measure < ActiveRecord::Base
|
|||
student_survey_items.any?
|
||||
end
|
||||
|
||||
def includes_admin_data_items?
|
||||
admin_data_items.any?
|
||||
end
|
||||
|
||||
def sources
|
||||
sources = []
|
||||
sources << :admin_data if includes_admin_data_items?
|
||||
sources << :student_surveys if includes_student_survey_items?
|
||||
sources << :teacher_surveys if includes_teacher_survey_items?
|
||||
sources
|
||||
end
|
||||
end
|
||||
|
|
|
|||
2
app/models/score.rb
Normal file
2
app/models/score.rb
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
class Score < Struct.new(:average, :meets_teacher_threshold?, :meets_student_threshold?)
|
||||
end
|
||||
|
|
@ -14,8 +14,6 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
.average(:likert_score)
|
||||
end
|
||||
|
||||
Score = Struct.new(:average, :meets_teacher_threshold?, :meets_student_threshold?)
|
||||
|
||||
def self.score_for_measure(measure:, school:, academic_year:)
|
||||
meets_teacher_threshold = teacher_sufficient_data? measure: measure, school: school, academic_year: academic_year
|
||||
meets_student_threshold = student_sufficient_data? measure: measure, school: school, academic_year: academic_year
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue