Update demographics table with lanugage options Create a lanugage table to hold the new languages Update the demographic loader to input languages into the database Update the cleaner to read the language column Update the parent table to hold a reference to a language Update the data uploader script to read the language from the csv and update the language information for any parent items that already exist (or create database entries if none already exist) update the analyze interface to add controls for selecting ‘parents by group’ and a dropdown for ‘parent by language’ Update the analyze controller to read the parent-by-group parameter Create a graph for the parent-by-group view Bubble up averages for language calculations. Make sure n-size only counts responses for a given measure.mciea-main
parent
1845d1ac7b
commit
b0df611f4d
@ -1,46 +0,0 @@
|
||||
module Analyze
|
||||
module Graph
|
||||
module Column
|
||||
module Parent
|
||||
class Language < ColumnBase
|
||||
attr_reader :parent
|
||||
|
||||
def initialize(parent:)
|
||||
@parent = parent
|
||||
end
|
||||
|
||||
def label
|
||||
["#{parent.designation}"]
|
||||
end
|
||||
|
||||
def basis
|
||||
"parent"
|
||||
end
|
||||
|
||||
def show_irrelevancy_message?(measure:)
|
||||
false
|
||||
end
|
||||
|
||||
def show_insufficient_data_message?(measure:, school:, academic_years:)
|
||||
false
|
||||
end
|
||||
|
||||
def type
|
||||
:parent
|
||||
end
|
||||
|
||||
def n_size(measure:, school:, academic_year:)
|
||||
SurveyItemResponse.where( survey_item: measure.parent_survey_items, school:, academic_year:),
|
||||
academic_year:).select(:response_id).distinct.count
|
||||
end
|
||||
|
||||
def score(measure:, school:, academic_year:)
|
||||
Score.new(average: 3,
|
||||
meets_teacher_threshold: false,
|
||||
meets_student_threshold:,
|
||||
meets_admin_data_threshold: false)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,9 @@
|
||||
module Analyze
|
||||
module Slice
|
||||
class ParentsByGroup < Base
|
||||
def initialize(graph:, label: "Parents by Group", slug: "parents-by-group")
|
||||
super(label:, slug:, graph:)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -0,0 +1,10 @@
|
||||
class CreateHousings < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :housings do |t|
|
||||
t.string :designation
|
||||
t.string :slug
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -1,7 +1,5 @@
|
||||
class AddHousingToParent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_reference :parents, :housing, foreign_key: true
|
||||
Parent.update_all(housing_id: Housing.find_by(designation: 'Unknown').id)
|
||||
change_column_null :parents, :housing_id, false
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
Reference in new issue