Add admin data messages to analyze page for insufficient/irrelevant states

pull/1/head
rebuilt 3 years ago
parent 53a08d41bf
commit bb9ea9b22d

@ -9,24 +9,25 @@ module Analyze
end end
def basis def basis
'student' 'admin data'
end end
def show_irrelevancy_message? def show_irrelevancy_message?
# !measure.includes_admin_data_items? !measure.includes_admin_data_items?
false
end end
def show_insufficient_data_message? def show_insufficient_data_message?
# academic_years.any? do |year| !academic_years.any? do |year|
# measure.sufficient_admin_data?(school:, academic_year: year) measure.sufficient_admin_data?(school:, academic_year: year)
# end end
false end
def insufficiency_message
['data not', 'available']
end end
def score(year_index) def score(year_index)
measure.admin_score(school:, academic_year: academic_years[year_index]) measure.admin_score(school:, academic_year: academic_years[year_index])
# Score.new(average: 3)
end end
end end
end end

@ -8,10 +8,6 @@ module Analyze
'All Students' 'All Students'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
!measure.includes_student_survey_items? !measure.includes_student_survey_items?
end end

@ -8,10 +8,6 @@ module Analyze
'Survey Data' 'Survey Data'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,7 +9,7 @@ module Analyze
end end
def basis def basis
'teacher' 'teacher surveys'
end end
def show_irrelevancy_message? def show_irrelevancy_message?

@ -9,10 +9,6 @@ module Analyze
'American Indian' 'American Indian'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,10 +9,6 @@ module Analyze
'Asian' 'Asian'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,10 +9,6 @@ module Analyze
'Black' 'Black'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -106,6 +106,14 @@ module Analyze
number_of_columns number_of_columns
end end
def basis
'student surveys'
end
def insufficiency_message
['survey response', 'rate below 25%']
end
private private
YearlyScore = Struct.new(:year, :score) YearlyScore = Struct.new(:year, :score)

@ -9,10 +9,6 @@ module Analyze
'Hispanic' 'Hispanic'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -10,10 +10,6 @@ module Analyze
'Middle Eastern' 'Middle Eastern'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,10 +9,6 @@ module Analyze
'Multiracial' 'Multiracial'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,10 +9,6 @@ module Analyze
'Race/Ethnicity Not-Listed' 'Race/Ethnicity Not-Listed'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -9,10 +9,6 @@ module Analyze
'White' 'White'
end end
def basis
'student'
end
def show_irrelevancy_message? def show_irrelevancy_message?
false false
end end

@ -24,14 +24,16 @@
<text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle"> <text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
<tspan x="<%= column.column_midpoint %>%" y="29%">measure not</tspan> <tspan x="<%= column.column_midpoint %>%" y="29%">measure not</tspan>
<tspan x="<%= column.column_midpoint %>%" y="34%">based on</tspan> <tspan x="<%= column.column_midpoint %>%" y="34%">based on</tspan>
<tspan x="<%= column.column_midpoint %>%" y="39%"><%= column.basis %> surveys </tspan> <tspan x="<%= column.column_midpoint %>%" y="39%"><%= column.basis %></tspan>
</text> </text>
<% elsif column.show_insufficient_data_message? %> <% elsif column.show_insufficient_data_message? %>
<rect x="<%= column.message_x %>%" y="<%= column.message_y %>%" rx="15" ry="15" width="<%= column.message_width %>%" height="<%= column.message_height %>%" fill="white" stroke="gray" /> <rect x="<%= column.message_x %>%" y="<%= column.message_y %>%" rx="15" ry="15" width="<%= column.message_width %>%" height="<%= column.message_height %>%" fill="white" stroke="gray" />
<text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle"> <text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
<tspan x="<%= column.column_midpoint %>%" y="29%">survey response</tspan> <% column.insufficiency_message.each_with_index do |line, index| %>
<tspan x="<%= column.column_midpoint %>%" y="34%">rate below 25%</tspan> <% offset = 29 + index * 5 %>
<tspan x='<%= column.column_midpoint %>%' y='<%= offset %>%'><%= line %></tspan>
<% end %>
</text> </text>
<% end %> <% end %>
</g> </g>

@ -184,7 +184,7 @@ describe GroupedBarColumnPresenter do
end end
it 'returns a text representation of the type of survey the bars are based on' do it 'returns a text representation of the type of survey the bars are based on' do
expect(student_presenter.basis).to eq 'student' expect(student_presenter.basis).to eq 'student surveys'
end end
it 'returns only bars that have a numeric score' do it 'returns only bars that have a numeric score' do

Loading…
Cancel
Save