diff --git a/app/models/school_category.rb b/app/models/school_category.rb index 359b61ab..f8e985b5 100644 --- a/app/models/school_category.rb +++ b/app/models/school_category.rb @@ -14,7 +14,7 @@ class SchoolCategory < ApplicationRecord scope :for_parent_category, -> (school, category=nil) { where(school: school).joins(:category).merge(Category.for_parent(category)) } scope :in, -> (year) { where(year: year) } - scope :valid, -> { where("zscore is not null") } + scope :valid, -> { where("zscore is not null or valid_child_count is not null") } def root_index category.root_index diff --git a/app/views/categories/show.html.haml b/app/views/categories/show.html.haml index a0e245da..610f2a81 100644 --- a/app/views/categories/show.html.haml +++ b/app/views/categories/show.html.haml @@ -1,3 +1,5 @@ +- valid = (@school_category.valid_child_count || 1) > 0 + = render 'layouts/school_header' .row @@ -12,37 +14,40 @@ = @category.name %p= @category.description - %p - - if @school_category.response_count > 0 - %b Total Responses: - = number_with_delimiter(@school_category.response_count) - -       - - %b Average Response: - = @school_category.answer_index_average.round(1) - (out of 5) - - - if @school_category.response_count > 0 && @school_category.zscore.present? -       - - - if @school_category.zscore.present? - %b Administrative Data: - - if @school_category.nonlikert.present? - = @school_category.nonlikert - = "(Benchmark: #{@school_category.category.benchmark})" -   - - if @school_category.zscore.present? - = @school_category.zscore.round(1) + 3 - (out of 5) + - if valid + %p + - if @school_category.response_count > 0 + %b Total Responses: + = number_with_delimiter(@school_category.response_count) -       - %b Valid Children: - = @school_category.valid_child_count || "N/A" +       + %b Average Response: + = @school_category.answer_index_average.round(1) + (out of 5) + + - if @school_category.response_count > 0 && @school_category.zscore.present? +       - .indicator-container.py-3 - = render 'school_categories/indicator', info: @school_category + - if @school_category.zscore.present? + %b Administrative Data: + - if @school_category.nonlikert.present? + = @school_category.nonlikert + = "(Benchmark: #{@school_category.category.benchmark})" +   + - if @school_category.zscore.present? + = @school_category.zscore.round(1) + 3 + (out of 5) + + + .indicator-container.py-3 + = render 'school_categories/indicator', info: @school_category + - else + .row.py-4 + .col-12.text-center + .px-2 + %h5 Insufficient Responses + %p No data is displayed for this measure because of insufficient responses. - unless @school.district.name == "Boston" && @category.slug == "effective-leadership" - if @child_school_categories.present? diff --git a/app/views/questions/_question.html.haml b/app/views/questions/_question.html.haml index 1cae75c0..54139208 100644 --- a/app/views/questions/_question.html.haml +++ b/app/views/questions/_question.html.haml @@ -49,6 +49,6 @@ %p.collapse{id: "raw-data#{question.id}"} = aggregated_responses.responses.map(&:answer_index_with_reverse).join(', ') - - if school_question.present? - .clearfix - %p= "Attempts: #{school_question.attempt_count}, Responses: #{school_question.response_count}, Response Rate: #{number_to_percentage(school_question.response_rate * 100, precision: 0)}" + -# - if school_question.present? + -# .clearfix + -# %p= "Attempts: #{school_question.attempt_count}, Responses: #{school_question.response_count}, Response Rate: #{number_to_percentage(school_question.response_rate * 100, precision: 0)}" diff --git a/app/views/school_categories/_school_category.html.haml b/app/views/school_categories/_school_category.html.haml index 1e0a75a9..cf01cb55 100644 --- a/app/views/school_categories/_school_category.html.haml +++ b/app/views/school_categories/_school_category.html.haml @@ -14,9 +14,11 @@ = school_category.category.blurb || truncate(school_category.category.description, length: 108) - else - .row.pt-2 + .row.py-1 .col-12.centered .px-2 %h5 Insufficient Responses %p No data is displayed for this measure because of insufficient responses. - -#%p= "Responded: #{aggregated_responses.count}, Possible: #{@school.available_responders_for(question)}" + %br + %br + %br