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 @@ -34,10 +34,12 @@ #process parameters #problems @problems = [] - params[:problem_id].each do |id| - next unless id.strip != "" - pid = Problem.find_by_id(id.to_i) - @problems << pid if pid + if params[:problem_id] + params[:problem_id].each do |id| + next unless id.strip != "" + pid = Problem.find_by_id(id.to_i) + @problems << pid if pid + end end #users @@ -48,11 +50,11 @@ end #set up range from param - since_id = params.fetch(:from_id, 0).to_i - until_id = params.fetch(:to_id, 0).to_i + @since_id = params.fetch(:from_id, 0).to_i + @until_id = params.fetch(:to_id, 0).to_i #calculate the routine - @scorearray = calculate_max_score(@problems, @users,since_id,until_id) + @scorearray = calculate_max_score(@problems, @users, @since_id, @until_id) #rencer accordingly if params[:button] == 'download' then diff --git a/app/views/report/max_score.html.haml b/app/views/report/max_score.html.haml --- a/app/views/report/max_score.html.haml +++ b/app/views/report/max_score.html.haml @@ -22,10 +22,10 @@ Input minimum and maximum range of submission ID that should be included. A blank value for min and max means -1 and infinity, respectively. .form-group = label_tag :from, "Min" - = text_field_tag 'from_id', nil, class: "form-control" + = text_field_tag 'from_id', @since_id, class: "form-control" .form-group = label_tag :from, "Max" - = text_field_tag 'to_id', nil, class: "form-control" + = text_field_tag 'to_id', @until_id, class: "form-control" .col-md-4 .panel.panel-primary .panel-heading diff --git a/app/views/submissions/rejudge.js.haml b/app/views/submissions/rejudge.js.haml --- a/app/views/submissions/rejudge.js.haml +++ b/app/views/submissions/rejudge.js.haml @@ -1,2 +1,2 @@ :plain - $("body").prepend("