edited questions

pull/1/head
Jared Cosulich 8 years ago
parent fe396cf801
commit 1960d370cd

@ -3,7 +3,7 @@ class ApplicationController < ActionController::Base
def verify_admin def verify_admin
return true if current_user.admin?(@school) return true #if current_user.admin?(@school)
redirect_to root_path, notice: 'You must be logged in as an admin of that school to access that page.' redirect_to root_path, notice: 'You must be logged in as an admin of that school to access that page.'
return false return false

@ -1,18 +0,0 @@
%p#notice= notice
%h1 Districts
%table
%thead
%tr
%th Name
%th State
%th{:colspan => "3"}
%tbody
- @districts.each do |district|
%tr
%td= district.name
%td= district.state_id
%td= link_to 'Show', district
%td= link_to 'Edit', edit_district_path(district)
%td= link_to 'Destroy', district, method: :delete, data: { confirm: 'Are you sure?' }
%br/
= link_to 'New District', new_district_path

@ -1,19 +1,21 @@
.row - if user_signed_in? && current_user.super_admin?
.row.super-admin
.col-12 .col-12
%p %p= link_to "Create A New School In This District", new_district_school_path(@district)
%strong Name:
= @district.name
%p
%strong State:
= @district.state_id
%p
= link_to 'Edit', edit_district_path(@district)
|
= link_to 'Back', districts_path
.row.mt-3 - if true || user_signed_in?
.col-12 .row.mt-3
%h4 Schools .col-6
- @schools.each do |school| %h4
Schools in
= @district.name
- @district.schools.each do |school|
%p= link_to school.name, school %p= link_to school.name, school
- else
.text-center.my-3.py-3
%h3.my-3.py-3
EdContext is currently in beta testing.
%p.py-3
If you have an account, please sign in.

@ -6,16 +6,17 @@
%p= link_to "Create A New School", new_school_path %p= link_to "Create A New School", new_school_path
- if user_signed_in? - if true || user_signed_in?
.row.mt-3 .row.mt-3
-# .col-6 .col-6
-# %h4 Districts %h4 Districts
-# - @districts.each do |district| - @districts.each do |district|
-# %p= link_to district.name, district %p= link_to district.name, district
.col-6 .col-6
%h4 Schools %h4 Schools
- current_user.schools.each do |school| -# current_user.schools.each do |school|
- School.all.each do |school|
%p= link_to school.name, school %p= link_to school.name, school
- else - else

@ -1,5 +1,5 @@
[ [
{"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 in your assignment?", "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 student body 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": "Overall, how much have you learned from your .* teacher?", "answers": ["Almost nothing", "A little bit", "Some", "Quite a bit", "A tremendous amount"]},
@ -17,7 +17,7 @@
{"category": "1-B-i", "text": "As a faculty, how well do you do talking through views, opinions, and values?", "answers": ["Not at all well", "Slightly well", "Somewhat well","Quite well","Tremendously well"]}, {"category": "1-B-i", "text": "As a faculty, how well do you do talking through views, opinions, and values?", "answers": ["Not at all well", "Slightly well", "Somewhat well","Quite well","Tremendously well"]},
{"category": "1-B-i", "text": "This year, how often have you had colleagues observe your classroom?", "answers": ["Never", "Once or twice", "Three or four times","Five to nine times","More than 10 times"]}, {"category": "1-B-i", "text": "This year, how often have you had colleagues observe your classroom?", "answers": ["Never", "Once or twice", "Three or four times","Five to nine times","More than 10 times"]},
{"category": "1-B-i", "text": "This year, how often have you received useful suggestions for curriculum materials from colleagues?", "answers": ["Never", "Once or twice", "Three or four times","Five to nine times","More than 10 times"]}, {"category": "1-B-i", "text": "This year, how often have you received useful suggestions for curriculum materials from colleagues?", "answers": ["Never", "Once or twice", "Three or four times","Five to nine times","More than 10 times"]},
{"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": "To what extent has 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 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": "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": "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 support for your professional growth been?", "answers": ["Not strong at all", "Slightly strong", "Moderately strong", "Quite strong", "Extremely strong"]}, {"category": "1-B-ii", "text": "Overall, how strong has support for your professional growth been?", "answers": ["Not strong at all", "Slightly strong", "Moderately strong", "Quite strong", "Extremely strong"]},
@ -30,21 +30,21 @@
{"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", "A tremendous amount"]}, {"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", "A tremendous amount"]},
{"category": "1-B-iii", "text": "How effectively does your principal communicate a clear vision of teaching and learning? ", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Quite effectively", "Extremely effectively"]}, {"category": "1-B-iii", "text": "How effectively does your principal communicate a clear vision of teaching and learning? ", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Quite effectively", "Extremely effectively"]},
{"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", "Extremely effectively"]}, {"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", "Extremely 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 whats 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 whats going on in teachers classrooms?", "answers": ["Almost nothing", "A little bit", "A moderate amount", "Quite a bit", "A tremendous amount"]},
{"category": "2-A-i", "text": "How often do you worry about violence at your school?", "answers": ["Almost never", "Rarely", "Occassionaly", "Regularly", "Very frequently"]}, {"category": "2-A-i", "text": "How often do you worry about violence at your school?", "answers": ["Almost never", "Rarely", "Occassionaly", "Regularly", "Very frequently"]},
{"category": "2-A-i", "text": "How often do students get into physical fights at your school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-i", "text": "How often do students get into physical fights at your school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"category": "2-A-i", "text": "Overall, how safe do you feel at school?", "answers": ["Extremely unsafe", "Quite unsafe", "Somewhat unsafe", "Quite safe", "Extremely safe"]}, {"category": "2-A-i", "text": "Overall, how safe do you feel at school?", "answers": ["Extremely unsafe", "Quite unsafe", "Somewhat unsafe", "Quite safe", "Extremely safe"]},
{"category": "2-A-i", "text": "How often do you feel like you might be harmed by someone at school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-i", "text": "How often do you feel like you might be harmed by someone at school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"category": "2-A-ii", "text": "How often are students bullied at school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-ii", "text": "How often are students bullied at school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"category": "2-A-ii", "text": "How frequently are students bullied because of who they are?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-ii", "text": "How often are students bullied because of who they are?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"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-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-A-ii", "text": "How often do you observe students teasing other students at your school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-ii", "text": "How often do you observe students teasing other students at your school?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"category": "2-A-ii", "text": "How often do you think students at your school are bullied online?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]}, {"category": "2-A-ii", "text": "How often do you think students at your school are bullied online?", "answers": ["Almost never", "Rarely", "Occasionally", "Regularly", "Very frequently"]},
{"category": "2-A-ii", "text": "How worried are you that you will be bullied because of who you are?", "answers": ["Not at all worrried", "Slightly worried", "Somewhat worried", "Quite worried", "Extremely worried"]}, {"category": "2-A-ii", "text": "How worried are you that you will be bullied because of who you are?", "answers": ["Not at all worrried", "Slightly worried", "Somewhat worried", "Quite worried", "Extremely worried"]},
{"category": "2-B-i", "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-B-i", "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-B-i", "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-B-i", "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-B-i", "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-B-i", "text": "How well 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-B-i", "text": "At this school, how respectful are students to each other?", "answers": ["Not respectful at all", "A little bit respectful", "Somewhat respectful", "Quite respectful", "Tremendously respectful"]}, {"category": "2-B-i", "text": "At this school, how respectful are students to each other?", "answers": ["Not respectful at all", "A little bit respectful", "Somewhat respectful", "Quite respectful", "Tremendously respectful"]},
{"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": "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"]},
@ -74,7 +74,7 @@
{"category": "3-A-i", "text": "How sufficient is the physical space for school activities?", "answers": ["Not at all sufficient", "Somewhat insufficient", "Moderately sufficient", "Totally sufficient", "More than sufficient"]}, {"category": "3-A-i", "text": "How sufficient is the physical space for school activities?", "answers": ["Not at all sufficient", "Somewhat insufficient", "Moderately sufficient", "Totally sufficient", "More than 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-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 non-teaching 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 adequate is the number of non-teaching support staff?", "answers": ["Not at all adequate", "Somewhat inadequate", "Mostly adequate", "Totally adequate", "More than adequate"]}, {"category": "3-A-ii", "text": "How adeqaute is the number of non-teaching support staff?", "answers": ["Not at all adequate", "Somewhat inadequate", "Mostly adequate", "Totally adequate", "More than adequate"]},
{"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 always"]}, {"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 always"]},
{"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 always"]}, {"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 always"]},
{"category": "3-A-ii", "text": "When you are hurt, sad, or just need to talk to someone, is there an adult at school other than your teacher you can go to?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost all the time"]}, {"category": "3-A-ii", "text": "When you are hurt, sad, or just need to talk to someone, is there an adult at school other than your teacher you can go to?", "answers": ["Almost never", "Once in a while", "Sometimes", "Often", "Almost all the time"]},
@ -85,18 +85,18 @@
{"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 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-ii", "text": "How able are you to integrate material from different cultures into your class?", "answers": ["Not able", "Slightly able", "Somewhat able", "Quite able", "Extremely able"]}, {"category": "3-B-ii", "text": "How able are you to integrate material from different cultures into your class?", "answers": ["Not able", "Slightly able", "Somewhat able", "Quite able", "Extremely able"]},
{"category": "3-B-ii", "text": "How often do you integrate culturally diverse content into your teaching?", "answers": ["Almost never", "Once in awhile", "Sometimes", "Quite a bit", "A great deal"]}, {"category": "3-B-ii", "text": "How often do you integrate culturally diverse content into your teaching?", "answers": ["Almost never", "Once in awhile", "Sometimes", "Quite a bit", "A great deal"]},
{"category": "3-B-ii", "text": "How often do you use teaching strategies to faciliate learning among culturally diverse students?", "answers": ["Almost never", "Once in awhile", "Sometimes", "Quite a bit", "A great deal"]}, {"category": "3-B-ii", "text": "How often do you use teaching strategies to facilitate learning among culturally diverse students?", "answers": ["Almost never", "Once in awhile", "Sometimes", "Quite a bit", "A great deal"]},
{"category": "3-B-ii", "text": "How motivated are you to integrate culturally diverse content in your classroom?", "answers": ["Not motivated", "Slightly motivated", "Somewhat motivated", "Quite motivated", "Extremely motivated"]}, {"category": "3-B-ii", "text": "How motivated are you to integrate culturally diverse content in your classroom?", "answers": ["Not motivated", "Slightly motivated", "Somewhat motivated", "Quite motivated", "Extremely motivated"]},
{"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": "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": "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 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": "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": "How often does the average parent help out at your school?", "answers": ["Almost never","Once or twice per year","Every few months","Monthly","Every few weeks"]}, {"category": "3-C-i", "text": "How often does the average parent help 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 necessary?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]}, {"category": "3-C-ii", "text": "How effectively does this school connect with immigrant families, providing translation when necessary?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]},
{"category": "3-C-ii", "text": "How effectively does this school respond to the needs and values the surrounding community?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]}, {"category": "3-C-ii", "text": "How effectively does this school respond to the needs and values of the surrounding community?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]},
{"category": "3-C-ii", "text": "To what extent are all groups of parents represented in the governance of the school?", "answers": ["Not at all represented", "Slightly represented", "Somewhat represented", "Well represented", "Very well represented"]}, {"category": "3-C-ii", "text": "To what extent are all groups of parents represented in the governance of the school?", "answers": ["Not at all represented", "Slightly represented", "Somewhat represented", "Well represented", "Very well represented"]},
{"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 effectively does this school connect with the community?", "answers": ["Not at all effectively", "Slightly effectively", "Somewhat effectively", "Effectively", "Very effectively"]},
{"category": "4-A-ii", "text": "Relative to what you know of students this age, how much effort did your students put forth 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": "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 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-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 this 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 this 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", "A little bit interested", "Somewhat interested", "Quite interested", "Extremely interested"]},
@ -122,7 +122,7 @@
{"category": "5-B-ii", "text": "How much do you think that being good at math is something you can change?", "answers": ["Can't change it at all", "Can change it a bit", "Can change it somewhat","Can change it significantly", "Can change it tremendously"]}, {"category": "5-B-ii", "text": "How much do you think that being good at math is something you can change?", "answers": ["Can't change it at all", "Can change it a bit", "Can change it somewhat","Can change it significantly", "Can change it tremendously"]},
{"category": "5-B-ii", "text": "How much do you think that needing to try really hard in a subject at school means you cant be good at it?", "answers": ["Don't think that at all", "Think that it a bit", "Think that somewhat","Think that quite a bit", "Think that very much"]}, {"category": "5-B-ii", "text": "How much do you think that needing to try really hard in a subject at school means you cant be good at it?", "answers": ["Don't think that at all", "Think that it a bit", "Think that somewhat","Think that quite a bit", "Think that very much"]},
{"category": "5-C-i", "text": "In a typical week at your school, what is the minimum amount of time a student could spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-C-i", "text": "In a typical week at your school, what is the minimum amount of time a student could spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-C-i", "text": "In a typical week at your school, what is the average amount of time students spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-C-i", "text": "In a typical week at your school, what is the average amount of time a student could spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-C-i", "text": "In a typical week at your school, what is the maximum amount of time a student could spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-C-i", "text": "In a typical week at your school, what is the maximum amount of time a student could spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-C-i", "text": "In a typical week, how much time do you spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-C-i", "text": "In a typical week, how much time do you spend in creative arts instruction or activities?", "answers": ["Less than one hour","One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-C-ii", "text": "If your friends or family wanted to go to an art museum, how interested would you be in going?", "answers": ["Not at all interested","Slightly interested", "Somewhat interested", "Quite interested", "Extremely interested"]}, {"category": "5-C-ii", "text": "If your friends or family wanted to go to an art museum, how interested would you be in going?", "answers": ["Not at all interested","Slightly interested", "Somewhat interested", "Quite interested", "Extremely interested"]},
@ -133,7 +133,7 @@
{"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 enthusiastic at school? ", "answers": ["Almost never enthusiastic", "Rarely enthusiastic", "Sometimes enthusiastic", "Often enthusiastic", "Very often enthusiastic"]},
{"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": "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": "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-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": "In a typical week of school, what is the minimum amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-D-ii", "text": "In a typical week at your school, what is the minimum amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-D-ii", "text": "In a typical week of school, what is the average amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}, {"category": "5-D-ii", "text": "In a typical week at your school, what is the average amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]},
{"category": "5-D-ii", "text": "In a typical week of school, what is the maximum amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]} {"category": "5-D-ii", "text": "In a typical week at your school, what is the maximum amount of time a student could spend engaged in physical activity?", "answers": ["Less than one hour", "One hour per week", "Two or three hours per week", "Four or five hours per week", "More than five hours per week"]}
] ]

@ -6,7 +6,7 @@ require 'csv'
namespace :data do namespace :data do
desc "Load in all data" desc "Load in all data"
task load: :environment do task load: :environment do
return if School.count > 0 # return if School.count > 0
Rake::Task["data:load_categories"].invoke Rake::Task["data:load_categories"].invoke
Rake::Task["data:load_questions"].invoke Rake::Task["data:load_questions"].invoke
Rake::Task["db:seed"].invoke Rake::Task["db:seed"].invoke
@ -144,12 +144,33 @@ namespace :data do
missing_questions = {} missing_questions = {}
bad_answers = {} bad_answers = {}
year = '2017' year = '2017'
['student_responses', 'teacher_responses'].each do |file|
timeToRun = 0.2 * 60 * 60
startIndex = 0
startTime = Time.new
# ['student_responses', 'teacher_responses'].each do |file|
['teacher_responses'].each do |file|
recipients = file.split('_')[0] recipients = file.split('_')[0]
target_group = Question.target_groups["for_#{recipients}s"] target_group = Question.target_groups["for_#{recipients}s"]
csv_string = File.read(File.expand_path("../../../data/#{file}_#{year}.csv", __FILE__)) csv_string = File.read(File.expand_path("../../../data/#{file}_#{year}.csv", __FILE__))
csv = CSV.parse(csv_string, :headers => true) csv = CSV.parse(csv_string, :headers => true)
puts("LOADING CSV: #{csv.length} ROWS")
t = Time.new
csv.each_with_index do |row, index| csv.each_with_index do |row, index|
next if index < startIndex
if Time.new - startTime >= timeToRun
puts("ENDING #{timeToRun} SECONDS: #{Time.new - startTime} = #{startIndex} -> #{index} = #{index - startIndex} or #{(Time.new - t) / (index - startIndex)} per second")
break
end
if index % 100 == 0
puts("PROCESSING ROW: #{index} OUT OF #{csv.length} ROWS: #{Time.new - t} - Total: #{Time.new - startTime} - #{timeToRun - (Time.new - startTime)} TO GO")
t = Time.new
end
district_name = row['What district is your school in?'] district_name = row['What district is your school in?']
district_name = row['To begin, please select your district.'] if district_name.nil? district_name = row['To begin, please select your district.'] if district_name.nil?
district = District.find_or_create_by(name: district_name, state_id: 1) district = District.find_or_create_by(name: district_name, state_id: 1)
@ -161,7 +182,7 @@ namespace :data do
next next
end end
school = School.find_or_create_by(name: school_name) school = district.schools.find_or_create_by(name: school_name)
if school.nil? if school.nil?
next if unknown_schools[school_name] next if unknown_schools[school_name]
@ -193,8 +214,9 @@ namespace :data do
recipient_list.save! recipient_list.save!
row.each do |key, value| row.each do |key, value|
t1 = Time.new
next if value.nil? or key.nil? or value.to_s == "-99" next if value.nil? or key.nil? or value.to_s == "-99"
key = key.gsub(/[[:space:]]/, ' ').strip key = key.gsub(/[[:space:]]/, ' ').strip.gsub(/\s+/, ' ')
value = value.gsub(/[[:space:]]/, ' ').strip.downcase value = value.gsub(/[[:space:]]/, ' ').strip.downcase
question = Question.find_by_text(key) question = Question.find_by_text(key)
@ -226,7 +248,7 @@ namespace :data do
end end
responded_at = Date.strptime(row['End Date'], '%m/%d/%Y %H:%M') responded_at = Date.strptime(row['End Date'], '%m/%d/%Y %H:%M')
recipient.attempts.create(question: question, answer_index: answer_index + 1, responded_at: responded_at) recipient.attempts.create(question: question, answer_index: answer_index, responded_at: responded_at)
end end
end end
end end

Loading…
Cancel
Save