mirror of
https://github.com/edcommonwealth/sqm-dashboards.git
synced 2026-03-09 15:38:21 -07:00
to survey table. We no longer check or keep track of the survey type. Instead we look in the database to see if a survey item has at least 10 responses. If it does, that survey item was presented to the respondent and we count it, and all responses when calculating the response rate. Remove response rate timestamp from caching logic because we no longer add the response rate to the database. All response rates are calculated on the fly Update three_b_two scraper to use teacher only numbers swap over to using https://profiles.doe.mass.edu/statereport/gradesubjectstaffing.aspx as the source of staffing information
27 lines
708 B
Ruby
27 lines
708 B
Ruby
# frozen_string_literal: true
|
|
|
|
class SqmApplicationController < ApplicationController
|
|
protect_from_forgery with: :exception, prepend: true
|
|
before_action :set_schools_and_districts
|
|
|
|
helper HeaderHelper
|
|
|
|
private
|
|
|
|
def set_schools_and_districts
|
|
@district = District.find_by_slug district_slug
|
|
@districts = District.all.order(:name)
|
|
@school = School.find_by_slug(school_slug)
|
|
@schools = School.includes([:district]).where(district: @district).order(:name)
|
|
@academic_year = AcademicYear.find_by_range params[:year]
|
|
@academic_years = AcademicYear.all.order(range: :desc)
|
|
end
|
|
|
|
def district_slug
|
|
params[:district_id]
|
|
end
|
|
|
|
def school_slug
|
|
params[:school_id]
|
|
end
|
|
end
|