mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 13:38:18 -08:00
ECP-202 insufficient data indicators on analyze page are aware of the graph requested and get shown based on the data requested (student/teacher/parent)
This commit is contained in:
parent
5911c2c090
commit
df96f08c12
2 changed files with 23 additions and 5 deletions
|
|
@ -46,7 +46,7 @@ module AnalyzeHelper
|
|||
@empty_dataset ||= Hash.new do |memo, (school, academic_year)|
|
||||
memo[[school, academic_year]] = measures.none? do |measure|
|
||||
response_rate = measure.subcategory.response_rate(school:, academic_year:)
|
||||
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold || measure.sufficient_admin_data?(school:, academic_year:)
|
||||
response_rate.meets_student_threshold || response_rate.meets_teacher_threshold || measure.sufficient_admin_data?(school:, academic_year:) || SurveyItemResponse.where(school:, academic_year:, survey_item: measures.flat_map(&:parent_survey_items)).count > 10
|
||||
end
|
||||
end
|
||||
|
||||
|
|
@ -63,8 +63,12 @@ module AnalyzeHelper
|
|||
@empty_survey_dataset[[school, academic_year]]
|
||||
end
|
||||
|
||||
def empty_parent_dataset?(measures:, school:, academic_year:)
|
||||
SurveyItemResponse.where(school:, academic_year:, survey_item: measures.flat_map(&:parent_survey_items)).count < 10
|
||||
end
|
||||
|
||||
def base_url
|
||||
analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @presenter.category,
|
||||
subcategory: @presenter.subcategory)
|
||||
subcategory: @presenter.subcategory)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -21,8 +21,13 @@
|
|||
<%= selected_academic_years.include?(year) ? "checked" : "" %>
|
||||
<% empty_dataset = empty_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% empty_survey_dataset = empty_survey_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% empty_parent_dataset = empty_parent_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% if graph.slug == 'all-data' %>
|
||||
<%= empty_dataset ? "disabled" : "" %>
|
||||
<% elsif graph.slug.starts_with?('parents-by') %>
|
||||
<%= empty_parent_dataset ? "disabled" : "" %>
|
||||
<% elsif graph.slug.starts_with?('students-and-teachers-and-parents') %>
|
||||
<%= empty_parent_dataset && empty_survey_dataset ? "disabled" : "" %>
|
||||
<% else %>
|
||||
<%= empty_survey_dataset ? "disabled" : "" %>
|
||||
<% end %>
|
||||
|
|
@ -32,14 +37,23 @@
|
|||
<% if graph.slug == 'all-data' && empty_dataset %>
|
||||
<i class="fa-solid fa-circle-exclamation px-3"
|
||||
data-bs-toggle="popover" data-bs-placement="right"
|
||||
data-bs-content="No admin data OR teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>%">
|
||||
data-bs-content="No admin data OR teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>% OR no parent responses">
|
||||
</i>
|
||||
<% end %>
|
||||
<% if graph.slug != 'all-data' && empty_survey_dataset %>
|
||||
<% elsif graph.slug == 'students-and-teachers-and-parents' && (empty_survey_dataset && empty_parent_dataset )%>
|
||||
<i class="fa-solid fa-circle-exclamation px-3"
|
||||
data-bs-toggle="popover" data-bs-placement="right"
|
||||
data-bs-content="Teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>% OR no parent responses">
|
||||
</i>
|
||||
<% elsif graph.slug != 'students-and-teachers-and-parents' && graph.slug.starts_with?('student') && empty_survey_dataset %>
|
||||
<i class="fa-solid fa-circle-exclamation px-3"
|
||||
data-bs-toggle="popover" data-bs-placement="right"
|
||||
data-bs-content="Teacher and student survey response rates below <%= ResponseRateCalculator::TEACHER_RATE_THRESHOLD %>%">
|
||||
</i>
|
||||
<% elsif graph.slug.starts_with?('parent') && empty_parent_dataset %>
|
||||
<i class="fa-solid fa-circle-exclamation px-3"
|
||||
data-bs-toggle="popover" data-bs-placement="right"
|
||||
data-bs-content="Insufficient parent survey responses">
|
||||
</i>
|
||||
<% end %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue