diff --git a/app/assets/javascripts/questions.coffee b/app/assets/javascripts/questions.coffee new file mode 100644 index 00000000..24f83d18 --- /dev/null +++ b/app/assets/javascripts/questions.coffee @@ -0,0 +1,3 @@ +# Place all the behaviors and hooks related to the matching controller here. +# All this logic will automatically be available in application.js. +# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/app/assets/stylesheets/questions.scss b/app/assets/stylesheets/questions.scss new file mode 100644 index 00000000..a7cd45c1 --- /dev/null +++ b/app/assets/stylesheets/questions.scss @@ -0,0 +1,3 @@ +// Place all the styles related to the Questions controller here. +// They will automatically be included in application.css. +// You can use Sass (SCSS) here: http://sass-lang.com/ diff --git a/app/controllers/questions_controller.rb b/app/controllers/questions_controller.rb new file mode 100644 index 00000000..8abd88f2 --- /dev/null +++ b/app/controllers/questions_controller.rb @@ -0,0 +1,74 @@ +class QuestionsController < ApplicationController + before_action :set_question, only: [:show, :edit, :update, :destroy] + + # GET /questions + # GET /questions.json + def index + @questions = Question.all + end + + # GET /questions/1 + # GET /questions/1.json + def show + end + + # GET /questions/new + def new + @question = Question.new + end + + # GET /questions/1/edit + def edit + end + + # POST /questions + # POST /questions.json + def create + @question = Question.new(question_params) + + respond_to do |format| + if @question.save + format.html { redirect_to @question, notice: 'Question was successfully created.' } + format.json { render :show, status: :created, location: @question } + else + format.html { render :new } + format.json { render json: @question.errors, status: :unprocessable_entity } + end + end + end + + # PATCH/PUT /questions/1 + # PATCH/PUT /questions/1.json + def update + respond_to do |format| + if @question.update(question_params) + format.html { redirect_to @question, notice: 'Question was successfully updated.' } + format.json { render :show, status: :ok, location: @question } + else + format.html { render :edit } + format.json { render json: @question.errors, status: :unprocessable_entity } + end + end + end + + # DELETE /questions/1 + # DELETE /questions/1.json + def destroy + @question.destroy + respond_to do |format| + format.html { redirect_to questions_url, notice: 'Question was successfully destroyed.' } + format.json { head :no_content } + end + end + + private + # Use callbacks to share common setup or constraints between actions. + def set_question + @question = Question.find(params[:id]) + end + + # Never trust parameters from the scary internet, only allow the white list through. + def question_params + params.require(:question).permit(:text, :option1, :option2, :option3, :option4, :option5, :category_id) + end +end diff --git a/app/helpers/questions_helper.rb b/app/helpers/questions_helper.rb new file mode 100644 index 00000000..2eaab4ab --- /dev/null +++ b/app/helpers/questions_helper.rb @@ -0,0 +1,2 @@ +module QuestionsHelper +end diff --git a/app/models/category.rb b/app/models/category.rb index e73efe67..dafde647 100644 --- a/app/models/category.rb +++ b/app/models/category.rb @@ -1,5 +1,6 @@ class Category < ApplicationRecord - + has_many :questions + validates :name, presence: true end diff --git a/app/models/question.rb b/app/models/question.rb new file mode 100644 index 00000000..aa7c9142 --- /dev/null +++ b/app/models/question.rb @@ -0,0 +1,10 @@ +class Question < ApplicationRecord + + validates :text, presence: true + validates :option1, presence: true + validates :option2, presence: true + validates :option3, presence: true + validates :option4, presence: true + validates :option5, presence: true + +end diff --git a/app/views/questions/_form.html.erb b/app/views/questions/_form.html.erb new file mode 100644 index 00000000..136bb0c7 --- /dev/null +++ b/app/views/questions/_form.html.erb @@ -0,0 +1,52 @@ +<%= form_for(question) do |f| %> + <% if question.errors.any? %> +
+

<%= pluralize(question.errors.count, "error") %> prohibited this question from being saved:

+ + +
+ <% end %> + +
+ <%= f.label :text %> + <%= f.text_field :text %> +
+ +
+ <%= f.label :option1 %> + <%= f.text_field :option1 %> +
+ +
+ <%= f.label :option2 %> + <%= f.text_field :option2 %> +
+ +
+ <%= f.label :option3 %> + <%= f.text_field :option3 %> +
+ +
+ <%= f.label :option4 %> + <%= f.text_field :option4 %> +
+ +
+ <%= f.label :option5 %> + <%= f.text_field :option5 %> +
+ +
+ <%= f.label :category_id %> + <%= f.number_field :category_id %> +
+ +
+ <%= f.submit %> +
+<% end %> diff --git a/app/views/questions/edit.html.erb b/app/views/questions/edit.html.erb new file mode 100644 index 00000000..8140146c --- /dev/null +++ b/app/views/questions/edit.html.erb @@ -0,0 +1,6 @@ +

Editing Question

+ +<%= render 'form', question: @question %> + +<%= link_to 'Show', @question %> | +<%= link_to 'Back', questions_path %> diff --git a/app/views/questions/index.html.erb b/app/views/questions/index.html.erb new file mode 100644 index 00000000..31e801d7 --- /dev/null +++ b/app/views/questions/index.html.erb @@ -0,0 +1,39 @@ +

<%= notice %>

+ +

Questions

+ + + + + + + + + + + + + + + + + <% @questions.each do |question| %> + + + + + + + + + + + + + <% end %> + +
TextOption1Option2Option3Option4Option5Category
<%= question.text %><%= question.option1 %><%= question.option2 %><%= question.option3 %><%= question.option4 %><%= question.option5 %><%= question.category_id %><%= link_to 'Show', question %><%= link_to 'Edit', edit_question_path(question) %><%= link_to 'Destroy', question, method: :delete, data: { confirm: 'Are you sure?' } %>
+ +
+ +<%= link_to 'New Question', new_question_path %> diff --git a/app/views/questions/index.json.jbuilder b/app/views/questions/index.json.jbuilder new file mode 100644 index 00000000..17eee51f --- /dev/null +++ b/app/views/questions/index.json.jbuilder @@ -0,0 +1,4 @@ +json.array!(@questions) do |question| + json.extract! question, :id, :text, :option1, :option2, :option3, :option4, :option5, :category_id + json.url question_url(question, format: :json) +end diff --git a/app/views/questions/new.html.erb b/app/views/questions/new.html.erb new file mode 100644 index 00000000..2d2d9b47 --- /dev/null +++ b/app/views/questions/new.html.erb @@ -0,0 +1,5 @@ +

New Question

+ +<%= render 'form', question: @question %> + +<%= link_to 'Back', questions_path %> diff --git a/app/views/questions/show.html.erb b/app/views/questions/show.html.erb new file mode 100644 index 00000000..dda47d04 --- /dev/null +++ b/app/views/questions/show.html.erb @@ -0,0 +1,39 @@ +

<%= notice %>

+ +

+ Text: + <%= @question.text %> +

+ +

+ Option1: + <%= @question.option1 %> +

+ +

+ Option2: + <%= @question.option2 %> +

+ +

+ Option3: + <%= @question.option3 %> +

+ +

+ Option4: + <%= @question.option4 %> +

+ +

+ Option5: + <%= @question.option5 %> +

+ +

+ Category: + <%= @question.category_id %> +

+ +<%= link_to 'Edit', edit_question_path(@question) %> | +<%= link_to 'Back', questions_path %> diff --git a/app/views/questions/show.json.jbuilder b/app/views/questions/show.json.jbuilder new file mode 100644 index 00000000..1ae40088 --- /dev/null +++ b/app/views/questions/show.json.jbuilder @@ -0,0 +1 @@ +json.extract! @question, :id, :text, :option1, :option2, :option3, :option4, :option5, :category_id, :created_at, :updated_at diff --git a/config/routes.rb b/config/routes.rb index 2a936a24..8db881dd 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,4 +1,5 @@ Rails.application.routes.draw do + resources :questions resources :categories resources :districts diff --git a/data/measures.json b/data/measures.json new file mode 100644 index 00000000..b0e16c62 --- /dev/null +++ b/data/measures.json @@ -0,0 +1,646 @@ +[ + { + "title":"Teachers and the Teaching Environment", + "blurb": "Are skilled teachers working together with supportive administrators?", + "text":"This category measures the relevant abilities of a school's teachers and the degree to which they are receiving the support they need to grow as professionals. It considers factors like teacher professional qualifications, effective classroom practices, and school-wide support for teaching development and growth.", + "sub":{ + "A":{ + "title":"Knowledge and Skills of Teachers", + "blurb": "Do qualified teachers employ effective practices?", + "text":"This subcategory seeks to determine the degree to which a school's teachers are prepared for their classroom assignments. It includes measures of teacher qualifications, effective classroom practices, and professional temperament.", + "measures":{ + "i":{ + "title":"Professional Qualifications", + "text":"This measure includes the percentage of teachers working in their area of licensure, and draws on anonymous teacher reports on their own comfort teaching grade-level, topics, and student body.", + "nonlikert":[ + { + "title":"Percentage of Teachers Working in Area of Licensure", + "benchmark":100, + "benchmark_explanation":"Benchmark from panel of experts.", + "values":{ + "argenziano":100, + "healey":100, + "brown":100, + "east":100, + "kennedy":100, + "somervillehigh":100, + "west":100, + "winter":67 + } + } + ] + }, + "ii":{ + "title":"Effective Practices", + "text":"This measure draws on anonymous student reports about factors like teacher clarity, support of students, and classroom management."}, + "iii":{ + "title":"Teacher Temperament", + "text":"This measure draws on anonymous student reports about the degree to which they perceive their teachers to be interested in and committed to them." + } + } + }, + "B":{ + "title":"Teaching Environment", + "blurb": "Are teachers supported in their development as professionals?", + "text":"This subcategory seeks to determine how well a school supports teachers and enables them to do their work. It includes measures of teacher satisfaction, effective leadership, and school-wide support for teacher development.", + "measures":{ + "i":{ + "title":"Teacher Turnover", + "text":"This measure draws includes the percent of turnover in the teaching staff not due to retirement.", + "nonlikert":[ + { + "title":"Teacher Turnover Rate (%)", + "benchmark":10, + "benchmark_explanation":"Benchmark from panel of experts.", + "values":{ + "argenziano":0, + "healey":2, + "brown":0, + "east":10, + "kennedy":4, + "somervillehigh":2, + "west":3, + "winter":2 + } + } + ] + }, + "ii":{ + "title":"Support For Teaching Development And Growth", + "text":"This measure includes district-wide professional development expenditures, and draws on anonymous teacher reports on the quality of professional development.", + "nonlikert":[ + { + "title":"Professional Development Spending per Teacher", + "benchmark":2925.43, + "benchmark_explanation":"State average.", + "values": { + "argenziano":3737, + "healey":4132, + "brown":2568, + "east":4023, + "kennedy":3795, + "somervillehigh":2923, + "west":4926, + "winter":3385 + }, "likert": { + "argenziano":4, + "brown":2, + "east":4, + "healey":4, + "kennedy":4, + "nextwave":1, + "somervillehigh":3, + "west":5, + "winter":4 + } + } + ] + }, + "iii":{ + "title":"Effective Leadership", + "text":"This measure draws on anonymous teacher reports about the degree to which they trust their principals to make good school-wide decisions, as well as on the degree to which their principals are strong instructional leaders." + } + } + } + } + }, { + "title":"School Culture", + "blurb": "Is there a safe and nurturing academic environment?", + "text":"This category measures the degree to which the school environment is safe, caring, and academically-oriented. It considers factors like bullying, student/teacher relationships, and regular attendance.", + "sub":{ + "A":{ + "title":"Safety", + "blurb": "Do students feel physically and emotionally safe at school?", + "text":"This subcategory seeks to determine how safe the school environment is. It includes measures of physical safety, bullying, and trust.", + "measures":{ + "i":{ + "title":"Student Physical Safety", + "text":"This measure draws on anonymous student reports about the degree to which they feel physically safe at school." + }, + "ii":{ + "title":"Bullying/Trust", + "text":"This measure draws on anonymous student reports about the nature and frequency of school bullying, as well as on the degree to which students respect and get along with each other." + } + } + }, + "B":{ + "title": "Relationships", + "blurb": "Are students connected to the school and to their teachers?", + "text":" This subcategory seeks to determine how welcoming and caring the school environment is. It includes measures of student sense of belonging and of student/teacher relationships.", + "measures":{ + "i":{ + "title":"Sense of Belonging", + "text":"This measure draws on anonymous student reports about the degree to which they feel understood, supported, and accepted by students and adults at the school." + }, + "ii":{ + "title":"Student/Teacher Relationships", + "text":"This measure draws on anonymous student reports about the degree to which they feel respected and cared for by their teachers." + } + } + }, + "C":{ + "title":"Academic Orientation", + "blurb": "Do students consistently come to school ready to learn?", + "text":"This subcategory seeks to determine the degree to which a school encourages students to focus on meeting academic challenges. It includes measures of student attendance and graduation, as well as of academic emphasis.", + "measures":{ + "i":{ + "title":"Attendance and Graduation", + "text":" This measure includes the percentage of students chronically absent (more than 10% of days) from school and the percentage of students graduating on time.", + "nonlikert":[ + { + "title":"Percentage of Students Chronically Absent", + "benchmark":10, + "benchmark_explanation":"National average.", + "values":{ + "argenziano":3.34, + "healey":9.26, + "brown":3.48, + "east":3.74, + "kennedy":8.2, + "somervillehigh":16.17, + "west":6.22, + "winter":8.74 + }, "likert": { + "argenziano":5, + "brown":5, + "capuano":2, + "east":5, + "fullcircle":1, + "healey":4, + "kennedy":4, + "nextwave":2, + "somervillehigh":2, + "westsomerville":4, + "winterhill":4 + } + },{ + "title":"Average Attendance Rate (%)", + "benchmark":94.9, + "benchmark_explanation":"State average.", + "values":{ + "argenziano":95.55, + "healey":94.17, + "brown":95.75, + "east":95.42, + "kennedy":94.57, + "somervillehigh":92.08, + "west":95.04, + "winter":94.87 + }, "likert": { + "argenziano":3, + "brown":4, + "capuano":2, + "east":3, + "fullcircle":1, + "healey":3, + "kennedy":3, + "nextwave":1, + "somervillehigh":1, + "west":3, + "winter":3 + } + },{ + "title":"4-Year Graduation Rate (HS only)", + "benchmark":86.1, + "benchmark_explanation":"State average.", + "values":{"somervillehigh":82.7}, + "likert": {"somervillehigh":2} + },{ + "title":"5-Year Graduation Rate (HS only)", + "benchmark":87.7, + "benchmark_explanation":"State average", + "values":{"somervillehigh":86.5}, + "likert": {"somervillehigh":4} + },{ + "title":"English Language Learner 4-Year Graduation Rate (HS only)", + "benchmark":63.9,"benchmark_explanation": + "State average", + "values":{"somervillehigh":66.7}, + "likert": {"somervillehigh":3} + },{ + "title":" English Language Learner 5-Year Graduation Rate (HS only)", + "benchmark":70.9, + "benchmark_explanation":"State average", + "values":{"somervillehigh":77}, + "likert": {"somervillehigh":4} + },{ + "title":"Special Education 4-Year Graduation Rate (HS only)", + "benchmark":69.1, + "benchmark_explanation":"State average", + "values":{"somervillehigh":69.2}, + "likert": {"somervillehigh":3} + },{ + "title":"Special Education 5-Year Graduation Rate (HS only)", + "benchmark":72.9, + "benchmark_explanation":"State average", + "values":{"somervillehigh":80.8}, + "likert": {"somervillehigh":4} + } + ] + }, + "ii":{ + "title":"Academic Press", + "text":"This measure draws on anonymous student reports about the degree to which teachers push them to do their best, work hard, and understand the material." + } + } + } + } + }, { + "title": "Resources", + "blurb": "Are facilities and personnel adequate to support learning?", + "text": "This category measures the adequacy of a school's facility, personnel, and curriculum, as well as the degree to which it is supported by the community. It considers factors like physical spaces and materials, class size, and family/school relationships.", + "sub": { + "A": { + "title": "Facilities and Personnel", + "blurb": "Are physical spaces and support staff sufficient to support learning?", + "text": "This subcategory seeks to determine the sufficiency of a school's staffing and facilities. It measures the quality of physical spaces and curricular materials, as well as the availability of content specialists and support personnel.", + "measures": { + "i": { + "title": "Physical Spaces and Materials", + "text": "This measure draws on anonymous teacher reports about their access to high-quality materials and facilities." + }, + "ii": { + "title": "Content Specialists and Support Staff", + "text": "This measure includes student-to-art-teacher, student o-counselor, and student-to-specialist ratios, and draws on anonymous teacher reports about the degree to which content specialists and support staff are available and effective.", + "nonlikert": [ + { + "title": "Counselors per Student", + "benchmark": 0.004, + "benchmark_explanation": "Benchmark from panel of experts", + "values": { + "argenziano": 0.003, + "healey": 0.004, + "brown": 0.007, + "east": 0.003, + "kennedy": 0.007, + "somervillehigh": 0.008, + "west": 0.006, + "winter": 0.005 + } + }, + { + "title": "Instructional Support Staff (Reading Coaches, etc.) per Student", + "benchmark": 0.012, + "benchmark_explanation": "National average", + "values": { + "argenziano": 0.011, + "healey": 0.009, + "brown": 0.01, + "east": 0.007, + "kennedy": 0.009, + "somervillehigh": 0.002, + "west": 0.005, + "winter": 0.009 + } + } + ] + } + } + }, + "B": { + "title": "Curricular Resources", + "blurb": "Does the school have a strong and varied curriculum?", + "text": "This subcategory seeks to determine the degree to which a school's classrooms include the essential resources teachers need. It includes measures of curriculum strength, curriculum variety, and class size.", + "measures": { + "i": { + "title": "Curricular Strength and Variety", + "text": "This measure includes the percentage of students completing the state core curriculum, the number of different classes offered per student, and the percentage of students participating in Advanced Placement courses in high school. It also draws on anonymous teacher reports on the strength and variety of the school curriculum.", + "nonlikert": [ + { + "title": "Percent of Students Completing MassCore Curriculum (HS only)", + "benchmark": 72.4, + "benchmark_explanation": "State average", + "values": { + "somervillehigh": 53.5 + }, "likert" :{ + "somervillehigh": 2 + } + }, { + "title": "Percent of Students Taking AP Tests (HS only)", + "benchmark": 16, + "benchmark_explanation": "State average", + "values": { + "somervillehigh": 11.3 + }, "likert":{ + "somervillehigh": 2 + } + }, { + "title": "Percent of AP Test Takers Earning Scores of 3 or Above (HS only)", + "benchmark": 63.1, + "benchmark_explanation": "State average", + "values": { + "somervillehigh": 71.6 + }, "likert":{ + "somervillehigh": 4 + } + } + ] + }, + "ii": { + "title": "Class Size", + "text": "This measure includes the average class size at each school, and draws on anonymous teacher reports about the degree to which their classes are sufficiently small to support learning.", + "nonlikert": [{ + "title": "Average Class Size (#)", + "benchmark": 18.1, + "benchmark_explanation": "State average", + "values": { + "argenziano": 20.7, + "healey": 19.1, + "brown": 15.5, + "east": 19.4, + "kennedy": 18.4, + "somervillehigh": 15.8, + "west": 19.4, + "winter": 16.1 + }, "likert": { + "argenziano": 2, + "brown": 2, + "capuano": 4, + "east": 2, + "fullcircle": 1, + "healey": 3, + "kennedy": 3, + "nextwave": 1, + "somervillehigh": 4, + "westsomerville": 2, + "winter": 4 + } + } + ] + } + } + }, + "C": { + "title": "Community Support", + "blurb": "Does the school have strong ties with families and the community?", + "text": "This subcategory seeks to determine the degree to which schools are supported by the surrounding community. It includes measures of family/school relationships, community involvement, and external partnerships.", + "measures": { + "i": { + "title": "Family/School Relationships", + "text": "This measure draws on anonymous teacher reports about parental engagement, as well as anonymous student reports about the degree to which their parents support them as learners." + }, + "ii": { + "title": "Community Involvement + External Partnerships", + "text": "This measure draws on anonymous teacher reports about the degree to which the school is an integrated part of the community." + } + } + } + } + }, + { + "title": "Indicators of Academic Learning", + "blurb": "Are students developing academic dispositions and content knowledge?", + "text": "This category measures how much students are learning core academic content, developing their own academic identities, and progressing along positive trajectories. It considers factors like test score growth, engagement in school, problem solving, and college-going rates.", + "sub": { + "A": { + "title": "Performance", + "blurb": "Are students developing their literacy and numeracy skills?", + "text": "This subcategory seeks to determine the degree to which students are learning core curricular content. It includes measures of growth on standardized tests and teacher perceptions of student academic growth; in the future, it will also include portfolio assessment scores.", + "measures": { + "i": { + "title": "Test Score Growth", + "text": "This measure includes school-wide scores for student growth on standardized tests, calculated by considering prior testing history and other factors.", + "nonlikert": [{ + "title": "SGP Growth Score on English MCAS", + "benchmark": 50, + "benchmark_explanation": "State average", + "values": { + "argenziano": 49, + "healey": 53, + "brown": 65, + "east": 61, + "kennedy": 61, + "somervillehigh": 75, + "west": 57, + "winter": 56 + }, "likert": { + "argenziano": 2, + "healey": 3, + "brown": 3, + "east": 3, + "kennedy": 3, + "somervillehigh": 4, + "west": 3, + "winter": 3 + } + }, { + "title": "SGP Growth Score on Math MCAS", + "benchmark": 50, + "benchmark_explanation": "State average", + "values": { + "argenziano": 46, + "healey": 59, + "brown": 70, + "east": 60, + "kennedy": 57, + "somervillehigh": 66, + "west": 76.5, + "winter": 57 + }, "likert": { + "argenziano": 2, + "healey": 3, + "brown": 4, + "east": 3, + "kennedy": 3, + "somervillehigh": 3, + "west": 4, + "winter": 3 + } + } + ] + }, + "ii": { + "title": "Portfolio or Alternative Assessments", + "text": "This measure draws on anonymous teacher reports about the efforts and abilities of their students. In the future this measure will also include expert evaluation of the work done by students in classrooms." + } + } + }, + "B": { + "title": "Student Commitment to Learning", + "blurb": "Do students engage in class and value the process of learning?", + "text": "This subcategory seeks to determine the degree to which students are invested in the process of learning. It includes measures of student engagement and of how much students value learning.", + "measures": { + "i": { + "title": "Engagement in School", + "text": "This measure draws on anonymous student reports about their level of focus, participation, and interest in class." + }, + "ii": { + "title": "Valuing of Learning", + "text": "This measure draws on anonymous student reports about how important school is to them and how much they view themselves as learners." + } + } + }, + "C": { + "title": "Critical Thinking", + "blurb": "Does the school emphasize the development of problem solving skills?", + "text": "This subcategory seeks to determine whether students are learning to think critically about school subjects and the world around them. It includes measures of how much problem solving is emphasized in class and, in the future, will include a measure of student problem solving ability.", + "measures": { + "i": { + "title": "Problem Solving Emphasis", + "text": "This measure draws on anonymous teacher reports about how often their students have the opportunity to generative their own interpretations of material and apply knowledge to new situations." + }, + "ii": { + "title": "Problem Solving Skills", + "text": "In the future, this measure will include an assessment of student ability to address problems without obvious solutions." + } + } + }, + "D": { + "title": "College and Career Readiness", + "blurb": "Are students being prepared for college and/or the workforce?", + "text": "This subcategory, applicable to high schools only, seeks to determine the degree to which students are prepared for college and beyond. It measures the percentage of students directly enrolling in two- or four-year colleges upon high school graduation and, in the future, will measure the college and career performance of high school graduates.", + "measures": { + "i": { + "title": "College-Going", + "text": "This measure includes the percentage of students enrolling in college immediately after high school graduation and, in the future, will include the college grades and employment status of graduates.", + "nonlikert": [ + { + "title": "Percentage of Students Enrolling in College (HS only)", + "benchmark": 75, + "benchmark_explanation": "Benchmark from a panel of experts", + "values": { + "somervillehigh": 70 + }, "likert": { + "somervillehigh": 2 + } + } + ] + }, + "ii": { + "title": "College Performance", + "text": "In the future, this measure will include data on the percentage of students graduating from college in four or six years, as well as the percentage of students requiring college remediation." + } + } + } + } + }, + { + "title": "Character and Wellbeing Outcomes", + "blurb": "Are students healthy and well-rounded?", + "text": "This category measures the development of traits relevant for full and rewarding lives-in society, the workplace, and their private lives. It considers factors like perseverance and determination, participation in arts and literature, and social and emotional health.", + "sub": { + "A": { + "title": "Civic Engagement", + "blurb": "Do students understand and appreciate each other’s differences?", + "text": "This subcategory seeks to determine the degree to which students are prepared to thoughtfully meaningfully interact with others in a diverse society. It measures how well students understand the perspectives of others, as well as the degree to which they get along with those unlike themselves.", + "measures": { + "i": { + "title": "Understanding Others", + "text": "In the future, this measure will draw on anonymous student reports about their ability to understand the views, emotions, and experiences of others." + }, + "ii": { + "title": "Appreciation for Diversity", + "text": "This measure draws on anonymous student reports about their level of comfort working with students from a wide variety of backgrounds." + } + } + }, + "B": { + "title": "Work Ethic", + "text": "This subcategory seeks to determine the degree to which students are willing to work hard on challenging tasks, even in light of setbacks. It includes measures of perseverance, determination, and orientation toward personal growth.", + "measures": { + "i": { + "title": "Perseverance and Determination", + "text": "This measure draws on anonymous student reports about their ability to pursue goals, work hard in spite of challenges, and finish what they start." + }, + "ii": { + "title": "Growth Mindset", + "text": "In the future, this measure will draw on anonymous student reports about the degree to which they see themselves as capable of expanding their skills through hard work." + } + } + }, + "C": { + "title": "Artistic and Creative Traits", + "blurb": "Are students exposed to arts, literature, and creative activities?", + "text": "This subcategory seeks to determine the degree to which students are being nurtured as artistic and creative people. It includes measures of student participation in arts and, in the future, will include a measure of student creativity.", + "measures": { + "i": { + "title": "Participation in Arts and Literature", + "text": "This measure draws on anonymous teacher reports about the frequency of student exposure to the arts.", + "nonlikert": [{ + "title": "Ratio of Art Classes to Total Students", + "benchmark": 0.082, + "benchmark_explanation": "State average", + "values": { + "argenziano": 0.1, + "healey": 0.11, + "brown": 0.12, + "east": 0.1, + "west": 0.11, + "winter": 0.13 + }, "likert": { + "argenziano": 4, + "brown": 4, + "east": 4, + "healey": 4, + "west": 4, + "winter": 5 + } + }] + }, + "ii": { + "title": "Creativity", + "text": "In the future, this measure will include an assessment of the ability of students to think outside-the-box when presented with different kinds of challenges." + } + } + }, + "D": { + "title": "Health", + "blurb": "Are students socially, emotionally, and physically healthy?", + "text": "This subcategory seeks to determine the health of students and the degree to which the school supports various health outcomes. It includes measures of student social, emotional, and physical health.", + "measures": { + "i": { + "title": "Social and Emotional Health", + "text": "This measure draws on anonymous student reports about how happy, calm, and focused they feel in school." + }, + "ii": { + "title": "Physical Health", + "text": "This measure draws on data from the Youth Risk Behavior survey on student physical health, as well as on anonymous teacher reports about student access to physical education and activity.", + "nonlikert": [{ + "title": "Ratio of PE Classes to Total Students", + "benchmark": 0.06, + "benchmark_explanation": "State average", + "values": { + "argenziano": 0.05, + "healey": 0.05, + "brown": 0.05, + "east": 0.05, + "kennedy": 0.05, + "west": 0.05, + "winter": 0.06 + }, "likert": { + "argenziano": 2, + "brown": 3, + "east": 2, + "healey": 2, + "west": 2, + "winter": 3 + } + }, + { + "title": "Percentage of Students Getting 60 Minutes of Exercise 5 Days per Week", + "benchmark": 55, + "benchmark_explanation": "National average", + "values": { + "argenziano": 46, + "healey": 43.2, + "brown": 64.6, + "east": 44.6, + "kennedy": 55.5, + "west": 61.7, + "winter": 44.7 + }, "likert": { + "argenziano": 1, + "healey": 5, + "east": 1, + "kennedy": 4, + "west": 5, + "winter": 1 + } + } + ] + } + } + } + } + } +] diff --git a/data/questions.json b/data/questions.json new file mode 100644 index 00000000..defa591f --- /dev/null +++ b/data/questions.json @@ -0,0 +1,205 @@ +[ + {"category": "1-A-i", "text": "Given your preparation for teaching, how comfortable are you teaching at the grade-level you have been assigned?", "answers": ["Not at all comfortable", "Slightly comfortable", "Somewhat comfortable", "Mostly comfortable", "Extremely comfortable"]}, + {"category": "1-A-i", "text": "Given your preparation for teaching how comfortable are you teaching at the grade-level you have been assigned?", "answers": ["Not at all comfortable", "Slightly comfortable", "Somewhat comfortable", "Mostly comfortable", "Extremely comfortable"]}, + {"category": "1-A-i", "text": "How prepared are you for teaching the topics that you are expected to teach?", "answers": ["Not prepared at all", "Slightly prepared", "Somewhat prepared", "Mostly prepared", "Thoroughly prepared"]}, + {"category": "1-A-i", "text": "How prepared are you for teaching the topics that you are expected to teach in your assignment?", "answers": ["Not prepared at all", "Slightly prepared", "Somewhat prepared", "Mostly prepared", "Thoroughly prepared"]}, + {"category": "1-A-i", "text": "How confident are you in working with the students at your school?", "answers": ["Not at all confident","Slightly confident","Somewhat confident","Mostly confident","Extremely confident"]}, + {"category": "1-A-i", "text": "How confident are you in working with the student body at your school?", "answers": ["Not at all confident","Slightly confident","Somewhat confident","Mostly confident","Extremely confident"]}, + {"category": "1-A-ii", "text": "Overall, how much have you learned from your .* teacher?", "answers": ["Almost nothing", "A little bit", "Some", "Quite a bit", "A tremendous amount"]}, + {"category": "1-A-ii", "text": "During class, how motivating are the activities that your .* teacher uses?", "answers": ["Not at all motivating", "Slightly motivating", "Somewhat motivating", "Quite motivating", "Extremely motivating"]}, + {"category": "1-A-ii", "text": "During class, how good is your .* teacher at making sure students do not get out of control?", "answers": ["Not at all good", "Slightly good", "Somewhat good", "Quite good", "Extremely good"]}, + {"category": "1-A-ii", "text": "For .* class, how clearly does your .* teacher present the information that you need to learn?", "answers": ["Not at all clearly", "A little bit clearly", "Somewhat", "Quite clearly", "Extremely clearly"]}, + {"category": "1-A-ii", "text": "For this class, how clearly does your .* teacher present the information that you need to learn?", "answers": ["Not at all clearly", "A little clearly", "Somewhat", "Quite clearly", "Extremely clearly"]}, + {"category": "1-A-ii", "text": "For this class, how clearly does your .* teacher present the information you need to learn?", "answers": ["Not at all clearly", "A little clearly", "Somewhat", "Quite clearly", "Extremely clearly"]}, + {"category": "1-A-ii", "text": "How much does your .* teacher know about the topic of his or her class?", "answers": ["Almost nothing", "A little bit", "Some", "Quite a bit", "A tremendous amount"]}, + {"category": "1-A-ii", "text": "In a typical .* class, how clearly do you understand what your .* teacher expects of you?", "answers": ["Not at all clearly", "A little bit clearly", "Somewhat clearly", "Quite clearly", "Extremely clearly"]}, + {"category": "1-A-ii", "text": "In a typical class, how clearly do you understand what your .* teacher expects of you?", "answers": ["Not at all clearly", "A little bit clearly", "Somewhat clearly", "Quite clearly", "Extremely clearly"]}, + {"category": "1-A-ii", "text": "When you need extra help, how good is your .* teacher at giving you that help?", "answers": ["Not at all good", "Slightly good", "Somewhat good", "Quite good", "Extremely good"]}, + {"category": "1-A-ii", "text": "How well has your .* teacher taught you about the topics of his or her class?", "answers": ["Not at all well", "Slightly well", "Somewhat well ", "Quite well", "Extremely well"]}, + {"category": "1-A-ii", "text": "How good is your .* teacher at making sure time does not get wasted in his/her class?", "answers": ["Not at all good", "Slightly good", "Somewhat good", "Quite good", "Extremely good"]}, + {"category": "1-A-ii", "text": "How good is your .* teacher at teaching in the way that you personally learn best?", "answers": ["Not at all good", "Slightly good", "Somewhat good", "Quite good", "Extremely good"]}, + {"category": "1-A-ii", "text": "How well can your .* teacher tell whether or not you understand a topic?", "answers": ["Not at all well", "Slightly well", "Slightly well ", "Quite well", "Extremely well"]}, + {"category": "1-A-ii", "text": "How comfortable are you asking your .* teacher questions about what you are learning in his or her class?", "answers": ["Not at all comfortable", "A little comfortable", "Somewhat comfortable", "Quite comfortable", "Extremely comfortable"]}, + {"category": "1-A-ii", "text": "How interesting does your .* teacher make the things you are learning in class?", "answers": ["Not at all interesting", "A little interesting", "Somewhat interesting", "Quite interesting", "Extremely interesting"]}, + {"category": "1-A-ii", "text": "How good is your .* teacher at helping you learn?", "answers": ["Not at all good","Slightly good","Somewhat good", "Quite good","Extremely good"]}, + {"category": "1-A-iii", "text": "When your .* teacher asks how you are doing, how often do you feel that he/she is really interested in your answer?", "answers": ["Never", "Once in a while", "Sometimes", "Frequently", "Always"]}, + {"category": "1-A-iii", "text": "How interested is your .* teacher in what you do outside of class?", "answers": ["Not at all interested", "A little bit interested", "Slightly interested", "Quite interested", "Extremely interested"]}, + {"category": "1-A-iii", "text": "How interested is your .* teacher in your career after you finish school?", "answers": ["Not at all interested", "A little bit interested", "Somewhat interested", "Quite interested", "Extremely interested"]}, + {"category": "1-A-iii", "text": "If you walked into class upset, how concerned would your .* teacher be?", "answers": ["Not at all concerned", "A little bit concerned", "Somewhat concerned", "Quite concerned", "Extremely concerned"]}, + {"category": "1-A-iii", "text": "If you came back to visit class three years from now, how excited would your .* teacher be to see you?", "answers": ["Not at all excited", "A little bit excited", "Somewhat excited", "Quite excited", "Extremely excited"]}, + {"category": "1-A-iii", "text": "If you had something on your mind, how carefully would your .* teacher listen to you?", "answers": ["Not at all carefully", "A little carefully", "Somewhat carefully","Quite carefully","Extremely carefully"]}, + {"category": "1-A-iii", "text": "If you had something on your mind, how carefully would your teacher listen to you?", "answers": ["Not at all carefully", "A little bit carefully", "Somewhat carefully","Quite carefully","Extremely carefully"]}, + {"category": "1-B-ii", "text": "To what extent have your professional development experiences included enough time to explore new ideas?", "answers": ["Not at all", "A little bit", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-ii", "text": "To what extent have your professional development included enough time to explore new ideas?", "answers": ["Not at all", "A little bit", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-ii", "text": "How much would you say that your professional development has been sustained/consistent (rather than discontinuous)? ", "answers": ["Not at all sustained", "Slightly sustained", "Somewhat sustained", "Quite sustained", "Thoroughly sustained"]}, + {"category": "1-B-ii", "text": "How effectively have professional development experiences encouraged you to work productively with colleagues? ", "answers": ["Not effectively at all ", "Slightly effectively", "Moderately effectively", "Quite effectively", "Extremely effectively"]}, + {"category": "1-B-ii", "text": "To what extent has your professional development been connected to the topics you teach? ", "answers": ["Not at all connected", "Slightly connected", "Somewhat connected", "Quite connected", "Tremendously connected"]}, + {"category": "1-B-ii", "text": "Overall, how strong has the support been for your professional growth?", "answers": ["Not strong at all", "Slightly strong", "Moderately strong", "Quite strong", "Extremely strong"]}, + {"category": "1-B-iii", "text": "To what extent do you trust your principal at his or her word? ", "answers": ["Not at all", "A little bit", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-iii", "text": "At your school, how comfortable are you raising concerns with the principal? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Somewhat comfortable", "Quite comfortable", "Extremely comfortable"]}, + {"category": "1-B-iii", "text": "How much do you trust your principal to stand up for you in disagreements with parents? ", "answers": ["Not at all", "A little bit ", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-iii", "text": "How likely do you think your principal would be to stand up for you in a disagreement with the district? ", "answers": ["Not at all likely", "Slightly likely", "Somewhat likely", "Quite likely", "Extremely likely"]}, + {"category": "1-B-iii", "text": "To what extent do you think your principal has the best interests of the school in mind?", "answers": ["Not at all","A little bit","Somewhat","Quite a bit","Almost entirely"]}, + {"category": "1-B-iii", "text": "How clearly does your principal convey to staff his or her expectations for meeting instructional goals?", "answers": ["Not at all clearly", "Slightly clearly", "Somewhat clearly", "Quite clearly", "Extremely clearly"]}, + {"category": "1-B-iii", "text": "How effectively does your principal communicate a clear vision for your school? ", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Quite effectively", "Extremely effectively"]}, + {"category": "1-B-iii", "text": "To what extent do you believe that your principal understands how children learn? ", "answers": ["Not at all", "A little bit", "Somewhat", "Quite a bit", "To a great extent"]}, + {"category": "1-B-iii", "text": "How rigorous are your principal's standards for student learning? ", "answers": ["Not rigorous at all", "Slightly rigorous", "Moderately rigorous", "Quite rigorous", "Extremely rigorous"]}, + {"category": "1-B-iii", "text": "How effectively does your principal press teachers to engage in good pedagogical practice? ", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Quite effectively", "Very effectively"]}, + {"category": "1-B-iii", "text": "How carefully does your principal track students' academic progress? ", "answers": ["Not carefully at all", "Slightly carefully", "Somewhat carefully", "Quite carefully", "Extremely carefully"]}, + {"category": "1-B-iii", "text": "How carefully does your principal track students’ academic progress?", "answers": ["Not carefully at all", "Slightly carefully", "Somewhat carefully", "Quite carefully", "Extremely carefully"]}, + {"category": "1-B-iii", "text": "How much does your principal know about what's going on in teachers' classrooms? ", "answers": ["Almost nothing", "A little bit", "A moderate amount", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-iii", "text": "How much does your principal know about what’s going on in teachers’ classrooms?", "answers": ["Almost nothing", "A little bit", "A moderate amount", "Quite a bit", "A tremendous amount"]}, + {"category": "1-B-iii", "text": "How effectively does your principal participate in instructional planning with teams of teachers? ", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Quite effectively", "Extremely effectively"]}, + {"category": "1-B-iii", "text": "Overall, how much has your principal improved the teaching of your faculty?", "answers": ["Not at all", "A little bit", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "2-A-i", "text": "How often do you worry about violence at your school?", "answers": ["Almost always", "Frequently", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-A-i", "text": "How often do students get into physical fights at your school?", "answers": ["Very frequently", "Regularly", "Occasionally", "Rarely", "Almost never"]}, + {"category": "2-A-i", "text": "Overall, how unsafe do you feel at your school?", "answers": ["Extremely unsafe", "Quite unsafe", "Somewhat unsafe", "A little bit unsafe", "Not at all unsafe"]}, + {"category": "2-A-i", "text": "Overall, how unsafe do you feel at school?", "answers": ["Extremely unsafe", "Quite unsafe", "Somewhat unsafe", "A little bit unsafe", "Not at all unsafe"]}, + {"category": "2-A-i", "text": "How often do you feel like you might be harmed by someone at school?", "answers": ["Almost always", "Frequently", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-A-ii", "text": "How often are students bullied at school? ", "answers": ["Almost all the time", "Often", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-A-ii", "text": "How frequently are students bullied online? ", "answers": ["Almost all the time", "Often", "Sometimes", "Once in a while", "Almost Never"]}, + {"category": "2-A-ii", "text": "How often are students bullied because of who they are?", "answers": ["Almost all the time","Often","Sometimes","Once in a while","Almost never"]}, + {"category": "2-A-ii", "text": "How much do students at this school care about each other? ", "answers": ["Not at all", "A little bit", "Somewhat", "A good amount", "A lot"]}, + {"category": "2-A-ii", "text": "How often do students at this school help each other learn? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost all the time"]}, + {"category": "2-A-ii", "text": "To what extent do students at this school get along with each other?", "answers": ["Not at all", "A little bit ", "Somewhat", "Quite a bit", "A great deal"]}, + {"category": "2-A-ii", "text": "How much respect do students at this school treat each other with? ", "answers": ["No respect", "A little bit of respect", "Some respect", "Quite a bit of respect", "Tremendous respect"]}, + {"category": "2-A-ii", "text": "How often do students at this school decide on their own to help each other?", "answers": ["Almost never", "Once in a while","Sometimes","Often", "Almost all the time"]}, + {"category": "2-A-ii", "text": "Overall, how unkind are students to each other?", "answers": ["Very unkind", "Quite unkind", "Somewhat unkind", "A little bit unkind", "Not at all unkind"]}, + {"category": "2-B-i", "text": "overall, how much do you feel like you belong at your school?", "answers": ["Do not belong", "Belong a little bit", "Belong somewhat ", "Belong quite a bit", "Almost totally belong"]}, + {"category": "2-B-i", "text": "Overall, how much do you feel like you belong at your school?", "answers": ["Do not belong", "Belong a little bit", "Belong somewhat ", "Belong quite a bit", "Almost totally belong"]}, + {"category": "2-B-i", "text": "At your school, how accepted do you feel by the other students? ", "answers": ["Not at all accepted", "A little accepted", "Somewhat accepted", "Quite accepted", "Extremely accepted"]}, + {"category": "2-B-i", "text": "How well do people at your school understand you? ", "answers": ["Don't understand me", "Understand me a little bit", "Understand me somewhat", "Understand me quite a bit", "Understand me extremely well"]}, + {"category": "2-B-i", "text": "How much support do the adults at your school give you? ", "answers": ["No support at all", "A little bit of support", "Some support", "Quite a bit of support", "A great deal of support"]}, + {"category": "2-B-i", "text": "How much respect do students in your school show you? ", "answers": ["No respect at all", "A little bit of respect", "Some respect", "Quite a bit of respect", "A great deal of respect"]}, + {"category": "2-B-i", "text": "How connected do you feel to the adults at your school? ", "answers": ["Not at all connected", "Slightly connected", "Somewhat connected", "Quite connected", "Extremely well connected"]}, + {"category": "2-B-i", "text": "How close are your relationships with others at this school?", "answers": ["Not at all close","A little close","Somewhat close", "Quite close", "Extremely close"]}, + {"category": "2-B-ii", "text": "How much do you enjoy learning from your .* teacher?", "answers": ["Not at all", "Slightly", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "2-B-ii", "text": "How friendly is your .* teacher toward you?", "answers": ["Not at all friendly", "A little bit friendly", "Somewhat friendly", "Quite friendly", "Extremely friendly"]}, + {"category": "2-B-ii", "text": "During class, how often do you talk when your .* teacher is talking (when you are supposed to be listening)?", "answers": ["Almost never", "Once in a while", "Sometimes", "Frequently", "Very frequently"]}, + {"category": "2-B-ii", "text": "How respectful is your .* teacher towards you?", "answers": ["Not at all respectful", "Slightly respectful", "Somewhat respectful", "Quite respectful", "Extremely respectful"]}, + {"category": "2-B-ii", "text": "How often do you ignore something your .* teacher says?", "answers": ["Very frequently", "Frequently", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-B-ii", "text": "How excited would you be to have your .* teacher again?", "answers": ["Not at all excited", "A little excited", "Somewhat excited", "Quite excited", "Extremely excited"]}, + {"category": "2-B-ii", "text": "How often does your .* teacher say something that bothers you?", "answers": ["Very frequently", "Frequently", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-B-ii", "text": "How unfair are the grades your .* teacher gives you in this class? ", "answers": ["Extremely unfair", "Quite unfair", "Somewhat unfair", "Slightly unfair", "Not at all unfair"]}, + {"category": "2-B-ii", "text": "How caring is your .* teacher towards you?", "answers": ["Not at all caring", "Slightly caring", "Somewhat caring", "Quite caring", "Extremely caring"]}, + {"category": "2-B-ii", "text": "How much do you like your .* teacher's personality?", "answers": ["Not at all ", "Slightly", "Somewhat", "Quite a bit", "A tremendous amount"]}, + {"category": "2-B-ii", "text": "How often does your .* teacher put you in a bad mood during class?", "answers": ["Very frequently", "Frequently", "Sometimes", "Once in a while", "Almost never"]}, + {"category": "2-B-ii", "text": "Overall, how much do you learn from your .* teacher?", "answers": ["Almost nothing", "A little bit", "Some", "Quite a bit", "A very great amount"]}, + {"category": "2-C-ii", "text": "How much does your .* teacher encourage you to do your best?", "answers": ["Does not encourage me at all", "Encourages me a little bit", "Encourages me some", "Encourages me quite a bit", "Encourages me a tremendous amount"]}, + {"category": "2-C-ii", "text": "When you feel like giving up on a difficult task, how likely is it that your .* teacher will help you keep trying?", "answers": ["Not at all likely", "Slightly likely", "Somewhat likely", "Quite likely", "Extremely likely"]}, + {"category": "2-C-ii", "text": "Overall, how high are your .* teacher's expectations of you?", "answers": ["Not at all high", "Slightly high", "Somewhat high", "Quite high", "Extremely high"]}, + {"category": "2-C-ii", "text": "How often does your .* teacher give you feedback that helps you learn?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "2-C-ii", "text": "How often does your .* teacher ask you to explain your answers?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost always"]}, + {"category": "2-C-ii", "text": "How hard does your .* teacher make you think? ", "answers": ["Not hard at all", "Slightly hard", "Somewhat hard", "Quite hard", "Extremely hard"]}, + {"category": "2-C-ii", "text": "In this class, how hard does your .* teacher make you think? ", "answers": ["Not hard at all", "Slightly hard", "Somewhat hard", "Quite hard", "Extremely hard"]}, + {"category": "2-C-ii", "text": "How often does your .* teacher ask you to figure out the answer to your own question?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost always"]}, + {"category": "2-C-ii", "text": "How often does your .* teacher take time to make sure you understand the material?", "answers": ["Almost never","Once in a while","Sometimes","Often","Almost always"]}, + {"category": "3-A-i", "text": "To what extent do you have access to the resources you need to effectively teach your students?", "answers": ["Not at all", "A little bit", "Somewhat ", "Quite a bit", "A great deal"]}, + {"category": "3-A-i", "text": "How would you rate the quality of available teaching resources?", "answers": ["Very low quality", "Moderately low quality", "Slightly high quality", "Moderately high quality", "Very high quality"]}, + {"category": "3-A-i", "text": "How adequate or inadequate is the support you receive for using technology? ", "answers": ["Support is highly inadequate", "Support is moderately inadequate", "Support is neither adequate nor inadequate", "Support is moderately adequate", "Support is highly adequate"]}, + {"category": "3-A-i", "text": "How sufficient or insufficient is the physical space for school activities?", "answers": ["Space is highly insufficient", "Space is moderately insufficient", "Space is neither sufficient nor insufficient", "Space is moderately sufficient", "Space is highly sufficient"]}, + {"category": "3-A-i", "text": "How well-maintained are school facilities?", "answers": ["Not at all well-maintained","Slightly well-maintained","Moderately well-maintained","Quite well-maintained","Extremely well-maintained"]}, + {"category": "3-A-ii", "text": "Overall, how effective is the support students receive from specialists and support staff? ", "answers": ["Not effective", "Slightly effective", "Somewhat effective", "Effective", "Very effective"]}, + {"category": "3-A-ii", "text": "Overall, how effective is the support students receive from non-teaching staff?", "answers": ["Not effective", "Slightly effective", "Somewhat effective", "Effective", "Very effective"]}, + {"category": "3-A-ii", "text": "How would you rate the number of content specialists and support staff at your school?", "answers": ["Far too low", "Somewhat too low", "Slightly too low", "Slightly too high", "Far too high"]}, + {"category": "3-A-ii", "text": "How often are school counselors available for students with non-academic issues", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost all the time"]}, + {"category": "3-A-ii", "text": "How often are non-teaching support staff available for students with non-academic issues?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost all the time"]}, + {"category": "3-A-ii", "text": "How often are specialists available for students who are struggling academically?", "answers": ["Almost never", "Once in a while","Sometimes","Often", "Almost all the time"]}, + {"category": "3-A-ii", "text": "How often are non-teaching support staff available for students who are struggling academically?", "answers": ["Almost never", "Once in a while","Sometimes","Often", "Almost all the time"]}, + {"category": "3-B-i", "text": "Overall, how rigorous is the curriculum that you are expected to teach?", "answers": ["Not at all rigorous", "A little bit rigorous", "Somewhat rigorous", "Rigorous", "Very rigorous"]}, + {"category": "3-B-i", "text": "How coherent is the curriculum that you are expected to teach?", "answers": ["Not at all coherent", "A little bit coherent", "Somewhat coherent", "Coherent", "Very coherent"]}, + {"category": "3-B-i", "text": "If one of your students transferred to another district with a challenging assortment of courses, how well prepared would he or she be?", "answers": ["Not at all prepared", "A little bit prepared", "Somewhat prepared", "Prepared", "Very prepared"]}, + {"category": "3-B-i", "text": "How well-rounded is the curriculum that you and your colleagues teach?", "answers": ["Not at all well-rounded", "Slightly well-rounded", "Somewhat well-rounded", "Well-rounded", "Very well-rounded"]}, + {"category": "3-B-i", "text": "How much is the curriculum at your school oriented towards test-preparation?", "answers": ["Not at all oriented towards test-prep", "Slightly oriented towards test-prep", "Somewhat oriented towards test-prep", "Oriented towards test-prep", "Very oriented towards test-prep"]}, + {"category": "3-B-i", "text": "How well have school and district leaders prepared you and your colleagues to teach your school's curriculum?", "answers": ["Not at all well-prepared","Slightly well-prepared","Somewhat well-prepared","Well-prepared","Very well-prepared"]}, + {"category": "3-B-i", "text": "How well have school and district leaders prepared you and your colleagues to teach your school’s curriculum?", "answers": ["Not at all well-prepared","Slightly well-prepared","Somewhat well-prepared","Well-prepared","Very well-prepared"]}, + {"category": "3-B-ii", "text": "To what extent would a smaller class size improve your ability to help students learn?", "answers": ["Very much so", "Significantly", "Somewhat", "A bit", "Not at all"]}, + {"category": "3-B-ii", "text": "To what extent would a smaller class improve your ability to know each student?", "answers": ["Very much so", "Significantly", "Somewhat", "A bit", "Not at all"]}, + {"category": "3-B-ii", "text": "To what extent would a smaller class improve classroom dynamics?", "answers": ["Very much so", "Significantly", "Somewhat", "A bit", "Not at all"]}, + {"category": "3-C-i", "text": "How often do you meet in person with parents at your school?", "answers": ["Almost never", "Once or twice per year", "Every few months", "Monthly", "Every few weeks"]}, + {"category": "3-C-i", "text": "In the past year, how often have a majority of parents visited your school?", "answers": ["Almost never", "Once or twice per year", "Every few months", "Monthly", "Every few weeks"]}, + {"category": "3-C-i", "text": "In the past year, how often have you discussed your school with parents from the school?", "answers": ["Almost never", "Once or twice per year", "Every few months", "Monthly", "Every few weeks"]}, + {"category": "3-C-i", "text": "In the past year, how often have you discussed your school with a majority of parents from the school?", "answers": ["Almost never", "Once or twice per year", "Every few months", "Monthly", "Every few weeks"]}, + {"category": "3-C-i", "text": "How involved have parents been in fundraising efforts at your school?", "answers": ["Not at all involved", "A little bit involved", "Somewhat involved", "Quite involved", "Extremely involved "]}, + {"category": "3-C-i", "text": "How involved have parents been with parent groups at your school?", "answers": ["Not at all involved", "A little bit involved", "Somewhat involved", "Quite involved", "Extremely involved "]}, + {"category": "3-C-i", "text": "In the past year, how often have parents helped out at your school?", "answers": ["Almost never","Once or twice per year","Every few months","Monthly","Every few weeks"]}, + {"category": "3-C-ii", "text": "How effectively does this school connect with immigrant parents, providing translation when possible?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]}, + {"category": "3-C-ii", "text": "Overall, how effectively does this school connect with the community?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]}, + {"category": "3-C-ii", "text": "Overall, how well do you believe your school is integrated into the community?", "answers": ["Not well integrated at all", "A bit integrated", "Somewhat integrated", "Quite integrated", "Extremely well integrated"]}, + {"category": "3-C-ii", "text": "How often do students have opportunities to take trips into the community during the school day?", "answers": ["Once or twice per year", "Every few months", "Monthly", "Every few weeks", "Weekly or more"]}, + {"category": "3-C-ii", "text": "How frequently do students have the opportunity to interact with community members inside the school?", "answers": ["Once or twice per year", "Every few months", "Monthly", "Every few weeks", "Weekly or more"]}, + {"category": "3-C-ii", "text": "How often do community members help or volunteer in the school?", "answers": ["Once or twice per year","Every few months","Monthly","Every few weeks","Weekly or more"]}, + {"category": "4-A-ii", "text": "Relative to what you know of most students at your school, how much effort did your students put forth overall in your classes this year?", "answers": ["Almost no effort", "A little bit of effort", "Some effort", "Quite a bit of effort", "A tremendous amount of effort"]}, + {"category": "4-A-ii", "text": "Relative to what you know of students this age, how much effort did your students put forth in your class this year?", "answers": ["Almost no effort", "A little bit of effort", "Some effort", "Quite a bit of effort", "A tremendous amount of effort"]}, + {"category": "4-A-ii", "text": "To what extent do you believe that your students' MCAS scores accurately reflect their abilities?", "answers": ["Scores are much higher than abilities", "Scores are somewhat higher than abilities", "Scores and abilities match", "Scores are somewhat lower than abilities", "Scores are far lower than abilities"]}, + {"category": "4-A-ii", "text": "To what extent do you believe that your students’ MCAS scores accurately reflect their abilities?", "answers": ["Scores are much higher than abilities", "Scores are somewhat higher than abilities", "Scores and abilities match", "Scores are somewhat lower than abilities", "Scores are far lower than abilities"]}, + {"category": "4-A-ii", "text": "If student work from your classes was compared with work from 'average' Massachusetts classes of the same grades/subjects, how do you think an objective observer would rate the work?", "answers": ["Significantly below grade-level average", "Somewhat below grade-level average", "Average for the grade level", "Above grade-level average", "Significantly above grade-level average"]}, + {"category": "4-A-ii", "text": "If student work from your classes was compared with work from \"average\" Massachusetts classes of the same grades/subjects, how do you think an objective observer would rate the work?", "answers": ["Significantly below grade-level average", "Somewhat below grade-level average", "Average for the grade level", "Above grade-level average", "Significantly above grade-level average"]}, + {"category": "4-A-ii", "text": "If an observer sat in on one of your classes for a week, how would she or he rate your students?", "answers": ["Significantly below grade-level average","Somewhat below grade-level average","Average for the grade level","Above grade-level average","Significantly above grade-level average"]}, + {"category": "4-A-ii", "text": "If an observer sat in on one of your classes for a week, how would s/he rate your students?", "answers": ["Significantly below grade-level average","Somewhat below grade-level average","Average for the grade level","Above grade-level average","Significantly above grade-level average"]}, + {"category": "4-B-i", "text": "How closely do you listen to what is said in your .* class?", "answers": ["Not at all closely", "A little bit closely", "Somewhat closely", "Quite closely", "Extremely closely"]}, + {"category": "4-B-i", "text": "How closely do you listen to what is said in class?", "answers": ["Not at all closely", "A little bit closely", "Somewhat closely", "Quite closely", "Extremely closely"]}, + {"category": "4-B-i", "text": "In this class, how much do you participate?", "answers": ["Not at all", "A little bit", "Some", "Quite a bit", "A tremendous amount"]}, + {"category": "4-B-i", "text": "How much do you participate in .* class?", "answers": ["Not at all", "A little bit", "Some", "Quite a bit", "A tremendous amount"]}, + {"category": "4-B-i", "text": "How often do you come to .* class ready to learn? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "How often do you come to class ready to learn? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "When you are not in .* class, how often do you talk about ideas from class? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "When you are not in class, how often do you talk about ideas from class? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "How often do you get so focused on class activities that you lose track of time? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "How often do you get so focused on .* class activities that you lose track of time? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very often"]}, + {"category": "4-B-i", "text": "How excited are you about going to this class? ", "answers": ["Not at all excited", "A little bit excited", "Somewhat excited", "Quite excited", "Extremely excited"]}, + {"category": "4-B-i", "text": "How excited are you about going to .* class? ", "answers": ["Not at all excited", "A little bit excited", "Somewhat excited", "Quite excited", "Extremely excited"]}, + {"category": "4-B-i", "text": "Overall, how interested are you in .* class?", "answers": ["Not at all interested", "A little bit interested", "Somewhat interested", "Quite interested", "Extremely interested"]}, + {"category": "4-B-i", "text": "Overall, how interested are you in this class?", "answers": ["Not at all interested", "Slightly interested", "Somewhat interested", "Quite interested", "Extremely interested"]}, + {"category": "4-B-i", "text": "How often do you take time outside of .* class to learn more about what you are studying in class?", "answers": ["Almost never","Once in a while","Sometimes","Often","Very often"]}, + {"category": "4-B-i", "text": "How often do you take time outside of class to learn more about what you are studying in class?", "answers": ["Almost never","Once in a while","Sometimes","Often","Very often"]}, + {"category": "4-B-ii", "text": "Overall, how important is school to you?", "answers": ["Not at all important", "Slightly important", "Somewhat important", "Quite important", "Extremely important"]}, + {"category": "4-B-ii", "text": "How often do you use ideas from school in your daily life?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "4-B-ii", "text": "How useful do you think school will be to you in the future?", "answers": ["Not at all useful", "A little bit useful", "Somewhat useful", "Quite useful", "Extremely useful"]}, + {"category": "4-B-ii", "text": "How important is it to you to do well in school?", "answers": ["Not at all important", "Slightly important", "Somewhat important", "Quite important", "Extremely important"]}, + {"category": "4-B-ii", "text": "How interesting do you find the things you learn in school?", "answers": ["Not at all interesting", "Slightly interesting", "Somewhat interesting", "Quite interesting ", "Extremely interesting"]}, + {"category": "4-B-ii", "text": "How curious are you to learn more about things you talked about in school?", "answers": ["Not at all curious", "Slightly curious", "Somewhat curious", "Quite curious", "Extremely curious"]}, + {"category": "4-B-ii", "text": "How much do you enjoy learning in school?", "answers": ["Do not enjoy at all", "Enjoy a little bit", "Enjoy somewhat", "Enjoy quite a bit", "Enjoy a tremendous amount"]}, + {"category": "4-B-ii", "text": "How much do you see yourself as a learner?", "answers": ["Don't see myself as a learner at all","See myself as a learner a little bit","See myself somewhat as a learner","See myself as a learner to some extent","See myself completely as a learner"]}, + {"category": "4-C-i", "text": "How often do students at your school come up with their own interpretations of material?  ", "answers": ["Almost never", "Once in a while", "Sometimes", "Frequently", "Almost all the time"]}, + {"category": "4-C-i", "text": "How often do students apply ideas they have learned to new situations? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Frequently", "Almost all the time"]}, + {"category": "4-C-i", "text": "How often do students collaborate in class to solve complex problems?", "answers": ["Almost never","Once in a while", "Sometimes", "Frequently", "Almost all the time"]}, + {"category": "5-A-i", "text": "How often do you attempt to understand your friends better by trying to figure out what they are thinking? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "How often do you try to think of more than one explanation for why someone else acted as they did? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "Overall, how often do you try to understand the point of view of other people? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "When you are angry at someone, how often do you try to \"put yourself in their shoes\"? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "In general, how often do you try to understand how other people see things?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "How often do you try to figure out what motivates others to behave as they do? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-i", "text": "How often do you try to figure out what emotions people are feeling when you meet them for the first time? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Very frequently"]}, + {"category": "5-A-ii", "text": "How comfortable would you be to work on a school project with a student who speaks a different language? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be eating lunch with a student who might be homeless? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be to be assigned a seat next to a student who is overweight? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be to go see a movie with a student of another race/ethnicity? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be sitting with a student who practices a different religion than you? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be visiting the home of a student who lives in a poor neighborhood? ", "answers": ["Not at all comfortable", "Slightly comfortable", "Neutral", "Comfortable", "Very comfortable"]}, + {"category": "5-A-ii", "text": "How comfortable would you be visiting the home of a student who lives in a wealthy neighborhood?", "answers": ["Not at all comfortable","Slightly comfortable","Neutral", "Comfortable","Very comfortable"]}, + {"category": "5-B-i", "text": "If you face a problem while working towards an important goal, how well can you keep working? ", "answers": ["Not well at all ", "Slightly well", "Somewhat well", "Quite well", "Extremely well"]}, + {"category": "5-B-i", "text": "How often do you stay focused on the same goal for several months at a time? ", "answers": ["Almost never", "Once in a while", "Sometimes", "Frequently", "Almost always"]}, + {"category": "5-B-i", "text": "Some people pursue some of their goals for a long time, and others change their goals frequently. Over the next several years, how likely are you to continue to pursue one of your current goals?", "answers": ["Not likely at all", "Slightly likely", "Somewhat likely", "Quite likely ", "Extremely likely"]}, + {"category": "5-B-i", "text": "How important is it to you to finish things you start? ", "answers": ["Not important at all", "Slightly important", "Somewhat important", "Quite important", "Extremely important"]}, + {"category": "5-B-i", "text": "How confident are you that you can remain focused on what you are doing, even when there are distractions? ", "answers": ["Not confident at all", "Slightly confident", "Somewhat confident", "Quite confident", "Extremely confident"]}, + {"category": "5-B-i", "text": "When faced with a very challenging task, how hard do you work to complete it? ", "answers": ["Not hard at all", "Slightly hard", "Somewhat hard", "Quite hard", "Extremely hard"]}, + {"category": "5-B-i", "text": "If you fail to reach an important goal, how likely are you to try again? ", "answers": ["Not likely at all", "Slightly likely", "Somewhat likely", "Quite likely", "Extremely likely"]}, + {"category": "5-B-i", "text": "How likely is it that you can motivate yourself to do unpleasant tasks if they will help you accomplish your goals?", "answers": ["Not likely at all","Slightly likely","Somewhat likely","Quite likely","Extremely likely"]}, + {"category": "5-C-i", "text": "How often are students exposed to arts at your school?", "answers": ["Less than once each week","One or two times each week","Almost every day","Every day","Frequently every day"]}, + {"category": "5-C-i", "text": "How often do students participate in visual arts at your school?", "answers": ["Less than once each week","One or two times each week","Almost every day","Every day","Frequently every day"]}, + {"category": "5-C-i", "text": "How often do students participate in music at your school?", "answers": ["Less than once each week","One or two times each week","Almost every day","Every day","Frequently every day"]}, + {"category": "5-C-i", "text": "How often are arts and music incorporated into other content areas at your school?", "answers": ["Less than once each week","One or two times each week","Almost every day","Every day","Frequently every day"]}, + {"category": "5-D-i", "text": "On an average day, how much do you pay attention in school? ", "answers": ["Not at all", "A bit", "Somewhat", "A good amount", "A trememndous amount"]}, + {"category": "5-D-i", "text": "How often do you feel overjoyed in school? ", "answers": ["Almost never overjoyed", "Rarely overjoyed", "Sometimes overjoyed", "Often overjoyed", "Very often overjoyed "]}, + {"category": "5-D-i", "text": "How often do you feel calm at school? ", "answers": ["Almost never calm", "Rarely calm", "Sometimes calm", "Often calm", "Very often calm"]}, + {"category": "5-D-i", "text": "On a regular day at school, how often do you feel relaxed? ", "answers": ["Almost never relaxed", "Rarely relaxed", "Sometimes relaxed", "Often relaxed", "Very often relaxed"]}, + {"category": "5-D-i", "text": "Are you enthusiastic at school? ", "answers": ["Almost never enthusiastic", "Rarely enthusiastic", "Sometimes enthusiastic", "Often enthusiastic", "Almost always enthusiastic"]}, + {"category": "5-D-i", "text": "How often are you enthusiastic at school? ", "answers": ["Almost never enthusiastic", "Rarely enthusiastic", "Sometimes enthusiastic", "Often enthusiastic", "Very often enthusiastic"]}, + {"category": "5-D-i", "text": "How often are you interested in what you're doing in school?", "answers": ["Almost never interested", "Rarely interested", "Sometimes interested", "Often interested", "Very often interested"]}, + {"category": "5-D-i", "text": "On a normal day in school, how confident do you feel? ", "answers": ["Not at all confident", "A bit confident", "Somewhat confident", "Significantly confident", "Very confident"]}, + {"category": "5-D-i", "text": "How energetic are you in school on an average day? ", "answers": ["Not at all energetic", "A bit energetic", "Somewhat energetic", "Very energetic", "Extremely energetic"]}, + {"category": "5-D-i", "text": "On a normal day in school, how much are you able to concentrate?", "answers": ["Can't concentrate at all", "Can concentrate a bit","Can concentrate somewhat","Can concentrate well","Can concentrate extremely well"]}, + {"category": "5-D-ii", "text": "How often do students engage in 30 minutes or more of physical activity at your school?", "answers": ["Not at all", "Less than once each week", "One or two times each week", "Almost every day", "Every day"]}, + {"category": "5-D-ii", "text": "How often do students at your school engage in programs aimed at improving their physical health?", "answers": ["Not at all", "Less than once each week", "One or two times each week", "Almost every day", "Every day"]} +] diff --git a/db/migrate/20170304020530_create_questions.rb b/db/migrate/20170304020530_create_questions.rb new file mode 100644 index 00000000..c7c4dd29 --- /dev/null +++ b/db/migrate/20170304020530_create_questions.rb @@ -0,0 +1,15 @@ +class CreateQuestions < ActiveRecord::Migration[5.0] + def change + create_table :questions do |t| + t.string :text + t.string :option1 + t.string :option2 + t.string :option3 + t.string :option4 + t.string :option5 + t.integer :category_id + + t.timestamps + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 93ca50dd..adb591d2 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.define(version: 20170303162123) do +ActiveRecord::Schema.define(version: 20170304020530) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -32,6 +32,18 @@ ActiveRecord::Schema.define(version: 20170303162123) do t.datetime "updated_at", null: false end + create_table "questions", force: :cascade do |t| + t.string "text" + t.string "option1" + t.string "option2" + t.string "option3" + t.string "option4" + t.string "option5" + t.integer "category_id" + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + end + create_table "recipient_lists", force: :cascade do |t| t.integer "school_id" t.string "name" diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake new file mode 100644 index 00000000..3f4d0226 --- /dev/null +++ b/lib/tasks/data.rake @@ -0,0 +1,171 @@ +require 'csv' + +namespace :data do + desc "Load in all data" + task load: :environment do + return if School.count > 0 + Rake::Task["db:seed"].invoke + Rake::Task["data:load_measurements"].invoke + Rake::Task["data:load_questions"].invoke + # Rake::Task["data:load_student_responses"].invoke + end + + desc 'Load in measurement data' + task load_measurements: :environment do + measures = JSON.parse(File.read(File.expand_path('../../../data/measures.json', __FILE__))) + measures.each_with_index do |measure, index| + category = Category.create( + name: measure['title'], + blurb: measure['blurb'], + description: measure['text'], + external_id: index + ) + + measure['sub'].keys.sort.each do |key| + subinfo = measure['sub'][key] + subcategory = category.child_categories.create( + name: subinfo['title'], + blurb: subinfo['blurb'], + description: subinfo['text'], + external_id: key + ) + + subinfo['measures'].keys.sort.each do |subinfo_key| + subsubinfo = subinfo['measures'][subinfo_key] + subsubcategory = subcategory.child_categories.create( + name: subsubinfo['title'], + blurb: subsubinfo['blurb'], + description: subsubinfo['text'], + external_id: subinfo_key + ) + + # if subsubinfo['nonlikert'].present? + # subsubinfo['nonlikert'].each do |nonlikert_info| + # next unless nonlikert_info['likert'].present? + # nonlikert = subsubcategory.child_measures.create( + # name: nonlikert_info['title'], + # description: nonlikert_info['benchmark_explanation'], + # benchmark: nonlikert_info['benchmark'] + # ) + # + # name_map = { + # "argenziano": "dr-albert-f-argenziano-school-at-lincoln-park", + # "healey": "arthur-d-healey-school", + # "brown": "benjamin-g-brown-school", + # "east": "east-somerville-community-school", + # "kennedy": "john-f-kennedy-elementary-school", + # "somervillehigh": "somerville-high-school", + # "west": "west-somerville-neighborhood-school", + # "winter": "winter-hill-community-innovation-school" + # } + # + # nonlikert_info['likert'].each do |key, likert| + # school_name = name_map[key.to_sym] + # next if school_name.nil? + # school = School.friendly.find(school_name) + # nonlikert.measurements.create(school: school, likert: likert, nonlikert: nonlikert_info['values'][key]) + # end + # end + # end + end + end + end + end + + desc 'Load in question data' + task load_questions: :environment do + variations = [ + 'homeroom', + 'English', + 'Math', + 'Science', + 'Social Studies' + ] + + questions = JSON.parse(File.read(File.expand_path('../../../data/questions.json', __FILE__))) + questions.each do |question| + category = nil + question['category'].split('-').each do |external_id| + categories = Category + categories = category.child_categories if category.present? + category = categories.where(external_id: external_id).first + end + question_text = question['text'].gsub(/[[:space:]]/, ' ').strip + if question_text.index('*').nil? + category.questions.create( + text: question_text, + option1: question['answers'][0], + option2: question['answers'][1], + option3: question['answers'][2], + option4: question['answers'][3], + option5: question['answers'][4] + ) + else + variations.each do |variation| + measure.questions.create(text: question_text.gsub('.*', variation), answers: question['answers'].to_yaml) + end + end + end + end + + desc 'Load in student and teacher responses' + task load_student_responses: :environment do + ENV['BULK_PROCESS'] = 'true' + answer_dictionary = { + 'Slightly': 'Somewhat' + } + + unknown_schools = {} + missing_questions = {} + bad_answers = {} + year = '2016' + ['student_responses', 'teacher_responses'].each do |file| + source = Measurement.sources[file.split('_')[0]] + csv_string = File.read(File.expand_path("../../../data/#{file}_#{year}.csv", __FILE__)) + csv = CSV.parse(csv_string, :headers => true) + csv.each do |row| + school_name = row['What school do you go to?'] + school_name = row['What school do you work at'] if school_name.nil? + school = School.find_by_name(school_name) + if school.nil? + next if unknown_schools[school_name] + puts "Unable to find school: #{school_name}" + unknown_schools[school_name] = true + next + end + + row.each do |key, value| + next if value.nil? or key.nil? + key = key.gsub(/[[:space:]]/, ' ').strip + value = value.gsub(/[[:space:]]/, ' ').strip.downcase + question = Question.find_by_text(key) + if question.nil? + next if missing_questions[key] + puts "Unable to find question: #{key}" + missing_questions[key] = true + next + end + + answers = YAML::load(question.answers).collect { |a| a.gsub(/[[:space:]]/, ' ').strip.downcase } + answerIndex = answers.index(value) + answer_dictionary.each do |k, v| + break if answerIndex.present? + answerIndex = answers.index(value.gsub(k.to_s, v.to_s)) || answers.index(value.gsub(v.to_s, k.to_s)) + end + + if answerIndex.nil? + next if bad_answers[key] + puts "Unable to find answer: #{key} = #{value} - #{answers.inspect}" + bad_answers[key] = true + next + end + + question.measurements.create(school: school, likert: answerIndex + 1, source: source) + end + end + end + ENV.delete('BULK_PROCESS') + + SchoolMeasure.all.each { |sm| sm.calculate_measurements } + end +end diff --git a/spec/controllers/questions_controller_spec.rb b/spec/controllers/questions_controller_spec.rb new file mode 100644 index 00000000..09a87481 --- /dev/null +++ b/spec/controllers/questions_controller_spec.rb @@ -0,0 +1,168 @@ +require 'rails_helper' + +# This spec was generated by rspec-rails when you ran the scaffold generator. +# It demonstrates how one might use RSpec to specify the controller code that +# was generated by Rails when you ran the scaffold generator. +# +# It assumes that the implementation code is generated by the rails scaffold +# generator. If you are using any extension libraries to generate different +# controller code, this generated spec may or may not pass. +# +# It only uses APIs available in rails and/or rspec-rails. There are a number +# of tools you can use to make these specs even more expressive, but we're +# sticking to rails and rspec-rails APIs to keep things simple and stable. +# +# Compared to earlier versions of this generator, there is very limited use of +# stubs and message expectations in this spec. Stubs are only used when there +# is no simpler way to get a handle on the object needed for the example. +# Message expectations are only used when there is no simpler way to specify +# that an instance is receiving a specific message. + +RSpec.describe QuestionsController, type: :controller do + + # This should return the minimal set of attributes required to create a valid + # Question. As you add validations to Question, be sure to + # adjust the attributes here as well. + let (:category) { Category.create!(name: 'Category') } + let(:valid_attributes) { + { + text: 'Question', + option1: 'option1', + option2: 'option2', + option3: 'option3', + option4: 'option4', + option5: 'option5', + category_id: category.id + } + } + + let(:invalid_attributes) { + {text: ''} + } + + # This should return the minimal set of values that should be in the session + # in order to pass any filters (e.g. authentication) defined in + # QuestionsController. Be sure to keep this updated too. + let(:valid_session) { {} } + + describe "GET #index" do + it "assigns all questions as @questions" do + question = Question.create! valid_attributes + get :index, params: {}, session: valid_session + expect(assigns(:questions)).to eq([question]) + end + end + + describe "GET #show" do + it "assigns the requested question as @question" do + question = Question.create! valid_attributes + get :show, params: {id: question.to_param}, session: valid_session + expect(assigns(:question)).to eq(question) + end + end + + describe "GET #new" do + it "assigns a new question as @question" do + get :new, params: {}, session: valid_session + expect(assigns(:question)).to be_a_new(Question) + end + end + + describe "GET #edit" do + it "assigns the requested question as @question" do + question = Question.create! valid_attributes + get :edit, params: {id: question.to_param}, session: valid_session + expect(assigns(:question)).to eq(question) + end + end + + describe "POST #create" do + context "with valid params" do + it "creates a new Question" do + expect { + post :create, params: {question: valid_attributes}, session: valid_session + }.to change(Question, :count).by(1) + end + + it "assigns a newly created question as @question" do + post :create, params: {question: valid_attributes}, session: valid_session + expect(assigns(:question)).to be_a(Question) + expect(assigns(:question)).to be_persisted + end + + it "redirects to the created question" do + post :create, params: {question: valid_attributes}, session: valid_session + expect(response).to redirect_to(Question.last) + end + end + + context "with invalid params" do + it "assigns a newly created but unsaved question as @question" do + post :create, params: {question: invalid_attributes}, session: valid_session + expect(assigns(:question)).to be_a_new(Question) + end + + it "re-renders the 'new' template" do + post :create, params: {question: invalid_attributes}, session: valid_session + expect(response).to render_template("new") + end + end + end + + describe "PUT #update" do + context "with valid params" do + let(:new_attributes) { + {text: 'Question2'} + } + + it "updates the requested question" do + question = Question.create! valid_attributes + put :update, params: {id: question.to_param, question: new_attributes}, session: valid_session + question.reload + expect(question.text).to eq('Question2') + end + + it "assigns the requested question as @question" do + question = Question.create! valid_attributes + put :update, params: {id: question.to_param, question: valid_attributes}, session: valid_session + expect(assigns(:question)).to eq(question) + end + + it "redirects to the question" do + question = Question.create! valid_attributes + put :update, params: {id: question.to_param, question: valid_attributes}, session: valid_session + expect(response).to redirect_to(question) + end + end + + context "with invalid params" do + it "assigns the question as @question" do + question = Question.create! valid_attributes + put :update, params: {id: question.to_param, question: invalid_attributes}, session: valid_session + expect(assigns(:question)).to eq(question) + end + + it "re-renders the 'edit' template" do + question = Question.create! valid_attributes + put :update, params: {id: question.to_param, question: invalid_attributes}, session: valid_session + expect(response).to render_template("edit") + end + end + end + + describe "DELETE #destroy" do + it "destroys the requested question" do + question = Question.create! valid_attributes + expect { + delete :destroy, params: {id: question.to_param}, session: valid_session + }.to change(Question, :count).by(-1) + end + + it "redirects to the questions list" do + question = Question.create! valid_attributes + delete :destroy, params: {id: question.to_param}, session: valid_session + expect(response).to redirect_to(questions_url) + end + end + +end diff --git a/spec/routing/questions_routing_spec.rb b/spec/routing/questions_routing_spec.rb new file mode 100644 index 00000000..c129db8f --- /dev/null +++ b/spec/routing/questions_routing_spec.rb @@ -0,0 +1,39 @@ +require "rails_helper" + +RSpec.describe QuestionsController, type: :routing do + describe "routing" do + + it "routes to #index" do + expect(:get => "/questions").to route_to("questions#index") + end + + it "routes to #new" do + expect(:get => "/questions/new").to route_to("questions#new") + end + + it "routes to #show" do + expect(:get => "/questions/1").to route_to("questions#show", :id => "1") + end + + it "routes to #edit" do + expect(:get => "/questions/1/edit").to route_to("questions#edit", :id => "1") + end + + it "routes to #create" do + expect(:post => "/questions").to route_to("questions#create") + end + + it "routes to #update via PUT" do + expect(:put => "/questions/1").to route_to("questions#update", :id => "1") + end + + it "routes to #update via PATCH" do + expect(:patch => "/questions/1").to route_to("questions#update", :id => "1") + end + + it "routes to #destroy" do + expect(:delete => "/questions/1").to route_to("questions#destroy", :id => "1") + end + + end +end diff --git a/spec/views/questions/edit.html.erb_spec.rb b/spec/views/questions/edit.html.erb_spec.rb new file mode 100644 index 00000000..ee7c0211 --- /dev/null +++ b/spec/views/questions/edit.html.erb_spec.rb @@ -0,0 +1,36 @@ +require 'rails_helper' + +RSpec.describe "questions/edit", type: :view do + before(:each) do + @question = assign(:question, Question.create!( + :text => "MyString", + :option1 => "MyString", + :option2 => "MyString", + :option3 => "MyString", + :option4 => "MyString", + :option5 => "MyString", + :category_id => 1 + )) + end + + it "renders the edit question form" do + render + + assert_select "form[action=?][method=?]", question_path(@question), "post" do + + assert_select "input#question_text[name=?]", "question[text]" + + assert_select "input#question_option1[name=?]", "question[option1]" + + assert_select "input#question_option2[name=?]", "question[option2]" + + assert_select "input#question_option3[name=?]", "question[option3]" + + assert_select "input#question_option4[name=?]", "question[option4]" + + assert_select "input#question_option5[name=?]", "question[option5]" + + assert_select "input#question_category_id[name=?]", "question[category_id]" + end + end +end diff --git a/spec/views/questions/index.html.erb_spec.rb b/spec/views/questions/index.html.erb_spec.rb new file mode 100644 index 00000000..8ab6fc10 --- /dev/null +++ b/spec/views/questions/index.html.erb_spec.rb @@ -0,0 +1,37 @@ +require 'rails_helper' + +RSpec.describe "questions/index", type: :view do + before(:each) do + assign(:questions, [ + Question.create!( + :text => "Text", + :option1 => "Option1", + :option2 => "Option2", + :option3 => "Option3", + :option4 => "Option4", + :option5 => "Option5", + :category_id => 2 + ), + Question.create!( + :text => "Text", + :option1 => "Option1", + :option2 => "Option2", + :option3 => "Option3", + :option4 => "Option4", + :option5 => "Option5", + :category_id => 2 + ) + ]) + end + + it "renders a list of questions" do + render + assert_select "tr>td", :text => "Text".to_s, :count => 2 + assert_select "tr>td", :text => "Option1".to_s, :count => 2 + assert_select "tr>td", :text => "Option2".to_s, :count => 2 + assert_select "tr>td", :text => "Option3".to_s, :count => 2 + assert_select "tr>td", :text => "Option4".to_s, :count => 2 + assert_select "tr>td", :text => "Option5".to_s, :count => 2 + assert_select "tr>td", :text => 2.to_s, :count => 2 + end +end diff --git a/spec/views/questions/new.html.erb_spec.rb b/spec/views/questions/new.html.erb_spec.rb new file mode 100644 index 00000000..c90dc16f --- /dev/null +++ b/spec/views/questions/new.html.erb_spec.rb @@ -0,0 +1,36 @@ +require 'rails_helper' + +RSpec.describe "questions/new", type: :view do + before(:each) do + assign(:question, Question.new( + :text => "MyString", + :option1 => "MyString", + :option2 => "MyString", + :option3 => "MyString", + :option4 => "MyString", + :option5 => "MyString", + :category_id => 1 + )) + end + + it "renders new question form" do + render + + assert_select "form[action=?][method=?]", questions_path, "post" do + + assert_select "input#question_text[name=?]", "question[text]" + + assert_select "input#question_option1[name=?]", "question[option1]" + + assert_select "input#question_option2[name=?]", "question[option2]" + + assert_select "input#question_option3[name=?]", "question[option3]" + + assert_select "input#question_option4[name=?]", "question[option4]" + + assert_select "input#question_option5[name=?]", "question[option5]" + + assert_select "input#question_category_id[name=?]", "question[category_id]" + end + end +end diff --git a/spec/views/questions/show.html.erb_spec.rb b/spec/views/questions/show.html.erb_spec.rb new file mode 100644 index 00000000..ee1c1fb0 --- /dev/null +++ b/spec/views/questions/show.html.erb_spec.rb @@ -0,0 +1,26 @@ +require 'rails_helper' + +RSpec.describe "questions/show", type: :view do + before(:each) do + @question = assign(:question, Question.create!( + :text => "Text", + :option1 => "Option1", + :option2 => "Option2", + :option3 => "Option3", + :option4 => "Option4", + :option5 => "Option5", + :category_id => 2 + )) + end + + it "renders attributes in

" do + render + expect(rendered).to match(/Text/) + expect(rendered).to match(/Option1/) + expect(rendered).to match(/Option2/) + expect(rendered).to match(/Option3/) + expect(rendered).to match(/Option4/) + expect(rendered).to match(/Option5/) + expect(rendered).to match(/2/) + end +end