From 93485bd886752d86d43a3da9cface18131aebcc1 Mon Sep 17 00:00:00 2001 From: Jared Cosulich Date: Fri, 21 Dec 2018 17:39:48 -0500 Subject: [PATCH] tweaking question partial --- app/views/questions/_question.html.haml | 2 +- lib/tasks/data.rake | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/views/questions/_question.html.haml b/app/views/questions/_question.html.haml index 75a902c1..6241047c 100644 --- a/app/views/questions/_question.html.haml +++ b/app/views/questions/_question.html.haml @@ -30,7 +30,7 @@ %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)}" - %p= "Source: #{question.target_group}" + %p= "Source: #{question.for_teachers? ? "Teachers" : "Students"}" - if valid_responses .clearfix diff --git a/lib/tasks/data.rake b/lib/tasks/data.rake index f0c8d146..490f151a 100644 --- a/lib/tasks/data.rake +++ b/lib/tasks/data.rake @@ -567,7 +567,7 @@ end # school_category.update( # valid_child_count: school_question_data.valid_child_count, # response_count: school_question_data.response_count, -# response_total: school_question_data.response_total +# answer_index_total: school_question_data.response_total # ) # end # end @@ -584,13 +584,15 @@ end # school = school_category.school # # children = SchoolCategory.for_parent_category(school, parent_category).in(school_category.year) -# valid_child_count = children.where("valid_child_count > 0").count +# valid_children = children.where("valid_child_count > 0") # school_category.update( -# valid_child_count: valid_child_count +# valid_child_count: valid_children.count, +# response_count: valid_children.sum(&:response_count), +# answer_index_total: valid_children.sum(&:answer_index_total) # ) # puts "" # puts "" -# puts("#{level} (#{i}/#{categories.length}) UPDATED (#{index}/#{school_categories.length}): #{school.slug} -> #{parent_category.slug} -> #{school_category.year} -> #{valid_child_count} --- PARENT: #{parent_categories.length}") +# puts("#{level} (#{i}/#{categories.length}) UPDATED (#{index}/#{school_categories.length}): #{school.slug} -> #{parent_category.slug} -> #{school_category.year} -> #{valid_children.count} --- PARENT: #{parent_categories.length}") # puts "" # puts "" # end