diff --git a/app/controllers/report_controller.rb b/app/controllers/report_controller.rb --- a/app/controllers/report_controller.rb +++ b/app/controllers/report_controller.rb @@ -465,6 +465,7 @@ protected def calculate_max_score(problems, users,since_id,until_id, get_last_score = false) + #score[i] = user #i's user stat where i is the index (not id) scorearray = Array.new users.each do |u| ustat = Array.new diff --git a/app/views/report/_score_table.html.haml b/app/views/report/_score_table.html.haml --- a/app/views/report/_score_table.html.haml +++ b/app/views/report/_score_table.html.haml @@ -12,9 +12,9 @@ %th.text-right Total %th.text-right Passed %tbody - - sum = Array.new(@scorearray[0].count,0) - - nonzero = Array.new(@scorearray[0].count,0) - - full = Array.new(@scorearray[0].count,0) + - sum = Array.new(@problems.count,0) + - nonzero = Array.new(@problems.count,0) + - full = Array.new(@problems.count,0) - @scorearray.each do |sc| %tr - total,num_passed = 0,0 diff --git a/app/views/report/current_score.html.haml b/app/views/report/current_score.html.haml --- a/app/views/report/current_score.html.haml +++ b/app/views/report/current_score.html.haml @@ -2,7 +2,7 @@ %h1 Current Score = form_tag current_score_report_path, method: 'get' do Show only users from this group - = select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_name]), id: 'group_name',class: 'select2' + = select_tag "group_id", options_from_collection_for_select( Group.all, 'id','name',params[:group_id]), id: 'group_name',class: 'select2', style: 'width: 20em'; = submit_tag 'Apply',class: 'btn btn-default' %br