diff --git a/app/models/admin_data_item.rb b/app/models/admin_data_item.rb index 1898ff90..43ea3a20 100644 --- a/app/models/admin_data_item.rb +++ b/app/models/admin_data_item.rb @@ -1,5 +1,6 @@ class AdminDataItem < ActiveRecord::Base belongs_to :scale + has_many :admin_data_values scope :for_measures, lambda { |measures| joins(:scale).where('scale.measure': measures) diff --git a/app/models/admin_data_value.rb b/app/models/admin_data_value.rb new file mode 100644 index 00000000..241fe31e --- /dev/null +++ b/app/models/admin_data_value.rb @@ -0,0 +1,5 @@ +class AdminDataValue < ApplicationRecord + belongs_to :school + belongs_to :admin_data_item + belongs_to :academic_year +end diff --git a/app/models/measure.rb b/app/models/measure.rb index 4772e064..394262cc 100644 --- a/app/models/measure.rb +++ b/app/models/measure.rb @@ -49,12 +49,25 @@ class Measure < ActiveRecord::Base @score ||= Hash.new do |memo| meets_student_threshold = sufficient_student_data?(school:, academic_year:) meets_teacher_threshold = sufficient_teacher_data?(school:, academic_year:) - next Score.new(nil, false, false) if !meets_student_threshold && !meets_teacher_threshold + lacks_sufficient_data = !meets_student_threshold && !meets_teacher_threshold && !includes_admin_data_items? + + next Score.new(nil, false, false) if lacks_sufficient_data scores = [] scores << teacher_scales.map { |scale| scale.score(school:, academic_year:) }.average if meets_teacher_threshold scores << student_scales.map { |scale| scale.score(school:, academic_year:) }.average if meets_student_threshold - memo[[school, academic_year]] = Score.new(scores.average, meets_teacher_threshold, meets_student_threshold) + if includes_admin_data_items? + scores << admin_data_items.map do |admin_data_item| + admin_value = admin_data_item.admin_data_values.where(school:, academic_year:).first + admin_value.likert_score if admin_value.present? + end + end + average = scores.flatten.compact.average + + next Score.new(nil, false, false) if average.nan? + + memo[[school, academic_year]] = + Score.new(average, meets_teacher_threshold, meets_student_threshold) end @score[[school, academic_year]] diff --git a/app/services/admin_data_loader.rb b/app/services/admin_data_loader.rb new file mode 100644 index 00000000..947fd3a2 --- /dev/null +++ b/app/services/admin_data_loader.rb @@ -0,0 +1,22 @@ +require 'csv' + +class AdminDataLoader + def self.load_data(filepath:) + CSV.parse(File.read(filepath), headers: true) do |row| + likert_score = row['LikertScore'] || row['Likert Score'] || row['Likert_Score'] + likert_score = likert_score.to_f + likert_score = 1 if likert_score > 0 && likert_score < 1 + next if likert_score == 0 + + ay = row['Academic Year'] || row['AcademicYear'] + dese_id = row['DESE ID'] || row['Dese ID'] || row['Dese Id'] + admin_data_item_id = row['Item ID'] || row['Item Id'] + admin_data_value = AdminDataValue.new + admin_data_value.likert_score = likert_score + admin_data_value.academic_year = AcademicYear.find_by_range ay + admin_data_value.school = School.find_by_dese_id dese_id.to_i + admin_data_value.admin_data_item = AdminDataItem.find_by_admin_data_item_id admin_data_item_id + admin_data_value.save! + end + end +end diff --git a/data/admin_data/2018-19_admin_data.csv b/data/admin_data/2018-19_admin_data.csv new file mode 100644 index 00000000..786c7c62 --- /dev/null +++ b/data/admin_data/2018-19_admin_data.csv @@ -0,0 +1,316 @@ +District,School,DESE ID,Category,Item ID,NonLikert Title,NL_Value,LikertScore,Benchmark,Data Type,Academic Year +Attleboro,Attleboro High School,160505,2-C-i,a-vale-i1,Chronic absence rate,19.7,3.03,10,%,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,2-C-i,a-vale-i1,Chronic absence rate,9.6,4.04,10,%,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,2-C-i,a-vale-i1,Chronic absence rate,11,3.9,10,%,2018-19 +Attleboro,Hyman Fine Elementary School,160040,2-C-i,a-vale-i1,Chronic absence rate,3.4,4.66,10,%,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,2-C-i,a-vale-i1,Chronic absence rate,8.2,4.18,10,%,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,2-C-i,a-vale-i1,Chronic absence rate,8.1,4.19,10,%,2018-19 +Attleboro,Peter Thacher Elementary School,160050,2-C-i,a-vale-i1,Chronic absence rate,13,3.7,10,%,2018-19 +Attleboro,Wamsutta Middle School,160320,2-C-i,a-vale-i1,Chronic absence rate,8.7,4.13,10,%,2018-19 +Attleboro,Thomas Willett Elementary School,160035,2-C-i,a-vale-i1,Chronic absence rate,6,4.4,10,%,2018-19 +Milford,Brookside Elementary School,1850065,2-C-i,a-vale-i1,Chronic absence rate,12.1,3.79,10,%,2018-19 +Milford,Memorial Elementary School,1850010,2-C-i,a-vale-i1,Chronic absence rate,11.5,3.85,10,%,2018-19 +Milford,Milford High School,1850505,2-C-i,a-vale-i1,Chronic absence rate,21.9,2.81,10,%,2018-19 +Milford,Shining Star Early Childhood Center,1850075,2-C-i,a-vale-i1,Chronic absence rate,30.5,1.95,10,%,2018-19 +Milford,Stacy Middle School,1850305,2-C-i,a-vale-i1,Chronic absence rate,12.7,3.73,10,%,2018-19 +Milford,Woodland Elementary School,1850090,2-C-i,a-vale-i1,Chronic absence rate,6.8,4.32,10,%,2018-19 +Revere,Beachmont Elementary School,2480013,2-C-i,a-vale-i1,Chronic absence rate,4.2,4.58,10,%,2018-19 +Revere,Garfield Elementary School,2480056,2-C-i,a-vale-i1,Chronic absence rate,9.3,4.07,10,%,2018-19 +Revere,Garfield Middle School,2480057,2-C-i,a-vale-i1,Chronic absence rate,8.5,4.15,10,%,2018-19 +Revere,Hill Elementary School,2480035,2-C-i,a-vale-i1,Chronic absence rate,3.3,4.67,10,%,2018-19 +Revere,Lincoln Elementary School,2480025,2-C-i,a-vale-i1,Chronic absence rate,7.9,4.21,10,%,2018-19 +Revere,Paul Revere Elementary School,2480050,2-C-i,a-vale-i1,Chronic absence rate,10.1,3.99,10,%,2018-19 +Revere,Revere High School,2480505,2-C-i,a-vale-i1,Chronic absence rate,13.8,3.62,10,%,2018-19 +Revere,Rumney Marsh Academy,2480014,2-C-i,a-vale-i1,Chronic absence rate,5,4.5,10,%,2018-19 +Revere,SeaCoast High School,2480520,2-C-i,a-vale-i1,Chronic absence rate,76.9,0,10,%,2018-19 +Revere,Susan B. Anthony Middle School,2480305,2-C-i,a-vale-i1,Chronic absence rate,8.1,4.19,10,%,2018-19 +Revere,Whelan Elementary School,2480003,2-C-i,a-vale-i1,Chronic absence rate,5.9,4.41,10,%,2018-19 +Winchester,Ambrose Elementary School,3440045,2-C-i,a-vale-i1,Chronic absence rate,3.8,4.62,10,%,2018-19 +Winchester,Lincoln Elementary School,2480025,2-C-i,a-vale-i1,Chronic absence rate,1.6,4.84,10,%,2018-19 +Winchester,Lynch Elementary School,3440020,2-C-i,a-vale-i1,Chronic absence rate,4,4.6,10,%,2018-19 +Winchester,McCall Middle School,3440305,2-C-i,a-vale-i1,Chronic absence rate,4.2,4.58,10,%,2018-19 +Winchester,Muraco Elementary School,3440040,2-C-i,a-vale-i1,Chronic absence rate,3.1,4.69,10,%,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,2-C-i,a-vale-i1,Chronic absence rate,4.2,4.58,10,%,2018-19 +Winchester,Winchester High School,3440505,2-C-i,a-vale-i1,Chronic absence rate,7.2,4.28,10,%,2018-19 +Attleboro,Attleboro High School,160505,3-A-i,a-reso-i1,Average class size,20.6,3.94,20,,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,3-A-i,a-reso-i1,Average class size,24.4,3.56,20,,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,3-A-i,a-reso-i1,Average class size,27,3.3,20,,2018-19 +Attleboro,Hyman Fine Elementary School,160040,3-A-i,a-reso-i1,Average class size,25.1,3.49,20,,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,3-A-i,a-reso-i1,Average class size,24,3.6,20,,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,3-A-i,a-reso-i1,Average class size,13.7,4.63,20,,2018-19 +Attleboro,Peter Thacher Elementary School,160050,3-A-i,a-reso-i1,Average class size,11.8,4.82,20,,2018-19 +Attleboro,Wamsutta Middle School,160320,3-A-i,a-reso-i1,Average class size,25.1,3.49,20,,2018-19 +Attleboro,Thomas Willett Elementary School,160035,3-A-i,a-reso-i1,Average class size,13.9,4.61,20,,2018-19 +Milford,Brookside Elementary School,1850065,3-A-i,a-reso-i1,Average class size,18.8,4.12,20,,2018-19 +Milford,Memorial Elementary School,1850010,3-A-i,a-reso-i1,Average class size,20.3,3.97,20,,2018-19 +Milford,Milford High School,1850505,3-A-i,a-reso-i1,Average class size,18.5,4.15,20,,2018-19 +Milford,Shining Star Early Childhood Center,1850075,3-A-i,a-reso-i1,Average class size,16,4.4,20,,2018-19 +Milford,Stacy Middle School,1850305,3-A-i,a-reso-i1,Average class size,22,3.8,20,,2018-19 +Milford,Woodland Elementary School,1850090,3-A-i,a-reso-i1,Average class size,22.5,3.75,20,,2018-19 +Revere,Beachmont Elementary School,2480013,3-A-i,a-reso-i1,Average class size,17,4.3,20,,2018-19 +Revere,Garfield Elementary School,2480056,3-A-i,a-reso-i1,Average class size,19,4.1,20,,2018-19 +Revere,Garfield Middle School,2480057,3-A-i,a-reso-i1,Average class size,21,3.9,20,,2018-19 +Revere,Hill Elementary School,2480035,3-A-i,a-reso-i1,Average class size,19,4.1,20,,2018-19 +Revere,Lincoln Elementary School,2480025,3-A-i,a-reso-i1,Average class size,19,4.1,20,,2018-19 +Revere,Paul Revere Elementary School,2480050,3-A-i,a-reso-i1,Average class size,21,3.9,20,,2018-19 +Revere,Revere High School,2480505,3-A-i,a-reso-i1,Average class size,16.8,4.32,20,,2018-19 +Revere,Rumney Marsh Academy,2480014,3-A-i,a-reso-i1,Average class size,21,3.9,20,,2018-19 +Revere,SeaCoast High School,2480520,3-A-i,a-reso-i1,Average class size,7,5,20,,2018-19 +Revere,Susan B. Anthony Middle School,2480305,3-A-i,a-reso-i1,Average class size,23,3.7,20,,2018-19 +Revere,Whelan Elementary School,2480003,3-A-i,a-reso-i1,Average class size,24,3.6,20,,2018-19 +Winchester,Ambrose Elementary School,3440045,3-A-i,a-reso-i1,Average class size,19.7,4.03,20,,2018-19 +Winchester,Lincoln Elementary School,2480025,3-A-i,a-reso-i1,Average class size,19.2,4.08,20,,2018-19 +Winchester,Lynch Elementary School,3440020,3-A-i,a-reso-i1,Average class size,19.4,4.06,20,,2018-19 +Winchester,McCall Middle School,3440305,3-A-i,a-reso-i1,Average class size,22.6,3.74,20,,2018-19 +Winchester,Muraco Elementary School,3440040,3-A-i,a-reso-i1,Average class size,17.9,4.21,20,,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,3-A-i,a-reso-i1,Average class size,20.4,3.96,20,,2018-19 +Winchester,Winchester High School,3440505,3-A-i,a-reso-i1,Average class size,17,4.3,20,,2018-19 +Attleboro,Attleboro High School,160505,3-B-i,a-curv-i3,Percent AP test takers scoring 3 or higher (HS only),53,5,20,%,2018-19 +Milford,Milford High School,1850505,3-B-i,a-curv-i3,Percent AP test takers scoring 3 or higher (HS only),58.5,5,20,%,2018-19 +Revere,Revere High School,2480505,3-B-i,a-curv-i3,Percent AP test takers scoring 3 or higher (HS only),50,5,20,%,2018-19 +Winchester,Winchester High School,3440505,3-B-i,a-curv-i3,Percent AP test takers scoring 3 or higher (HS only),90.5,5,20,%,2018-19 +Attleboro,Attleboro High School,160505,3-B-i,a-curv-i2,Percent juniors and seniors enrolled in one AP (HS only),21.82130584,2.909507445,30,%,2018-19 +Milford,Milford High School,1850505,3-B-i,a-curv-i2,Percent juniors and seniors enrolled in one AP (HS only),45.23,5,30,%,2018-19 +Revere,Revere High School,2480505,3-B-i,a-curv-i2,Percent juniors and seniors enrolled in one AP (HS only),18,2.4,30,%,2018-19 +Revere,SeaCoast High School,2480520,3-B-i,a-curv-i2,Percent juniors and seniors enrolled in one AP (HS only),0,0,30,%,2018-19 +Winchester,Winchester High School,3440505,3-B-i,a-curv-i2,Percent juniors and seniors enrolled in one AP (HS only),23,3.066666667,30,%,2018-19 +Attleboro,Attleboro High School,160505,3-B-i,a-cure-i1,Percent students of color enrolled in advanced coursework,32.9,3.615384615,36.4,%,2018-19 +Revere,Revere High School,2480505,3-B-i,a-cure-i1,Percent students of color enrolled in advanced coursework,12.3,1.351648352,36.4,%,2018-19 +Revere,SeaCoast High School,2480520,3-B-i,a-cure-i1,Percent students of color enrolled in advanced coursework,0,0,36.4,%,2018-19 +Winchester,Winchester High School,3440505,3-B-i,a-cure-i1,Percent students of color enrolled in advanced coursework,31,3.406593407,36.4,%,2018-19 +Attleboro,Attleboro High School,160505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,15.28896673,1.409121358,43.4,,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,3-A-ii,a-sust-i3,Student to instructional support staff ratio,16.97142857,1.564186965,43.4,,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,3-A-ii,a-sust-i3,Student to instructional support staff ratio,19.14705882,1.764705882,43.4,,2018-19 +Attleboro,Hyman Fine Elementary School,160040,3-A-ii,a-sust-i3,Student to instructional support staff ratio,16.46428571,1.517445688,43.4,,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,3-A-ii,a-sust-i3,Student to instructional support staff ratio,15.65517241,1.442873033,43.4,,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,3-A-ii,a-sust-i3,Student to instructional support staff ratio,13.65517241,1.258541236,43.4,,2018-19 +Attleboro,Peter Thacher Elementary School,160050,3-A-ii,a-sust-i3,Student to instructional support staff ratio,11.80555556,1.088069637,43.4,,2018-19 +Attleboro,Wamsutta Middle School,160320,3-A-ii,a-sust-i3,Student to instructional support staff ratio,17,1.566820276,43.4,,2018-19 +Attleboro,Thomas Willett Elementary School,160035,3-A-ii,a-sust-i3,Student to instructional support staff ratio,13.93103448,1.283966312,43.4,,2018-19 +Milford,Brookside Elementary School,1850065,3-A-ii,a-sust-i3,Student to instructional support staff ratio,14.1506647,1.304208728,43.4,,2018-19 +Milford,Memorial Elementary School,1850010,3-A-ii,a-sust-i3,Student to instructional support staff ratio,16.60311958,1.530241436,43.4,,2018-19 +Milford,Milford High School,1850505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,46.38888889,4.27547363,43.4,,2018-19 +Milford,Shining Star Early Childhood Center,1850075,3-A-ii,a-sust-i3,Student to instructional support staff ratio,5.482388974,0.505289306,43.4,,2018-19 +Milford,Stacy Middle School,1850305,3-A-ii,a-sust-i3,Student to instructional support staff ratio,32.74691358,3.018148717,43.4,,2018-19 +Milford,Woodland Elementary School,1850090,3-A-ii,a-sust-i3,Student to instructional support staff ratio,22.85714286,2.106649112,43.4,,2018-19 +Revere,Beachmont Elementary School,2480013,3-A-ii,a-sust-i3,Student to instructional support staff ratio,38,3.502304147,43.4,,2018-19 +Revere,Garfield Elementary School,2480056,3-A-ii,a-sust-i3,Student to instructional support staff ratio,39.57894737,3.647829251,43.4,,2018-19 +Revere,Garfield Middle School,2480057,3-A-ii,a-sust-i3,Student to instructional support staff ratio,71.75,5,43.4,,2018-19 +Revere,Hill Elementary School,2480035,3-A-ii,a-sust-i3,Student to instructional support staff ratio,65.81818182,5,43.4,,2018-19 +Revere,Lincoln Elementary School,2480025,3-A-ii,a-sust-i3,Student to instructional support staff ratio,59,5,43.4,,2018-19 +Revere,Paul Revere Elementary School,2480050,3-A-ii,a-sust-i3,Student to instructional support staff ratio,46.3,4.267281106,43.4,,2018-19 +Revere,Revere High School,2480505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,75.25925926,5,43.4,,2018-19 +Revere,Rumney Marsh Academy,2480014,3-A-ii,a-sust-i3,Student to instructional support staff ratio,56.36363636,5,43.4,,2018-19 +Revere,SeaCoast High School,2480520,3-A-ii,a-sust-i3,Student to instructional support staff ratio,30.33333333,2.795698924,43.4,,2018-19 +Revere,Susan B. Anthony Middle School,2480305,3-A-ii,a-sust-i3,Student to instructional support staff ratio,76.875,5,43.4,,2018-19 +Revere,Whelan Elementary School,2480003,3-A-ii,a-sust-i3,Student to instructional support staff ratio,23.63636364,2.178466695,43.4,,2018-19 +Winchester,Ambrose Elementary School,3440045,3-A-ii,a-sust-i3,Student to instructional support staff ratio,65.66666667,5,43.4,,2018-19 +Winchester,Lincoln Elementary School,2480025,3-A-ii,a-sust-i3,Student to instructional support staff ratio,86.2,5,43.4,,2018-19 +Winchester,Lynch Elementary School,3440020,3-A-ii,a-sust-i3,Student to instructional support staff ratio,60.875,5,43.4,,2018-19 +Winchester,McCall Middle School,3440305,3-A-ii,a-sust-i3,Student to instructional support staff ratio,276,5,43.4,,2018-19 +Winchester,Muraco Elementary School,3440040,3-A-ii,a-sust-i3,Student to instructional support staff ratio,94,5,43.4,,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,3-A-ii,a-sust-i3,Student to instructional support staff ratio,83.4,5,43.4,,2018-19 +Winchester,Winchester High School,3440505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,135.9,5,43.4,,2018-19 +Milford,Milford High School,1850505,4-D-i,a-cgpr-i1,College enrollment rate (HS only),69,4.207317073,65.6,%,2018-19 +Revere,Revere High School,2480505,4-D-i,a-cgpr-i1,College enrollment rate (HS only),69,4.207317073,65.6,%,2018-19 +Revere,SeaCoast High School,2480520,4-D-i,a-cgpr-i1,College enrollment rate (HS only),31.9,1.945121951,65.6,%,2018-19 +Winchester,Winchester High School,3440505,4-D-i,a-cgpr-i1,College enrollment rate (HS only),90.5,5,65.6,%,2018-19 +Milford,Milford High School,1850505,4-B-ii,a-degr-i1,4-year on-time graduation rate (HS only),91.4,4.57,80,%,2018-19 +Revere,Revere High School,2480505,4-B-ii,a-degr-i1,4-year on-time graduation rate (HS only),92.8,4.64,80,%,2018-19 +Revere,SeaCoast High School,2480520,4-B-ii,a-degr-i1,4-year on-time graduation rate (HS only),29.5,1.475,80,%,2018-19 +Winchester,Winchester High School,3440505,4-B-ii,a-degr-i1,4-year on-time graduation rate (HS only),94.9,4.745,80,%,2018-19 +Milford,Brookside Elementary School,1850065,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,90,4.5,80,%,2018-19 +Milford,Memorial Elementary School,1850010,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,92,4.6,80,%,2018-19 +Milford,Milford High School,1850505,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,82,4.1,80,%,2018-19 +Milford,Shining Star Early Childhood Center,1850075,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,80,4,80,%,2018-19 +Milford,Stacy Middle School,1850305,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,89,4.45,80,%,2018-19 +Milford,Woodland Elementary School,1850090,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,85,4.25,80,%,2018-19 +Revere,Beachmont Elementary School,2480013,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,75,3.75,80,%,2018-19 +Revere,Garfield Middle School,2480057,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,47,2.35,80,%,2018-19 +Revere,Hill Elementary School,2480035,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,76,3.8,80,%,2018-19 +Revere,Lincoln Elementary School,2480025,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,68,3.4,80,%,2018-19 +Revere,Paul Revere Elementary School,2480050,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,63,3.15,80,%,2018-19 +Revere,Revere High School,2480505,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,61,3.05,80,%,2018-19 +Revere,Rumney Marsh Academy,2480014,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,49,2.45,80,%,2018-19 +Revere,SeaCoast High School,2480520,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,0.41,0.0205,80,%,2018-19 +Revere,Susan B. Anthony Middle School,2480305,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,67,3.35,80,%,2018-19 +Revere,Whelan Elementary School,2480003,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,82,4.1,80,%,2018-19 +Winchester,Ambrose Elementary School,3440045,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,82,4.1,80,%,2018-19 +Winchester,Lincoln Elementary School,2480025,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,66.6,3.33,80,%,2018-19 +Winchester,Lynch Elementary School,3440020,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,60,3,80,%,2018-19 +Winchester,McCall Middle School,3440305,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,71,3.55,80,%,2018-19 +Winchester,Muraco Elementary School,3440040,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,69,3.45,80,%,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,84,4.2,80,%,2018-19 +Winchester,Winchester High School,3440505,1-A-i,a-exp-i1,Percentage teachers with 5+ years of experience,92,4.6,80,%,2018-19 +Milford,Milford High School,1850505,4-B-ii,a-degr-i3,5-year graduation rate (HS only),93.3,4.390588235,85,%,2018-19 +Revere,Revere High School,2480505,4-B-ii,a-degr-i3,5-year graduation rate (HS only),90.4,4.254117647,85,%,2018-19 +Revere,SeaCoast High School,2480520,4-B-ii,a-degr-i3,5-year graduation rate (HS only),27.8,1.308235294,85,%,2018-19 +Winchester,Winchester High School,3440505,4-B-ii,a-degr-i3,5-year graduation rate (HS only),99.3,4.672941176,85,%,2018-19 +Attleboro,Attleboro High School,160505,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),90.6,4.263529412,85,%,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),100,4.705882353,85,%,2018-19 +Attleboro,Hyman Fine Elementary School,160040,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),92.9,4.371764706,85,%,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),89.3,4.202352941,85,%,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),93.5,4.4,85,%,2018-19 +Attleboro,Peter Thacher Elementary School,160050,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),83.3,3.92,85,%,2018-19 +Attleboro,Wamsutta Middle School,160320,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),91.2,4.291764706,85,%,2018-19 +Attleboro,Thomas Willett Elementary School,160035,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),100,4.705882353,85,%,2018-19 +Milford,Brookside Elementary School,1850065,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),97.5,4.588235294,85,%,2018-19 +Milford,Memorial Elementary School,1850010,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),97.5,4.588235294,85,%,2018-19 +Milford,Milford High School,1850505,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),96.8,4.555294118,85,%,2018-19 +Milford,Shining Star Early Childhood Center,1850075,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),100,4.705882353,85,%,2018-19 +Milford,Stacy Middle School,1850305,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),96.2,4.527058824,85,%,2018-19 +Milford,Woodland Elementary School,1850090,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),94.8,4.461176471,85,%,2018-19 +Revere,Beachmont Elementary School,2480013,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),100,4.705882353,85,%,2018-19 +Revere,Garfield Middle School,2480057,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),96,4.517647059,85,%,2018-19 +Revere,Hill Elementary School,2480035,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),100,4.705882353,85,%,2018-19 +Revere,Lincoln Elementary School,2480025,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),96,4.517647059,85,%,2018-19 +Revere,Paul Revere Elementary School,2480050,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),97,4.564705882,85,%,2018-19 +Revere,Revere High School,2480505,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),92,4.329411765,85,%,2018-19 +Revere,Rumney Marsh Academy,2480014,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),85,4,85,%,2018-19 +Revere,SeaCoast High School,2480520,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),90,4.235294118,85,%,2018-19 +Revere,Susan B. Anthony Middle School,2480305,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),85,4,85,%,2018-19 +Revere,Whelan Elementary School,2480003,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),97,4.564705882,85,%,2018-19 +Winchester,Ambrose Elementary School,3440045,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),92.3,4.343529412,85,%,2018-19 +Winchester,Lincoln Elementary School,2480025,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),84.8,3.990588235,85,%,2018-19 +Winchester,Lynch Elementary School,3440020,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),82.4,3.877647059,85,%,2018-19 +Winchester,McCall Middle School,3440305,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),79.3,3.731764706,85,%,2018-19 +Winchester,Muraco Elementary School,3440040,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),88.6,4.169411765,85,%,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),91.9,4.324705882,85,%,2018-19 +Winchester,Winchester High School,3440505,1-A-iii,a-pcom-i1,Percent teacher returning (excluding retirement),90.3,4.249411765,85,%,2018-19 +Attleboro,Attleboro High School,160505,2-C-i,a-vale-i2,Average daily attendance,93.2,4.142222222,90,%,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,2-C-i,a-vale-i2,Average daily attendance,95.1,4.226666667,90,%,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,2-C-i,a-vale-i2,Average daily attendance,95.7,4.253333333,90,%,2018-19 +Attleboro,Hyman Fine Elementary School,160040,2-C-i,a-vale-i2,Average daily attendance,96.2,4.275555556,90,%,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,2-C-i,a-vale-i2,Average daily attendance,95.4,4.24,90,%,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,2-C-i,a-vale-i2,Average daily attendance,95.5,4.244444444,90,%,2018-19 +Attleboro,Peter Thacher Elementary School,160050,2-C-i,a-vale-i2,Average daily attendance,94.9,4.217777778,90,%,2018-19 +Attleboro,Wamsutta Middle School,160320,2-C-i,a-vale-i2,Average daily attendance,95.7,4.253333333,90,%,2018-19 +Attleboro,Thomas Willett Elementary School,160035,2-C-i,a-vale-i2,Average daily attendance,95.4,4.24,90,%,2018-19 +Milford,Brookside Elementary School,1850065,2-C-i,a-vale-i2,Average daily attendance,94.9,4.217777778,90,%,2018-19 +Milford,Memorial Elementary School,1850010,2-C-i,a-vale-i2,Average daily attendance,94.9,4.217777778,90,%,2018-19 +Milford,Milford High School,1850505,2-C-i,a-vale-i2,Average daily attendance,92.9,4.128888889,90,%,2018-19 +Milford,Shining Star Early Childhood Center,1850075,2-C-i,a-vale-i2,Average daily attendance,91.3,4.057777778,90,%,2018-19 +Milford,Stacy Middle School,1850305,2-C-i,a-vale-i2,Average daily attendance,94.8,4.213333333,90,%,2018-19 +Milford,Woodland Elementary School,1850090,2-C-i,a-vale-i2,Average daily attendance,95.8,4.257777778,90,%,2018-19 +Revere,Beachmont Elementary School,2480013,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Revere,Garfield Elementary School,2480056,2-C-i,a-vale-i2,Average daily attendance,95,4.222222222,90,%,2018-19 +Revere,Garfield Middle School,2480057,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Revere,Hill Elementary School,2480035,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Revere,Lincoln Elementary School,2480025,2-C-i,a-vale-i2,Average daily attendance,95,4.222222222,90,%,2018-19 +Revere,Paul Revere Elementary School,2480050,2-C-i,a-vale-i2,Average daily attendance,95,4.222222222,90,%,2018-19 +Revere,Revere High School,2480505,2-C-i,a-vale-i2,Average daily attendance,94,4.177777778,90,%,2018-19 +Revere,Rumney Marsh Academy,2480014,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Revere,SeaCoast High School,2480520,2-C-i,a-vale-i2,Average daily attendance,75,3.333333333,90,%,2018-19 +Revere,Susan B. Anthony Middle School,2480305,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Revere,Whelan Elementary School,2480003,2-C-i,a-vale-i2,Average daily attendance,95,4.222222222,90,%,2018-19 +Winchester,Ambrose Elementary School,3440045,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Winchester,Lincoln Elementary School,2480025,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Winchester,Lynch Elementary School,3440020,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Winchester,McCall Middle School,3440305,2-C-i,a-vale-i2,Average daily attendance,96.2,4.275555556,90,%,2018-19 +Winchester,Muraco Elementary School,3440040,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,2-C-i,a-vale-i2,Average daily attendance,96,4.266666667,90,%,2018-19 +Winchester,Winchester High School,3440505,2-C-i,a-vale-i2,Average daily attendance,95.7,4.253333333,90,%,2018-19 +Attleboro,Attleboro High School,160505,3-B-i,a-curv-i1,Percent graduates completing MassCORE (HS only),87.4,3.884444444,90,%,2018-19 +Milford,Milford High School,1850505,3-B-i,a-curv-i1,Percent graduates completing MassCORE (HS only),99.6,5,90,%,2018-19 +Revere,Revere High School,2480505,3-B-i,a-curv-i1,Percent graduates completing MassCORE (HS only),100,5,90,%,2018-19 +Revere,SeaCoast High School,2480520,3-B-i,a-curv-i1,Percent graduates completing MassCORE (HS only),100,5,90,%,2018-19 +Winchester,Winchester High School,3440505,3-B-i,a-curv-i1,Percent graduates completing MassCORE (HS only),87.3,3.88,90,%,2018-19 +Attleboro,Attleboro High School,160505,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,98.2,4.134736842,95,%,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Hyman Fine Elementary School,160040,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Peter Thacher Elementary School,160050,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Wamsutta Middle School,160320,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Thomas Willett Elementary School,160035,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Brookside Elementary School,1850065,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Memorial Elementary School,1850010,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Milford High School,1850505,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Shining Star Early Childhood Center,1850075,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Stacy Middle School,1850305,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Milford,Woodland Elementary School,1850090,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Beachmont Elementary School,2480013,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Garfield Elementary School,2480056,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Garfield Middle School,2480057,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Hill Elementary School,2480035,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Lincoln Elementary School,2480025,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Paul Revere Elementary School,2480050,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Revere High School,2480505,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,95.54,4.022736842,95,%,2018-19 +Revere,Rumney Marsh Academy,2480014,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,SeaCoast High School,2480520,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Revere,Susan B. Anthony Middle School,2480305,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,97.69,4.113263158,95,%,2018-19 +Revere,Whelan Elementary School,2480003,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Ambrose Elementary School,3440045,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Lincoln Elementary School,2480025,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Lynch Elementary School,3440020,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,McCall Middle School,3440305,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Muraco Elementary School,3440040,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Winchester,Winchester High School,3440505,1-A-i,a-exp-i3,Percentage teachers teaching in area of licensure,100,5,95,%,2018-19 +Attleboro,Attleboro High School,160505,3-A-ii,a-sust-i1,Student to guidance counselor ratio,249.4285714,4.1,250,,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Hyman Fine Elementary School,160040,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Peter Thacher Elementary School,160050,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Wamsutta Middle School,160320,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Attleboro,Thomas Willett Elementary School,160035,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Milford,Brookside Elementary School,1850065,3-A-ii,a-sust-i1,Student to guidance counselor ratio,479,1.71,250,,2018-19 +Milford,Memorial Elementary School,1850010,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Milford,Milford High School,1850505,3-A-ii,a-sust-i1,Student to guidance counselor ratio,194.8333333,4.55,250,,2018-19 +Milford,Shining Star Early Childhood Center,1850075,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Milford,Stacy Middle School,1850305,3-A-ii,a-sust-i1,Student to guidance counselor ratio,353.6666667,2.96,250,,2018-19 +Milford,Woodland Elementary School,1850090,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Revere,Beachmont Elementary School,2480013,3-A-ii,a-sust-i1,Student to guidance counselor ratio,342,3.08,250,,2018-19 +Revere,Garfield Elementary School,2480056,3-A-ii,a-sust-i1,Student to guidance counselor ratio,376,2.74,250,,2018-19 +Revere,Garfield Middle School,2480057,3-A-ii,a-sust-i1,Student to guidance counselor ratio,574,0.76,250,,2018-19 +Revere,Hill Elementary School,2480035,3-A-ii,a-sust-i1,Student to guidance counselor ratio,724,0,250,,2018-19 +Revere,Lincoln Elementary School,2480025,3-A-ii,a-sust-i1,Student to guidance counselor ratio,649,0,250,,2018-19 +Revere,Paul Revere Elementary School,2480050,3-A-ii,a-sust-i1,Student to guidance counselor ratio,463,1.87,250,,2018-19 +Revere,Revere High School,2480505,3-A-ii,a-sust-i1,Student to guidance counselor ratio,225.7777778,4.24,250,,2018-19 +Revere,Rumney Marsh Academy,2480014,3-A-ii,a-sust-i1,Student to guidance counselor ratio,310,3.4,250,,2018-19 +Revere,SeaCoast High School,2480520,3-A-ii,a-sust-i1,Student to guidance counselor ratio,91,5,250,,2018-19 +Revere,Susan B. Anthony Middle School,2480305,3-A-ii,a-sust-i1,Student to guidance counselor ratio,307.5,3.42,250,,2018-19 +Revere,Whelan Elementary School,2480003,3-A-ii,a-sust-i1,Student to guidance counselor ratio,780,0,250,,2018-19 +Winchester,Ambrose Elementary School,3440045,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Winchester,Lincoln Elementary School,2480025,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Winchester,Lynch Elementary School,3440020,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Winchester,McCall Middle School,3440305,3-A-ii,a-sust-i1,Student to guidance counselor ratio,220.8,4.29,250,,2018-19 +Winchester,Muraco Elementary School,3440040,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,3-A-ii,a-sust-i1,Student to guidance counselor ratio,0,0,250,,2018-19 +Winchester,Winchester High School,3440505,3-A-ii,a-sust-i1,Student to guidance counselor ratio,271.8,3.78,250,,2018-19 +Attleboro,Attleboro High School,160505,5-D-ii,a-phya-i1,Medical staff to student ratio,582,3.104,750,,2018-19 +Attleboro,Cyril K. Brennan Middle School,160315,5-D-ii,a-phya-i1,Medical staff to student ratio,594,3.168,750,,2018-19 +Attleboro,Robert J. Coelho Middle School,160305,5-D-ii,a-phya-i1,Medical staff to student ratio,651,3.472,750,,2018-19 +Attleboro,Hyman Fine Elementary School,160040,5-D-ii,a-phya-i1,Medical staff to student ratio,461,2.458666667,750,,2018-19 +Attleboro,Hill-Roberts Elementary School,160045,5-D-ii,a-phya-i1,Medical staff to student ratio,454,2.421333333,750,,2018-19 +Attleboro,A. Irvin Studley Elementary School,160001,5-D-ii,a-phya-i1,Medical staff to student ratio,396,2.112,750,,2018-19 +Attleboro,Peter Thacher Elementary School,160050,5-D-ii,a-phya-i1,Medical staff to student ratio,141.6666667,0.755555556,750,,2018-19 +Attleboro,Wamsutta Middle School,160320,5-D-ii,a-phya-i1,Medical staff to student ratio,578,3.082666667,750,,2018-19 +Attleboro,Thomas Willett Elementary School,160035,5-D-ii,a-phya-i1,Medical staff to student ratio,404,2.154666667,750,,2018-19 +Milford,Brookside Elementary School,1850065,5-D-ii,a-phya-i1,Medical staff to student ratio,479,2.554666667,750,,2018-19 +Milford,Memorial Elementary School,1850010,5-D-ii,a-phya-i1,Medical staff to student ratio,479,2.554666667,750,,2018-19 +Milford,Milford High School,1850505,5-D-ii,a-phya-i1,Medical staff to student ratio,584.5,3.117333333,750,,2018-19 +Milford,Shining Star Early Childhood Center,1850075,5-D-ii,a-phya-i1,Medical staff to student ratio,119.3333333,0.636444444,750,,2018-19 +Milford,Stacy Middle School,1850305,5-D-ii,a-phya-i1,Medical staff to student ratio,530.5,2.829333333,750,,2018-19 +Milford,Woodland Elementary School,1850090,5-D-ii,a-phya-i1,Medical staff to student ratio,508,2.709333333,750,,2018-19 +Revere,Beachmont Elementary School,2480013,5-D-ii,a-phya-i1,Medical staff to student ratio,342,1.824,750,,2018-19 +Revere,Garfield Elementary School,2480056,5-D-ii,a-phya-i1,Medical staff to student ratio,752,4.010666667,750,,2018-19 +Revere,Garfield Middle School,2480057,5-D-ii,a-phya-i1,Medical staff to student ratio,574,3.061333333,750,,2018-19 +Revere,Hill Elementary School,2480035,5-D-ii,a-phya-i1,Medical staff to student ratio,724,3.861333333,750,,2018-19 +Revere,Lincoln Elementary School,2480025,5-D-ii,a-phya-i1,Medical staff to student ratio,649,3.461333333,750,,2018-19 +Revere,Paul Revere Elementary School,2480050,5-D-ii,a-phya-i1,Medical staff to student ratio,463,2.469333333,750,,2018-19 +Revere,Revere High School,2480505,5-D-ii,a-phya-i1,Medical staff to student ratio,677.3333333,3.612444444,750,,2018-19 +Revere,Rumney Marsh Academy,2480014,5-D-ii,a-phya-i1,Medical staff to student ratio,620,3.306666667,750,,2018-19 +Revere,SeaCoast High School,2480520,5-D-ii,a-phya-i1,Medical staff to student ratio,91,0.485333333,750,,2018-19 +Revere,Susan B. Anthony Middle School,2480305,5-D-ii,a-phya-i1,Medical staff to student ratio,615,3.28,750,,2018-19 +Revere,Whelan Elementary School,2480003,5-D-ii,a-phya-i1,Medical staff to student ratio,780,4.16,750,,2018-19 +Winchester,Ambrose Elementary School,3440045,5-D-ii,a-phya-i1,Medical staff to student ratio,394,2.101333333,750,,2018-19 +Winchester,Lincoln Elementary School,2480025,5-D-ii,a-phya-i1,Medical staff to student ratio,431,2.298666667,750,,2018-19 +Winchester,Lynch Elementary School,3440020,5-D-ii,a-phya-i1,Medical staff to student ratio,487,2.597333333,750,,2018-19 +Winchester,McCall Middle School,3440305,5-D-ii,a-phya-i1,Medical staff to student ratio,552,2.944,750,,2018-19 +Winchester,Muraco Elementary School,3440040,5-D-ii,a-phya-i1,Medical staff to student ratio,376,2.005333333,750,,2018-19 +Winchester,Vinson-Owen Elementary School,3440025,5-D-ii,a-phya-i1,Medical staff to student ratio,417,2.224,750,,2018-19 +Winchester,Winchester High School,3440505,5-D-ii,a-phya-i1,Medical staff to student ratio,339.75,1.812,750,,2018-19 diff --git a/db/migrate/20220405174019_create_admin_data_values.rb b/db/migrate/20220405174019_create_admin_data_values.rb new file mode 100644 index 00000000..b601f7b2 --- /dev/null +++ b/db/migrate/20220405174019_create_admin_data_values.rb @@ -0,0 +1,12 @@ +class CreateAdminDataValues < ActiveRecord::Migration[7.0] + def change + create_table :admin_data_values do |t| + t.float :likert_score + t.references :school, null: false, foreign_key: true + t.references :admin_data_item, null: false, foreign_key: true + t.references :academic_year, null: false, foreign_key: true + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 00587d57..8cb5ce85 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.0].define(version: 2022_03_01_083725) do +ActiveRecord::Schema[7.0].define(version: 2022_04_05_174019) do # These are extensions that must be enabled in order to support this database enable_extension "pg_stat_statements" enable_extension "plpgsql" @@ -35,6 +35,18 @@ ActiveRecord::Schema[7.0].define(version: 2022_03_01_083725) do t.index ["scale_id"], name: "index_admin_data_items_on_scale_id" end + create_table "admin_data_values", force: :cascade do |t| + t.float "likert_score" + t.bigint "school_id", null: false + t.bigint "admin_data_item_id", null: false + t.bigint "academic_year_id", null: false + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.index ["academic_year_id"], name: "index_admin_data_values_on_academic_year_id" + t.index ["admin_data_item_id"], name: "index_admin_data_values_on_admin_data_item_id" + t.index ["school_id"], name: "index_admin_data_values_on_school_id" + end + create_table "categories", id: :serial, force: :cascade do |t| t.string "name" t.text "description" @@ -356,6 +368,9 @@ ActiveRecord::Schema[7.0].define(version: 2022_03_01_083725) do end add_foreign_key "admin_data_items", "scales" + add_foreign_key "admin_data_values", "academic_years" + add_foreign_key "admin_data_values", "admin_data_items" + add_foreign_key "admin_data_values", "schools" add_foreign_key "legacy_recipient_lists", "legacy_schools", column: "school_id" add_foreign_key "legacy_schedules", "legacy_schools", column: "school_id" add_foreign_key "legacy_school_categories", "legacy_categories", column: "category_id" diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index 634ff9a8..836fd93e 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -44,6 +44,14 @@ namespace :data do puts "=====================> Completed loading #{SurveyItemResponse.count} survey responses" end + desc 'load admin_data' + task load_admin_data: :environment do + Dir.glob(Rails.root.join('data', 'admin_data', '*.csv')).each do |filepath| + puts "=====================> Loading data from csv at path: #{filepath}" + AdminDataLoader.load_data filepath: + end + puts "=====================> Completed loading #{AdminDataValue.count} survey responses" + end desc 'Load in all data' task load: :environment do # return if School.count > 0 diff --git a/spec/factories.rb b/spec/factories.rb index 2e04f0fb..f6490f52 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -1,4 +1,11 @@ FactoryBot.define do + factory :admin_data_value do + likert_score { 1.5 } + school + admin_data_item + academic_year + end + factory :survey do form { 0 } academic_year diff --git a/spec/fixtures/sample_admin_data.csv b/spec/fixtures/sample_admin_data.csv new file mode 100644 index 00000000..39991252 --- /dev/null +++ b/spec/fixtures/sample_admin_data.csv @@ -0,0 +1,13 @@ +District,School,DESE ID,Category,Item ID,NonLikert Title,NL_Value,LikertScore,Benchmark,Data Type,Academic Year +Attleboro,Attleboro High School,160505,2-C-i,a-vale-i1,Chronic absence rate,19.7,3.03,10,%,2018-19 +Milford,Woodland Elementary School,1850090,2-C-i,a-vale-i1,Chronic absence rate,6.8,4.32,10,%,2018-19 +Revere,Beachmont Elementary School,2480013,2-C-i,a-vale-i1,Chronic absence rate,4.2,4.58,10,%,2018-19 +Winchester,Winchester High School,3440505,2-C-i,a-vale-i1,Chronic absence rate,7.2,4.28,10,%,2018-19 +Attleboro,Attleboro High School,160505,3-A-i,a-reso-i1,Average class size,20.6,0,20,,2018-19 +Milford,Woodland Elementary School,1850090,3-A-i,a-reso-i1,Average class size,22.5,3.75,20,,2018-19 +Revere,Beachmont Elementary School,2480013,3-A-i,a-reso-i1,Average class size,17,4.3,20,,2018-19 +Winchester,Winchester High School,3440505,3-A-i,a-reso-i1,Average class size,17,4.3,20,,2018-19 +Attleboro,Attleboro High School,160505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,15.28896673,0.4,43.4,,2018-19 +Milford,Woodland Elementary School,1850090,3-A-ii,a-sust-i3,Student to instructional support staff ratio,22.85714286,2.106649112,43.4,,2018-19 +Revere,Beachmont Elementary School,2480013,3-A-ii,a-sust-i3,Student to instructional support staff ratio,38,3.502304147,43.4,,2018-19 +Winchester,Winchester High School,3440505,3-A-ii,a-sust-i3,Student to instructional support staff ratio,135.9,5,43.4,,2018-19 diff --git a/spec/models/admin_data_value_spec.rb b/spec/models/admin_data_value_spec.rb new file mode 100644 index 00000000..5675e023 --- /dev/null +++ b/spec/models/admin_data_value_spec.rb @@ -0,0 +1,5 @@ +require 'rails_helper' + +RSpec.describe AdminDataValue, type: :model do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/services/admin_data_loader_spec.rb b/spec/services/admin_data_loader_spec.rb new file mode 100644 index 00000000..cd9febe7 --- /dev/null +++ b/spec/services/admin_data_loader_spec.rb @@ -0,0 +1,56 @@ +require 'rails_helper' + +describe AdminDataLoader do + let(:path_to_admin_data) { Rails.root.join('spec', 'fixtures', 'sample_admin_data.csv') } + let(:ay_2018_19) { AcademicYear.find_by_range '2018-19' } + let(:attleboro) { School.find_by_dese_id 160_505 } + let(:winchester) { School.find_by_dese_id 3_440_505 } + let(:chronic_absense_rate) { AdminDataItem.find_by_admin_data_item_id 'a-vale-i1' } + let(:student_to_instructor_ratio) { AdminDataItem.find_by_admin_data_item_id 'a-sust-i3' } + + before :each do + Rails.application.load_seed + end + + after :each do + DatabaseCleaner.clean + end + + describe 'self.load_data' do + before :each do + AdminDataLoader.load_data filepath: path_to_admin_data + end + it 'assigns the academic year to admin data value' do + expect(AdminDataValue.where(school: attleboro, + admin_data_item: chronic_absense_rate).first.academic_year).to eq ay_2018_19 + end + + it 'assigns the school to the admin data value' do + expect(AdminDataValue.first.school).to eq attleboro + expect(AdminDataValue.last.school).to eq winchester + end + + it 'links the admin data value to the correct admin data item' do + expect(AdminDataValue.first.admin_data_item).to eq chronic_absense_rate + expect(AdminDataValue.last.admin_data_item).to eq student_to_instructor_ratio + end + + it 'loads all the admin data values in the target csv file' do + expect(AdminDataValue.count).to eq 11 + end + + it 'captures the likert score ' do + expect(AdminDataValue.first.likert_score).to eq 3.03 + expect(AdminDataValue.last.likert_score).to eq 5 + end + + it 'rounds up any likert_scores between 0 and 1 (non-inclusive) to 1' do + expect(AdminDataValue.where(school: attleboro, academic_year: ay_2018_19, + admin_data_item: AdminDataItem.find_by_admin_data_item_id('a-sust-i3')).first.likert_score).to eq 1 + end + it 'rejects importing rows with a value of 0' do + expect(AdminDataValue.where(school: attleboro, academic_year: ay_2018_19, + admin_data_item: AdminDataItem.find_by_admin_data_item_id('a-reso-i1'))).not_to exist + end + end +end