Description:
make report max_score remember user options
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r647:bb242b3ef68d - - 3 files changed: 8 inserted, 6 deleted

@@ -34,11 +34,13
34 #process parameters
34 #process parameters
35 #problems
35 #problems
36 @problems = []
36 @problems = []
37 + if params[:problem_id]
37 params[:problem_id].each do |id|
38 params[:problem_id].each do |id|
38 next unless id.strip != ""
39 next unless id.strip != ""
39 pid = Problem.find_by_id(id.to_i)
40 pid = Problem.find_by_id(id.to_i)
40 @problems << pid if pid
41 @problems << pid if pid
41 end
42 end
43 + end
42
44
43 #users
45 #users
44 @users = if params[:user] == "all" then
46 @users = if params[:user] == "all" then
@@ -48,11 +50,11
48 end
50 end
49
51
50 #set up range from param
52 #set up range from param
51 - since_id = params.fetch(:from_id, 0).to_i
53 + @since_id = params.fetch(:from_id, 0).to_i
52 - until_id = params.fetch(:to_id, 0).to_i
54 + @until_id = params.fetch(:to_id, 0).to_i
53
55
54 #calculate the routine
56 #calculate the routine
55 - @scorearray = calculate_max_score(@problems, @users,since_id,until_id)
57 + @scorearray = calculate_max_score(@problems, @users, @since_id, @until_id)
56
58
57 #rencer accordingly
59 #rencer accordingly
58 if params[:button] == 'download' then
60 if params[:button] == 'download' then
@@ -22,10 +22,10
22 Input minimum and maximum range of submission ID that should be included. A blank value for min and max means -1 and infinity, respectively.
22 Input minimum and maximum range of submission ID that should be included. A blank value for min and max means -1 and infinity, respectively.
23 .form-group
23 .form-group
24 = label_tag :from, "Min"
24 = label_tag :from, "Min"
25 - = text_field_tag 'from_id', nil, class: "form-control"
25 + = text_field_tag 'from_id', @since_id, class: "form-control"
26 .form-group
26 .form-group
27 = label_tag :from, "Max"
27 = label_tag :from, "Max"
28 - = text_field_tag 'to_id', nil, class: "form-control"
28 + = text_field_tag 'to_id', @until_id, class: "form-control"
29 .col-md-4
29 .col-md-4
30 .panel.panel-primary
30 .panel.panel-primary
31 .panel-heading
31 .panel-heading
@@ -1,2 +1,2
1 :plain
1 :plain
2 - $("body").prepend("<div class=\"alert alert-info\"> Submission #{@submission.id}'s task status has been chaned to \"#{@task.status_str}\" </div>")
2 + $("body").prepend("<div class=\"alert alert-info\"> Submission #{@submission.id}'s task status has been changed to \"#{@task.status_str}\". It will be re-judged soon. </div>")
You need to be logged in to leave comments. Login now