parent
4d942258e4
commit
fd9d2f4a13
@ -1,38 +1,49 @@
|
|||||||
- aggregated_responses = question.aggregated_responses_for_school(@school)
|
- aggregated_responses = question.aggregated_responses_for_school(@school)
|
||||||
- return if aggregated_responses.nil?
|
- return if aggregated_responses.nil?
|
||||||
|
- valid_responses = (aggregated_responses.count.to_f / @school.available_responders_for(question).to_f) >= 0.3
|
||||||
|
|
||||||
.col-12.col-md-6.py-3
|
.col-12.col-md-6.py-3
|
||||||
.question.p-2{id: "question-#{question.id}"}
|
.question.p-2{id: "question-#{question.id}"}
|
||||||
%p.question-text.pt-3.px-2
|
%p.question-text.pt-3.px-2
|
||||||
= question.normalized_text
|
= question.normalized_text
|
||||||
|
|
||||||
.row.pt-2
|
- if valid_responses
|
||||||
.col-4.indicator-container.centered
|
.row.pt-2
|
||||||
= render 'school_categories/indicator', info: aggregated_responses, small: true
|
.col-4.indicator-container.centered
|
||||||
|
= render 'school_categories/indicator', info: aggregated_responses, small: true
|
||||||
|
|
||||||
.col-8
|
.col-8
|
||||||
%p
|
%p
|
||||||
%b Total Responses:
|
%b Total Responses:
|
||||||
= aggregated_responses.count
|
= aggregated_responses.count
|
||||||
%p
|
%p
|
||||||
%b Most Popular:
|
%b Most Popular:
|
||||||
= truncate(aggregated_responses.most_popular_answer, length: 27)
|
= truncate(aggregated_responses.most_popular_answer, length: 27)
|
||||||
%p
|
%p
|
||||||
%b Source:
|
%b Source:
|
||||||
= question.source.titleize
|
= question.source.titleize
|
||||||
|
- else
|
||||||
|
.row.pt-2
|
||||||
|
.col-12.centered
|
||||||
|
.px-2
|
||||||
|
%h5 Insufficient Responses
|
||||||
|
%p No data is displayed for this question because of insufficient responses.
|
||||||
|
-#%p= "Responded: #{aggregated_responses.count}, Possible: #{@school.available_responders_for(question)}"
|
||||||
|
|
||||||
.clearfix
|
|
||||||
|
|
||||||
.show-hide.px-2
|
- if valid_responses
|
||||||
%p
|
.clearfix
|
||||||
%a{"aria-controls" => "histogram#{question.id}", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#histogram#{question.id}"}
|
|
||||||
Histogram
|
.show-hide.px-2
|
||||||
|
|
%p
|
||||||
%a{"aria-controls" => "raw-data#{question.id}", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#raw-data#{question.id}"}
|
%a{"aria-controls" => "histogram#{question.id}", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#histogram#{question.id}"}
|
||||||
Raw Data
|
Histogram
|
||||||
|
|
|
||||||
|
%a{"aria-controls" => "raw-data#{question.id}", "aria-expanded" => "false", "data-toggle" => "collapse", :href => "#raw-data#{question.id}"}
|
||||||
|
Raw Data
|
||||||
|
|
||||||
.collapse{id: "histogram#{question.id}"}
|
.collapse{id: "histogram#{question.id}"}
|
||||||
= render 'shared/histogram', data: aggregated_responses
|
= render 'shared/histogram', data: aggregated_responses
|
||||||
|
|
||||||
%p.collapse{id: "raw-data#{question.id}"}
|
%p.collapse{id: "raw-data#{question.id}"}
|
||||||
= aggregated_responses.responses.map(&:answer_index_with_reverse).join(', ')
|
= aggregated_responses.responses.map(&:answer_index_with_reverse).join(', ')
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
class AddStudentAndTeaceherCountToSchools < ActiveRecord::Migration[5.0]
|
||||||
|
def change
|
||||||
|
add_column :schools, :student_count, :integer
|
||||||
|
add_column :schools, :teacher_count, :integer
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Reference in new issue