mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Update empty dataset indicators
This commit is contained in:
parent
880da0d8ff
commit
7ddada5050
2 changed files with 25 additions and 4 deletions
|
|
@ -49,6 +49,16 @@ module AnalyzeHelper
|
|||
@empty_dataset[[school, academic_year]]
|
||||
end
|
||||
|
||||
def empty_survey_dataset?(measures:, school:, academic_year:)
|
||||
@empty_survey_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
|
||||
end
|
||||
end
|
||||
@empty_survey_dataset[[school, academic_year]]
|
||||
end
|
||||
|
||||
def base_url
|
||||
analyze_subcategory_link(district: @district, school: @school, academic_year: @academic_year, category: @category,
|
||||
subcategory: @subcategory)
|
||||
|
|
|
|||
|
|
@ -8,12 +8,23 @@
|
|||
value="<%= analyze_subcategory_link(district: district, school: school, academic_year: academic_year, category: category, subcategory: subcategory) %>"
|
||||
<%= selected_academic_years.include?(year) ? "checked" : "" %>
|
||||
data-action="click->analyze#refresh"
|
||||
<%= empty_dataset?(measures: measures, school: school, academic_year: year) ? "disabled" : "" %>
|
||||
<%# <%= @graph.value == 'students-by-group' && year.range != @available_academic_years.last.range ? "disabled" : "" %1> %>>
|
||||
|
||||
<% empty_dataset = empty_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% empty_survey_dataset = empty_survey_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% if @graph.slug == 'all-data' %>
|
||||
<%= empty_dataset ? "disabled" : "" %>
|
||||
<% else %>
|
||||
<%= empty_survey_dataset ? "disabled" : "" %>
|
||||
<% end %>
|
||||
>
|
||||
<label class="px-3" for="<%= year.range %>"><%= year.range %></label><br>
|
||||
<div class="bg-color-blue px-3" style="width:20px;height:20px;background-color:<%= colors[index] %>;"></div>
|
||||
<% if empty_dataset?(measures: measures, school: school, academic_year: year) %>
|
||||
<% 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 %>%">
|
||||
</i>
|
||||
<% end %>
|
||||
<% if @graph.slug != 'all-data' && 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 %>%">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue