Description:
prepare for better hall of fame
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r425:b86f327e0d75 - - 8 files changed: 46 inserted, 70 deleted
@@ -1,57 +1,62 | |||
|
1 | 1 | class ApplicationController < ActionController::Base |
|
2 | 2 | protect_from_forgery |
|
3 | 3 | |
|
4 | 4 | SINGLE_USER_MODE_CONF_KEY = 'system.single_user_mode' |
|
5 | 5 | |
|
6 | 6 | def admin_authorization |
|
7 | 7 | return false unless authenticate |
|
8 | 8 | user = User.find(session[:user_id], :include => ['roles']) |
|
9 | - redirect_to :controller => 'main', :action => 'login' unless user.admin? | |
|
9 | + unless user.admin? | |
|
10 | + flash[:notice] = 'You are not authorized to view the page you requested' | |
|
11 | + redirect_to :controller => 'main', :action => 'login' unless user.admin? | |
|
12 | + return false | |
|
13 | + end | |
|
14 | + return true | |
|
10 | 15 | end |
|
11 | 16 | |
|
12 | 17 | def authorization_by_roles(allowed_roles) |
|
13 | 18 | return false unless authenticate |
|
14 | 19 | user = User.find(session[:user_id]) |
|
15 | 20 | unless user.roles.detect { |role| allowed_roles.member?(role.name) } |
|
16 | 21 | flash[:notice] = 'You are not authorized to view the page you requested' |
|
17 | 22 | redirect_to :controller => 'main', :action => 'login' |
|
18 | 23 | return false |
|
19 | 24 | end |
|
20 | 25 | end |
|
21 | 26 | |
|
22 | 27 | protected |
|
23 | 28 | |
|
24 | 29 | def authenticate |
|
25 | 30 | unless session[:user_id] |
|
26 | 31 | flash[:notice] = 'You need to login' |
|
27 | 32 | if GraderConfiguration[SINGLE_USER_MODE_CONF_KEY] |
|
28 | 33 | flash[:notice] = 'You need to login but you cannot log in at this time' |
|
29 | 34 | end |
|
30 | 35 | redirect_to :controller => 'main', :action => 'login' |
|
31 | 36 | return false |
|
32 | 37 | end |
|
33 | 38 | |
|
34 | 39 | # check if run in single user mode |
|
35 | 40 | if GraderConfiguration[SINGLE_USER_MODE_CONF_KEY] |
|
36 | 41 | user = User.find(session[:user_id]) |
|
37 | 42 | if user==nil or (not user.admin?) |
|
38 | 43 | flash[:notice] = 'You cannot log in at this time' |
|
39 | 44 | redirect_to :controller => 'main', :action => 'login' |
|
40 | 45 | return false |
|
41 | 46 | end |
|
42 | 47 | return true |
|
43 | 48 | end |
|
44 | 49 | |
|
45 | 50 | if GraderConfiguration.multicontests? |
|
46 | 51 | user = User.find(session[:user_id]) |
|
47 | 52 | return true if user.admin? |
|
48 | 53 | begin |
|
49 | 54 | if user.contest_stat(true).forced_logout |
|
50 | 55 | flash[:notice] = 'You have been automatically logged out.' |
|
51 | 56 | redirect_to :controller => 'main', :action => 'index' |
|
52 | 57 | end |
|
53 | 58 | rescue |
|
54 | 59 | end |
|
55 | 60 | end |
|
56 | 61 | return true |
|
57 | 62 | end |
@@ -1,51 +1,60 | |||
|
1 | 1 | class GradersController < ApplicationController |
|
2 | 2 | |
|
3 | - before_filter :admin_authorization | |
|
3 | + before_filter :admin_authorization, except: [ :submission ] | |
|
4 | + before_filter(only: [:submission]) { | |
|
5 | + return false unless authenticate | |
|
6 | + | |
|
7 | + if GraderConfiguration["right.user_view_submission"] | |
|
8 | + return true; | |
|
9 | + end | |
|
10 | + | |
|
11 | + admin_authorization | |
|
12 | + } | |
|
4 | 13 | |
|
5 | 14 | verify :method => :post, :only => ['clear_all', |
|
6 | 15 | 'start_exam', |
|
7 | 16 | 'start_grading', |
|
8 | 17 | 'stop_all', |
|
9 | 18 | 'clear_terminated'], |
|
10 | 19 | :redirect_to => {:action => 'index'} |
|
11 | 20 | |
|
12 | 21 | def index |
|
13 | 22 | redirect_to :action => 'list' |
|
14 | 23 | end |
|
15 | 24 | |
|
16 | 25 | def list |
|
17 | 26 | @grader_processes = GraderProcess.find_running_graders |
|
18 | 27 | @stalled_processes = GraderProcess.find_stalled_process |
|
19 | 28 | |
|
20 | 29 | @terminated_processes = GraderProcess.find_terminated_graders |
|
21 | 30 | |
|
22 | 31 | @last_task = Task.find(:first, |
|
23 | 32 | :order => 'created_at DESC') |
|
24 | 33 | @last_test_request = TestRequest.find(:first, |
|
25 | 34 | :order => 'created_at DESC') |
|
26 | 35 | end |
|
27 | 36 | |
|
28 | 37 | def clear |
|
29 | 38 | grader_proc = GraderProcess.find(params[:id]) |
|
30 | 39 | grader_proc.destroy if grader_proc!=nil |
|
31 | 40 | redirect_to :action => 'list' |
|
32 | 41 | end |
|
33 | 42 | |
|
34 | 43 | def clear_terminated |
|
35 | 44 | GraderProcess.find_terminated_graders.each do |p| |
|
36 | 45 | p.destroy |
|
37 | 46 | end |
|
38 | 47 | redirect_to :action => 'list' |
|
39 | 48 | end |
|
40 | 49 | |
|
41 | 50 | def clear_all |
|
42 | 51 | GraderProcess.find(:all).each do |p| |
|
43 | 52 | p.destroy |
|
44 | 53 | end |
|
45 | 54 | redirect_to :action => 'list' |
|
46 | 55 | end |
|
47 | 56 | |
|
48 | 57 | def view |
|
49 | 58 | if params[:type]=='Task' |
|
50 | 59 | redirect_to :action => 'task', :id => params[:id] |
|
51 | 60 | else |
@@ -1,55 +1,55 | |||
|
1 | 1 | class ReportController < ApplicationController |
|
2 | 2 | |
|
3 | 3 | before_filter :admin_authorization, only: [:login_stat,:submission_stat] |
|
4 | - before_filter { |c| | |
|
4 | + before_filter(only: [:problem_hof]) { |c| | |
|
5 | 5 | return false unless authenticate |
|
6 | 6 | |
|
7 | - if GraderConfiguration["system.hall_of_fame_available"] | |
|
7 | + if GraderConfiguration["right.user_view_submission"] | |
|
8 | 8 | return true; |
|
9 | 9 | end |
|
10 | 10 | |
|
11 | 11 | admin_authorization |
|
12 | 12 | } |
|
13 | 13 | |
|
14 | 14 | def login_stat |
|
15 | 15 | @logins = Array.new |
|
16 | 16 | |
|
17 | 17 | date_and_time = '%Y-%m-%d %H:%M' |
|
18 | 18 | begin |
|
19 | 19 | @since_time = DateTime.strptime(params[:since_datetime],date_and_time) |
|
20 | 20 | rescue |
|
21 | 21 | @since_time = DateTime.new(1000,1,1) |
|
22 | 22 | end |
|
23 | 23 | begin |
|
24 | 24 | @until_time = DateTime.strptime(params[:until_datetime],date_and_time) |
|
25 | 25 | rescue |
|
26 | 26 | @until_time = DateTime.new(3000,1,1) |
|
27 | 27 | end |
|
28 | 28 | |
|
29 | 29 | User.all.each do |user| |
|
30 | 30 | @logins << { login: user.login, |
|
31 | 31 | full_name: user.full_name, |
|
32 | 32 | count: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
33 | 33 | user.id,@since_time,@until_time) |
|
34 | 34 | .count(:id), |
|
35 | 35 | min: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
36 | 36 | user.id,@since_time,@until_time) |
|
37 | 37 | .minimum(:created_at), |
|
38 | 38 | max: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
39 | 39 | user.id,@since_time,@until_time) |
|
40 | 40 | .maximum(:created_at) |
|
41 | 41 | } |
|
42 | 42 | end |
|
43 | 43 | end |
|
44 | 44 | |
|
45 | 45 | def submission_stat |
|
46 | 46 | |
|
47 | 47 | date_and_time = '%Y-%m-%d %H:%M' |
|
48 | 48 | begin |
|
49 | 49 | @since_time = DateTime.strptime(params[:since_datetime],date_and_time) |
|
50 | 50 | rescue |
|
51 | 51 | @since_time = DateTime.new(1000,1,1) |
|
52 | 52 | end |
|
53 | 53 | begin |
|
54 | 54 | @until_time = DateTime.strptime(params[:until_datetime],date_and_time) |
|
55 | 55 | rescue |
@@ -111,77 +111,77 | |||
|
111 | 111 | @by_lang[lang.pretty_name] = { |
|
112 | 112 | runtime: { avail: false, value: 2**30-1 }, |
|
113 | 113 | memory: { avail: false, value: 2**30-1 }, |
|
114 | 114 | length: { avail: false, value: 2**30-1 }, |
|
115 | 115 | first: { avail: false, value: DateTime.new(3000,1,1) } |
|
116 | 116 | } |
|
117 | 117 | end |
|
118 | 118 | |
|
119 | 119 | if sub.max_runtime and sub.max_runtime < @by_lang[lang.pretty_name][:runtime][:value] |
|
120 | 120 | @by_lang[lang.pretty_name][:runtime] = { |
|
121 | 121 | avail: true, |
|
122 | 122 | user_id: sub.user_id, |
|
123 | 123 | value: sub.max_runtime, |
|
124 | 124 | sub_id: sub.id |
|
125 | 125 | } |
|
126 | 126 | end |
|
127 | 127 | |
|
128 | 128 | if sub.peak_memory and sub.peak_memory < @by_lang[lang.pretty_name][:memory][:value] |
|
129 | 129 | @by_lang[lang.pretty_name][:memory] = { |
|
130 | 130 | avail: true, |
|
131 | 131 | user_id: sub.user_id, |
|
132 | 132 | value: sub.peak_memory, |
|
133 | 133 | sub_id: sub.id |
|
134 | 134 | } |
|
135 | 135 | end |
|
136 | 136 | |
|
137 | 137 | if sub.submitted_at and sub.submitted_at < @by_lang[lang.pretty_name][:first][:value] |
|
138 | 138 | @by_lang[lang.pretty_name][:first] = { |
|
139 | 139 | avail: true, |
|
140 | 140 | user_id: sub.user_id, |
|
141 | 141 | value: sub.submitted_at, |
|
142 | 142 | sub_id: sub.id |
|
143 | 143 | } |
|
144 | 144 | end |
|
145 | 145 | |
|
146 | 146 | if @by_lang[lang.pretty_name][:length][:value] > sub.effective_code_length |
|
147 | 147 | @by_lang[lang.pretty_name][:length] = { |
|
148 | 148 | avail: true, |
|
149 | 149 | user_id: sub.user_id, |
|
150 | 150 | value: sub.effective_code_length, |
|
151 | 151 | sub_id: sub.id |
|
152 | 152 | } |
|
153 | 153 | end |
|
154 | 154 | end |
|
155 | 155 | |
|
156 | 156 | #process user_id |
|
157 | 157 | @by_lang.each do |lang,prop| |
|
158 | 158 | prop.each do |k,v| |
|
159 |
- v[:user] = User.exists?(v[:user_id]) ? User.find(v[:user_id]). |
|
|
159 | + v[:user] = User.exists?(v[:user_id]) ? User.find(v[:user_id]).full_name : "(NULL)" | |
|
160 | 160 | end |
|
161 | 161 | end |
|
162 | 162 | |
|
163 | 163 | #sum into best |
|
164 | 164 | if @by_lang and @by_lang.first |
|
165 | 165 | @best = @by_lang.first[1] |
|
166 | 166 | @by_lang.each do |lang,prop| |
|
167 | - if @best[:runtime][:value] > prop[:runtime][:value] | |
|
167 | + if @best[:runtime][:value] >= prop[:runtime][:value] | |
|
168 | 168 | @best[:runtime] = prop[:runtime] |
|
169 | 169 | @best[:runtime][:lang] = lang |
|
170 | 170 | end |
|
171 | - if @best[:memory][:value] > prop[:memory][:value] | |
|
171 | + if @best[:memory][:value] >= prop[:memory][:value] | |
|
172 | 172 | @best[:memory] = prop[:memory] |
|
173 | 173 | @best[:memory][:lang] = lang |
|
174 | 174 | end |
|
175 | - if @best[:length][:value] > prop[:length][:value] | |
|
175 | + if @best[:length][:value] >= prop[:length][:value] | |
|
176 | 176 | @best[:length] = prop[:length] |
|
177 | 177 | @best[:length][:lang] = lang |
|
178 | 178 | end |
|
179 | - if @best[:first][:value] > prop[:first][:value] | |
|
179 | + if @best[:first][:value] >= prop[:first][:value] | |
|
180 | 180 | @best[:first] = prop[:first] |
|
181 | 181 | @best[:first][:lang] = lang |
|
182 | 182 | end |
|
183 | 183 | end |
|
184 | 184 | end |
|
185 | 185 | end |
|
186 | 186 | end |
|
187 | 187 | end |
@@ -1,82 +1,82 | |||
|
1 | 1 | # Methods added to this helper will be available to all templates in the application. |
|
2 | 2 | module ApplicationHelper |
|
3 | 3 | |
|
4 | 4 | def user_header |
|
5 | 5 | menu_items = '' |
|
6 | 6 | user = User.find(session[:user_id]) |
|
7 | 7 | |
|
8 | 8 | if (user!=nil) and (session[:admin]) |
|
9 | 9 | # admin menu |
|
10 | 10 | menu_items << "<b>Administrative task:</b> " |
|
11 | 11 | append_to menu_items, '[Announcements]', 'announcements', 'index' |
|
12 | 12 | append_to menu_items, '[Msg console]', 'messages', 'console' |
|
13 | 13 | append_to menu_items, '[Problems]', 'problems', 'index' |
|
14 | 14 | append_to menu_items, '[Users]', 'user_admin', 'index' |
|
15 | 15 | append_to menu_items, '[Results]', 'user_admin', 'user_stat' |
|
16 | 16 | append_to menu_items, '[Report]', 'report', 'login_stat' |
|
17 | 17 | append_to menu_items, '[Graders]', 'graders', 'list' |
|
18 | 18 | append_to menu_items, '[Contests]', 'contest_management', 'index' |
|
19 | 19 | append_to menu_items, '[Sites]', 'sites', 'index' |
|
20 | 20 | append_to menu_items, '[System config]', 'configurations', 'index' |
|
21 | 21 | menu_items << "<br/>" |
|
22 | 22 | end |
|
23 | 23 | |
|
24 | 24 | # main page |
|
25 | 25 | append_to menu_items, "[#{I18n.t 'menu.main'}]", 'main', 'list' |
|
26 | 26 | append_to menu_items, "[#{I18n.t 'menu.messages'}]", 'messages', 'list' |
|
27 | 27 | |
|
28 | 28 | if (user!=nil) and (GraderConfiguration.show_tasks_to?(user)) |
|
29 | 29 | append_to menu_items, "[#{I18n.t 'menu.tasks'}]", 'tasks', 'list' |
|
30 | 30 | append_to menu_items, "[#{I18n.t 'menu.submissions'}]", 'main', 'submission' |
|
31 | 31 | append_to menu_items, "[#{I18n.t 'menu.test'}]", 'test', 'index' |
|
32 | 32 | end |
|
33 | 33 | |
|
34 |
- if GraderConfiguration[' |
|
|
34 | + if GraderConfiguration['right.user_hall_of_fame'] | |
|
35 | 35 | append_to menu_items, "[#{I18n.t 'menu.hall_of_fame'}]", 'report', 'problem_hof' |
|
36 | 36 | end |
|
37 | 37 | append_to menu_items, "[#{I18n.t 'menu.help'}]", 'main', 'help' |
|
38 | 38 | |
|
39 | 39 | if GraderConfiguration['system.user_setting_enabled'] |
|
40 | 40 | append_to menu_items, "[#{I18n.t 'menu.settings'}]", 'users', 'index' |
|
41 | 41 | end |
|
42 | 42 | append_to menu_items, "[#{I18n.t 'menu.log_out'}]", 'main', 'login' |
|
43 | 43 | |
|
44 | 44 | menu_items.html_safe |
|
45 | 45 | end |
|
46 | 46 | |
|
47 | 47 | def append_to(option,label, controller, action) |
|
48 | 48 | option << ' ' if option!='' |
|
49 | 49 | option << link_to_unless_current(label, |
|
50 | 50 | :controller => controller, |
|
51 | 51 | :action => action) |
|
52 | 52 | end |
|
53 | 53 | |
|
54 | 54 | def format_short_time(time) |
|
55 | 55 | now = Time.now.gmtime |
|
56 | 56 | st = '' |
|
57 | 57 | if (time.yday != now.yday) or |
|
58 | 58 | (time.year != now.year) |
|
59 | 59 | st = time.strftime("%x ") |
|
60 | 60 | end |
|
61 | 61 | st + time.strftime("%X") |
|
62 | 62 | end |
|
63 | 63 | |
|
64 | 64 | def format_short_duration(duration) |
|
65 | 65 | return '' if duration==nil |
|
66 | 66 | d = duration.to_f |
|
67 | 67 | return Time.at(d).gmtime.strftime("%X") |
|
68 | 68 | end |
|
69 | 69 | |
|
70 | 70 | def read_textfile(fname,max_size=2048) |
|
71 | 71 | begin |
|
72 | 72 | File.open(fname).read(max_size) |
|
73 | 73 | rescue |
|
74 | 74 | nil |
|
75 | 75 | end |
|
76 | 76 | end |
|
77 | 77 | |
|
78 | 78 | def user_title_bar(user) |
|
79 | 79 | header = '' |
|
80 | 80 | time_left = '' |
|
81 | 81 | |
|
82 | 82 | # |
@@ -1,27 +1,27 | |||
|
1 | 1 | %style{type: "text/css"} |
|
2 | 2 | = @css_style |
|
3 | 3 | |
|
4 | 4 | %h1= "Submission: #{@submission.id}" |
|
5 | 5 | |
|
6 | 6 | %p |
|
7 | 7 | User: |
|
8 | - = "#{@submission.user.login}" | |
|
8 | + = "(#{@submission.user.login}) #{@submission.user.full_name}" | |
|
9 | 9 | %br/ |
|
10 | 10 | Problem: |
|
11 | 11 | - if @submission.problem!=nil |
|
12 | 12 | = "#{@submission.problem.full_name}" |
|
13 | 13 | - else |
|
14 | 14 | = "(n/a)" |
|
15 | 15 | %br/ |
|
16 | 16 | = "Number: #{@submission.number}" |
|
17 | 17 | %br/ |
|
18 | 18 | = "Submitted at: #{format_short_time(@submission.submitted_at)}" |
|
19 | 19 | %br/ |
|
20 | 20 | = "Points : #{@submission.points}/#{@submission.problem.full_score}" |
|
21 | 21 | %br/ |
|
22 | 22 | = "Comment : #{@submission.grader_comment}" |
|
23 | 23 | |
|
24 | 24 | %b Source code (first 10kb) |
|
25 | 25 | //%div.highlight{:style => "border: 1px solid black;"} |
|
26 | 26 | =@formatted_code.html_safe |
|
27 | 27 |
@@ -1,33 +1,31 | |||
|
1 | 1 | - content_for :header do |
|
2 | 2 | = javascript_include_tag 'new' |
|
3 | 3 | |
|
4 | 4 | %script{:type=>"text/javascript"} |
|
5 | 5 | $(function () { |
|
6 | 6 | $('#since_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
7 | 7 | $('#until_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
8 | 8 | }); |
|
9 | 9 | |
|
10 | - | |
|
11 | 10 | %h1 Login status |
|
12 | 11 | |
|
13 | - | |
|
14 | 12 | =render partial: 'report_menu' |
|
15 | 13 | =render partial: 'date_range', locals: {param_text: 'Login date range:', title: 'Query login stat in the range' } |
|
16 | 14 | |
|
17 | 15 | %table.info |
|
18 | 16 | %thead |
|
19 | 17 | %tr.info-head |
|
20 | 18 | %th login |
|
21 | 19 | %th full name |
|
22 | 20 | %th login count |
|
23 | 21 | %th earliest |
|
24 | 22 | %th latest |
|
25 | 23 | %tbody |
|
26 | 24 | - @logins.each do |l| |
|
27 | 25 | %tr{class: cycle('info-even','info-odd')} |
|
28 | 26 | %td= l[:login] |
|
29 | 27 | %td= l[:full_name] |
|
30 | 28 | %td= l[:count] |
|
31 | 29 | %td= l[:min] ? l[:min].in_time_zone.strftime('%Y-%m-%d %H:%M') : '' |
|
32 | 30 | %td= l[:max] ? l[:max].in_time_zone.strftime('%Y-%m-%d %H:%M') : '' |
|
33 | 31 |
@@ -1,65 +1,22 | |||
|
1 | + | |
|
2 | + /- if params[:id] | |
|
3 | + / %h1 Tasks Hall of Fame | |
|
4 | + / = link_to('[back to All-Time Hall of Fame]', action: 'problem_hof', id: nil ) | |
|
5 | + /- else | |
|
6 | + / %h1 All-Time Hall of Fame | |
|
7 | + | |
|
8 | + | |
|
1 | 9 | %h1 Tasks Hall of Fame |
|
2 | - | |
|
3 | 10 | .task-menu |
|
4 | 11 | Tasks |
|
5 | 12 | %br/ |
|
6 | 13 | - @problems.each do |prob| |
|
7 | 14 | = link_to( "[#{prob.name}]", {id: prob.id}) |
|
8 | 15 | |
|
9 | - | |
|
10 | - | |
|
11 | - | |
|
12 | - %h2 Overall | |
|
13 | - | |
|
14 | - - if @best | |
|
15 | - %b Best Runtime: | |
|
16 | - = " by #{@best[:runtime][:user]} with #{@best[:runtime][:value] * 1000} milliseconds at submission " \ | |
|
17 | - = link_to("#" + @best[:runtime][:sub_id].to_s, controller: 'graders', action: 'submission', id:@best[:runtime][:sub_id]) | |
|
18 | - %br/ | |
|
19 | - %b Best Memory Usage: | |
|
20 | - = " by #{@best[:memory][:user]} with #{@best[:memory][:value]} kbytes at submission " | |
|
21 | - = link_to("#" + @best[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id:@best[:memory][:sub_id]) | |
|
22 | - %br/ | |
|
23 | - %b Shortest Code: | |
|
24 | - = " by #{@best[:length][:user]} with #{@best[:length][:value]} at submission " | |
|
25 | - = link_to("#" + @best[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:length][:sub_id]) | |
|
26 | - %br/ | |
|
27 | - %b First solver: | |
|
28 | - = " by #{@best[:first][:user]} is the first solver on #{@best[:first][:value]} at submission " | |
|
29 | - = link_to("#" + @best[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:first][:sub_id]) | |
|
30 | - %br/ | |
|
16 | + - unless params[:id] | |
|
17 | + /=render partial: 'all_time_hof' | |
|
18 | + Please select a problem. | |
|
19 | + - else | |
|
20 | + =render partial: 'task_hof' | |
|
31 | 21 | |
|
32 | 22 | |
|
33 | - %p | |
|
34 | - This counts only for submission with 100% score <br/> | |
|
35 | - Right now, java is excluded from memory usage competition. (Because it always uses 2GB memory...) | |
|
36 | - | |
|
37 | - %h2 By language | |
|
38 | - | |
|
39 | - %table.info | |
|
40 | - %thead | |
|
41 | - %tr.info-head | |
|
42 | - %th Language | |
|
43 | - %th Best runtime (ms) | |
|
44 | - %th Best memory (kbytes) | |
|
45 | - %th Shortest Code (bytes) | |
|
46 | - %th First solver | |
|
47 | - %tbody | |
|
48 | - - @by_lang.each do |lang,value| | |
|
49 | - %tr{class: cycle('info-even','info-odd')} | |
|
50 | - %td= lang | |
|
51 | - %td | |
|
52 | - = "#{value[:runtime][:user]} (#{(value[:runtime][:value] * 1000).to_i} @" | |
|
53 | - = "#{link_to("#" + value[:runtime][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:runtime][:sub_id])} )".html_safe | |
|
54 | - %td | |
|
55 | - = "#{value[:memory][:user]} (#{value[:memory][:value]} @" | |
|
56 | - = "#{link_to("#" + value[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:memory][:sub_id])} )".html_safe | |
|
57 | - %td | |
|
58 | - = "#{value[:length][:user]} (#{value[:length][:value]} @" | |
|
59 | - = "#{link_to("#" + value[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:length][:sub_id])} )".html_safe | |
|
60 | - %td | |
|
61 | - = "#{value[:first][:user]} (#{value[:first][:value]} @" | |
|
62 | - = "#{link_to("#" + value[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:first][:sub_id])} )".html_safe | |
|
63 | - | |
|
64 | - - else | |
|
65 | - %h3 No submissions |
@@ -9,102 +9,109 | |||
|
9 | 9 | |
|
10 | 10 | { |
|
11 | 11 | :key => 'ui.front.title', |
|
12 | 12 | :value_type => 'string', |
|
13 | 13 | :default_value => 'Grader' |
|
14 | 14 | }, |
|
15 | 15 | |
|
16 | 16 | { |
|
17 | 17 | :key => 'ui.front.welcome_message', |
|
18 | 18 | :value_type => 'string', |
|
19 | 19 | :default_value => 'Welcome!' |
|
20 | 20 | }, |
|
21 | 21 | |
|
22 | 22 | { |
|
23 | 23 | :key => 'ui.show_score', |
|
24 | 24 | :value_type => 'boolean', |
|
25 | 25 | :default_value => 'true' |
|
26 | 26 | }, |
|
27 | 27 | |
|
28 | 28 | { |
|
29 | 29 | :key => 'contest.time_limit', |
|
30 | 30 | :value_type => 'string', |
|
31 | 31 | :default_value => 'unlimited', |
|
32 | 32 | :description => 'Time limit in format hh:mm, or "unlimited" for contests with no time limits. This config is CACHED. Restart the server before the change can take effect.' |
|
33 | 33 | }, |
|
34 | 34 | |
|
35 | 35 | { |
|
36 | 36 | :key => 'system.mode', |
|
37 | 37 | :value_type => 'string', |
|
38 | 38 | :default_value => 'standard', |
|
39 | 39 | :description => 'Current modes are "standard", "contest", "indv-contest", and "analysis".' |
|
40 | 40 | }, |
|
41 | 41 | |
|
42 | 42 | { |
|
43 | 43 | :key => 'contest.name', |
|
44 | 44 | :value_type => 'string', |
|
45 | 45 | :default_value => 'Grader', |
|
46 | 46 | :description => 'This name will be shown on the user header bar.' |
|
47 | 47 | }, |
|
48 | 48 | |
|
49 | 49 | { |
|
50 | 50 | :key => 'contest.multisites', |
|
51 | 51 | :value_type => 'boolean', |
|
52 | 52 | :default_value => 'false', |
|
53 | 53 | :description => 'If the server is in contest mode and this option is true, on the log in of the admin a menu for site selections is shown.' |
|
54 | 54 | }, |
|
55 | 55 | |
|
56 | 56 | { |
|
57 |
- :key => ' |
|
|
57 | + :key => 'right.user_hall_of_fame', | |
|
58 | 58 | :value_type => 'boolean', |
|
59 | 59 | :default_value => 'false', |
|
60 | 60 | :description => 'If true, any user can access hall of fame page.' |
|
61 | 61 | }, |
|
62 | 62 | |
|
63 | + { | |
|
64 | + :key => 'right.user_view_submission', | |
|
65 | + :value_type => 'boolean', | |
|
66 | + :default_value => 'false', | |
|
67 | + :description => 'If true, any user can view submissions of every one.' | |
|
68 | + }, | |
|
69 | + | |
|
63 | 70 | # If Configuration['system.online_registration'] is true, the |
|
64 | 71 | # system allows online registration, and will use these |
|
65 | 72 | # information for sending confirmation emails. |
|
66 | 73 | { |
|
67 | 74 | :key => 'system.online_registration.smtp', |
|
68 | 75 | :value_type => 'string', |
|
69 | 76 | :default_value => 'smtp.somehost.com' |
|
70 | 77 | }, |
|
71 | 78 | |
|
72 | 79 | { |
|
73 | 80 | :key => 'system.online_registration.from', |
|
74 | 81 | :value_type => 'string', |
|
75 | 82 | :default_value => 'your.email@address' |
|
76 | 83 | }, |
|
77 | 84 | |
|
78 | 85 | { |
|
79 | 86 | :key => 'system.admin_email', |
|
80 | 87 | :value_type => 'string', |
|
81 | 88 | :default_value => 'admin@admin.email' |
|
82 | 89 | }, |
|
83 | 90 | |
|
84 | 91 | { |
|
85 | 92 | :key => 'system.user_setting_enabled', |
|
86 | 93 | :value_type => 'boolean', |
|
87 | 94 | :default_value => 'true', |
|
88 | 95 | :description => 'If this option is true, users can change their settings' |
|
89 | 96 | }, |
|
90 | 97 | |
|
91 | 98 | { |
|
92 | 99 | :key => 'system.user_setting_enabled', |
|
93 | 100 | :value_type => 'boolean', |
|
94 | 101 | :default_value => 'true', |
|
95 | 102 | :description => 'If this option is true, users can change their settings' |
|
96 | 103 | } |
|
97 | 104 | |
|
98 | 105 | # If Configuration['contest.test_request.early_timeout'] is true |
|
99 | 106 | # the user will not be able to use test request at 30 minutes |
|
100 | 107 | # before the contest ends. |
|
101 | 108 | { |
|
102 | 109 | :key => 'contest.test_request.early_timeout', |
|
103 | 110 | :value_type => 'boolean', |
|
104 | 111 | :default_value => 'false' |
|
105 | 112 | }, |
|
106 | 113 | |
|
107 | 114 | { |
|
108 | 115 | :key => 'system.multicontests', |
|
109 | 116 | :value_type => 'boolean', |
|
110 | 117 | :default_value => 'false' |
You need to be logged in to leave comments.
Login now