fully hiding insufficient data in Boston

pull/1/head
Jared Cosulich 7 years ago
parent 50b97498fd
commit 1b06552edd

@ -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

@ -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&nbsp;Responses:
= number_with_delimiter(@school_category.response_count)
&nbsp; &nbsp; &nbsp;
%b Average&nbsp;Response:
= @school_category.answer_index_average.round(1)
(out of 5)
- if @school_category.response_count > 0 && @school_category.zscore.present?
&nbsp; &nbsp; &nbsp;
- if @school_category.zscore.present?
%b Administrative&nbsp;Data:
- if @school_category.nonlikert.present?
= @school_category.nonlikert
= "(Benchmark: #{@school_category.category.benchmark})"
&nbsp;
- 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&nbsp;Responses:
= number_with_delimiter(@school_category.response_count)
&nbsp; &nbsp; &nbsp;
%b Valid&nbsp;Children:
= @school_category.valid_child_count || "N/A"
&nbsp; &nbsp; &nbsp;
%b Average&nbsp;Response:
= @school_category.answer_index_average.round(1)
(out of 5)
- if @school_category.response_count > 0 && @school_category.zscore.present?
&nbsp; &nbsp; &nbsp;
.indicator-container.py-3
= render 'school_categories/indicator', info: @school_category
- if @school_category.zscore.present?
%b Administrative&nbsp;Data:
- if @school_category.nonlikert.present?
= @school_category.nonlikert
= "(Benchmark: #{@school_category.category.benchmark})"
&nbsp;
- 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?

@ -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)}"

@ -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

Loading…
Cancel
Save