mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-07 21:48:16 -08:00
Show response rate for students
This commit is contained in:
parent
b111b2f106
commit
59865cd874
17 changed files with 461 additions and 214 deletions
|
|
@ -4,7 +4,12 @@ All notable changes to this project will be documented in this file.
|
|||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
## [Released]
|
||||
### Added
|
||||
- short description to Category
|
||||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- Add student response rate
|
||||
`bundle exec rake db:migrate`
|
||||
|
||||
|
|
|
|||
2
Rakefile
2
Rakefile
|
|
@ -8,7 +8,7 @@ begin
|
|||
require 'rspec/core/rake_task'
|
||||
RSpec::Core::RakeTask.new(:spec)
|
||||
|
||||
# task(:default).clear
|
||||
task(:default).clear
|
||||
task default: :spec
|
||||
rescue LoadError => e
|
||||
raise e unless ENV['RAILS_ENV'] == 'production'
|
||||
|
|
|
|||
|
|
@ -117,3 +117,16 @@
|
|||
background-color: $gray-3;
|
||||
}
|
||||
|
||||
.response-rate {
|
||||
background-color: $gray-3;
|
||||
border: 1px solid;
|
||||
border-color: $gray-2;
|
||||
width: 150px;
|
||||
border-radius: 8px;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
.response-rate-percentage {
|
||||
font-size: 20px;
|
||||
@extend .sub-header-4;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,30 @@ class Seeder
|
|||
School.where.not(dese_id: dese_ids).destroy_all
|
||||
end
|
||||
|
||||
def seed_respondents(csv_file)
|
||||
schools = []
|
||||
year = '2020-21'
|
||||
academic_year = AcademicYear.find_by_range year
|
||||
CSV.parse(File.read(csv_file), headers: true) do |row|
|
||||
dese_id = row['DESE School ID'].strip.to_i
|
||||
total_students = row["Total Students for Response Rate (#{year})"]
|
||||
total_teachers = row["Total Teachers for Response Rate (#{year})"]
|
||||
|
||||
district_name = row['District'].strip
|
||||
district = District.find_or_create_by! name: district_name
|
||||
|
||||
school = School.find_by dese_id: dese_id, district: district
|
||||
schools << school
|
||||
respondent = Respondent.find_or_initialize_by school: school
|
||||
respondent.total_students = total_students
|
||||
respondent.total_teachers = total_teachers
|
||||
respondent.academic_year = academic_year
|
||||
respondent.save
|
||||
end
|
||||
|
||||
Respondent.where.not(school: schools).destroy_all
|
||||
end
|
||||
|
||||
def seed_sqm_framework(csv_file)
|
||||
CSV.parse(File.read(csv_file), headers: true) do |row|
|
||||
category_id = row['Category ID'].strip
|
||||
|
|
|
|||
4
app/models/respondent.rb
Normal file
4
app/models/respondent.rb
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
class Respondent < ApplicationRecord
|
||||
belongs_to :school
|
||||
belongs_to :academic_year
|
||||
end
|
||||
|
|
@ -7,9 +7,7 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
belongs_to :survey_item
|
||||
|
||||
def self.score_for_subcategory(subcategory:, school:, academic_year:)
|
||||
measures = subcategory.measures.select do |measure|
|
||||
sufficient_data?(measure: measure, school: school, academic_year: academic_year)
|
||||
end
|
||||
measures = measures_with_sufficient_data(subcategory: subcategory, school: school, academic_year: academic_year)
|
||||
|
||||
return nil unless measures.size.positive?
|
||||
|
||||
|
|
@ -18,6 +16,27 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
end.average
|
||||
end
|
||||
|
||||
def self.average_number_of_student_respondents(subcategory:, school:, academic_year:)
|
||||
response_count = subcategory.measures.map do |measure|
|
||||
next 0 unless measure.includes_student_survey_items?
|
||||
|
||||
SurveyItemResponse.student_responses_for_measure(measure, school, academic_year).count
|
||||
end.sum
|
||||
|
||||
survey_item_count = subcategory.measures.map do |measure|
|
||||
measure.student_survey_items.count
|
||||
end.sum
|
||||
return 0 unless survey_item_count.positive?
|
||||
|
||||
response_count / survey_item_count
|
||||
end
|
||||
|
||||
def self.measures_with_sufficient_data(subcategory:, school:, academic_year:)
|
||||
subcategory.measures.select do |measure|
|
||||
sufficient_data?(measure: measure, school: school, academic_year: academic_year)
|
||||
end
|
||||
end
|
||||
|
||||
def self.responses_for_measure(measure:, school:, academic_year:)
|
||||
meets_teacher_threshold = teacher_sufficient_data? measure: measure, school: school, academic_year: academic_year
|
||||
meets_student_threshold = student_sufficient_data? measure: measure, school: school, academic_year: academic_year
|
||||
|
|
@ -88,4 +107,5 @@ class SurveyItemResponse < ActiveRecord::Base
|
|||
end
|
||||
!!meets_teacher_threshold
|
||||
end
|
||||
private_class_method :measures_with_sufficient_data
|
||||
end
|
||||
|
|
|
|||
|
|
@ -30,6 +30,13 @@ class SubcategoryPresenter
|
|||
academic_year: @academic_year)
|
||||
end
|
||||
|
||||
def student_response_rate
|
||||
@student_response_rate ||= response_rate(type: :total_students) do
|
||||
SurveyItemResponse.average_number_of_student_respondents(subcategory: @subcategory, school: @school,
|
||||
academic_year: @academic_year)
|
||||
end
|
||||
end
|
||||
|
||||
def measure_presenters
|
||||
@subcategory.measures.includes([:admin_data_items]).sort_by(&:measure_id).map do |measure|
|
||||
MeasurePresenter.new(measure: measure, academic_year: @academic_year, school: @school)
|
||||
|
|
@ -50,4 +57,16 @@ class SubcategoryPresenter
|
|||
def measures
|
||||
@measures ||= @subcategory.measures.includes([:admin_data_items]).order(:measure_id)
|
||||
end
|
||||
|
||||
def response_rate(type:)
|
||||
number_of_responses = yield
|
||||
total_responses = Respondent.where(school: @school, academic_year: @academic_year).first
|
||||
return 0 unless total_responses.present?
|
||||
|
||||
total_possible_responses = total_responses.send(type)
|
||||
|
||||
return 0 if number_of_responses.nil? || total_possible_responses == 0
|
||||
|
||||
(number_of_responses / total_possible_responses * 100).round
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -7,7 +7,23 @@
|
|||
<div>
|
||||
<%= render partial: "gauge_graph", locals: { gauge: subcategory.gauge_presenter, gauge_class: 'gauge-graph-lg', font_class: 'sub-header-3' } %>
|
||||
</div>
|
||||
<p class="body-large mx-7"><%= subcategory.description %></p>
|
||||
<div class="d-flex flex-column mx-7">
|
||||
<p class="body-large "><%= subcategory.description %></p>
|
||||
|
||||
<div class="d-flex justify-content-start">
|
||||
<div class="body-large text-center response-rate">
|
||||
<p class="response-rate-percentage"><%= subcategory.student_response_rate %>%</p>
|
||||
<p>of students responded</p>
|
||||
</div>
|
||||
<%# <div class="body-large mx-3 text-center response-rate"> %>
|
||||
<%# <p class="response-rate-percentage"><%= subcategory.teacher_response_rate %1>%</p> %>
|
||||
<%# <p>of teachers responded</p> %>
|
||||
<%# <p> %>
|
||||
<%# <%= subcategory.total_teachers %1> %>
|
||||
<%# </p> %>
|
||||
</%#>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,198 +1,198 @@
|
|||
District,School Name,District Code,School Code,DESE School ID,School Closed In ,Total Students for Response Rate,Total Teachers for Response Rate
|
||||
Attleboro,A. Irvin Studley Elementary School,1,7,00160001,,75,26.90
|
||||
Attleboro,Thomas Willett Elementary School,1,9,00160035,,70,26.40
|
||||
Attleboro,Hyman Fine Elementary School,1,6,00160040,,86,31.50
|
||||
Attleboro,Hill-Roberts Elementary School,1,5,00160045,,97,28.10
|
||||
Attleboro,Peter Thacher Elementary School,1,8,00160050,,94,34.60
|
||||
Attleboro,Robert J. Coelho Middle School,1,3,00160305,,633,38.80
|
||||
Attleboro,Cyril K. Brennan Middle School,1,2,00160315,,620,41.30
|
||||
Attleboro,Wamsutta Middle School,1,4,00160320,,578,37.00
|
||||
Attleboro,Attleboro High School,1,1,00160505,,1792,114.70
|
||||
Boston,Lee Academy,2,,00350001,,0,19.20
|
||||
Boston,Baldwin Early Learning Pilot Academy ,2,117,00350003,,0,15.00
|
||||
Boston,Mary Lyon K-8 School,2,66,00350004,,76,17.40
|
||||
Boston,West Zone Early Learning Center ,2,123,00350006,,0,12.00
|
||||
Boston,Ellison/Parks Early Education School,2,120,00350008,,0,21.00
|
||||
Boston,East Boston Early Education Center ,2,119,00350009,,0,19.30
|
||||
Boston,Haynes Early Education Center ,2,121,00350010,,0,16.50
|
||||
Boston,Boston Teachers Union K-8 School,2,14,00350012,,157,20.20
|
||||
Boston,Jackson/Mann K-8 School,2,57,00350013,,235,53.30
|
||||
Boston,Pauline A. Shaw Elementary School,2,98,00350014,,0,15.50
|
||||
Boston,Curley K-8 School,2,26,00350020,,474,100.30
|
||||
Boston,Ludwig van Beethoven Elementary School,2,5,00350021,,0,24.50
|
||||
Boston,William E. Carter School,2,124,00350036,,27,2.00
|
||||
Boston,Charles Sumner Elementary School,2,100,00350052,,145,42.30
|
||||
Boston,Charles H. Taylor Elementary School,2,101,00350054,,111,37.00
|
||||
Boston,Curtis Guild Elementary School,2,45,00350062,,101,29.30
|
||||
Boston,Dante Alghieri Montessori School,2,2,00350066,,28,10.30
|
||||
Boston,David A. Ellis Elementary School,2,35,00350072,,113,37.60
|
||||
Boston,Henry Dearborn STEM Academy,2,27,00350074,,578,52.50
|
||||
Boston,Dennis Haley K-8 School,2,47,00350077,,199,45.70
|
||||
Boston,Donald McKay K-8 School,2,73,00350080,,452,70.10
|
||||
Boston,Edward Everett Elementary School,2,37,00350088,,123,23.00
|
||||
Boston,John Eliot K-8 School,2,34,00350096,,386,57.40
|
||||
Boston,Ellis Mendell School,2,79,00350100,,82,26.50
|
||||
Boston,Franklin D. Roosevelt K-8 School,2,96,00350116,,222,36.80
|
||||
Boston,George H. Conley Elementary School,2,25,00350122,,96,22.80
|
||||
Boston,Edward M. Kennedy Academy for Health Careers,2,58,04520505,,385,36.30
|
||||
Boston,Henry Grew Elementary School,2,44,00350135,,67,17.80
|
||||
Boston,Oliver Wendell Holmes Elementary School,2,53,00350138,,81,31.90
|
||||
Boston,Hugh R. O'Donnell Elementary School,2,87,00350141,,99,24.50
|
||||
Boston,James F. Condon K-8 School,2,24,00350146,,419,64.20
|
||||
Boston,James W. Hennigan K-8 School,2,50,00350153,,366,49.80
|
||||
Boston,James J. Chittick Elementary School,2,20,00350154,,71,34.20
|
||||
Boston,James Otis Elementary School,2,90,00350156,,136,36.60
|
||||
Boston,John F. Kennedy Elementary School,2,59,00350166,,115,27.10
|
||||
Somerville,John F. Kennedy Elementary School,5,6,02740083,,251,36.60
|
||||
Boston,UP Academy Holland,2,110,00350167,,216,48.50
|
||||
Boston,John D. Philbrick Elementary School,2,93,00350172,,33,14.90
|
||||
Boston,John W. McCormack Middle School,2,72,00350179,,250,26.50
|
||||
Boston,John Winthrop Elementary School,2,115,00350180,,56,27.00
|
||||
Boston,Joseph P. Tynan Elementary School,2,106,00350181,,77,28.10
|
||||
Boston,Joseph Hurley K-8 School,2,55,00350182,,152,22.50
|
||||
Boston,Joseph Lee K-8 School,2,64,00350183,,320,65.90
|
||||
Boston,Joseph P. Manning Elementary School,2,69,00350184,,69,16.20
|
||||
Boston,Joyce Kilmer K-8 School,2,62,00350190,,210,43.00
|
||||
Boston,Harvard/Kent Elementary School,2,48,00350200,,156,45.20
|
||||
Boston,Manassah E. Bradley Elementary School,2,15,00350215,,105,21.70
|
||||
Boston,Mattahunt,2,122,00350226,,#N/A,#N/A
|
||||
Boston,Mather Elementary School,2,71,00350227,,152,45.40
|
||||
Boston,Maurice Tobin K-8 School,2,104,00350229,,229,35.80
|
||||
Boston,Michael J. Perkins Elementary School,2,91,00350231,,78,18.40
|
||||
Boston,Wolfgang A. Mozart Elementary School,2,82,00350237,,46,18.30
|
||||
Boston,Richard J. Murphy K-8 School,2,84,00350240,,556,70.10
|
||||
Boston,Nathan Hale Elementary School,2,46,00350243,,68,19.00
|
||||
Boston,Oliver Hazard Perry K-8 School,2,92,00350255,,81,23.70
|
||||
Boston,Orchard Gardens K-8 School,2,89,00350257,,452,74.10
|
||||
Boston,William Ohrenberger School,2,88,00350258,,452,44.80
|
||||
Boston,Patrick Lyndon K-8 School,2,65,00350262,,304,52.50
|
||||
Boston,Patrick Kennedy Elementary School,2,60,00350264,,108,26.20
|
||||
Boston,Dr. William W. Henderson K-12 Inclusion School,2,49,00350266,,0,21.80
|
||||
Boston,Paul A. Dever Elementary School,2,28,00350268,,121,39.40
|
||||
Boston,Phineas Bates Elementary School,2,4,00350278,,69,23.40
|
||||
Boston,Josiah Quincy Elementary School,2,94,00350286,,245,65.70
|
||||
Boston,Josiah Quincy Upper School,2,95,00350565,,535,48.70
|
||||
Boston,Clap Elementary School,2,21,00350298,,47,13.40
|
||||
Boston,Samuel Adams Elementary School,2,1,00350302,,79,28.40
|
||||
Boston,Samuel Mason Elementary School,2,70,00350304,,64,28.30
|
||||
Boston,Sarah Greenwood K-8 School,2,43,00350308,,183,35.60
|
||||
Boston,Gardner Pilot Academy,2,41,00350326,,199,31.60
|
||||
Boston,Thomas J. Kenny Elementary School,2,61,00350328,,153,33.40
|
||||
Boston,Warren/Prescott K-8 School,2,112,00350346,,236,48.10
|
||||
Boston,William E. Channing Elementary School,2,18,00350360,,69,23.70
|
||||
Boston,William McKinley School,2,78,00350363,,252,58.50
|
||||
Boston,William E. Russell Elementary School,2,97,00350366,,87,34.40
|
||||
Boston,William Monroe Trotter K-8 School,2,105,00350370,,165,31.80
|
||||
Boston,F. Lyman Winship Elementary School,2,114,00350374,,32,23.00
|
||||
Boston,Thomas Edison K-8 School,2,32,00350375,,278,57.30
|
||||
Boston,"Martin Luther King, Jr. K-8 School",2,63,00350376,,231,55.70
|
||||
Boston,Higginson-Lewis School,2,52,00350377,,190,27.40
|
||||
Boston,Mildred Avenue K-8 School,2,80,00350378,,464,55.90
|
||||
Boston,Young Achievers Science and Math K-8 School,2,116,00350380,,314,54.50
|
||||
Boston,Mission Hill K-8 School,2,81,00350382,,107,24.50
|
||||
Boston,Lilla G. Frederick Middle School,2,40,00350383,,381,40.30
|
||||
Boston,Blackstone Innovation School,2,6,00350390,,156,55.70
|
||||
Boston,Clarence R. Edwards Middle School,2,33,00350430,,206,25.80
|
||||
Boston,Washington Irving Middle School,2,56,00350445,,184,27.80
|
||||
Boston,James P. Timilty Middle School,2,103,00350485,,233,31.70
|
||||
Boston,Brighton High School,2,16,00350505,,402,49.80
|
||||
Boston,Boston International Newcomers Academy,2,11,00350507,,398,54.10
|
||||
Boston,Charlestown High School,2,19,00350515,,785,95.10
|
||||
Boston,Community Academy,2,22,00350518,,51,12.70
|
||||
Boston,Excel High School,2,38,00350522,,471,49.90
|
||||
Boston,Jeremiah E. Burke High School,2,17,00350525,,390,34.90
|
||||
Boston,East Boston High School,2,31,00350530,,1055,89.60
|
||||
Boston,English High School,2,36,00350535,,518,58.10
|
||||
Boston,Madison Park Technical Vocational High School,2,68,00350537,,1043,128.10
|
||||
Boston,Fenway High School,2,39,00350540,,388,37.30
|
||||
Boston,Another Course to College,2,3,00350541,,236,25.00
|
||||
Boston,New Mission High School,2,85,00350542,,481,44.90
|
||||
Boston,Greater Egleston High School,2,42,00350543,,114,10.70
|
||||
Boston,Boston Latin Academy,2,12,00350545,,1787,94.00
|
||||
Boston,Boston Arts Academy,2,7,00350546,,482,53.00
|
||||
Boston,Margarita Muniz Academy,2,83,00350549,,315,27.70
|
||||
Boston,Boston Community Leadership Academy,2,8,00350558,,478,44.60
|
||||
Boston,Boston Latin School,2,13,00350560,,2483,126.00
|
||||
Boston,John D. O'Bryant School of Mathematics and Science,2,86,00350575,,1624,110.20
|
||||
Boston,Urban Science Academy,2,111,00350579,,#N/A,#N/A
|
||||
Boston,Community Academy of Science and Health,2,23,00350581,,334,41.20
|
||||
Boston,Mary Lyon High School,2,67,00350655,,137,16.60
|
||||
Boston,Mario Umana Academy,2,107,00350656,,500,64.00
|
||||
Boston,TechBoston Academy,2,102,00350657,,901,95.00
|
||||
Boston,West Roxbury Academy,2,113,00350658,,#N/A,#N/A
|
||||
Boston,Snowden International School at Copley,2,99,00350690,,483,44.00
|
||||
Boston,Rafael Hernandez K-8 School,2,51,00350691,,177,28.30
|
||||
Boston,Horace Mann School for the Deaf and Hard of Hearing,2,54,00350750,,50,35.50
|
||||
Boston,Boston Collaborative High School,2,29,00350755,,160,15.30
|
||||
Boston,Boston Adult Technical Academy ,2,118,00351002,,#N/A,#N/A
|
||||
Boston,Boston Day and Evening Academy,2,9,00441006,,#N/A,#N/A
|
||||
Lowell,Cardinal O'Connell Alternative School,3,3,01600001,,0,9.00
|
||||
Lowell,Bailey Elementary School,3,1,01600002,,90,35.00
|
||||
Lowell,STEM Academy at the Rogers School,3,20,01600005,,510,59.00
|
||||
Lowell,McAvinnue Elementary School,3,10,01600010,,86,39.00
|
||||
Lowell,Greenhalge Elementary School,3,5,01600015,,88,37.00
|
||||
Lowell,Pyne Arts School,3,15,01600018,,264,38.20
|
||||
Lowell,Abraham Lincoln Elementary School,3,52,01600020,,90,39.00
|
||||
Revere,Lincoln Elementary School,4,5,02480025,,175,39.10
|
||||
Winchester,Lincoln Elementary School,6,2,03440005,,157,30.20
|
||||
Lowell,Moody Elementary School,3,11,01600027,,43,17.80
|
||||
Lowell,Morey Elementary School,3,12,01600030,,88,37.00
|
||||
Lowell,Pawtucketville Memorial Elementary School,3,14,01600036,,91,34.00
|
||||
Lowell,Reilly Elementary School,3,16,01600040,,89,32.20
|
||||
Lowell,Shaughnessy Elementary School,3,19,01600050,,92,38.00
|
||||
Lowell,Washington Elementary School,3,25,01600055,,46,23.00
|
||||
Lowell,McAuliffe Elementary School,3,9,01600075,,91,37.00
|
||||
Lowell,Murkland Elementary School,3,13,01600080,,87,35.00
|
||||
Lowell,Laura Lee Therapeutic Day School,3,6,01600085,,23,6.80
|
||||
Lowell,Bartlett Community Partnership School,3,26,01600090,,256,40.80
|
||||
Lowell,Butler Middle School,3,2,01600310,,550,42.40
|
||||
Lowell,Daley Middle School,3,4,01600315,,691,50.20
|
||||
Lowell,LeBlanc Therapeutic Day School,3,7,01600320,,36,7.30
|
||||
Lowell,Robinson Middle School,3,18,01600330,,658,45.40
|
||||
Lowell,Sullivan Middle School,3,22,01600340,,641,47.00
|
||||
Lowell,Wang Middle School,3,24,01600345,,668,46.00
|
||||
Lowell,Stoklosa Middle School,3,21,01600360,,656,53.60
|
||||
Lowell,Lowell High School,3,8,01600505,,3048,212.90
|
||||
Lowell,The Career Academy,3,23,01600515,,94,9.90
|
||||
Lowell,Adie Day School,3,51,01600605,,32,11.00
|
||||
Lowell,Riverside School,3,17,01600920,,#N/A,#N/A
|
||||
Milford,Memorial Elementary School,7,4,01850010,,0,38.40
|
||||
Milford,Brookside Elementary School,7,3,01850065,,0,39.40
|
||||
Milford,Shining Star Early Childhood Center,7,5,01850075,,0,7.60
|
||||
Milford,Woodland Elementary School,7,1,01850090,,656,81.20
|
||||
Milford,Stacy Middle School,7,26,01850305,,1032,76.40
|
||||
Milford,Milford High School,7,2,01850505,,1257,95.20
|
||||
Revere,Whelan Elementary School,4,7,02480003,,256,53.50
|
||||
Revere,Beachmont Elementary School,4,1,02480013,,97,29.00
|
||||
Revere,Rumney Marsh Academy,4,9,02480014,,600,50.50
|
||||
Revere,Hill Elementary School,4,4,02480035,,237,47.50
|
||||
Revere,Paul Revere Elementary School,4,6,02480050,,159,41.50
|
||||
Revere,Garfield Elementary School,4,2,02480056,,201,57.80
|
||||
Revere,Garfield Middle School,4,3,02480057,,568,44.90
|
||||
Revere,Susan B. Anthony Middle School,4,8,02480305,,575,49.00
|
||||
Revere,Revere High School,4,10,02480505,,1978,135.60
|
||||
Revere,Seacoast High School,4,11,02480520,,81,12.80
|
||||
Somerville,Michael E. Capuano Early Childhood Center,5,12,02740005,,0,23.30
|
||||
Somerville,Benjamin G. Brown School,5,2,02740015,,78,15.80
|
||||
Somerville,Arthur D. Healey School,5,1,02740075,,235,42.80
|
||||
Somerville,Dr. Albert F. Argenziano School at Lincoln Park,5,3,02740087,,290,45.70
|
||||
Somerville,East Somerville Community School,5,4,02740111,,392,54.20
|
||||
Somerville,West Somerville Neighborhood School,5,9,02740115,,193,29.30
|
||||
Somerville,Winter Hill Community Innovation School,5,10,02740120,,230,46.70
|
||||
Somerville,Somerville High School,5,8,02740505,,1215,113.20
|
||||
Somerville,Next Wave/Full Circle,5,5,02740510,,56,10.70
|
||||
Wareham,John William Decas Elementary School,8,1,03100003,,0,48.50
|
||||
Wareham,Minot Forest Elementary School,8,2,03100017,,134,25.70
|
||||
Wareham,Wareham Middle School,8,3,03100305,,533,36.00
|
||||
Wareham,Wareham Cooperative Alternative School,8,8,03100315,,33,2.60
|
||||
Wareham,Wareham High School,8,4,03100505,,585,59.20
|
||||
Winchester,Lynch Elementary School,6,3,03440020,,158,43.20
|
||||
Winchester,Vinson-Owen Elementary School,6,5,03440025,,136,36.30
|
||||
Winchester,Muraco Elementary School,6,4,03440040,,136,25.30
|
||||
Winchester,Ambrose Elementary School,6,1,03440045,,130,30.20
|
||||
Winchester,McCall Middle School,6,6,03440305,,1084,85.30
|
||||
Winchester,Winchester High School,6,7,03440505,,1403,98.20
|
||||
Boston,Dudley Street Neighborhood Charter School,2,30,04070405,,77,10.30
|
||||
Boston,Boston Green Academy,2,10,04110305,,509,57.50
|
||||
Boston,UP Academy Boston,2,108,04800405,,349,35.30
|
||||
Boston,UP Academy Dorchester,2,109,35050405,,354,45.70
|
||||
District,School Name,District Code,School Code,DESE School ID,School Closed In ,Total Students for Response Rate (2020-21),Total Teachers for Response Rate (2020-21)
|
||||
Attleboro,A. Irvin Studley Elementary School,1,7,00160001,,75,26.90
|
||||
Attleboro,Thomas Willett Elementary School,1,9,00160035,,70,26.40
|
||||
Attleboro,Hyman Fine Elementary School,1,6,00160040,,86,31.50
|
||||
Attleboro,Hill-Roberts Elementary School,1,5,00160045,,97,28.10
|
||||
Attleboro,Peter Thacher Elementary School,1,8,00160050,,94,34.60
|
||||
Attleboro,Robert J. Coelho Middle School,1,3,00160305,,633,38.80
|
||||
Attleboro,Cyril K. Brennan Middle School,1,2,00160315,,620,41.30
|
||||
Attleboro,Wamsutta Middle School,1,4,00160320,,578,37.00
|
||||
Attleboro,Attleboro High School,1,1,00160505,,1792,114.70
|
||||
Boston,Lee Academy,2,,00350001,,0,19.20
|
||||
Boston,Baldwin Early Learning Pilot Academy ,2,117,00350003,,0,15.00
|
||||
Boston,Mary Lyon K-8 School,2,66,00350004,,76,17.40
|
||||
Boston,West Zone Early Learning Center ,2,123,00350006,,0,12.00
|
||||
Boston,Ellison/Parks Early Education School,2,120,00350008,,0,21.00
|
||||
Boston,East Boston Early Education Center ,2,119,00350009,,0,19.30
|
||||
Boston,Haynes Early Education Center ,2,121,00350010,,0,16.50
|
||||
Boston,Boston Teachers Union K-8 School,2,14,00350012,,157,20.20
|
||||
Boston,Jackson/Mann K-8 School,2,57,00350013,,235,53.30
|
||||
Boston,Pauline A. Shaw Elementary School,2,98,00350014,,0,15.50
|
||||
Boston,Curley K-8 School,2,26,00350020,,474,100.30
|
||||
Boston,Ludwig van Beethoven Elementary School,2,5,00350021,,0,24.50
|
||||
Boston,William E. Carter School,2,124,00350036,,27,2.00
|
||||
Boston,Charles Sumner Elementary School,2,100,00350052,,145,42.30
|
||||
Boston,Charles H. Taylor Elementary School,2,101,00350054,,111,37.00
|
||||
Boston,Curtis Guild Elementary School,2,45,00350062,,101,29.30
|
||||
Boston,Dante Alghieri Montessori School,2,2,00350066,,28,10.30
|
||||
Boston,David A. Ellis Elementary School,2,35,00350072,,113,37.60
|
||||
Boston,Henry Dearborn STEM Academy,2,27,00350074,,578,52.50
|
||||
Boston,Dennis Haley K-8 School,2,47,00350077,,199,45.70
|
||||
Boston,Donald McKay K-8 School,2,73,00350080,,452,70.10
|
||||
Boston,Edward Everett Elementary School,2,37,00350088,,123,23.00
|
||||
Boston,John Eliot K-8 School,2,34,00350096,,386,57.40
|
||||
Boston,Ellis Mendell School,2,79,00350100,,82,26.50
|
||||
Boston,Franklin D. Roosevelt K-8 School,2,96,00350116,,222,36.80
|
||||
Boston,George H. Conley Elementary School,2,25,00350122,,96,22.80
|
||||
Boston,Edward M. Kennedy Academy for Health Careers,2,58,04520505,,385,36.30
|
||||
Boston,Henry Grew Elementary School,2,44,00350135,,67,17.80
|
||||
Boston,Oliver Wendell Holmes Elementary School,2,53,00350138,,81,31.90
|
||||
Boston,Hugh R. O'Donnell Elementary School,2,87,00350141,,99,24.50
|
||||
Boston,James F. Condon K-8 School,2,24,00350146,,419,64.20
|
||||
Boston,James W. Hennigan K-8 School,2,50,00350153,,366,49.80
|
||||
Boston,James J. Chittick Elementary School,2,20,00350154,,71,34.20
|
||||
Boston,James Otis Elementary School,2,90,00350156,,136,36.60
|
||||
Boston,John F. Kennedy Elementary School,2,59,00350166,,115,27.10
|
||||
Somerville,John F. Kennedy Elementary School,5,6,02740083,,251,36.60
|
||||
Boston,UP Academy Holland,2,110,00350167,,216,48.50
|
||||
Boston,John D. Philbrick Elementary School,2,93,00350172,,33,14.90
|
||||
Boston,John W. McCormack Middle School,2,72,00350179,,250,26.50
|
||||
Boston,John Winthrop Elementary School,2,115,00350180,,56,27.00
|
||||
Boston,Joseph P. Tynan Elementary School,2,106,00350181,,77,28.10
|
||||
Boston,Joseph Hurley K-8 School,2,55,00350182,,152,22.50
|
||||
Boston,Joseph Lee K-8 School,2,64,00350183,,320,65.90
|
||||
Boston,Joseph P. Manning Elementary School,2,69,00350184,,69,16.20
|
||||
Boston,Joyce Kilmer K-8 School,2,62,00350190,,210,43.00
|
||||
Boston,Harvard/Kent Elementary School,2,48,00350200,,156,45.20
|
||||
Boston,Manassah E. Bradley Elementary School,2,15,00350215,,105,21.70
|
||||
Boston,Mattahunt,2,122,00350226,,#N/A,#N/A
|
||||
Boston,Mather Elementary School,2,71,00350227,,152,45.40
|
||||
Boston,Maurice Tobin K-8 School,2,104,00350229,,229,35.80
|
||||
Boston,Michael J. Perkins Elementary School,2,91,00350231,,78,18.40
|
||||
Boston,Wolfgang A. Mozart Elementary School,2,82,00350237,,46,18.30
|
||||
Boston,Richard J. Murphy K-8 School,2,84,00350240,,556,70.10
|
||||
Boston,Nathan Hale Elementary School,2,46,00350243,,68,19.00
|
||||
Boston,Oliver Hazard Perry K-8 School,2,92,00350255,,81,23.70
|
||||
Boston,Orchard Gardens K-8 School,2,89,00350257,,452,74.10
|
||||
Boston,William Ohrenberger School,2,88,00350258,,452,44.80
|
||||
Boston,Patrick Lyndon K-8 School,2,65,00350262,,304,52.50
|
||||
Boston,Patrick Kennedy Elementary School,2,60,00350264,,108,26.20
|
||||
Boston,Dr. William W. Henderson K-12 Inclusion School,2,49,00350266,,0,21.80
|
||||
Boston,Paul A. Dever Elementary School,2,28,00350268,,121,39.40
|
||||
Boston,Phineas Bates Elementary School,2,4,00350278,,69,23.40
|
||||
Boston,Josiah Quincy Elementary School,2,94,00350286,,245,65.70
|
||||
Boston,Josiah Quincy Upper School,2,95,00350565,,535,48.70
|
||||
Boston,Clap Elementary School,2,21,00350298,,47,13.40
|
||||
Boston,Samuel Adams Elementary School,2,1,00350302,,79,28.40
|
||||
Boston,Samuel Mason Elementary School,2,70,00350304,,64,28.30
|
||||
Boston,Sarah Greenwood K-8 School,2,43,00350308,,183,35.60
|
||||
Boston,Gardner Pilot Academy,2,41,00350326,,199,31.60
|
||||
Boston,Thomas J. Kenny Elementary School,2,61,00350328,,153,33.40
|
||||
Boston,Warren/Prescott K-8 School,2,112,00350346,,236,48.10
|
||||
Boston,William E. Channing Elementary School,2,18,00350360,,69,23.70
|
||||
Boston,William McKinley School,2,78,00350363,,252,58.50
|
||||
Boston,William E. Russell Elementary School,2,97,00350366,,87,34.40
|
||||
Boston,William Monroe Trotter K-8 School,2,105,00350370,,165,31.80
|
||||
Boston,F. Lyman Winship Elementary School,2,114,00350374,,32,23.00
|
||||
Boston,Thomas Edison K-8 School,2,32,00350375,,278,57.30
|
||||
Boston,"Martin Luther King, Jr. K-8 School",2,63,00350376,,231,55.70
|
||||
Boston,Higginson-Lewis School,2,52,00350377,,190,27.40
|
||||
Boston,Mildred Avenue K-8 School,2,80,00350378,,464,55.90
|
||||
Boston,Young Achievers Science and Math K-8 School,2,116,00350380,,314,54.50
|
||||
Boston,Mission Hill K-8 School,2,81,00350382,,107,24.50
|
||||
Boston,Lilla G. Frederick Middle School,2,40,00350383,,381,40.30
|
||||
Boston,Blackstone Innovation School,2,6,00350390,,156,55.70
|
||||
Boston,Clarence R. Edwards Middle School,2,33,00350430,,206,25.80
|
||||
Boston,Washington Irving Middle School,2,56,00350445,,184,27.80
|
||||
Boston,James P. Timilty Middle School,2,103,00350485,,233,31.70
|
||||
Boston,Brighton High School,2,16,00350505,,402,49.80
|
||||
Boston,Boston International Newcomers Academy,2,11,00350507,,398,54.10
|
||||
Boston,Charlestown High School,2,19,00350515,,785,95.10
|
||||
Boston,Community Academy,2,22,00350518,,51,12.70
|
||||
Boston,Excel High School,2,38,00350522,,471,49.90
|
||||
Boston,Jeremiah E. Burke High School,2,17,00350525,,390,34.90
|
||||
Boston,East Boston High School,2,31,00350530,,1055,89.60
|
||||
Boston,English High School,2,36,00350535,,518,58.10
|
||||
Boston,Madison Park Technical Vocational High School,2,68,00350537,,1043,128.10
|
||||
Boston,Fenway High School,2,39,00350540,,388,37.30
|
||||
Boston,Another Course to College,2,3,00350541,,236,25.00
|
||||
Boston,New Mission High School,2,85,00350542,,481,44.90
|
||||
Boston,Greater Egleston High School,2,42,00350543,,114,10.70
|
||||
Boston,Boston Latin Academy,2,12,00350545,,1787,94.00
|
||||
Boston,Boston Arts Academy,2,7,00350546,,482,53.00
|
||||
Boston,Margarita Muniz Academy,2,83,00350549,,315,27.70
|
||||
Boston,Boston Community Leadership Academy,2,8,00350558,,478,44.60
|
||||
Boston,Boston Latin School,2,13,00350560,,2483,126.00
|
||||
Boston,John D. O'Bryant School of Mathematics and Science,2,86,00350575,,1624,110.20
|
||||
Boston,Urban Science Academy,2,111,00350579,,#N/A,#N/A
|
||||
Boston,Community Academy of Science and Health,2,23,00350581,,334,41.20
|
||||
Boston,Mary Lyon High School,2,67,00350655,,137,16.60
|
||||
Boston,Mario Umana Academy,2,107,00350656,,500,64.00
|
||||
Boston,TechBoston Academy,2,102,00350657,,901,95.00
|
||||
Boston,West Roxbury Academy,2,113,00350658,,#N/A,#N/A
|
||||
Boston,Snowden International School at Copley,2,99,00350690,,483,44.00
|
||||
Boston,Rafael Hernandez K-8 School,2,51,00350691,,177,28.30
|
||||
Boston,Horace Mann School for the Deaf and Hard of Hearing,2,54,00350750,,50,35.50
|
||||
Boston,Boston Collaborative High School,2,29,00350755,,160,15.30
|
||||
Boston,Boston Adult Technical Academy ,2,118,00351002,,#N/A,#N/A
|
||||
Boston,Boston Day and Evening Academy,2,9,00441006,,#N/A,#N/A
|
||||
Lowell,Cardinal O'Connell Alternative School,3,3,01600001,,0,9.00
|
||||
Lowell,Bailey Elementary School,3,1,01600002,,90,35.00
|
||||
Lowell,STEM Academy at the Rogers School,3,20,01600005,,510,59.00
|
||||
Lowell,McAvinnue Elementary School,3,10,01600010,,86,39.00
|
||||
Lowell,Greenhalge Elementary School,3,5,01600015,,88,37.00
|
||||
Lowell,Pyne Arts School,3,15,01600018,,264,38.20
|
||||
Lowell,Abraham Lincoln Elementary School,3,52,01600020,,90,39.00
|
||||
Revere,Lincoln Elementary School,4,5,02480025,,175,39.10
|
||||
Winchester,Lincoln Elementary School,6,2,03440005,,157,30.20
|
||||
Lowell,Moody Elementary School,3,11,01600027,,43,17.80
|
||||
Lowell,Morey Elementary School,3,12,01600030,,88,37.00
|
||||
Lowell,Pawtucketville Memorial Elementary School,3,14,01600036,,91,34.00
|
||||
Lowell,Reilly Elementary School,3,16,01600040,,89,32.20
|
||||
Lowell,Shaughnessy Elementary School,3,19,01600050,,92,38.00
|
||||
Lowell,Washington Elementary School,3,25,01600055,,46,23.00
|
||||
Lowell,McAuliffe Elementary School,3,9,01600075,,91,37.00
|
||||
Lowell,Murkland Elementary School,3,13,01600080,,87,35.00
|
||||
Lowell,Laura Lee Therapeutic Day School,3,6,01600085,,23,6.80
|
||||
Lowell,Bartlett Community Partnership School,3,26,01600090,,256,40.80
|
||||
Lowell,Butler Middle School,3,2,01600310,,550,42.40
|
||||
Lowell,Daley Middle School,3,4,01600315,,691,50.20
|
||||
Lowell,LeBlanc Therapeutic Day School,3,7,01600320,,36,7.30
|
||||
Lowell,Robinson Middle School,3,18,01600330,,658,45.40
|
||||
Lowell,Sullivan Middle School,3,22,01600340,,641,47.00
|
||||
Lowell,Wang Middle School,3,24,01600345,,668,46.00
|
||||
Lowell,Stoklosa Middle School,3,21,01600360,,656,53.60
|
||||
Lowell,Lowell High School,3,8,01600505,,3048,212.90
|
||||
Lowell,The Career Academy,3,23,01600515,,94,9.90
|
||||
Lowell,Adie Day School,3,51,01600605,,32,11.00
|
||||
Lowell,Riverside School,3,17,01600920,,#N/A,#N/A
|
||||
Milford,Memorial Elementary School,7,4,01850010,,0,38.40
|
||||
Milford,Brookside Elementary School,7,3,01850065,,0,39.40
|
||||
Milford,Shining Star Early Childhood Center,7,5,01850075,,0,7.60
|
||||
Milford,Woodland Elementary School,7,1,01850090,,656,81.20
|
||||
Milford,Stacy Middle School,7,26,01850305,,1032,76.40
|
||||
Milford,Milford High School,7,2,01850505,,1257,95.20
|
||||
Revere,Whelan Elementary School,4,7,02480003,,256,53.50
|
||||
Revere,Beachmont Elementary School,4,1,02480013,,97,29.00
|
||||
Revere,Rumney Marsh Academy,4,9,02480014,,600,50.50
|
||||
Revere,Hill Elementary School,4,4,02480035,,237,47.50
|
||||
Revere,Paul Revere Elementary School,4,6,02480050,,159,41.50
|
||||
Revere,Garfield Elementary School,4,2,02480056,,201,57.80
|
||||
Revere,Garfield Middle School,4,3,02480057,,568,44.90
|
||||
Revere,Susan B. Anthony Middle School,4,8,02480305,,575,49.00
|
||||
Revere,Revere High School,4,10,02480505,,1978,135.60
|
||||
Revere,Seacoast High School,4,11,02480520,,81,12.80
|
||||
Somerville,Michael E. Capuano Early Childhood Center,5,12,02740005,,0,23.30
|
||||
Somerville,Benjamin G. Brown School,5,2,02740015,,78,15.80
|
||||
Somerville,Arthur D. Healey School,5,1,02740075,,235,42.80
|
||||
Somerville,Dr. Albert F. Argenziano School at Lincoln Park,5,3,02740087,,290,45.70
|
||||
Somerville,East Somerville Community School,5,4,02740111,,392,54.20
|
||||
Somerville,West Somerville Neighborhood School,5,9,02740115,,193,29.30
|
||||
Somerville,Winter Hill Community Innovation School,5,10,02740120,,230,46.70
|
||||
Somerville,Somerville High School,5,8,02740505,,1215,113.20
|
||||
Somerville,Next Wave/Full Circle,5,5,02740510,,56,10.70
|
||||
Wareham,John William Decas Elementary School,8,1,03100003,,0,48.50
|
||||
Wareham,Minot Forest Elementary School,8,2,03100017,,134,25.70
|
||||
Wareham,Wareham Middle School,8,3,03100305,,533,36.00
|
||||
Wareham,Wareham Cooperative Alternative School,8,8,03100315,,33,2.60
|
||||
Wareham,Wareham High School,8,4,03100505,,585,59.20
|
||||
Winchester,Lynch Elementary School,6,3,03440020,,158,43.20
|
||||
Winchester,Vinson-Owen Elementary School,6,5,03440025,,136,36.30
|
||||
Winchester,Muraco Elementary School,6,4,03440040,,136,25.30
|
||||
Winchester,Ambrose Elementary School,6,1,03440045,,130,30.20
|
||||
Winchester,McCall Middle School,6,6,03440305,,1084,85.30
|
||||
Winchester,Winchester High School,6,7,03440505,,1403,98.20
|
||||
Boston,Dudley Street Neighborhood Charter School,2,30,04070405,,77,10.30
|
||||
Boston,Boston Green Academy,2,10,04110305,,509,57.50
|
||||
Boston,UP Academy Boston,2,108,04800405,,349,35.30
|
||||
Boston,UP Academy Dorchester,2,109,35050405,,354,45.70
|
||||
|
12
db/migrate/20220124144902_create_respondents.rb
Normal file
12
db/migrate/20220124144902_create_respondents.rb
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
class CreateRespondents < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_table :respondents do |t|
|
||||
t.references :school, null: false, foreign_key: true
|
||||
t.references :academic_year, null: false, foreign_key: true
|
||||
t.float :total_students
|
||||
t.float :total_teachers
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
15
db/schema.rb
15
db/schema.rb
|
|
@ -10,7 +10,7 @@
|
|||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2021_12_17_164449) do
|
||||
ActiveRecord::Schema.define(version: 2022_01_24_144902) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
|
|
@ -272,6 +272,17 @@ ActiveRecord::Schema.define(version: 2021_12_17_164449) do
|
|||
t.index ["subcategory_id"], name: "index_measures_on_subcategory_id"
|
||||
end
|
||||
|
||||
create_table "respondents", force: :cascade do |t|
|
||||
t.bigint "school_id", null: false
|
||||
t.bigint "academic_year_id", null: false
|
||||
t.float "total_students"
|
||||
t.float "total_teachers"
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["academic_year_id"], name: "index_respondents_on_academic_year_id"
|
||||
t.index ["school_id"], name: "index_respondents_on_school_id"
|
||||
end
|
||||
|
||||
create_table "schools", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.integer "district_id"
|
||||
|
|
@ -327,6 +338,8 @@ ActiveRecord::Schema.define(version: 2021_12_17_164449) do
|
|||
add_foreign_key "legacy_school_categories", "legacy_categories", column: "category_id"
|
||||
add_foreign_key "legacy_school_categories", "legacy_schools", column: "school_id"
|
||||
add_foreign_key "measures", "subcategories"
|
||||
add_foreign_key "respondents", "academic_years"
|
||||
add_foreign_key "respondents", "schools"
|
||||
add_foreign_key "subcategories", "categories"
|
||||
add_foreign_key "survey_item_responses", "academic_years"
|
||||
add_foreign_key "survey_item_responses", "schools"
|
||||
|
|
|
|||
|
|
@ -4,4 +4,5 @@ seeder = Seeder.new
|
|||
|
||||
seeder.seed_academic_years '2020-21', '2021-22'
|
||||
seeder.seed_districts_and_schools Rails.root.join('data', 'master_list_of_schools_and_districts.csv')
|
||||
seeder.seed_respondents Rails.root.join('data', 'master_list_of_schools_and_districts.csv')
|
||||
seeder.seed_sqm_framework Rails.root.join('data', 'sqm_framework.csv')
|
||||
|
|
|
|||
|
|
@ -86,4 +86,9 @@ FactoryBot.define do
|
|||
description { rand.to_s }
|
||||
measure
|
||||
end
|
||||
|
||||
factory :respondent do
|
||||
school
|
||||
academic_year
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
District,School Name,District Code,School Code,DESE School ID
|
||||
Attleboro,Attleboro High School,1,1,00160505
|
||||
Boston,Samuel Adams Elementary School,2,1,00350302
|
||||
District,School Name,District Code,School Code,DESE School ID,School Closed In ,Total Students for Response Rate (2020-21),Total Teachers for Response Rate (2020-21)
|
||||
Attleboro,Attleboro High School,1,1,00160505,,1792,114.70
|
||||
Boston,Samuel Adams Elementary School,2,1,00350302,,79,28.40
|
||||
|
|
|
|||
|
|
|
@ -41,7 +41,7 @@ describe Seeder do
|
|||
context 'when partial data already exists' do
|
||||
let!(:existing_district) { create(:district, name: 'Boston') }
|
||||
let!(:removed_school) do
|
||||
create(:school, name: 'John Oldes Academy', dese_id: 12_345, district: existing_district)
|
||||
create(:school, name: 'John Oldest Academy', dese_id: 12_345, district: existing_district)
|
||||
end
|
||||
let!(:removed_survey_item_response) { create(:survey_item_response, school: removed_school) }
|
||||
let!(:existing_school) do
|
||||
|
|
@ -87,6 +87,31 @@ describe Seeder do
|
|||
end
|
||||
end
|
||||
|
||||
context 'respondents' do
|
||||
before :each do
|
||||
create(:academic_year, range: '2020-21')
|
||||
seeder.seed_districts_and_schools sample_districts_and_schools_csv
|
||||
end
|
||||
|
||||
it 'seeds the total number of respondents for a school' do
|
||||
expect do
|
||||
seeder.seed_respondents sample_districts_and_schools_csv
|
||||
end.to change { Respondent.count }.by(2)
|
||||
end
|
||||
|
||||
it 'seeds idempotently' do
|
||||
expect do
|
||||
seeder.seed_respondents sample_districts_and_schools_csv
|
||||
end.to change { Respondent.count }.by(2)
|
||||
|
||||
expect(Respondent.all.count).to eq 2
|
||||
|
||||
expect do
|
||||
seeder.seed_respondents sample_districts_and_schools_csv
|
||||
end.to change { Respondent.count }.by(0)
|
||||
end
|
||||
end
|
||||
|
||||
context 'the sqm framework' do
|
||||
before do
|
||||
school_culture_category = create(:category, category_id: '2', sort_index: -1)
|
||||
|
|
|
|||
|
|
@ -27,10 +27,15 @@ describe SurveyItemResponse, type: :model do
|
|||
academic_year: ay).average).to eq 4
|
||||
end
|
||||
|
||||
it 'affirms that the result meets the threshold' do
|
||||
it 'affirms that the result meets the teacher threshold' do
|
||||
expect(SurveyItemResponse.score_for_measure(measure: measure, school: school,
|
||||
academic_year: ay).meets_teacher_threshold?).to be true
|
||||
end
|
||||
|
||||
it 'reports the result does not meeet student threshold' do
|
||||
expect(SurveyItemResponse.score_for_measure(measure: measure, school: school,
|
||||
academic_year: ay).meets_student_threshold?).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context "and the average number of responses across the measure's survey items meets the teacher threshold of 17" do
|
||||
|
|
@ -113,10 +118,14 @@ describe SurveyItemResponse, type: :model do
|
|||
academic_year: ay).average).to eq 4
|
||||
end
|
||||
|
||||
it 'affirms that the result meets the threshold' do
|
||||
it 'affirms that the result meets the student threshold' do
|
||||
expect(SurveyItemResponse.score_for_measure(measure: measure, school: school,
|
||||
academic_year: ay).meets_student_threshold?).to be true
|
||||
end
|
||||
it 'notes that the result does not meet the teacher threshold' do
|
||||
expect(SurveyItemResponse.score_for_measure(measure: measure, school: school,
|
||||
academic_year: ay).meets_teacher_threshold?).to be false
|
||||
end
|
||||
end
|
||||
|
||||
context "and the average number of responses across the measure's survey items meets the student threshold of 196" do
|
||||
|
|
@ -297,4 +306,61 @@ describe SurveyItemResponse, type: :model do
|
|||
academic_year: ay)).to eq 2.5
|
||||
end
|
||||
end
|
||||
|
||||
describe '.responses_for_measure' do
|
||||
let(:subcategory) { create(:subcategory) }
|
||||
let(:sufficient_measure_1) { create(:measure, subcategory: subcategory) }
|
||||
let(:sufficient_measure_2) { create(:measure, subcategory: subcategory) }
|
||||
let(:insufficient_measure) { create(:measure, subcategory: subcategory) }
|
||||
let(:sufficient_teacher_survey_item) { create(:teacher_survey_item, measure: sufficient_measure_1) }
|
||||
let(:insufficient_teacher_survey_item) { create(:teacher_survey_item, measure: insufficient_measure) }
|
||||
let(:sufficient_student_survey_item) { create(:student_survey_item, measure: sufficient_measure_2) }
|
||||
let(:insufficient_student_survey_item) { create(:student_survey_item, measure: insufficient_measure) }
|
||||
|
||||
before :each do
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: sufficient_teacher_survey_item,
|
||||
academic_year: ay, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD, survey_item: sufficient_student_survey_item,
|
||||
academic_year: ay, school: school, likert_score: 4)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD - 1,
|
||||
survey_item: insufficient_teacher_survey_item, academic_year: ay, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD - 1,
|
||||
survey_item: insufficient_student_survey_item, academic_year: ay, school: school, likert_score: 1)
|
||||
end
|
||||
|
||||
it 'returns only responses in a measure that meets the low threshold' do
|
||||
expect(SurveyItemResponse.responses_for_measure(measure: sufficient_measure_1, school: school, academic_year: ay).count).to eq SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD
|
||||
expect(SurveyItemResponse.responses_for_measure(measure: sufficient_measure_2, school: school, academic_year: ay).count).to eq SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD
|
||||
expect(SurveyItemResponse.responses_for_measure(measure: insufficient_measure, school: school, academic_year: ay)).to be nil
|
||||
end
|
||||
end
|
||||
|
||||
describe '.average_number_of_student_respondents' do
|
||||
let(:subcategory) { create(:subcategory) }
|
||||
let(:sufficient_measure_1) { create(:measure, subcategory: subcategory) }
|
||||
let(:sufficient_measure_2) { create(:measure, subcategory: subcategory) }
|
||||
let(:insufficient_measure) { create(:measure, subcategory: subcategory) }
|
||||
let(:sufficient_teacher_survey_item) { create(:teacher_survey_item, measure: sufficient_measure_1) }
|
||||
let(:sufficient_student_survey_item_1) { create(:student_survey_item, measure: sufficient_measure_1) }
|
||||
let(:insufficient_teacher_survey_item) { create(:teacher_survey_item, measure: insufficient_measure) }
|
||||
let(:sufficient_student_survey_item_2) { create(:student_survey_item, measure: sufficient_measure_2) }
|
||||
let(:insufficient_student_survey_item) { create(:student_survey_item, measure: insufficient_measure) }
|
||||
|
||||
before :each do
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: sufficient_teacher_survey_item,
|
||||
academic_year: ay, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD, survey_item: sufficient_student_survey_item_1,
|
||||
academic_year: ay, school: school, likert_score: 4)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD + 1, survey_item: sufficient_student_survey_item_2,
|
||||
academic_year: ay, school: school, likert_score: 4)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD - 1,
|
||||
survey_item: insufficient_teacher_survey_item, academic_year: ay, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD - 1,
|
||||
survey_item: insufficient_student_survey_item, academic_year: ay, school: school, likert_score: 1)
|
||||
end
|
||||
|
||||
it 'returns only responses in a measure that meets the low threshold' do
|
||||
expect(SurveyItemResponse.average_number_of_student_respondents(subcategory: subcategory, school: school, academic_year: ay)).to eq SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,22 +6,38 @@ describe SubcategoryPresenter do
|
|||
let(:subcategory) do
|
||||
create(:subcategory, name: 'A great subcategory', subcategory_id: 'A', description: 'A great description')
|
||||
end
|
||||
let(:survey_respondents) do
|
||||
create(:respondent, school: school, total_students: SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD, total_teachers: 10.0, academic_year: academic_year)
|
||||
end
|
||||
let(:subcategory_presenter) do
|
||||
survey_respondents
|
||||
measure1 = create(:measure, subcategory: subcategory)
|
||||
survey_item1 = create(:teacher_survey_item, measure: measure1, watch_low_benchmark: 4, growth_low_benchmark: 4.25,
|
||||
approval_low_benchmark: 4.5, ideal_low_benchmark: 4.75)
|
||||
survey_item2 = create(:student_survey_item, measure: measure1, watch_low_benchmark: 4, growth_low_benchmark: 4.25,
|
||||
approval_low_benchmark: 4.5, ideal_low_benchmark: 4.75)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item1,
|
||||
academic_year: academic_year, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item1,
|
||||
academic_year: academic_year, school: school, likert_score: 5)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD / 2, survey_item: survey_item2,
|
||||
academic_year: academic_year, school: school, likert_score: 3)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD / 2, survey_item: survey_item2,
|
||||
academic_year: academic_year, school: school, likert_score: 3)
|
||||
|
||||
measure2 = create(:measure, subcategory: subcategory)
|
||||
survey_item2 = create(:teacher_survey_item, measure: measure2, watch_low_benchmark: 1.25,
|
||||
survey_item3 = create(:teacher_survey_item, measure: measure2, watch_low_benchmark: 1.25,
|
||||
growth_low_benchmark: 1.5, approval_low_benchmark: 1.75, ideal_low_benchmark: 2.0)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item2,
|
||||
survey_item4 = create(:student_survey_item, measure: measure2, watch_low_benchmark: 1.25,
|
||||
growth_low_benchmark: 1.5, approval_low_benchmark: 1.75, ideal_low_benchmark: 2.0)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item3,
|
||||
academic_year: academic_year, school: school, likert_score: 1)
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item2,
|
||||
create_list(:survey_item_response, SurveyItemResponse::TEACHER_RESPONSE_THRESHOLD, survey_item: survey_item3,
|
||||
academic_year: academic_year, school: school, likert_score: 5)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD / 2, survey_item: survey_item4,
|
||||
academic_year: academic_year, school: school, likert_score: 3)
|
||||
create_list(:survey_item_response, SurveyItemResponse::STUDENT_RESPONSE_THRESHOLD / 2, survey_item: survey_item4,
|
||||
academic_year: academic_year, school: school, likert_score: 3)
|
||||
|
||||
measure_of_only_admin_data = create(:measure, subcategory: subcategory)
|
||||
create(:admin_data_item, measure: measure_of_only_admin_data, watch_low_benchmark: 2, growth_low_benchmark: 3,
|
||||
|
|
@ -49,6 +65,14 @@ describe SubcategoryPresenter do
|
|||
expect(subcategory_presenter.gauge_presenter.title).to eq 'Growth'
|
||||
end
|
||||
|
||||
it 'returns the student response rate' do
|
||||
expect(subcategory_presenter.student_response_rate).to eq 100.0
|
||||
end
|
||||
|
||||
# it 'returns the teacher response rate' do
|
||||
# expect(subcategory_presenter.teacher_response_rate).to eq 20.0
|
||||
# end
|
||||
|
||||
it 'creates a measure presenter for each measure in a subcategory' do
|
||||
expect(subcategory_presenter.measure_presenters.count).to eq subcategory.measures.count
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue