Description:
fix bug in score report
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r614:20f955456e9b - - 1 file changed: 2 inserted, 2 deleted
@@ -43,26 +43,26 | |||
|
43 | 43 | pid = Problem.find_by_id(id.to_i) |
|
44 | 44 | @problems << pid if pid |
|
45 | 45 | end |
|
46 | 46 | |
|
47 | 47 | #users |
|
48 | 48 | @users = if params[:user] == "all" then |
|
49 | 49 | User.find(:all, :include => [:contests, :contest_stat]) |
|
50 | 50 | else |
|
51 | 51 | User.includes(:contests).includes(:contest_stat).where(enabled: true) |
|
52 | 52 | end |
|
53 | 53 | |
|
54 | 54 | #set up range from param |
|
55 |
- since_id = params.fetch(:m |
|
|
56 |
- until_id = params.fetch(: |
|
|
55 | + since_id = params.fetch(:from_id, 0).to_i | |
|
56 | + until_id = params.fetch(:to_id, 0).to_i | |
|
57 | 57 | |
|
58 | 58 | #calculate the routine |
|
59 | 59 | @scorearray = calculate_max_score(@problems, @users,since_id,until_id) |
|
60 | 60 | |
|
61 | 61 | #rencer accordingly |
|
62 | 62 | if params[:button] == 'download' then |
|
63 | 63 | csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
64 | 64 | send_data csv, filename: 'max_score.csv' |
|
65 | 65 | else |
|
66 | 66 | #render template: 'user_admin/user_stat' |
|
67 | 67 | render 'max_score' |
|
68 | 68 | end |
You need to be logged in to leave comments.
Login now