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
def basis
'student'
'admin data'
end
def show_irrelevancy_message?
# !measure.includes_admin_data_items?
false
!measure.includes_admin_data_items?
end
def show_insufficient_data_message?
# academic_years.any? do |year|
# measure.sufficient_admin_data?(school:, academic_year: year)
# end
false
!academic_years.any? do |year|
measure.sufficient_admin_data?(school:, academic_year: year)
end
end
def insufficiency_message
['data not', 'available']
end
def score(year_index)
measure.admin_score(school:, academic_year: academic_years[year_index])
# Score.new(average: 3)
end
end
end

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

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

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

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

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

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

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

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

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

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

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

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

@ -24,14 +24,16 @@
<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="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>
<% 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" />
<text x="<%= column.column_midpoint %>%" y="<%= 20 %>%" text-anchor="middle">
<tspan x="<%= column.column_midpoint %>%" y="29%">survey response</tspan>
<tspan x="<%= column.column_midpoint %>%" y="34%">rate below 25%</tspan>
<% column.insufficiency_message.each_with_index do |line, index| %>
<% offset = 29 + index * 5 %>
<tspan x='<%= column.column_midpoint %>%' y='<%= offset %>%'><%= line %></tspan>
<% end %>
</text>
<% end %>
</g>

@ -184,7 +184,7 @@ describe GroupedBarColumnPresenter do
end
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
it 'returns only bars that have a numeric score' do

Loading…
Cancel
Save