Description:
submission stat
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r788:3241620ac7e7 - - 10 files changed: 425 inserted, 296 deleted

@@ -0,0 +1,61
1 + - content_for :header do
2 + = javascript_include_tag 'local_jquery'
3 +
4 + %h1 Submissions detail
5 +
6 + .row
7 + .col-md-4
8 + = render partial: 'shared/problem_select'
9 + .col-md-4
10 + = render partial: 'shared/problem_select'
11 + .col-md-4
12 + = render partial: 'shared/user_select'
13 +
14 +
15 + .row
16 + .col-12
17 + %table.table.table-hover.table-condense.datatable
18 + -#
19 + %thead
20 + %tr
21 + %th User
22 + %th Problem
23 + %th Subbmission ID
24 + %th Submit Time
25 + %th Score
26 + %th detail
27 + %tbody
28 + - @submissions.each do |s|
29 + %tr
30 + %td= s.user.login
31 + %td= s.problem.long_name
32 + %td= s.id
33 + %td= s.submitted_at
34 + %td= s.points
35 + %td= s.grader_comment
36 +
37 +
38 + :javascript
39 + $('.datatable').DataTable({
40 + columns: [
41 + {title: 'User', data: 'login'},
42 + {title: 'Problem', data: 'problem.long_name'},
43 + {title: 'Sub ID', data: 'id'},
44 + {title: 'Submit at', data: 'submitted_at'},
45 + {title: 'Points', data: 'points'},
46 + {title: 'detail', data: 'grader_comment'},
47 + ],
48 + ajax: {
49 + url: '#{submission_query_report_path}',
50 + type: 'POST',
51 + data: (d) => {
52 + d.since_datetime = '1123'
53 + d.until_datetime = 'xxx'
54 + },
55 + dataType: 'json',
56 + beforeSend: (request) => {
57 + request.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'));
58 + },
59 + }, //end ajax
60 + 'pageLength': 50
61 + });
@@ -0,0 +1,15
1 + json.draw params['draw']&.to_i
2 + json.recordsTotal @recordsTotal
3 + json.recordsFiltered @recordsFiltered
4 + json.data do
5 + json.array! @submissions do |sub|
6 + json.extact! sub, :id, :points, :grader_comment
7 + json.submitted_at sub.submitted_at
8 + json.problem do
9 + json.long_name sub.problem&.long_name
10 + end
11 + json.user do
12 + json.login sub.user&.login
13 + end
14 + end
15 + end
@@ -0,0 +1,10
1 + .panel.panel-primary
2 + .panel-heading
3 + Problems
4 + .panel-body
5 + %p
6 + Select problem(s) that we wish to know the score.
7 + = label_tag :problem_id, "Problems"
8 + = select_tag 'problem_id[]',
9 + options_for_select(Problem.all.collect {|p| ["[#{p.name}] #{p.full_name}", p.id]},params[:problem_id]),
10 + { class: 'select2 form-control', multiple: "true" }
@@ -0,0 +1,12
1 + .panel.panel-primary
2 + .panel-heading
3 + Users
4 + .panel-body
5 + .radio
6 + %label
7 + = radio_button_tag 'users', 'all', (params[:users] == "all")
8 + All users
9 + .radio
10 + %label
11 + = radio_button_tag 'users', 'enabled', (params[:users] == "enabled")
12 + Only enabled users
@@ -5,37 +5,37
5 ZenTest (~> 4.3)
5 ZenTest (~> 4.3)
6 ZenTest (4.11.2)
6 ZenTest (4.11.2)
7 ace-rails-ap (4.2)
7 ace-rails-ap (4.2)
8 - actioncable (5.2.3)
8 + actioncable (5.2.4.2)
9 - actionpack (= 5.2.3)
9 + actionpack (= 5.2.4.2)
10 nio4r (~> 2.0)
10 nio4r (~> 2.0)
11 websocket-driver (>= 0.6.1)
11 websocket-driver (>= 0.6.1)
12 - actionmailer (5.2.3)
12 + actionmailer (5.2.4.2)
13 - actionpack (= 5.2.3)
13 + actionpack (= 5.2.4.2)
14 - actionview (= 5.2.3)
14 + actionview (= 5.2.4.2)
15 - activejob (= 5.2.3)
15 + activejob (= 5.2.4.2)
16 mail (~> 2.5, >= 2.5.4)
16 mail (~> 2.5, >= 2.5.4)
17 rails-dom-testing (~> 2.0)
17 rails-dom-testing (~> 2.0)
18 - actionpack (5.2.3)
18 + actionpack (5.2.4.2)
19 - actionview (= 5.2.3)
19 + actionview (= 5.2.4.2)
20 - activesupport (= 5.2.3)
20 + activesupport (= 5.2.4.2)
21 - rack (~> 2.0)
21 + rack (~> 2.0, >= 2.0.8)
22 rack-test (>= 0.6.3)
22 rack-test (>= 0.6.3)
23 rails-dom-testing (~> 2.0)
23 rails-dom-testing (~> 2.0)
24 rails-html-sanitizer (~> 1.0, >= 1.0.2)
24 rails-html-sanitizer (~> 1.0, >= 1.0.2)
25 - actionview (5.2.3)
25 + actionview (5.2.4.2)
26 - activesupport (= 5.2.3)
26 + activesupport (= 5.2.4.2)
27 builder (~> 3.1)
27 builder (~> 3.1)
28 erubi (~> 1.4)
28 erubi (~> 1.4)
29 rails-dom-testing (~> 2.0)
29 rails-dom-testing (~> 2.0)
30 rails-html-sanitizer (~> 1.0, >= 1.0.3)
30 rails-html-sanitizer (~> 1.0, >= 1.0.3)
31 - activejob (5.2.3)
31 + activejob (5.2.4.2)
32 - activesupport (= 5.2.3)
32 + activesupport (= 5.2.4.2)
33 globalid (>= 0.3.6)
33 globalid (>= 0.3.6)
34 - activemodel (5.2.3)
34 + activemodel (5.2.4.2)
35 - activesupport (= 5.2.3)
35 + activesupport (= 5.2.4.2)
36 - activerecord (5.2.3)
36 + activerecord (5.2.4.2)
37 - activemodel (= 5.2.3)
37 + activemodel (= 5.2.4.2)
38 - activesupport (= 5.2.3)
38 + activesupport (= 5.2.4.2)
39 arel (>= 9.0)
39 arel (>= 9.0)
40 activerecord-session_store (1.1.3)
40 activerecord-session_store (1.1.3)
41 actionpack (>= 4.0)
41 actionpack (>= 4.0)
@@ -43,26 +43,26
43 multi_json (~> 1.11, >= 1.11.2)
43 multi_json (~> 1.11, >= 1.11.2)
44 rack (>= 1.5.2, < 3)
44 rack (>= 1.5.2, < 3)
45 railties (>= 4.0)
45 railties (>= 4.0)
46 - activestorage (5.2.3)
46 + activestorage (5.2.4.2)
47 - actionpack (= 5.2.3)
47 + actionpack (= 5.2.4.2)
48 - activerecord (= 5.2.3)
48 + activerecord (= 5.2.4.2)
49 marcel (~> 0.3.1)
49 marcel (~> 0.3.1)
50 - activesupport (5.2.3)
50 + activesupport (5.2.4.2)
51 concurrent-ruby (~> 1.0, >= 1.0.2)
51 concurrent-ruby (~> 1.0, >= 1.0.2)
52 i18n (>= 0.7, < 2)
52 i18n (>= 0.7, < 2)
53 minitest (~> 5.1)
53 minitest (~> 5.1)
54 tzinfo (~> 1.1)
54 tzinfo (~> 1.1)
55 - addressable (2.6.0)
55 + addressable (2.7.0)
56 - public_suffix (>= 2.0.2, < 4.0)
56 + public_suffix (>= 2.0.2, < 5.0)
57 ansi (1.5.0)
57 ansi (1.5.0)
58 arel (9.0.0)
58 arel (9.0.0)
59 - autoprefixer-rails (9.5.1.1)
59 + autoprefixer-rails (9.5.1)
60 execjs
60 execjs
61 best_in_place (3.0.3)
61 best_in_place (3.0.3)
62 actionpack (>= 3.2)
62 actionpack (>= 3.2)
63 railties (>= 3.2)
63 railties (>= 3.2)
64 - bindex (0.7.0)
64 + bindex (0.8.1)
65 - bootsnap (1.4.4)
65 + bootsnap (1.4.6)
66 msgpack (~> 1.0)
66 msgpack (~> 1.0)
67 bootstrap-datepicker-rails (1.8.0.1)
67 bootstrap-datepicker-rails (1.8.0.1)
68 railties (>= 3.0)
68 railties (>= 3.0)
@@ -73,21 +73,17
73 bootstrap-toggle-rails (2.2.1.0)
73 bootstrap-toggle-rails (2.2.1.0)
74 bootstrap3-datetimepicker-rails (4.17.47)
74 bootstrap3-datetimepicker-rails (4.17.47)
75 momentjs-rails (>= 2.8.1)
75 momentjs-rails (>= 2.8.1)
76 - builder (3.2.3)
76 + builder (3.2.4)
77 byebug (11.0.1)
77 byebug (11.0.1)
78 - capybara (3.25.0)
78 + capybara (3.15.1)
79 addressable
79 addressable
80 mini_mime (>= 0.1.3)
80 mini_mime (>= 0.1.3)
81 nokogiri (~> 1.8)
81 nokogiri (~> 1.8)
82 rack (>= 1.6.0)
82 rack (>= 1.6.0)
83 rack-test (>= 0.6.3)
83 rack-test (>= 0.6.3)
84 - regexp_parser (~> 1.5)
84 + regexp_parser (~> 1.2)
85 xpath (~> 3.2)
85 xpath (~> 3.2)
86 - capybara-console (0.0.4)
86 + childprocess (3.0.0)
87 - capybara
88 - rails (>= 3.0)
89 - childprocess (1.0.1)
90 - rake (< 13.0)
91 coffee-rails (4.2.2)
87 coffee-rails (4.2.2)
92 coffee-script (>= 2.2.0)
88 coffee-script (>= 2.2.0)
93 railties (>= 4.0.0)
89 railties (>= 4.0.0)
@@ -95,18 +91,18
95 coffee-script-source
91 coffee-script-source
96 execjs
92 execjs
97 coffee-script-source (1.12.2)
93 coffee-script-source (1.12.2)
98 - concurrent-ruby (1.1.5)
94 + concurrent-ruby (1.1.6)
99 - crass (1.0.4)
95 + crass (1.0.6)
100 dynamic_form (1.1.4)
96 dynamic_form (1.1.4)
101 - erubi (1.8.0)
97 + erubi (1.9.0)
102 erubis (2.7.0)
98 erubis (2.7.0)
103 execjs (2.7.0)
99 execjs (2.7.0)
104 - ffi (1.11.1)
100 + ffi (1.10.0)
105 fuzzy-string-match (1.0.1)
101 fuzzy-string-match (1.0.1)
106 RubyInline (>= 3.8.6)
102 RubyInline (>= 3.8.6)
107 globalid (0.4.2)
103 globalid (0.4.2)
108 activesupport (>= 4.2.0)
104 activesupport (>= 4.2.0)
109 - haml (5.1.0)
105 + haml (5.0.4)
110 temple (>= 0.8.0)
106 temple (>= 0.8.0)
111 tilt
107 tilt
112 haml-rails (1.0.0)
108 haml-rails (1.0.0)
@@ -120,11 +116,11
120 haml (>= 4.0, < 6)
116 haml (>= 4.0, < 6)
121 nokogiri (>= 1.6.0)
117 nokogiri (>= 1.6.0)
122 ruby_parser (~> 3.5)
118 ruby_parser (~> 3.5)
123 - i18n (1.6.0)
119 + i18n (1.8.2)
124 concurrent-ruby (~> 1.0)
120 concurrent-ruby (~> 1.0)
125 in_place_editing (1.2.0)
121 in_place_editing (1.2.0)
126 - jbuilder (2.9.1)
122 + jbuilder (2.10.0)
127 - activesupport (>= 4.2.0)
123 + activesupport (>= 5.0.0)
128 jquery-countdown-rails (2.0.2)
124 jquery-countdown-rails (2.0.2)
129 jquery-datatables-rails (3.4.0)
125 jquery-datatables-rails (3.4.0)
130 actionpack (>= 3.1)
126 actionpack (>= 3.1)
@@ -145,18 +141,18
145 rb-fsevent (~> 0.9, >= 0.9.4)
141 rb-fsevent (~> 0.9, >= 0.9.4)
146 rb-inotify (~> 0.9, >= 0.9.7)
142 rb-inotify (~> 0.9, >= 0.9.7)
147 ruby_dep (~> 1.2)
143 ruby_dep (~> 1.2)
148 - loofah (2.2.3)
144 + loofah (2.4.0)
149 crass (~> 1.0.2)
145 crass (~> 1.0.2)
150 nokogiri (>= 1.5.9)
146 nokogiri (>= 1.5.9)
151 mail (2.7.1)
147 mail (2.7.1)
152 mini_mime (>= 0.1.1)
148 mini_mime (>= 0.1.1)
153 marcel (0.3.3)
149 marcel (0.3.3)
154 mimemagic (~> 0.3.2)
150 mimemagic (~> 0.3.2)
155 - method_source (0.9.2)
151 + method_source (1.0.0)
156 - mimemagic (0.3.3)
152 + mimemagic (0.3.4)
157 - mini_mime (1.0.1)
153 + mini_mime (1.0.2)
158 mini_portile2 (2.4.0)
154 mini_portile2 (2.4.0)
159 - minitest (5.11.3)
155 + minitest (5.14.0)
160 minitest-reporters (1.3.6)
156 minitest-reporters (1.3.6)
161 ansi
157 ansi
162 builder
158 builder
@@ -164,30 +160,30
164 ruby-progressbar
160 ruby-progressbar
165 momentjs-rails (2.20.1)
161 momentjs-rails (2.20.1)
166 railties (>= 3.1)
162 railties (>= 3.1)
167 - msgpack (1.3.0)
163 + msgpack (1.3.3)
168 multi_json (1.13.1)
164 multi_json (1.13.1)
169 mysql2 (0.5.2)
165 mysql2 (0.5.2)
170 - nio4r (2.3.1)
166 + nio4r (2.5.2)
171 - nokogiri (1.10.3)
167 + nokogiri (1.10.9)
172 mini_portile2 (~> 2.4.0)
168 mini_portile2 (~> 2.4.0)
173 - public_suffix (3.1.1)
169 + public_suffix (4.0.3)
174 - puma (4.0.0)
170 + puma (4.3.3)
175 nio4r (~> 2.0)
171 nio4r (~> 2.0)
176 - rack (2.0.7)
172 + rack (2.2.2)
177 rack-test (1.1.0)
173 rack-test (1.1.0)
178 rack (>= 1.0, < 3)
174 rack (>= 1.0, < 3)
179 - rails (5.2.3)
175 + rails (5.2.4.2)
180 - actioncable (= 5.2.3)
176 + actioncable (= 5.2.4.2)
181 - actionmailer (= 5.2.3)
177 + actionmailer (= 5.2.4.2)
182 - actionpack (= 5.2.3)
178 + actionpack (= 5.2.4.2)
183 - actionview (= 5.2.3)
179 + actionview (= 5.2.4.2)
184 - activejob (= 5.2.3)
180 + activejob (= 5.2.4.2)
185 - activemodel (= 5.2.3)
181 + activemodel (= 5.2.4.2)
186 - activerecord (= 5.2.3)
182 + activerecord (= 5.2.4.2)
187 - activestorage (= 5.2.3)
183 + activestorage (= 5.2.4.2)
188 - activesupport (= 5.2.3)
184 + activesupport (= 5.2.4.2)
189 bundler (>= 1.3.0)
185 bundler (>= 1.3.0)
190 - railties (= 5.2.3)
186 + railties (= 5.2.4.2)
191 sprockets-rails (>= 2.0.0)
187 sprockets-rails (>= 2.0.0)
192 rails-controller-testing (1.0.4)
188 rails-controller-testing (1.0.4)
193 actionpack (>= 5.0.1.x)
189 actionpack (>= 5.0.1.x)
@@ -196,28 +192,28
196 rails-dom-testing (2.0.3)
192 rails-dom-testing (2.0.3)
197 activesupport (>= 4.2.0)
193 activesupport (>= 4.2.0)
198 nokogiri (>= 1.6)
194 nokogiri (>= 1.6)
199 - rails-html-sanitizer (1.0.4)
195 + rails-html-sanitizer (1.3.0)
200 - loofah (~> 2.2, >= 2.2.2)
196 + loofah (~> 2.3)
201 rails_bootstrap_sortable (2.0.6)
197 rails_bootstrap_sortable (2.0.6)
202 momentjs-rails (>= 2.8.3)
198 momentjs-rails (>= 2.8.3)
203 - railties (5.2.3)
199 + railties (5.2.4.2)
204 - actionpack (= 5.2.3)
200 + actionpack (= 5.2.4.2)
205 - activesupport (= 5.2.3)
201 + activesupport (= 5.2.4.2)
206 method_source
202 method_source
207 rake (>= 0.8.7)
203 rake (>= 0.8.7)
208 thor (>= 0.19.0, < 2.0)
204 thor (>= 0.19.0, < 2.0)
209 - rake (12.3.2)
205 + rake (13.0.1)
210 rb-fsevent (0.10.3)
206 rb-fsevent (0.10.3)
211 rb-inotify (0.10.0)
207 rb-inotify (0.10.0)
212 ffi (~> 1.0)
208 ffi (~> 1.0)
213 rdiscount (2.2.0.1)
209 rdiscount (2.2.0.1)
214 - regexp_parser (1.5.1)
210 + regexp_parser (1.7.0)
215 rouge (3.3.0)
211 rouge (3.3.0)
216 ruby-progressbar (1.10.0)
212 ruby-progressbar (1.10.0)
217 ruby_dep (1.5.0)
213 ruby_dep (1.5.0)
218 ruby_parser (3.13.1)
214 ruby_parser (3.13.1)
219 sexp_processor (~> 4.9)
215 sexp_processor (~> 4.9)
220 - rubyzip (1.2.3)
216 + rubyzip (1.3.0)
221 sass (3.7.4)
217 sass (3.7.4)
222 sass-listen (~> 4.0.0)
218 sass-listen (~> 4.0.0)
223 sass-listen (4.0.0)
219 sass-listen (4.0.0)
@@ -229,10 +225,9
229 sprockets (>= 2.8, < 4.0)
225 sprockets (>= 2.8, < 4.0)
230 sprockets-rails (>= 2.0, < 4.0)
226 sprockets-rails (>= 2.0, < 4.0)
231 tilt (>= 1.1, < 3)
227 tilt (>= 1.1, < 3)
232 - sassc (2.0.1)
228 + sassc (2.2.1)
233 ffi (~> 1.9)
229 ffi (~> 1.9)
234 - rake
230 + sassc-rails (2.1.2)
235 - sassc-rails (2.1.1)
236 railties (>= 4.0.0)
231 railties (>= 4.0.0)
237 sassc (>= 2.0)
232 sassc (>= 2.0)
238 sprockets (> 3.0)
233 sprockets (> 3.0)
@@ -240,14 +235,15
240 tilt
235 tilt
241 select2-rails (4.0.3)
236 select2-rails (4.0.3)
242 thor (~> 0.14)
237 thor (~> 0.14)
243 - selenium-webdriver (3.142.3)
238 + selenium-webdriver (3.142.7)
244 - childprocess (>= 0.5, < 2.0)
239 + childprocess (>= 0.5, < 4.0)
245 - rubyzip (~> 1.2, >= 1.2.2)
240 + rubyzip (>= 1.2.2)
246 sexp_processor (4.12.0)
241 sexp_processor (4.12.0)
247 - simple_form (4.1.0)
242 + simple_form (5.0.2)
248 actionpack (>= 5.0)
243 actionpack (>= 5.0)
249 activemodel (>= 5.0)
244 activemodel (>= 5.0)
250 - spring (2.1.0)
245 + spring (2.0.2)
246 + activesupport (>= 4.2)
251 spring-watcher-listen (2.0.1)
247 spring-watcher-listen (2.0.1)
252 listen (>= 2.7, < 4.0)
248 listen (>= 2.7, < 4.0)
253 spring (>= 1.2, < 3.0)
249 spring (>= 1.2, < 3.0)
@@ -263,7 +259,7
263 thor (0.20.3)
259 thor (0.20.3)
264 thread_safe (0.3.6)
260 thread_safe (0.3.6)
265 tilt (2.0.9)
261 tilt (2.0.9)
266 - tzinfo (1.2.5)
262 + tzinfo (1.2.7)
267 thread_safe (~> 0.1)
263 thread_safe (~> 0.1)
268 uglifier (4.1.20)
264 uglifier (4.1.20)
269 execjs (>= 0.3.0, < 3)
265 execjs (>= 0.3.0, < 3)
@@ -272,7 +268,7
272 activemodel (>= 5.0)
268 activemodel (>= 5.0)
273 bindex (>= 0.4.0)
269 bindex (>= 0.4.0)
274 railties (>= 5.0)
270 railties (>= 5.0)
275 - webdriver (0.1.0)
271 + webdriver (0.5.0)
276 websocket-driver (0.7.1)
272 websocket-driver (0.7.1)
277 websocket-extensions (>= 0.1.0)
273 websocket-extensions (>= 0.1.0)
278 websocket-extensions (0.1.4)
274 websocket-extensions (0.1.4)
@@ -299,7 +295,6
299 bootstrap3-datetimepicker-rails
295 bootstrap3-datetimepicker-rails
300 byebug
296 byebug
301 capybara (>= 2.15)
297 capybara (>= 2.15)
302 - capybara-console
303 coffee-rails
298 coffee-rails
304 dynamic_form
299 dynamic_form
305 fuzzy-string-match
300 fuzzy-string-match
@@ -338,4 +333,4
338 yaml_db
333 yaml_db
339
334
340 BUNDLED WITH
335 BUNDLED WITH
341 - 1.17.2
336 + 1.16.2
@@ -164,4 +164,65
164 return true
164 return true
165 end
165 end
166
166
167 + #function for datatable ajax query
168 + #return record,total_count,filter_count
169 + def process_query_record(record,
170 + total_count: nil,
171 + select: '',
172 + global_search: [],
173 + no_search: false,
174 + force_order: '',
175 + date_filter: '', date_param_since: 'date_since',date_param_until: 'date_until')
176 + arel_table = record.model.arel_table
177 +
178 + if !no_search && params['search']
179 + global_value = record.model.sanitize_sql(params['search']['value'].strip.downcase)
180 + if !global_value.blank?
181 + global_value.split.each do |value|
182 + global_where = global_search.map{|f| "LOWER(#{f}) like '%#{value}%'"}.join(' OR ')
183 + record = record.where(global_where)
167 end
184 end
185 + end
186 +
187 + params['columns'].each do |i, col|
188 + if !col['search']['value'].blank?
189 + record = record.where(arel_table[col['name']].lower.matches("%#{col['search']['value'].strip.downcase}%"))
190 + end
191 + end
192 + end
193 +
194 + if !date_filter.blank?
195 + date_since = Time.parse( params[:date_since] ) rescue Time.new(1,1,1)
196 + date_until = Time.parse( params[:date_until] ) rescue Time.zone.now()
197 + date_range = date_since..date_until
198 + record = record.where(date_filter.to_sym => date_range)
199 + end
200 +
201 + if force_order.blank?
202 + if params['order']
203 + params['order'].each do |i, o|
204 + colName = params['columns'][o['column']]['name']
205 + colName = "#{record.model.table_name}.#{colName}" if colName.upcase == 'ID'
206 + record = record.order("#{colName} #{o['dir'].casecmp('desc') != 0 ? 'ASC' : 'DESC'}") unless colName.blank?
207 + end
208 + end
209 + else
210 + record = record.order(force_order)
211 + end
212 +
213 + filterCount = record.count(record.model.primary_key)
214 + # if .group() is used, filterCount might be like {id_1: count_1, id_2: count_2, ...}
215 + # so we should count the result again..
216 + if filterCount.is_a? Hash
217 + filterCount = filterCount.count
218 + end
219 +
220 + record = record.offset(params['start'] || 0).limit(params['length'] || 100)
221 + if (!select.blank?)
222 + record = record.select(select)
223 + end
224 +
225 + return record, total_count || record.model.count, filterCount
226 + end
227 +
228 + end
@@ -142,8 +142,7
142 end
142 end
143 end
143 end
144
144
145 - def submission_stat
145 + def submission
146 -
147 date_and_time = '%Y-%m-%d %H:%M'
146 date_and_time = '%Y-%m-%d %H:%M'
148 begin
147 begin
149 @since_time = DateTime.strptime(params[:since_datetime],date_and_time)
148 @since_time = DateTime.strptime(params[:since_datetime],date_and_time)
@@ -156,25 +155,22
156 @until_time = DateTime.new(3000,1,1)
155 @until_time = DateTime.new(3000,1,1)
157 end
156 end
158
157
159 - @submissions = {}
158 + @submissions = Submission
160 -
159 + .joins(:problem).joins(:user)
161 - User.find_each do |user|
160 + .where("submitted_at >= ? AND submitted_at <= ?",@since_time,@until_time)
162 - @submissions[user.id] = { login: user.login, full_name: user.full_name, count: 0, sub: { } }
163 end
161 end
164
162
165 - Submission.where("submitted_at >= ? AND submitted_at <= ?",@since_time,@until_time).find_each do |s|
163 + def submission_query
166 - if @submissions[s.user_id]
164 + @submissions = Submission
167 - if not @submissions[s.user_id][:sub].has_key?(s.problem_id)
165 + .joins(:problem).joins(:user)
168 - a = Problem.find_by_id(s.problem_id)
166 + .where("submitted_at >= ? AND submitted_at <= ?",@since_time,@until_time)
169 - @submissions[s.user_id][:sub][s.problem_id] =
167 +
170 - { prob_name: (a ? a.full_name : '(NULL)'),
168 + @submissions, @recordsTotal, @recordsFiltered = process_query_record( @submissions,
171 - sub_ids: [s.id] }
169 + global_search: ['user.login','user.full_name','problem.name','problem.full_name','points'],
172 - else
170 + date_filter: 'submitted_at',
173 - @submissions[s.user_id][:sub][s.problem_id][:sub_ids] << s.id
171 + date_param_since: 'since_datetime',
174 - end
172 + date_param_until: 'until_datetime',
175 - @submissions[s.user_id][:count] += 1
173 + )
176 - end
177 - end
178 end
174 end
179
175
180 def problem_hof
176 def problem_hof
@@ -152,6 +152,8
152 post 'cheat_report'
152 post 'cheat_report'
153 get 'cheat_scruntinize'
153 get 'cheat_scruntinize'
154 post 'cheat_scruntinize'
154 post 'cheat_scruntinize'
155 + get 'submission'
156 + post 'submission_query'
155 end
157 end
156 #get 'report/current_score', to: 'report#current_score', as: 'report_current_score'
158 #get 'report/current_score', to: 'report#current_score', as: 'report_current_score'
157 #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof'
159 #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof'
@@ -1,3 +1,4
1 + # encoding: UTF-8
1 # This file is auto-generated from the current state of the database. Instead
2 # This file is auto-generated from the current state of the database. Instead
2 # of editing this file, please use the migrations feature of Active Record to
3 # of editing this file, please use the migrations feature of Active Record to
3 # incrementally modify your database, and then regenerate this schema definition.
4 # incrementally modify your database, and then regenerate this schema definition.
@@ -10,298 +11,311
10 #
11 #
11 # It's strongly recommended that you check this file into your version control system.
12 # It's strongly recommended that you check this file into your version control system.
12
13
13 - ActiveRecord::Schema.define(version: 2018_06_12_102327) do
14 + ActiveRecord::Schema.define(version: 20180612102327) do
14
15
15 - create_table "announcements", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
16 + create_table "announcements", force: :cascade do |t|
16 - t.string "author"
17 + t.string "author", limit: 255
17 - t.text "body"
18 + t.text "body", limit: 65535
18 t.boolean "published"
19 t.boolean "published"
19 t.datetime "created_at"
20 t.datetime "created_at"
20 t.datetime "updated_at"
21 t.datetime "updated_at"
21 t.boolean "frontpage", default: false
22 t.boolean "frontpage", default: false
22 t.boolean "contest_only", default: false
23 t.boolean "contest_only", default: false
23 - t.string "title"
24 + t.string "title", limit: 255
24 - t.string "notes"
25 + t.string "notes", limit: 255
25 end
26 end
26
27
27 - create_table "contests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
28 + create_table "contests", force: :cascade do |t|
28 - t.string "title"
29 + t.string "title", limit: 255
29 t.boolean "enabled"
30 t.boolean "enabled"
30 t.datetime "created_at"
31 t.datetime "created_at"
31 t.datetime "updated_at"
32 t.datetime "updated_at"
32 - t.string "name"
33 + t.string "name", limit: 255
33 end
34 end
34
35
35 - create_table "contests_problems", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
36 + create_table "contests_problems", id: false, force: :cascade do |t|
36 - t.integer "contest_id"
37 + t.integer "contest_id", limit: 4
37 - t.integer "problem_id"
38 + t.integer "problem_id", limit: 4
38 end
39 end
39
40
40 - create_table "contests_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
41 + create_table "contests_users", id: false, force: :cascade do |t|
41 - t.integer "contest_id"
42 + t.integer "contest_id", limit: 4
42 - t.integer "user_id"
43 + t.integer "user_id", limit: 4
43 end
44 end
44
45
45 - create_table "countries", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
46 + create_table "countries", force: :cascade do |t|
46 - t.string "name"
47 + t.string "name", limit: 255
47 t.datetime "created_at"
48 t.datetime "created_at"
48 t.datetime "updated_at"
49 t.datetime "updated_at"
49 end
50 end
50
51
51 - create_table "descriptions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
52 + create_table "descriptions", force: :cascade do |t|
52 - t.text "body"
53 + t.text "body", limit: 65535
53 t.boolean "markdowned"
54 t.boolean "markdowned"
54 t.datetime "created_at"
55 t.datetime "created_at"
55 t.datetime "updated_at"
56 t.datetime "updated_at"
56 end
57 end
57
58
58 - create_table "grader_configurations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
59 + create_table "grader_configurations", force: :cascade do |t|
59 - t.string "key"
60 + t.string "key", limit: 255
60 - t.string "value_type"
61 + t.string "value_type", limit: 255
61 - t.string "value"
62 + t.string "value", limit: 255
62 t.datetime "created_at"
63 t.datetime "created_at"
63 t.datetime "updated_at"
64 t.datetime "updated_at"
64 - t.text "description"
65 + t.text "description", limit: 65535
65 end
66 end
66
67
67 - create_table "grader_processes", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
68 + create_table "grader_processes", force: :cascade do |t|
68 - t.string "host"
69 + t.string "host", limit: 255
69 - t.integer "pid"
70 + t.integer "pid", limit: 4
70 - t.string "mode"
71 + t.string "mode", limit: 255
71 t.boolean "active"
72 t.boolean "active"
72 t.datetime "created_at"
73 t.datetime "created_at"
73 t.datetime "updated_at"
74 t.datetime "updated_at"
74 - t.integer "task_id"
75 + t.integer "task_id", limit: 4
75 - t.string "task_type"
76 + t.string "task_type", limit: 255
76 t.boolean "terminated"
77 t.boolean "terminated"
77 - t.index ["host", "pid"], name: "index_grader_processes_on_host_and_pid"
78 end
78 end
79
79
80 - create_table "groups", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
80 + add_index "grader_processes", ["host", "pid"], name: "index_grader_processes_on_host_and_pid", using: :btree
81 - t.string "name"
81 +
82 - t.string "description"
82 + create_table "groups", force: :cascade do |t|
83 + t.string "name", limit: 255
84 + t.string "description", limit: 255
83 end
85 end
84
86
85 - create_table "groups_problems", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
87 + create_table "groups_problems", id: false, force: :cascade do |t|
86 - t.integer "problem_id", null: false
88 + t.integer "problem_id", limit: 4, null: false
87 - t.integer "group_id", null: false
89 + t.integer "group_id", limit: 4, null: false
88 - t.index ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id"
89 end
90 end
90
91
91 - create_table "groups_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
92 + add_index "groups_problems", ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id", using: :btree
92 - t.integer "group_id", null: false
93 +
93 - t.integer "user_id", null: false
94 + create_table "groups_users", id: false, force: :cascade do |t|
94 - t.index ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id"
95 + t.integer "group_id", limit: 4, null: false
96 + t.integer "user_id", limit: 4, null: false
95 end
97 end
96
98
97 - create_table "heart_beats", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
99 + add_index "groups_users", ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id", using: :btree
98 - t.integer "user_id"
100 +
99 - t.string "ip_address"
101 + create_table "heart_beats", force: :cascade do |t|
102 + t.integer "user_id", limit: 4
103 + t.string "ip_address", limit: 255
100 t.datetime "created_at"
104 t.datetime "created_at"
101 t.datetime "updated_at"
105 t.datetime "updated_at"
102 - t.string "status"
106 + t.string "status", limit: 255
103 - t.index ["updated_at"], name: "index_heart_beats_on_updated_at"
104 end
107 end
105
108
106 - create_table "languages", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
109 + add_index "heart_beats", ["updated_at"], name: "index_heart_beats_on_updated_at", using: :btree
110 +
111 + create_table "languages", force: :cascade do |t|
107 t.string "name", limit: 10
112 t.string "name", limit: 10
108 - t.string "pretty_name"
113 + t.string "pretty_name", limit: 255
109 t.string "ext", limit: 10
114 t.string "ext", limit: 10
110 - t.string "common_ext"
115 + t.string "common_ext", limit: 255
111 end
116 end
112
117
113 - create_table "logins", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
118 + create_table "logins", force: :cascade do |t|
114 - t.integer "user_id"
119 + t.integer "user_id", limit: 4
115 - t.string "ip_address"
120 + t.string "ip_address", limit: 255
116 t.datetime "created_at"
121 t.datetime "created_at"
117 t.datetime "updated_at"
122 t.datetime "updated_at"
118 end
123 end
119
124
120 - create_table "messages", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
125 + create_table "messages", force: :cascade do |t|
121 - t.integer "sender_id"
126 + t.integer "sender_id", limit: 4
122 - t.integer "receiver_id"
127 + t.integer "receiver_id", limit: 4
123 - t.integer "replying_message_id"
128 + t.integer "replying_message_id", limit: 4
124 - t.text "body"
129 + t.text "body", limit: 65535
125 t.boolean "replied"
130 t.boolean "replied"
126 t.datetime "created_at"
131 t.datetime "created_at"
127 t.datetime "updated_at"
132 t.datetime "updated_at"
128 end
133 end
129
134
130 - create_table "problems", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
135 + create_table "problems", force: :cascade do |t|
131 t.string "name", limit: 30
136 t.string "name", limit: 30
132 - t.string "full_name"
137 + t.string "full_name", limit: 255
133 - t.integer "full_score"
138 + t.integer "full_score", limit: 4
134 t.date "date_added"
139 t.date "date_added"
135 t.boolean "available"
140 t.boolean "available"
136 - t.string "url"
141 + t.string "url", limit: 255
137 - t.integer "description_id"
142 + t.integer "description_id", limit: 4
138 t.boolean "test_allowed"
143 t.boolean "test_allowed"
139 t.boolean "output_only"
144 t.boolean "output_only"
140 - t.string "description_filename"
145 + t.string "description_filename", limit: 255
141 t.boolean "view_testcase"
146 t.boolean "view_testcase"
142 end
147 end
143
148
144 - create_table "problems_tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
149 + create_table "problems_tags", force: :cascade do |t|
145 - t.integer "problem_id"
150 + t.integer "problem_id", limit: 4
146 - t.integer "tag_id"
151 + t.integer "tag_id", limit: 4
147 - t.index ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true
148 - t.index ["problem_id"], name: "index_problems_tags_on_problem_id"
149 - t.index ["tag_id"], name: "index_problems_tags_on_tag_id"
150 end
152 end
151
153
152 - create_table "rights", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
154 + add_index "problems_tags", ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true, using: :btree
153 - t.string "name"
155 + add_index "problems_tags", ["problem_id"], name: "index_problems_tags_on_problem_id", using: :btree
154 - t.string "controller"
156 + add_index "problems_tags", ["tag_id"], name: "index_problems_tags_on_tag_id", using: :btree
155 - t.string "action"
157 +
158 + create_table "rights", force: :cascade do |t|
159 + t.string "name", limit: 255
160 + t.string "controller", limit: 255
161 + t.string "action", limit: 255
156 end
162 end
157
163
158 - create_table "rights_roles", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
164 + create_table "rights_roles", id: false, force: :cascade do |t|
159 - t.integer "right_id"
165 + t.integer "right_id", limit: 4
160 - t.integer "role_id"
166 + t.integer "role_id", limit: 4
161 - t.index ["role_id"], name: "index_rights_roles_on_role_id"
162 end
167 end
163
168
164 - create_table "roles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
169 + add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree
165 - t.string "name"
170 +
171 + create_table "roles", force: :cascade do |t|
172 + t.string "name", limit: 255
166 end
173 end
167
174
168 - create_table "roles_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
175 + create_table "roles_users", id: false, force: :cascade do |t|
169 - t.integer "role_id"
176 + t.integer "role_id", limit: 4
170 - t.integer "user_id"
177 + t.integer "user_id", limit: 4
171 - t.index ["user_id"], name: "index_roles_users_on_user_id"
172 end
178 end
173
179
174 - create_table "sessions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
180 + add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree
175 - t.string "session_id"
181 +
176 - t.text "data"
182 + create_table "sessions", force: :cascade do |t|
183 + t.string "session_id", limit: 255
184 + t.text "data", limit: 65535
177 t.datetime "updated_at"
185 t.datetime "updated_at"
178 - t.index ["session_id"], name: "index_sessions_on_session_id"
179 - t.index ["updated_at"], name: "index_sessions_on_updated_at"
180 end
186 end
181
187
182 - create_table "sites", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
188 + add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree
183 - t.string "name"
189 + add_index "sessions", ["updated_at"], name: "index_sessions_on_updated_at", using: :btree
190 +
191 + create_table "sites", force: :cascade do |t|
192 + t.string "name", limit: 255
184 t.boolean "started"
193 t.boolean "started"
185 t.datetime "start_time"
194 t.datetime "start_time"
186 t.datetime "created_at"
195 t.datetime "created_at"
187 t.datetime "updated_at"
196 t.datetime "updated_at"
188 - t.integer "country_id"
197 + t.integer "country_id", limit: 4
189 - t.string "password"
198 + t.string "password", limit: 255
190 end
199 end
191
200
192 - create_table "submission_view_logs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
201 + create_table "submission_view_logs", force: :cascade do |t|
193 - t.integer "user_id"
202 + t.integer "user_id", limit: 4
194 - t.integer "submission_id"
203 + t.integer "submission_id", limit: 4
195 t.datetime "created_at"
204 t.datetime "created_at"
196 t.datetime "updated_at"
205 t.datetime "updated_at"
197 end
206 end
198
207
199 - create_table "submissions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
208 + create_table "submissions", force: :cascade do |t|
200 - t.integer "user_id"
209 + t.integer "user_id", limit: 4
201 - t.integer "problem_id"
210 + t.integer "problem_id", limit: 4
202 - t.integer "language_id"
211 + t.integer "language_id", limit: 4
203 t.text "source", limit: 16777215
212 t.text "source", limit: 16777215
204 - t.binary "binary"
213 + t.binary "binary", limit: 65535
205 t.datetime "submitted_at"
214 t.datetime "submitted_at"
206 t.datetime "compiled_at"
215 t.datetime "compiled_at"
207 - t.text "compiler_message"
216 + t.text "compiler_message", limit: 65535
208 t.datetime "graded_at"
217 t.datetime "graded_at"
209 - t.integer "points"
218 + t.integer "points", limit: 4
210 - t.text "grader_comment"
219 + t.text "grader_comment", limit: 65535
211 - t.integer "number"
220 + t.integer "number", limit: 4
212 - t.string "source_filename"
221 + t.string "source_filename", limit: 255
213 - t.float "max_runtime"
222 + t.float "max_runtime", limit: 24
214 - t.integer "peak_memory"
223 + t.integer "peak_memory", limit: 4
215 - t.integer "effective_code_length"
224 + t.integer "effective_code_length", limit: 4
216 - t.string "ip_address"
225 + t.string "ip_address", limit: 255
217 - t.index ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true
218 - t.index ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id"
219 end
226 end
220
227
221 - create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
228 + add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree
222 - t.string "name", null: false
229 + add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree
223 - t.text "description"
230 +
231 + create_table "tags", force: :cascade do |t|
232 + t.string "name", limit: 255, null: false
233 + t.text "description", limit: 65535
224 t.boolean "public"
234 t.boolean "public"
225 t.datetime "created_at", null: false
235 t.datetime "created_at", null: false
226 t.datetime "updated_at", null: false
236 t.datetime "updated_at", null: false
227 end
237 end
228
238
229 - create_table "tasks", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
239 + create_table "tasks", force: :cascade do |t|
230 - t.integer "submission_id"
240 + t.integer "submission_id", limit: 4
231 t.datetime "created_at"
241 t.datetime "created_at"
232 - t.integer "status"
242 + t.integer "status", limit: 4
233 t.datetime "updated_at"
243 t.datetime "updated_at"
234 - t.index ["submission_id"], name: "index_tasks_on_submission_id"
235 end
244 end
236
245
237 - create_table "test_pairs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
246 + add_index "tasks", ["submission_id"], name: "index_tasks_on_submission_id", using: :btree
238 - t.integer "problem_id"
247 +
248 + create_table "test_pairs", force: :cascade do |t|
249 + t.integer "problem_id", limit: 4
239 t.text "input", limit: 16777215
250 t.text "input", limit: 16777215
240 t.text "solution", limit: 16777215
251 t.text "solution", limit: 16777215
241 t.datetime "created_at"
252 t.datetime "created_at"
242 t.datetime "updated_at"
253 t.datetime "updated_at"
243 end
254 end
244
255
245 - create_table "test_requests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
256 + create_table "test_requests", force: :cascade do |t|
246 - t.integer "user_id"
257 + t.integer "user_id", limit: 4
247 - t.integer "problem_id"
258 + t.integer "problem_id", limit: 4
248 - t.integer "submission_id"
259 + t.integer "submission_id", limit: 4
249 - t.string "input_file_name"
260 + t.string "input_file_name", limit: 255
250 - t.string "output_file_name"
261 + t.string "output_file_name", limit: 255
251 - t.string "running_stat"
262 + t.string "running_stat", limit: 255
252 - t.integer "status"
263 + t.integer "status", limit: 4
253 t.datetime "updated_at"
264 t.datetime "updated_at"
254 t.datetime "submitted_at"
265 t.datetime "submitted_at"
255 t.datetime "compiled_at"
266 t.datetime "compiled_at"
256 - t.text "compiler_message"
267 + t.text "compiler_message", limit: 65535
257 t.datetime "graded_at"
268 t.datetime "graded_at"
258 - t.string "grader_comment"
269 + t.string "grader_comment", limit: 255
259 t.datetime "created_at"
270 t.datetime "created_at"
260 - t.float "running_time"
271 + t.float "running_time", limit: 24
261 - t.string "exit_status"
272 + t.string "exit_status", limit: 255
262 - t.integer "memory_usage"
273 + t.integer "memory_usage", limit: 4
263 - t.index ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id"
264 end
274 end
265
275
266 - create_table "testcases", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
276 + add_index "test_requests", ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id", using: :btree
267 - t.integer "problem_id"
277 +
268 - t.integer "num"
278 + create_table "testcases", force: :cascade do |t|
269 - t.integer "group"
279 + t.integer "problem_id", limit: 4
270 - t.integer "score"
280 + t.integer "num", limit: 4
281 + t.integer "group", limit: 4
282 + t.integer "score", limit: 4
271 t.text "input", limit: 4294967295
283 t.text "input", limit: 4294967295
272 t.text "sol", limit: 4294967295
284 t.text "sol", limit: 4294967295
273 t.datetime "created_at"
285 t.datetime "created_at"
274 t.datetime "updated_at"
286 t.datetime "updated_at"
275 - t.index ["problem_id"], name: "index_testcases_on_problem_id"
276 end
287 end
277
288
278 - create_table "user_contest_stats", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
289 + add_index "testcases", ["problem_id"], name: "index_testcases_on_problem_id", using: :btree
279 - t.integer "user_id"
290 +
291 + create_table "user_contest_stats", force: :cascade do |t|
292 + t.integer "user_id", limit: 4
280 t.datetime "started_at"
293 t.datetime "started_at"
281 t.datetime "created_at"
294 t.datetime "created_at"
282 t.datetime "updated_at"
295 t.datetime "updated_at"
283 t.boolean "forced_logout"
296 t.boolean "forced_logout"
284 end
297 end
285
298
286 - create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t|
299 + create_table "users", force: :cascade do |t|
287 t.string "login", limit: 50
300 t.string "login", limit: 50
288 - t.string "full_name"
301 + t.string "full_name", limit: 255
289 - t.string "hashed_password"
302 + t.string "hashed_password", limit: 255
290 t.string "salt", limit: 5
303 t.string "salt", limit: 5
291 - t.string "alias"
304 + t.string "alias", limit: 255
292 - t.string "email"
305 + t.string "email", limit: 255
293 - t.integer "site_id"
306 + t.integer "site_id", limit: 4
294 - t.integer "country_id"
307 + t.integer "country_id", limit: 4
295 t.boolean "activated", default: false
308 t.boolean "activated", default: false
296 t.datetime "created_at"
309 t.datetime "created_at"
297 t.datetime "updated_at"
310 t.datetime "updated_at"
298 - t.string "section"
311 + t.string "section", limit: 255
299 t.boolean "enabled", default: true
312 t.boolean "enabled", default: true
300 - t.string "remark"
313 + t.string "remark", limit: 255
301 - t.string "last_ip"
314 + t.string "last_ip", limit: 255
302 - t.index ["login"], name: "index_users_on_login", unique: true
303 end
315 end
304
316
317 + add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree
318 +
305 add_foreign_key "problems_tags", "problems"
319 add_foreign_key "problems_tags", "problems"
306 add_foreign_key "problems_tags", "tags"
320 add_foreign_key "problems_tags", "tags"
307 end
321 end
deleted file
You need to be logged in to leave comments. Login now