record responded_at

pull/1/head
Jared Cosulich 9 years ago
parent c3964a09f2
commit 9ce9a35e27

@ -14,9 +14,10 @@ class AttemptsController < ApplicationController
attempt.update_attributes(
answer_index: twilio_params[:Body].to_i,
responded_at: Time.new,
twilio_details: twilio_params.to_h.to_yaml
)
render plain: 'Thank you!'
render plain: "We've registered your response of #{attempt.response)}. To see how others responded to the same question please visit "
end
# # GET /attempts/1/edit

@ -29,7 +29,8 @@ class Category < ApplicationRecord
"school-culture",
"resources",
"indicators-of-academic-learning",
"character-and-wellbeing-outcomes"
"character-and-wellbeing-outcomes",
"family-questions"
].index(root_identifier)
end

@ -2,7 +2,7 @@
- likert = info.answer_index_average
- average_offset = (likert/num_likerts) * 100
- zones = ['Warning Zone: Schools that fall in this range are five or more years away from reaching community-wide targets. Consequently, this zone, as established by teachers, principals, parents, and district administrators, indicates that a school is in significant need of improvement. If the school is not in the Warning Zone in other areas, it may be a relatively successful school overall. Still, it must immediately develop a plan for addressing its shortcomings.', 'Watch Zone: Schools falling in this range are three or four years away from reaching community-wide targets. This zone, established by teachers, principals, parents, and district administrators, is not an ideal place for schools to be. But it does not mean that the school is failing. Instead, it means that the school needs to place particular emphasis on improving its work in this area.', 'Growth Zone: Schools falling in this range earned scores just below "acceptable." Yet these schools are close enough to the Approval Zone that they might reasonably reach it within two years. As established by teachers, principals, parents, and district administrators, this zone is an acceptable place for schools to be if they have the leadership, focus, and resources to improve their work in a particular area.', 'Approval Zone: Schools falling in this range earned scores between "acceptable" and "ideal." This zone, established by teachers, principals, parents, and district administrators, is the target that all schools should be striving to hit. Scoring in this range does not mean that a school is perfect; but it does mean that it is meeting or exceeding community-wide expectations in a particular category.', 'This area represents a set of outcomes so close to perfect that they are unlikely to be realized in any school.']
- approval_zone = [[76, 90], [77, 91], [71, 85], [73, 86], [73, 86]][info.category.root_index]
- approval_zone = [[76, 90], [77, 91], [71, 85], [73, 86], [73, 86], [0,100]][info.category.root_index]
- zone_widths = [0]
- zone_widths << approval_zone[0] - (15 + 15)

@ -39,8 +39,11 @@ RSpec.describe AttemptsController, type: :controller do
attempt.reload
expect(attempt.answer_index).to eq(3)
expect(attempt.twilio_details).to eq(twilio_attributes.with_indifferent_access.to_yaml)
expect(attempt.responded_at).to be_present
expect(first_attempt.answer_index).to be_nil
expect(first_attempt.twilio_details).to be_nil
expect(first_attempt.responded_at).to be_nil
end
it "sends back a message" do

Loading…
Cancel
Save