Description:
put to master
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r720:debc8d9f3f74 - - 1 file changed: 1 inserted, 1 deleted
@@ -1,31 +1,31 | |||||
|
1 | require 'csv' |
|
1 | require 'csv' |
|
2 |
|
2 | ||
|
3 | class ReportController < ApplicationController |
|
3 | class ReportController < ApplicationController |
|
4 |
|
4 | ||
|
5 | before_filter :authenticate |
|
5 | before_filter :authenticate |
|
6 |
|
6 | ||
|
7 | - before_filter :admin_authorization, only: [:login_stat,:submission_stat, :stuck, :cheat_report, :cheat_scruntinize, :show_max_score] |
|
7 | + before_filter :admin_authorization, only: [:login_stat,:submission_stat, :stuck, :cheat_report, :cheat_scruntinize, :show_max_score, :current_score] |
|
8 |
|
8 | ||
|
9 | before_filter(only: [:problem_hof]) { |c| |
|
9 | before_filter(only: [:problem_hof]) { |c| |
|
10 | return false unless authenticate |
|
10 | return false unless authenticate |
|
11 |
|
11 | ||
|
12 | admin_authorization unless GraderConfiguration["right.user_view_submission"] |
|
12 | admin_authorization unless GraderConfiguration["right.user_view_submission"] |
|
13 | } |
|
13 | } |
|
14 |
|
14 | ||
|
15 | def max_score |
|
15 | def max_score |
|
16 | end |
|
16 | end |
|
17 |
|
17 | ||
|
18 | def current_score |
|
18 | def current_score |
|
19 | @problems = Problem.available_problems |
|
19 | @problems = Problem.available_problems |
|
20 | @users = User.includes(:contests).includes(:contest_stat).where(enabled: true) |
|
20 | @users = User.includes(:contests).includes(:contest_stat).where(enabled: true) |
|
21 | @scorearray = calculate_max_score(@problems, @users,0,0,true) |
|
21 | @scorearray = calculate_max_score(@problems, @users,0,0,true) |
|
22 |
|
22 | ||
|
23 | #rencer accordingly |
|
23 | #rencer accordingly |
|
24 | if params[:button] == 'download' then |
|
24 | if params[:button] == 'download' then |
|
25 | csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
25 | csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
26 | send_data csv, filename: 'max_score.csv' |
|
26 | send_data csv, filename: 'max_score.csv' |
|
27 | else |
|
27 | else |
|
28 | #render template: 'user_admin/user_stat' |
|
28 | #render template: 'user_admin/user_stat' |
|
29 | render 'current_score' |
|
29 | render 'current_score' |
|
30 | end |
|
30 | end |
|
31 | end |
|
31 | end |
You need to be logged in to leave comments.
Login now