Description:
submission report
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r790:7ddf708c67bd - - 15 files changed: 327 inserted, 303 deleted
@@ -0,0 +1,20 | |||
|
1 | + .panel.panel-primary | |
|
2 | + .panel-heading | |
|
3 | + Date ranges | |
|
4 | + .panel-body | |
|
5 | + .row.form-group | |
|
6 | + .col-md-4 | |
|
7 | + From Date: | |
|
8 | + .col-md-6 | |
|
9 | + .input-group.date | |
|
10 | + = text_field_tag :since_datetime, nil, class: 'form-control' | |
|
11 | + %span.input-group-addon | |
|
12 | + %span.glyphicon.glyphicon-calendar | |
|
13 | + .row.form-group | |
|
14 | + .col-md-4 | |
|
15 | + Until Date: | |
|
16 | + .col-md-6 | |
|
17 | + .input-group.date | |
|
18 | + = text_field_tag :until_datetime, nil, class: 'form-control' | |
|
19 | + %span.input-group-addon | |
|
20 | + %span.glyphicon.glyphicon-calendar |
@@ -0,0 +1,5 | |||
|
1 | + class AddIndexToSubmission < ActiveRecord::Migration[5.2] | |
|
2 | + def change | |
|
3 | + add_index :submissions, :submitted_at | |
|
4 | + end | |
|
5 | + end |
@@ -0,0 +1,5 | |||
|
1 | + class AddIdToGroupUser < ActiveRecord::Migration[5.2] | |
|
2 | + def change | |
|
3 | + add_column :groups_users, :id, :primary_key | |
|
4 | + end | |
|
5 | + end |
@@ -29,74 +29,74 | |||
|
29 | 29 | #gem 'sass-rails' |
|
30 | 30 | gem 'sassc-rails' |
|
31 | 31 | gem 'coffee-rails' |
|
32 | 32 | |
|
33 | 33 | # See https://github.com/sstephenson/execjs#readme for more supported runtimes |
|
34 | 34 | # gem 'therubyracer', :platforms => :ruby |
|
35 | 35 | |
|
36 | 36 | gem 'uglifier' |
|
37 | 37 | |
|
38 | 38 | gem 'haml' |
|
39 | 39 | gem 'haml-rails' |
|
40 | 40 | |
|
41 | 41 | # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks |
|
42 | 42 | #gem 'turbolinks', '~> 5' |
|
43 | 43 | # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder |
|
44 | 44 | gem 'jbuilder', '~> 2.5' |
|
45 | 45 | |
|
46 | 46 | |
|
47 | 47 | #in-place editor |
|
48 | 48 | gem 'best_in_place', '~> 3.0.1' |
|
49 | 49 | |
|
50 | 50 | # jquery addition |
|
51 | 51 | gem 'jquery-rails' |
|
52 | 52 | gem 'jquery-ui-rails' |
|
53 | - gem 'jquery-timepicker-addon-rails' | |
|
53 | + #gem 'jquery-timepicker-addon-rails' | |
|
54 | 54 | gem 'jquery-tablesorter' |
|
55 | 55 | gem 'jquery-countdown-rails' |
|
56 | 56 | |
|
57 | 57 | #syntax highlighter |
|
58 | 58 | gem 'rouge' |
|
59 | 59 | |
|
60 | 60 | #bootstrap add-ons |
|
61 | 61 | gem 'bootstrap-sass', '~> 3.4.1' |
|
62 | 62 | gem 'bootstrap-switch-rails' |
|
63 | 63 | gem 'bootstrap-toggle-rails' |
|
64 | 64 | gem 'autoprefixer-rails' |
|
65 | - gem 'momentjs-rails' | |
|
65 | + gem 'momentjs-rails', '>= 2.9.0' | |
|
66 | 66 | gem 'rails_bootstrap_sortable' |
|
67 | - gem 'bootstrap-datepicker-rails' | |
|
68 | - gem 'bootstrap3-datetimepicker-rails' | |
|
67 | + #gem 'bootstrap-datepicker-rails' | |
|
68 | + gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47' | |
|
69 | 69 | #gem 'jquery-datatables-rails' |
|
70 | 70 | |
|
71 | 71 | #----------- user interface ----------------- |
|
72 | 72 | gem 'simple_form' |
|
73 | 73 | #select 2 |
|
74 | 74 | gem 'select2-rails' |
|
75 | 75 | #ace editor |
|
76 | 76 | gem 'ace-rails-ap' |
|
77 | 77 | #paginator |
|
78 | - gem 'will_paginate', '~> 3.0.7' | |
|
78 | + #gem 'will_paginate', '~> 3.0.7' | |
|
79 | 79 | |
|
80 | 80 | gem 'mail' |
|
81 | 81 | gem 'rdiscount' |
|
82 | 82 | gem 'dynamic_form' |
|
83 | 83 | gem 'in_place_editing' |
|
84 | 84 | #gem 'verification', :git => 'https://github.com/sikachu/verification.git' |
|
85 | 85 | |
|
86 | 86 | |
|
87 | 87 | #---------------- testiing ----------------------- |
|
88 | 88 | gem 'minitest-reporters' |
|
89 | 89 | |
|
90 | 90 | #---------------- for console -------------------- |
|
91 | 91 | gem 'fuzzy-string-match' |
|
92 | 92 | |
|
93 | 93 | |
|
94 | 94 | group :development, :test do |
|
95 | 95 | # Call 'byebug' anywhere in the code to stop execution and get a debugger console |
|
96 | 96 | gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] |
|
97 | 97 | end |
|
98 | 98 | |
|
99 | 99 | group :development do |
|
100 | 100 | # Access an interactive console on exception pages or by calling 'console' anywhere in the code. |
|
101 | 101 | gem 'web-console', '>= 3.3.0' |
|
102 | 102 | gem 'listen', '>= 3.0.5', '< 3.2' |
@@ -43,50 +43,48 | |||
|
43 | 43 | multi_json (~> 1.11, >= 1.11.2) |
|
44 | 44 | rack (>= 1.5.2, < 3) |
|
45 | 45 | railties (>= 4.0) |
|
46 | 46 | activestorage (5.2.4.2) |
|
47 | 47 | actionpack (= 5.2.4.2) |
|
48 | 48 | activerecord (= 5.2.4.2) |
|
49 | 49 | marcel (~> 0.3.1) |
|
50 | 50 | activesupport (5.2.4.2) |
|
51 | 51 | concurrent-ruby (~> 1.0, >= 1.0.2) |
|
52 | 52 | i18n (>= 0.7, < 2) |
|
53 | 53 | minitest (~> 5.1) |
|
54 | 54 | tzinfo (~> 1.1) |
|
55 | 55 | addressable (2.7.0) |
|
56 | 56 | public_suffix (>= 2.0.2, < 5.0) |
|
57 | 57 | ansi (1.5.0) |
|
58 | 58 | arel (9.0.0) |
|
59 | 59 | autoprefixer-rails (9.5.1) |
|
60 | 60 | execjs |
|
61 | 61 | best_in_place (3.0.3) |
|
62 | 62 | actionpack (>= 3.2) |
|
63 | 63 | railties (>= 3.2) |
|
64 | 64 | bindex (0.8.1) |
|
65 | 65 | bootsnap (1.4.6) |
|
66 | 66 | msgpack (~> 1.0) |
|
67 | - bootstrap-datepicker-rails (1.8.0.1) | |
|
68 | - railties (>= 3.0) | |
|
69 | 67 | bootstrap-sass (3.4.1) |
|
70 | 68 | autoprefixer-rails (>= 5.2.1) |
|
71 | 69 | sassc (>= 2.0.0) |
|
72 | 70 | bootstrap-switch-rails (3.3.4) |
|
73 | 71 | bootstrap-toggle-rails (2.2.1.0) |
|
74 | 72 | bootstrap3-datetimepicker-rails (4.17.47) |
|
75 | 73 | momentjs-rails (>= 2.8.1) |
|
76 | 74 | builder (3.2.4) |
|
77 | 75 | byebug (11.0.1) |
|
78 | 76 | capybara (3.15.1) |
|
79 | 77 | addressable |
|
80 | 78 | mini_mime (>= 0.1.3) |
|
81 | 79 | nokogiri (~> 1.8) |
|
82 | 80 | rack (>= 1.6.0) |
|
83 | 81 | rack-test (>= 0.6.3) |
|
84 | 82 | regexp_parser (~> 1.2) |
|
85 | 83 | xpath (~> 3.2) |
|
86 | 84 | childprocess (3.0.0) |
|
87 | 85 | coffee-rails (4.2.2) |
|
88 | 86 | coffee-script (>= 2.2.0) |
|
89 | 87 | railties (>= 4.0.0) |
|
90 | 88 | coffee-script (2.4.1) |
|
91 | 89 | coffee-script-source |
|
92 | 90 | execjs |
@@ -101,53 +99,48 | |||
|
101 | 99 | fuzzy-string-match (1.0.1) |
|
102 | 100 | RubyInline (>= 3.8.6) |
|
103 | 101 | globalid (0.4.2) |
|
104 | 102 | activesupport (>= 4.2.0) |
|
105 | 103 | haml (5.0.4) |
|
106 | 104 | temple (>= 0.8.0) |
|
107 | 105 | tilt |
|
108 | 106 | haml-rails (1.0.0) |
|
109 | 107 | actionpack (>= 4.0.1) |
|
110 | 108 | activesupport (>= 4.0.1) |
|
111 | 109 | haml (>= 4.0.6, < 6.0) |
|
112 | 110 | html2haml (>= 1.0.1) |
|
113 | 111 | railties (>= 4.0.1) |
|
114 | 112 | html2haml (2.2.0) |
|
115 | 113 | erubis (~> 2.7.0) |
|
116 | 114 | haml (>= 4.0, < 6) |
|
117 | 115 | nokogiri (>= 1.6.0) |
|
118 | 116 | ruby_parser (~> 3.5) |
|
119 | 117 | i18n (1.8.2) |
|
120 | 118 | concurrent-ruby (~> 1.0) |
|
121 | 119 | in_place_editing (1.2.0) |
|
122 | 120 | jbuilder (2.10.0) |
|
123 | 121 | activesupport (>= 5.0.0) |
|
124 | 122 | jquery-countdown-rails (2.0.2) |
|
125 | - jquery-datatables-rails (3.4.0) | |
|
126 | - actionpack (>= 3.1) | |
|
127 | - jquery-rails | |
|
128 | - railties (>= 3.1) | |
|
129 | - sass-rails | |
|
130 | 123 | jquery-rails (4.3.3) |
|
131 | 124 | rails-dom-testing (>= 1, < 3) |
|
132 | 125 | railties (>= 4.2.0) |
|
133 | 126 | thor (>= 0.14, < 2.0) |
|
134 | 127 | jquery-tablesorter (1.26.1) |
|
135 | 128 | railties (>= 3.2, < 6) |
|
136 | 129 | jquery-timepicker-addon-rails (1.4.1) |
|
137 | 130 | railties (>= 3.1) |
|
138 | 131 | jquery-ui-rails (6.0.1) |
|
139 | 132 | railties (>= 3.2.16) |
|
140 | 133 | listen (3.1.5) |
|
141 | 134 | rb-fsevent (~> 0.9, >= 0.9.4) |
|
142 | 135 | rb-inotify (~> 0.9, >= 0.9.7) |
|
143 | 136 | ruby_dep (~> 1.2) |
|
144 | 137 | loofah (2.4.0) |
|
145 | 138 | crass (~> 1.0.2) |
|
146 | 139 | nokogiri (>= 1.5.9) |
|
147 | 140 | mail (2.7.1) |
|
148 | 141 | mini_mime (>= 0.1.1) |
|
149 | 142 | marcel (0.3.3) |
|
150 | 143 | mimemagic (~> 0.3.2) |
|
151 | 144 | method_source (1.0.0) |
|
152 | 145 | mimemagic (0.3.4) |
|
153 | 146 | mini_mime (1.0.2) |
@@ -193,144 +186,129 | |||
|
193 | 186 | activesupport (>= 4.2.0) |
|
194 | 187 | nokogiri (>= 1.6) |
|
195 | 188 | rails-html-sanitizer (1.3.0) |
|
196 | 189 | loofah (~> 2.3) |
|
197 | 190 | rails_bootstrap_sortable (2.0.6) |
|
198 | 191 | momentjs-rails (>= 2.8.3) |
|
199 | 192 | railties (5.2.4.2) |
|
200 | 193 | actionpack (= 5.2.4.2) |
|
201 | 194 | activesupport (= 5.2.4.2) |
|
202 | 195 | method_source |
|
203 | 196 | rake (>= 0.8.7) |
|
204 | 197 | thor (>= 0.19.0, < 2.0) |
|
205 | 198 | rake (13.0.1) |
|
206 | 199 | rb-fsevent (0.10.3) |
|
207 | 200 | rb-inotify (0.10.0) |
|
208 | 201 | ffi (~> 1.0) |
|
209 | 202 | rdiscount (2.2.0.1) |
|
210 | 203 | regexp_parser (1.7.0) |
|
211 | 204 | rouge (3.3.0) |
|
212 | 205 | ruby-progressbar (1.10.0) |
|
213 | 206 | ruby_dep (1.5.0) |
|
214 | 207 | ruby_parser (3.13.1) |
|
215 | 208 | sexp_processor (~> 4.9) |
|
216 | 209 | rubyzip (1.3.0) |
|
217 | - sass (3.7.4) | |
|
218 | - sass-listen (~> 4.0.0) | |
|
219 | - sass-listen (4.0.0) | |
|
220 | - rb-fsevent (~> 0.9, >= 0.9.4) | |
|
221 | - rb-inotify (~> 0.9, >= 0.9.7) | |
|
222 | - sass-rails (5.0.7) | |
|
223 | - railties (>= 4.0.0, < 6) | |
|
224 | - sass (~> 3.1) | |
|
225 | - sprockets (>= 2.8, < 4.0) | |
|
226 | - sprockets-rails (>= 2.0, < 4.0) | |
|
227 | - tilt (>= 1.1, < 3) | |
|
228 | 210 | sassc (2.2.1) |
|
229 | 211 | ffi (~> 1.9) |
|
230 | 212 | sassc-rails (2.1.2) |
|
231 | 213 | railties (>= 4.0.0) |
|
232 | 214 | sassc (>= 2.0) |
|
233 | 215 | sprockets (> 3.0) |
|
234 | 216 | sprockets-rails |
|
235 | 217 | tilt |
|
236 | 218 | select2-rails (4.0.3) |
|
237 | 219 | thor (~> 0.14) |
|
238 | 220 | selenium-webdriver (3.142.7) |
|
239 | 221 | childprocess (>= 0.5, < 4.0) |
|
240 | 222 | rubyzip (>= 1.2.2) |
|
241 | 223 | sexp_processor (4.12.0) |
|
242 | 224 | simple_form (5.0.2) |
|
243 | 225 | actionpack (>= 5.0) |
|
244 | 226 | activemodel (>= 5.0) |
|
245 | 227 | spring (2.0.2) |
|
246 | 228 | activesupport (>= 4.2) |
|
247 | 229 | spring-watcher-listen (2.0.1) |
|
248 | 230 | listen (>= 2.7, < 4.0) |
|
249 | 231 | spring (>= 1.2, < 3.0) |
|
250 | 232 | sprockets (3.7.2) |
|
251 | 233 | concurrent-ruby (~> 1.0) |
|
252 | 234 | rack (> 1, < 3) |
|
253 | 235 | sprockets-rails (3.2.1) |
|
254 | 236 | actionpack (>= 4.0) |
|
255 | 237 | activesupport (>= 4.0) |
|
256 | 238 | sprockets (>= 3.0.0) |
|
257 | 239 | sqlite3 (1.4.1) |
|
258 | 240 | temple (0.8.1) |
|
259 | 241 | thor (0.20.3) |
|
260 | 242 | thread_safe (0.3.6) |
|
261 | 243 | tilt (2.0.9) |
|
262 | 244 | tzinfo (1.2.7) |
|
263 | 245 | thread_safe (~> 0.1) |
|
264 | 246 | uglifier (4.1.20) |
|
265 | 247 | execjs (>= 0.3.0, < 3) |
|
266 | 248 | web-console (3.7.0) |
|
267 | 249 | actionview (>= 5.0) |
|
268 | 250 | activemodel (>= 5.0) |
|
269 | 251 | bindex (>= 0.4.0) |
|
270 | 252 | railties (>= 5.0) |
|
271 | 253 | webdriver (0.5.0) |
|
272 | 254 | websocket-driver (0.7.1) |
|
273 | 255 | websocket-extensions (>= 0.1.0) |
|
274 | 256 | websocket-extensions (0.1.4) |
|
275 | - will_paginate (3.0.12) | |
|
276 | 257 | xpath (3.2.0) |
|
277 | 258 | nokogiri (~> 1.8) |
|
278 | 259 | yaml_db (0.7.0) |
|
279 | 260 | rails (>= 3.0) |
|
280 | 261 | rake (>= 0.8.7) |
|
281 | 262 | |
|
282 | 263 | PLATFORMS |
|
283 | 264 | ruby |
|
284 | 265 | |
|
285 | 266 | DEPENDENCIES |
|
286 | 267 | ace-rails-ap |
|
287 | 268 | activerecord-session_store |
|
288 | 269 | autoprefixer-rails |
|
289 | 270 | best_in_place (~> 3.0.1) |
|
290 | 271 | bootsnap (>= 1.1.0) |
|
291 | - bootstrap-datepicker-rails | |
|
292 | 272 | bootstrap-sass (~> 3.4.1) |
|
293 | 273 | bootstrap-switch-rails |
|
294 | 274 | bootstrap-toggle-rails |
|
295 | - bootstrap3-datetimepicker-rails | |
|
275 | + bootstrap3-datetimepicker-rails (~> 4.17.47) | |
|
296 | 276 | byebug |
|
297 | 277 | capybara (>= 2.15) |
|
298 | 278 | coffee-rails |
|
299 | 279 | dynamic_form |
|
300 | 280 | fuzzy-string-match |
|
301 | 281 | haml |
|
302 | 282 | haml-rails |
|
303 | 283 | in_place_editing |
|
304 | 284 | jbuilder (~> 2.5) |
|
305 | 285 | jquery-countdown-rails |
|
306 | - jquery-datatables-rails | |
|
307 | 286 | jquery-rails |
|
308 | 287 | jquery-tablesorter |
|
309 | 288 | jquery-timepicker-addon-rails |
|
310 | 289 | jquery-ui-rails |
|
311 | 290 | listen (>= 3.0.5, < 3.2) |
|
312 | 291 | |
|
313 | 292 | minitest-reporters |
|
314 | - momentjs-rails | |
|
293 | + momentjs-rails (>= 2.9.0) | |
|
315 | 294 | mysql2 |
|
316 | 295 | puma |
|
317 | 296 | rails (~> 5.2) |
|
318 | 297 | rails-controller-testing |
|
319 | 298 | rails_bootstrap_sortable |
|
320 | 299 | rdiscount |
|
321 | 300 | rouge |
|
322 | 301 | sassc-rails |
|
323 | 302 | select2-rails |
|
324 | 303 | selenium-webdriver |
|
325 | 304 | simple_form |
|
326 | 305 | spring |
|
327 | 306 | spring-watcher-listen (~> 2.0.0) |
|
328 | 307 | sqlite3 |
|
329 | 308 | uglifier |
|
330 | 309 | web-console (>= 3.3.0) |
|
331 | 310 | webdriver |
|
332 | - will_paginate (~> 3.0.7) | |
|
333 | 311 | yaml_db |
|
334 | 312 | |
|
335 | 313 | BUNDLED WITH |
|
336 |
- 1.1 |
|
|
314 | + 1.17.2 |
@@ -1,39 +1,40 | |||
|
1 | 1 | $(document).on 'change', '.btn-file :file', -> |
|
2 | 2 | input = $(this) |
|
3 | 3 | numFiles = if input.get(0).files then input.get(0).files.length else 1 |
|
4 | 4 | label = input.val().replace(/\\/g, '/').replace(/.*\//, '') |
|
5 | 5 | input.trigger 'fileselect', [ |
|
6 | 6 | numFiles |
|
7 | 7 | label |
|
8 | 8 | ] |
|
9 | 9 | return |
|
10 | 10 | |
|
11 | 11 | |
|
12 | 12 | # document ready |
|
13 | 13 | |
|
14 | 14 | $ -> |
|
15 |
- $(".select2").select2( |
|
|
15 | + $(".select2").select2({ | |
|
16 | + }) | |
|
16 | 17 | #$(".bootstrap-switch").bootstrapSwitch() |
|
17 | 18 | #$(".bootstrap-toggle").bootstrapToggle() |
|
18 | 19 | $('.btn-file :file').on 'fileselect', (event, numFiles, label) -> |
|
19 | 20 | input = $(this).parents('.input-group').find(':text') |
|
20 | 21 | log = if numFiles > 1 then numFiles + ' files selected' else label |
|
21 | 22 | if input.length |
|
22 | 23 | input.val log |
|
23 | 24 | else |
|
24 | 25 | if log |
|
25 | 26 | alert log |
|
26 | 27 | return |
|
27 | 28 | $(".go-button").on 'click', (event) -> |
|
28 | 29 | link = $(this).attr("data-source") |
|
29 | 30 | url = $(link).val() |
|
30 | 31 | if url |
|
31 | 32 | window.location.href = url |
|
32 | 33 | return |
|
33 | 34 | $('.ajax-toggle').on 'click', (event) -> |
|
34 | 35 | target = $(event.target) |
|
35 | 36 | target.removeClass 'btn-default' |
|
36 | 37 | target.removeClass 'btn-success' |
|
37 | 38 | target.addClass 'btn-warning' |
|
38 | 39 | target.text '...' |
|
39 | 40 | return |
@@ -1,60 +1,60 | |||
|
1 | 1 | /* This is a manifest file that'll be compiled into application.css, which will include all the files |
|
2 | 2 | * listed below. |
|
3 | 3 | * |
|
4 | 4 | * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, |
|
5 | 5 | * or any plugin's vendor/assets/stylesheets directory can be referenced here using a relative path. |
|
6 | 6 | * |
|
7 | 7 | * You're free to add application-wide styles to this file and they'll appear at the bottom of the |
|
8 | 8 | * compiled file so the styles you add here take precedence over styles defined in any styles |
|
9 | 9 | * defined in the other CSS/SCSS files in this directory. It is generally better to create a new |
|
10 | 10 | * file per style scope. |
|
11 | 11 | * |
|
12 | 12 | * // bootstrap says that we should not do this, but @import each file instead |
|
13 | 13 | * # *= require_tree . |
|
14 | 14 | * # *= require_self |
|
15 | 15 | */ |
|
16 | 16 | |
|
17 | 17 | @import "jquery-ui"; |
|
18 | 18 | //@import "jquery.ui.core"; |
|
19 | 19 | //@import "jquery.ui.theme"; |
|
20 | 20 | //@import "jquery.ui.datepicker"; |
|
21 | 21 | //@import "jquery.ui.slider"; |
|
22 | - @import "jquery-ui-timepicker-addon"; | |
|
23 | - @import "jquery-tablesorter/theme.metro-dark"; | |
|
22 | + //@import "jquery-ui-timepicker-addon"; | |
|
23 | + //@import "jquery-tablesorter/theme.metro-dark"; | |
|
24 | 24 | @import "jquery.countdown"; |
|
25 | 25 | @import "tablesorter-theme.cafe"; |
|
26 | 26 | |
|
27 | 27 | //bootstrap |
|
28 | 28 | @import "bootstrap-sprockets"; |
|
29 | 29 | @import "bootstrap"; |
|
30 | 30 | @import "select2"; |
|
31 | 31 | @import "select2-bootstrap"; |
|
32 | 32 | |
|
33 | 33 | //@import bootstrap3-switch |
|
34 | 34 | @import "bootstrap-toggle"; |
|
35 | 35 | @import "bootstrap-sortable"; |
|
36 | - @import "bootstrap-datepicker3"; | |
|
36 | + //@import "bootstrap-datepicker3"; | |
|
37 | 37 | @import "bootstrap-datetimepicker"; |
|
38 | 38 | @import "datatables.net-bs/css/dataTables.bootstrap.min"; |
|
39 | 39 | @import "datatables.net-buttons-bs/css/buttons.bootstrap.min"; |
|
40 | 40 | |
|
41 | 41 | //bootstrap navbar color (from) |
|
42 | 42 | $bgDefault: #19197b; |
|
43 | 43 | $bgHighlight: #06064b; |
|
44 | 44 | $colDefault: #8e8eb4; |
|
45 | 45 | $colHighlight: #ffffff; |
|
46 | 46 | $dropDown: false; |
|
47 | 47 | |
|
48 | 48 | @font-face { |
|
49 | 49 | font-family: 'Glyphicons Halflings'; |
|
50 | 50 | src: font-path('bootstrap/glyphicons-halflings-regular.eot'); |
|
51 | 51 | src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), |
|
52 | 52 | font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'), |
|
53 | 53 | font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'), |
|
54 | 54 | font-path('bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg'); |
|
55 | 55 | } |
|
56 | 56 | |
|
57 | 57 | |
|
58 | 58 | .navbar-default { |
|
59 | 59 | background-color: $bgDefault; |
|
60 | 60 | border-color: $bgHighlight; |
@@ -151,78 +151,88 | |||
|
151 | 151 | |
|
152 | 152 | def is_request_ip_allowed? |
|
153 | 153 | unless GraderConfiguration[WHITELIST_IGNORE_CONF_KEY] |
|
154 | 154 | user_ip = IPAddr.new(request.remote_ip) |
|
155 | 155 | |
|
156 | 156 | GraderConfiguration[WHITELIST_IP_CONF_KEY].delete(' ').split(',').each do |ips| |
|
157 | 157 | allow_ips = IPAddr.new(ips) |
|
158 | 158 | if allow_ips.include?(user_ip) |
|
159 | 159 | return true |
|
160 | 160 | end |
|
161 | 161 | end |
|
162 | 162 | return false |
|
163 | 163 | end |
|
164 | 164 | return true |
|
165 | 165 | end |
|
166 | 166 | |
|
167 | 167 | #function for datatable ajax query |
|
168 | 168 | #return record,total_count,filter_count |
|
169 | 169 | def process_query_record(record, |
|
170 | 170 |
total_count: nil, |
|
171 | 171 |
select: '', |
|
172 | 172 |
global_search: [], |
|
173 | 173 |
no_search: false, |
|
174 | 174 |
force_order: '', |
|
175 |
- date_filter: '', date_param_since: 'date_since',date_param_until: 'date_until' |
|
|
175 | + date_filter: '', date_param_since: 'date_since',date_param_until: 'date_until', | |
|
176 | + hard_limit: nil) | |
|
176 | 177 | arel_table = record.model.arel_table |
|
177 | 178 | |
|
178 | 179 | if !no_search && params['search'] |
|
179 | 180 | global_value = record.model.sanitize_sql(params['search']['value'].strip.downcase) |
|
180 | 181 | if !global_value.blank? |
|
181 | 182 | global_value.split.each do |value| |
|
182 | 183 | global_where = global_search.map{|f| "LOWER(#{f}) like '%#{value}%'"}.join(' OR ') |
|
183 | 184 | record = record.where(global_where) |
|
184 | 185 | end |
|
185 | 186 | end |
|
186 | 187 | |
|
187 | 188 | params['columns'].each do |i, col| |
|
188 | 189 | if !col['search']['value'].blank? |
|
189 | 190 | record = record.where(arel_table[col['name']].lower.matches("%#{col['search']['value'].strip.downcase}%")) |
|
190 | 191 | end |
|
191 | 192 | end |
|
192 | 193 | end |
|
193 | 194 | |
|
194 | 195 | 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 | |
|
196 | + param_since = params[date_param_since] | |
|
197 | + param_until = params[date_param_until] | |
|
198 | + date_since = Time.zone.parse( param_since ) || Time.new(1,1,1) rescue Time.new(1,1,1) | |
|
199 | + date_until = Time.zone.parse( param_until ) || Time.zone.now() rescue Time.zone.now() | |
|
200 | + date_range = date_since..(date_until.end_of_day) | |
|
198 | 201 | record = record.where(date_filter.to_sym => date_range) |
|
199 | 202 | end |
|
200 | 203 | |
|
201 | 204 | if force_order.blank? |
|
202 | 205 | if params['order'] |
|
203 | 206 | params['order'].each do |i, o| |
|
204 | 207 | colName = params['columns'][o['column']]['name'] |
|
205 | 208 | colName = "#{record.model.table_name}.#{colName}" if colName.upcase == 'ID' |
|
206 | 209 | record = record.order("#{colName} #{o['dir'].casecmp('desc') != 0 ? 'ASC' : 'DESC'}") unless colName.blank? |
|
207 | 210 | end |
|
208 | 211 | end |
|
209 | 212 | else |
|
210 | 213 | record = record.order(force_order) |
|
211 | 214 | end |
|
212 | 215 | |
|
213 | 216 | filterCount = record.count(record.model.primary_key) |
|
214 | 217 | # if .group() is used, filterCount might be like {id_1: count_1, id_2: count_2, ...} |
|
215 | 218 | # so we should count the result again.. |
|
216 | 219 | if filterCount.is_a? Hash |
|
217 | 220 | filterCount = filterCount.count |
|
218 | 221 | end |
|
219 | 222 | |
|
220 | - record = record.offset(params['start'] || 0).limit(params['length'] || 100) | |
|
223 | + | |
|
224 | + record = record.offset(params['start'] || 0) | |
|
225 | + record = record.limit(hard_limit) | |
|
226 | + if (params['length']) | |
|
227 | + limit = params['length'].to_i | |
|
228 | + limit == hard_limit if (hard_limit && hard_limit < limit) | |
|
229 | + record = record.limit(limit) | |
|
230 | + end | |
|
221 | 231 | if (!select.blank?) |
|
222 | 232 | record = record.select(select) |
|
223 | 233 | end |
|
224 | 234 | |
|
225 | 235 | return record, total_count || record.model.count, filterCount |
|
226 | 236 | end |
|
227 | 237 | |
|
228 | 238 | end |
@@ -1,31 +1,31 | |||
|
1 | 1 | require 'csv' |
|
2 | 2 | |
|
3 | 3 | class ReportController < ApplicationController |
|
4 | 4 | |
|
5 | 5 | before_action :check_valid_login |
|
6 | 6 | |
|
7 |
- before_action :admin_authorization, only: [:login_stat,:submission |
|
|
7 | + before_action :admin_authorization, only: [:login_stat,:submission, :submission_query, :stuck, :cheat_report, :cheat_scruntinize, :show_max_score, :current_score] | |
|
8 | 8 | |
|
9 | 9 | before_action(only: [:problem_hof]) { |c| |
|
10 | 10 | return false unless check_valid_login |
|
11 | 11 | |
|
12 | 12 | admin_authorization unless GraderConfiguration["right.user_view_submission"] |
|
13 | 13 | } |
|
14 | 14 | |
|
15 | 15 | def max_score |
|
16 | 16 | end |
|
17 | 17 | |
|
18 | 18 | def current_score |
|
19 | 19 | @problems = Problem.available_problems |
|
20 | 20 | if params[:group_id] |
|
21 | 21 | @group = Group.find(params[:group_id]) |
|
22 | 22 | @users = @group.users.where(enabled: true) |
|
23 | 23 | else |
|
24 | 24 | @users = User.includes(:contests).includes(:contest_stat).where(enabled: true) |
|
25 | 25 | end |
|
26 | 26 | @scorearray = calculate_max_score(@problems, @users,0,0,true) |
|
27 | 27 | |
|
28 | 28 | #rencer accordingly |
|
29 | 29 | if params[:button] == 'download' then |
|
30 | 30 | csv = gen_csv_from_scorearray(@scorearray,@problems) |
|
31 | 31 | send_data csv, filename: 'max_score.csv' |
@@ -122,76 +122,75 | |||
|
122 | 122 | end |
|
123 | 123 | |
|
124 | 124 | User.all.each do |user| |
|
125 | 125 | @logins << { id: user.id, |
|
126 | 126 | login: user.login, |
|
127 | 127 | full_name: user.full_name, |
|
128 | 128 | count: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
129 | 129 | user.id,@since_time,@until_time) |
|
130 | 130 | .count(:id), |
|
131 | 131 | min: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
132 | 132 | user.id,@since_time,@until_time) |
|
133 | 133 | .minimum(:created_at), |
|
134 | 134 | max: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
135 | 135 | user.id,@since_time,@until_time) |
|
136 | 136 | .maximum(:created_at), |
|
137 | 137 | ip: Login.where("user_id = ? AND created_at >= ? AND created_at <= ?", |
|
138 | 138 | user.id,@since_time,@until_time) |
|
139 | 139 | .select(:ip_address).uniq |
|
140 | 140 | |
|
141 | 141 | } |
|
142 | 142 | end |
|
143 | 143 | end |
|
144 | 144 | |
|
145 | 145 | def submission |
|
146 | - date_and_time = '%Y-%m-%d %H:%M' | |
|
147 | - begin | |
|
148 | - @since_time = DateTime.strptime(params[:since_datetime],date_and_time) | |
|
149 | - rescue | |
|
150 | - @since_time = DateTime.new(1000,1,1) | |
|
151 | - end | |
|
152 | - begin | |
|
153 | - @until_time = DateTime.strptime(params[:until_datetime],date_and_time) | |
|
154 | - rescue | |
|
155 | - @until_time = DateTime.new(3000,1,1) | |
|
156 | - end | |
|
157 | - | |
|
158 | - @submissions = Submission | |
|
159 | - .joins(:problem).joins(:user) | |
|
160 | 146 | end |
|
161 | 147 | |
|
162 | 148 | def submission_query |
|
163 | 149 | @submissions = Submission |
|
164 |
- . |
|
|
150 | + .includes(:problem).includes(:user).includes(:language) | |
|
151 | + | |
|
152 | + if params[:problem] | |
|
153 | + @submission = @submission.where(problem_id: params[:problem]) | |
|
154 | + end | |
|
155 | + | |
|
156 | + case params[:users] | |
|
157 | + when 'enabled' | |
|
158 | + @submissions = @submissions.where('user.enabled': true) | |
|
159 | + when 'group' | |
|
160 | + @submissions = @submissions.joins(user: :groups).where(user: {groups: {id: params[:groups]}}) if params[:groups] | |
|
161 | + end | |
|
162 | + | |
|
163 | + #set default | |
|
164 | + params[:since_datetime] = Date.today.to_s if params[:since_datetime].blank? | |
|
165 | 165 | |
|
166 | 166 | @submissions, @recordsTotal, @recordsFiltered = process_query_record( @submissions, |
|
167 | 167 | global_search: ['user.login','user.full_name','problem.name','problem.full_name','points'], |
|
168 | 168 | date_filter: 'submitted_at', |
|
169 | 169 | date_param_since: 'since_datetime', |
|
170 | 170 | date_param_until: 'until_datetime', |
|
171 | + hard_limit: 100_000 | |
|
171 | 172 | ) |
|
172 | - puts '-------------------------------' | |
|
173 | - puts @submissions | |
|
174 | 173 | end |
|
175 | 174 | |
|
176 | 175 | def problem_hof |
|
177 | 176 | # gen problem list |
|
178 | 177 | @user = User.find(session[:user_id]) |
|
179 | 178 | @problems = @user.available_problems |
|
180 | 179 | |
|
181 | 180 | # get selected problems or the default |
|
182 | 181 | if params[:id] |
|
183 | 182 | begin |
|
184 | 183 | @problem = Problem.available.find(params[:id]) |
|
185 | 184 | rescue |
|
186 | 185 | redirect_to action: :problem_hof |
|
187 | 186 | flash[:notice] = 'Error: submissions for that problem are not viewable.' |
|
188 | 187 | return |
|
189 | 188 | end |
|
190 | 189 | end |
|
191 | 190 | |
|
192 | 191 | return unless @problem |
|
193 | 192 | |
|
194 | 193 | @by_lang = {} #aggregrate by language |
|
195 | 194 | |
|
196 | 195 | range =65 |
|
197 | 196 | @histogram = { data: Array.new(range,0), summary: {} } |
@@ -43,49 +43,49 | |||
|
43 | 43 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
44 | 44 | Manage |
|
45 | 45 | %span.caret |
|
46 | 46 | %ul.dropdown-menu |
|
47 | 47 | = add_menu( 'Announcements', 'announcements', 'index') |
|
48 | 48 | = add_menu( 'Problems', 'problems', 'index') |
|
49 | 49 | = add_menu( 'Tags', 'tags', 'index') |
|
50 | 50 | = add_menu( 'Users', 'user_admin', 'index') |
|
51 | 51 | = add_menu( 'User Groups', 'groups', 'index') |
|
52 | 52 | = add_menu( 'Graders', 'graders', 'list') |
|
53 | 53 | = add_menu( 'Message ', 'messages', 'console') |
|
54 | 54 | %li.divider{role: 'separator'} |
|
55 | 55 | = add_menu( 'System config', 'configurations', 'index') |
|
56 | 56 | %li.divider{role: 'separator'} |
|
57 | 57 | = add_menu( 'Sites', 'sites', 'index') |
|
58 | 58 | = add_menu( 'Contests', 'contest_management', 'index') |
|
59 | 59 | / report |
|
60 | 60 | %li.dropdown |
|
61 | 61 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
62 | 62 | Report |
|
63 | 63 | %span.caret |
|
64 | 64 | %ul.dropdown-menu |
|
65 | 65 | = add_menu( 'Current Score', 'report', 'current_score') |
|
66 | 66 | = add_menu( 'Score Report', 'report', 'max_score') |
|
67 |
- = add_menu( 'Report', 'report', ' |
|
|
67 | + = add_menu( 'Submission Report', 'report', 'submission') | |
|
68 | 68 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
69 | 69 | =link_to "#{ungraded} backlogs!", |
|
70 | 70 | grader_list_path, |
|
71 | 71 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
72 | 72 | |
|
73 | 73 | %ul.nav.navbar-nav.navbar-right |
|
74 | 74 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
75 | 75 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) |
|
76 | 76 | - if GraderConfiguration['system.user_setting_enabled'] |
|
77 | 77 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog', id: 'user_profile')}".html_safe, 'users', 'profile', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
78 | 78 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
|
79 | 79 | |
|
80 | 80 | / |
|
81 | 81 | - if (@current_user!=nil) and (session[:admin]) |
|
82 | 82 | %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar |
|
83 | 83 | .container-fluid |
|
84 | 84 | .collapse.navbar-collapse |
|
85 | 85 | %ul.nav.navbar-nav |
|
86 | 86 | = add_menu( '[Announcements]', 'announcements', 'index') |
|
87 | 87 | = add_menu( '[Msg console]', 'messages', 'console') |
|
88 | 88 | = add_menu( '[Problems]', 'problems', 'index') |
|
89 | 89 | = add_menu( '[Users]', 'user_admin', 'index') |
|
90 | 90 | = add_menu( '[Results]', 'user_admin', 'user_stat') |
|
91 | 91 | = add_menu( '[Report]', 'report', 'multiple_login') |
@@ -1,67 +1,77 | |||
|
1 | 1 | - content_for :header do |
|
2 | 2 | = javascript_include_tag 'local_jquery' |
|
3 | 3 | |
|
4 | 4 | %h1 Submissions detail |
|
5 | 5 | |
|
6 | 6 | .row |
|
7 | 7 | .col-md-4 |
|
8 | 8 | = render partial: 'shared/problem_select' |
|
9 | 9 | .col-md-4 |
|
10 |
- = render partial: 'shared/ |
|
|
10 | + = render partial: 'shared/date_filter' | |
|
11 | 11 | .col-md-4 |
|
12 | 12 | = render partial: 'shared/user_select' |
|
13 | 13 | |
|
14 | + .row | |
|
15 | + .col-md-6 | |
|
16 | + .alert.alert-info | |
|
17 | + %ul | |
|
18 | + %li Display a maximum of 100,000 entries to save computation power | |
|
19 | + %li You have to click refresh when changing the filter above | |
|
14 | 20 | |
|
15 | 21 | .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 | |
|
22 | + .col-sm-12 | |
|
23 | + %table.table.table-hover.table-condense.datatable{style: 'width: 100%'} | |
|
36 | 24 | |
|
37 | 25 | |
|
38 | 26 | :javascript |
|
39 | - $('.datatable').DataTable({ | |
|
40 | - dom: 'Bfrtip', | |
|
27 | + $(function() { | |
|
28 | + submission_table = $('.datatable').DataTable({ | |
|
29 | + dom: "<'row'<'col-sm-3'B><'col-sm-3'l><'col-sm-6'f>>" + "<'row'<'col-sm-12'tr>>" + "<'row'<'col-sm-5'i><'col-sm-7'p>>", | |
|
30 | + autoWidth: true, | |
|
41 | 31 | buttons: [ |
|
42 | - 'copy', 'excel', 'pdf' | |
|
32 | + { | |
|
33 | + text: 'Refresh', | |
|
34 | + action: (e,dt,node,config) => { | |
|
35 | + submission_table.clear().draw() | |
|
36 | + submission_table.ajax.reload( () => { submission_table.columns.adjust().draw() } ) | |
|
37 | + } | |
|
38 | + }, | |
|
39 | + 'copy', 'excel' | |
|
43 | 40 | ], |
|
44 | 41 | columns: [ |
|
45 | 42 | {title: 'Sub ID', data: 'id'}, |
|
46 | 43 | {title: 'User', data: 'user.login'}, |
|
47 | 44 | {title: 'Problem', data: 'problem.long_name'}, |
|
48 | 45 | {title: 'Language', data: 'language.pretty_name'}, |
|
49 | 46 | {title: 'Submit at', data: 'submitted_at'}, |
|
50 | 47 | {title: 'Result', data: 'grader_comment'}, |
|
51 | 48 | {title: 'Score', data: 'points'}, |
|
52 | 49 | {title: 'IP', data: 'ip_address'}, |
|
53 | 50 | ], |
|
54 | 51 | ajax: { |
|
55 | 52 | url: '#{submission_query_report_path}', |
|
56 | 53 | type: 'POST', |
|
57 | 54 | data: (d) => { |
|
58 |
- d.since_datetime = |
|
|
59 |
- d.until_datetime = |
|
|
55 | + d.since_datetime = $('#since_datetime').val() | |
|
56 | + d.until_datetime = $('#until_datetime').val() | |
|
57 | + d.users = $("input[name='users']:checked").val() | |
|
58 | + d.problems = $("#problem_id").select2('val') | |
|
59 | + d.groups = $("#group_id").select2('val') | |
|
60 | 60 | }, |
|
61 | 61 | dataType: 'json', |
|
62 | 62 | beforeSend: (request) => { |
|
63 | 63 | request.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content')); |
|
64 | 64 | }, |
|
65 | 65 | }, //end ajax |
|
66 | - 'pageLength': 50 | |
|
66 | + 'pageLength': 50, | |
|
67 | + processing: true, | |
|
67 | 68 | }); |
|
69 | + | |
|
70 | + $('.input-group.date').datetimepicker({ | |
|
71 | + format: 'YYYY-MM-DD', | |
|
72 | + showTodayButton: true, | |
|
73 | + locale: 'en', | |
|
74 | + widgetPositioning: {horizontal: 'auto', vertical: 'bottom'}, | |
|
75 | + defaultDate: moment() | |
|
76 | + }); | |
|
77 | + }); |
@@ -1,18 +1,20 | |||
|
1 | 1 | json.draw params['draw']&.to_i |
|
2 | 2 | json.recordsTotal @recordsTotal |
|
3 | 3 | json.recordsFiltered @recordsFiltered |
|
4 | 4 | json.data do |
|
5 | 5 | json.array! @submissions do |sub| |
|
6 |
- json.extract! sub, : |
|
|
7 | - json.submitted_at sub.submitted_at.to_s(:db) | |
|
6 | + json.extract! sub, :grader_comment, :ip_address | |
|
7 | + json.id "<a href='#{submission_path(sub)}'>#{sub.id}</a>" | |
|
8 | + json.submitted_at sub.submitted_at.strftime('%Y-%m-%d %H:%M') | |
|
9 | + json.points "#{sub.points}/#{sub.problem&.full_score}" | |
|
8 | 10 | json.problem do |
|
9 |
- json.long_name sub.problem |
|
|
11 | + json.long_name sub.problem ? sub.problem.long_name : '-- deleted problem --' | |
|
10 | 12 | end |
|
11 | 13 | json.user do |
|
12 | - json.login sub.user&.login | |
|
14 | + json.login sub.user ? "<a href='#{stat_user_path(sub.user)}'>(#{sub.user&.login})</a> #{sub.user&.full_name}" : '-- deleted user --' | |
|
13 | 15 | end |
|
14 | 16 | json.language do |
|
15 | 17 | json.pretty_name sub.language&.pretty_name |
|
16 | 18 | end |
|
17 | 19 | end |
|
18 | 20 | end |
@@ -1,10 +1,10 | |||
|
1 | 1 | .panel.panel-primary |
|
2 | 2 | .panel-heading |
|
3 | 3 | Problems |
|
4 | 4 | .panel-body |
|
5 | 5 | %p |
|
6 |
- Select problem(s) t |
|
|
6 | + Select problem(s) to be included in the report | |
|
7 | 7 | = label_tag :problem_id, "Problems" |
|
8 | 8 | = select_tag 'problem_id[]', |
|
9 | 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" } | |
|
10 | + { id: :problem_id, class: 'select2 form-control', multiple: "true" } |
@@ -1,12 +1,19 | |||
|
1 | 1 | .panel.panel-primary |
|
2 | 2 | .panel-heading |
|
3 | 3 | Users |
|
4 | 4 | .panel-body |
|
5 | 5 | .radio |
|
6 | 6 | %label |
|
7 | 7 | = radio_button_tag 'users', 'all', (params[:users] == "all") |
|
8 | 8 | All users |
|
9 | 9 | .radio |
|
10 | 10 | %label |
|
11 | 11 | = radio_button_tag 'users', 'enabled', (params[:users] == "enabled") |
|
12 | 12 | Only enabled users |
|
13 | + .radio | |
|
14 | + %label | |
|
15 | + = radio_button_tag 'users', 'group', (params[:users] == "group") | |
|
16 | + Only these groups | |
|
17 | + = select_tag 'group_id[]', | |
|
18 | + options_for_select(Group.all.collect {|g| ["[#{g.name}] #{g.description}", g.id]}), | |
|
19 | + { id: 'group_id', class: 'select2 form-control', multiple: "true"} |
@@ -1,321 +1,308 | |||
|
1 | - # encoding: UTF-8 | |
|
2 | 1 |
|
|
3 | 2 | # of editing this file, please use the migrations feature of Active Record to |
|
4 | 3 | # incrementally modify your database, and then regenerate this schema definition. |
|
5 | 4 | # |
|
6 | 5 | # Note that this schema.rb definition is the authoritative source for your |
|
7 | 6 | # database schema. If you need to create the application database on another |
|
8 | 7 | # system, you should be using db:schema:load, not running all the migrations |
|
9 | 8 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
10 | 9 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
11 | 10 | # |
|
12 | 11 | # It's strongly recommended that you check this file into your version control system. |
|
13 | 12 | |
|
14 |
- ActiveRecord::Schema.define(version: 20 |
|
|
13 | + ActiveRecord::Schema.define(version: 2020_04_04_142959) do | |
|
15 | 14 | |
|
16 | - create_table "announcements", force: :cascade do |t| | |
|
17 |
- t.string |
|
|
18 |
- t.text |
|
|
15 | + create_table "announcements", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
16 | + t.string "author" | |
|
17 | + t.text "body", limit: 16777215 | |
|
19 | 18 |
t.boolean |
|
20 | - t.datetime "created_at" | |
|
21 | - t.datetime "updated_at" | |
|
19 | + t.datetime "created_at", null: false | |
|
20 | + t.datetime "updated_at", null: false | |
|
22 | 21 |
t.boolean |
|
23 | 22 |
t.boolean |
|
24 |
- t.string |
|
|
25 |
- t.string |
|
|
23 | + t.string "title" | |
|
24 | + t.string "notes" | |
|
26 | 25 | end |
|
27 | 26 | |
|
28 | - create_table "contests", force: :cascade do |t| | |
|
29 |
- t.string |
|
|
27 | + create_table "contests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
28 | + t.string "title" | |
|
30 | 29 |
t.boolean |
|
31 | - t.datetime "created_at" | |
|
32 | - t.datetime "updated_at" | |
|
33 |
- t.string |
|
|
34 | - end | |
|
35 | - | |
|
36 | - create_table "contests_problems", id: false, force: :cascade do |t| | |
|
37 | - t.integer "contest_id", limit: 4 | |
|
38 | - t.integer "problem_id", limit: 4 | |
|
39 | - end | |
|
40 | - | |
|
41 | - create_table "contests_users", id: false, force: :cascade do |t| | |
|
42 | - t.integer "contest_id", limit: 4 | |
|
43 | - t.integer "user_id", limit: 4 | |
|
30 | + t.datetime "created_at", null: false | |
|
31 | + t.datetime "updated_at", null: false | |
|
32 | + t.string "name" | |
|
44 | 33 | end |
|
45 | 34 | |
|
46 | - create_table "countries", force: :cascade do |t| | |
|
47 | - t.string "name", limit: 255 | |
|
48 | - t.datetime "created_at" | |
|
49 | - t.datetime "updated_at" | |
|
35 | + create_table "contests_problems", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
36 | + t.integer "contest_id" | |
|
37 | + t.integer "problem_id" | |
|
50 | 38 | end |
|
51 | 39 | |
|
52 |
- create_table " |
|
|
53 | - t.text "body", limit: 65535 | |
|
54 | - t.boolean "markdowned" | |
|
55 | - t.datetime "created_at" | |
|
56 | - t.datetime "updated_at" | |
|
40 | + create_table "contests_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
41 | + t.integer "contest_id" | |
|
42 | + t.integer "user_id" | |
|
57 | 43 | end |
|
58 | 44 | |
|
59 | - create_table "grader_configurations", force: :cascade do |t| | |
|
60 | - t.string "key", limit: 255 | |
|
61 | - t.string "value_type", limit: 255 | |
|
62 | - t.string "value", limit: 255 | |
|
63 | - t.datetime "created_at" | |
|
64 | - t.datetime "updated_at" | |
|
65 | - t.text "description", limit: 65535 | |
|
45 | + create_table "countries", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
46 | + t.string "name" | |
|
47 | + t.datetime "created_at", null: false | |
|
48 | + t.datetime "updated_at", null: false | |
|
66 | 49 | end |
|
67 | 50 | |
|
68 | - create_table "grader_processes", force: :cascade do |t| | |
|
69 |
- t. |
|
|
70 | - t.integer "pid", limit: 4 | |
|
71 | - t.string "mode", limit: 255 | |
|
72 | - t.boolean "active" | |
|
73 | - t.datetime "created_at" | |
|
74 | - t.datetime "updated_at" | |
|
75 | - t.integer "task_id", limit: 4 | |
|
76 | - t.string "task_type", limit: 255 | |
|
77 | - t.boolean "terminated" | |
|
51 | + create_table "descriptions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
52 | + t.text "body", limit: 16777215 | |
|
53 | + t.boolean "markdowned" | |
|
54 | + t.datetime "created_at", null: false | |
|
55 | + t.datetime "updated_at", null: false | |
|
56 | + end | |
|
57 | + | |
|
58 | + create_table "grader_configurations", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
59 | + t.string "key" | |
|
60 | + t.string "value_type" | |
|
61 | + t.string "value" | |
|
62 | + t.datetime "created_at", null: false | |
|
63 | + t.datetime "updated_at", null: false | |
|
64 | + t.text "description", limit: 16777215 | |
|
78 | 65 | end |
|
79 | 66 | |
|
80 | - add_index "grader_processes", ["host", "pid"], name: "index_grader_processes_on_host_and_pid", using: :btree | |
|
81 | - | |
|
82 | - create_table "groups", force: :cascade do |t| | |
|
83 | - t.string "name", limit: 255 | |
|
84 | - t.string "description", limit: 255 | |
|
85 | - end | |
|
86 | - | |
|
87 | - create_table "groups_problems", id: false, force: :cascade do |t| | |
|
88 | - t.integer "problem_id", limit: 4, null: false | |
|
89 | - t.integer "group_id", limit: 4, null: false | |
|
67 | + create_table "grader_processes", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
68 | + t.string "host" | |
|
69 | + t.integer "pid" | |
|
70 | + t.string "mode" | |
|
71 | + t.boolean "active" | |
|
72 | + t.datetime "created_at", null: false | |
|
73 | + t.datetime "updated_at", null: false | |
|
74 | + t.integer "task_id" | |
|
75 | + t.string "task_type" | |
|
76 | + t.boolean "terminated" | |
|
77 | + t.index ["host", "pid"], name: "index_grader_processes_on_ip_and_pid" | |
|
90 | 78 | end |
|
91 | 79 | |
|
92 | - add_index "groups_problems", ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id", using: :btree | |
|
93 | - | |
|
94 | - create_table "groups_users", id: false, force: :cascade do |t| | |
|
95 | - t.integer "group_id", limit: 4, null: false | |
|
96 | - t.integer "user_id", limit: 4, null: false | |
|
80 | + create_table "groups", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
81 | + t.string "name" | |
|
82 | + t.string "description" | |
|
97 | 83 | end |
|
98 | 84 | |
|
99 | - add_index "groups_users", ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id", using: :btree | |
|
85 | + create_table "groups_problems", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
86 | + t.integer "problem_id", null: false | |
|
87 | + t.integer "group_id", null: false | |
|
88 | + t.index ["group_id", "problem_id"], name: "index_groups_problems_on_group_id_and_problem_id" | |
|
89 | + end | |
|
100 | 90 | |
|
101 | - create_table "heart_beats", force: :cascade do |t| | |
|
102 |
- t.integer |
|
|
103 | - t.string "ip_address", limit: 255 | |
|
104 | - t.datetime "created_at" | |
|
105 | - t.datetime "updated_at" | |
|
106 | - t.string "status", limit: 255 | |
|
91 | + create_table "groups_users", options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
92 | + t.integer "group_id", null: false | |
|
93 | + t.integer "user_id", null: false | |
|
94 | + t.index ["user_id", "group_id"], name: "index_groups_users_on_user_id_and_group_id" | |
|
107 | 95 | end |
|
108 | 96 | |
|
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| | |
|
112 | - t.string "name", limit: 10 | |
|
113 | - t.string "pretty_name", limit: 255 | |
|
114 | - t.string "ext", limit: 10 | |
|
115 | - t.string "common_ext", limit: 255 | |
|
97 | + create_table "heart_beats", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
98 | + t.integer "user_id" | |
|
99 | + t.string "ip_address" | |
|
100 | + t.datetime "created_at", null: false | |
|
101 | + t.datetime "updated_at", null: false | |
|
102 | + t.string "status" | |
|
103 | + t.index ["updated_at"], name: "index_heart_beats_on_updated_at" | |
|
116 | 104 | end |
|
117 | 105 | |
|
118 | - create_table "logins", force: :cascade do |t| | |
|
119 |
- t.in |
|
|
120 | - t.string "ip_address", limit: 255 | |
|
121 | - t.datetime "created_at" | |
|
122 | - t.datetime "updated_at" | |
|
106 | + create_table "languages", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
107 | + t.string "name", limit: 10 | |
|
108 | + t.string "pretty_name" | |
|
109 | + t.string "ext", limit: 10 | |
|
110 | + t.string "common_ext" | |
|
123 | 111 | end |
|
124 | 112 | |
|
125 | - create_table "messages", force: :cascade do |t| | |
|
126 |
- t.integer |
|
|
127 | - t.integer "receiver_id", limit: 4 | |
|
128 | - t.integer "replying_message_id", limit: 4 | |
|
129 | - t.text "body", limit: 65535 | |
|
130 | - t.boolean "replied" | |
|
131 | - t.datetime "created_at" | |
|
132 | - t.datetime "updated_at" | |
|
113 | + create_table "logins", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
114 | + t.integer "user_id" | |
|
115 | + t.string "ip_address" | |
|
116 | + t.datetime "created_at", null: false | |
|
117 | + t.datetime "updated_at", null: false | |
|
133 | 118 | end |
|
134 | 119 | |
|
135 | - create_table "problems", force: :cascade do |t| | |
|
136 | - t.string "name", limit: 30 | |
|
137 | - t.string "full_name", limit: 255 | |
|
138 | - t.integer "full_score", limit: 4 | |
|
120 | + create_table "messages", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
121 | + t.integer "sender_id" | |
|
122 | + t.integer "receiver_id" | |
|
123 | + t.integer "replying_message_id" | |
|
124 | + t.text "body", limit: 16777215 | |
|
125 | + t.boolean "replied" | |
|
126 | + t.datetime "created_at", null: false | |
|
127 | + t.datetime "updated_at", null: false | |
|
128 | + end | |
|
129 | + | |
|
130 | + create_table "problems", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
131 | + t.string "name", limit: 100 | |
|
132 | + t.string "full_name" | |
|
133 | + t.integer "full_score" | |
|
139 | 134 |
t.date |
|
140 | 135 | t.boolean "available" |
|
141 | - t.string "url", limit: 255 | |
|
142 |
- t.integer "description_id" |
|
|
136 | + t.string "url" | |
|
137 | + t.integer "description_id" | |
|
143 | 138 | t.boolean "test_allowed" |
|
144 | 139 | t.boolean "output_only" |
|
145 |
- t.string |
|
|
140 | + t.string "description_filename" | |
|
146 | 141 | t.boolean "view_testcase" |
|
147 | 142 | end |
|
148 | 143 | |
|
149 | - create_table "problems_tags", force: :cascade do |t| | |
|
150 |
- t.integer "problem_id" |
|
|
151 |
- t.integer "tag_id" |
|
|
144 | + create_table "problems_tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
145 | + t.integer "problem_id" | |
|
146 | + t.integer "tag_id" | |
|
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" | |
|
152 | 150 | end |
|
153 | 151 | |
|
154 | - add_index "problems_tags", ["problem_id", "tag_id"], name: "index_problems_tags_on_problem_id_and_tag_id", unique: true, using: :btree | |
|
155 | - add_index "problems_tags", ["problem_id"], name: "index_problems_tags_on_problem_id", using: :btree | |
|
156 | - add_index "problems_tags", ["tag_id"], name: "index_problems_tags_on_tag_id", using: :btree | |
|
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 | |
|
152 | + create_table "rights", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
153 | + t.string "name" | |
|
154 | + t.string "controller" | |
|
155 | + t.string "action" | |
|
162 | 156 | end |
|
163 | 157 | |
|
164 | - create_table "rights_roles", id: false, force: :cascade do |t| | |
|
165 |
- t.integer "right_id" |
|
|
166 |
- t.integer "role_id" |
|
|
158 | + create_table "rights_roles", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
159 | + t.integer "right_id" | |
|
160 | + t.integer "role_id" | |
|
161 | + t.index ["role_id"], name: "index_rights_roles_on_role_id" | |
|
167 | 162 | end |
|
168 | 163 | |
|
169 | - add_index "rights_roles", ["role_id"], name: "index_rights_roles_on_role_id", using: :btree | |
|
170 | - | |
|
171 | - create_table "roles", force: :cascade do |t| | |
|
172 | - t.string "name", limit: 255 | |
|
164 | + create_table "roles", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
165 | + t.string "name" | |
|
173 | 166 | end |
|
174 | 167 | |
|
175 | - create_table "roles_users", id: false, force: :cascade do |t| | |
|
176 |
- t.integer "role_id" |
|
|
177 |
- t.integer "user_id" |
|
|
168 | + create_table "roles_users", id: false, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
169 | + t.integer "role_id" | |
|
170 | + t.integer "user_id" | |
|
171 | + t.index ["user_id"], name: "index_roles_users_on_user_id" | |
|
178 | 172 | end |
|
179 | 173 | |
|
180 | - add_index "roles_users", ["user_id"], name: "index_roles_users_on_user_id", using: :btree | |
|
181 | - | |
|
182 | - create_table "sessions", force: :cascade do |t| | |
|
183 | - t.string "session_id", limit: 255 | |
|
184 | - t.text "data", limit: 65535 | |
|
174 | + create_table "sessions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
175 | + t.string "session_id" | |
|
176 | + t.text "data", limit: 16777215 | |
|
185 | 177 | 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" | |
|
186 | 180 | end |
|
187 | 181 | |
|
188 | - add_index "sessions", ["session_id"], name: "index_sessions_on_session_id", using: :btree | |
|
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 | |
|
182 | + create_table "sites", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
183 | + t.string "name" | |
|
193 | 184 |
t.boolean |
|
194 | 185 | t.datetime "start_time" |
|
195 | - t.datetime "created_at" | |
|
196 | - t.datetime "updated_at" | |
|
197 |
- t.integer |
|
|
198 |
- t.string |
|
|
186 | + t.datetime "created_at", null: false | |
|
187 | + t.datetime "updated_at", null: false | |
|
188 | + t.integer "country_id" | |
|
189 | + t.string "password" | |
|
199 | 190 | end |
|
200 | 191 | |
|
201 | - create_table "submission_view_logs", force: :cascade do |t| | |
|
202 |
- t.integer |
|
|
203 |
- t.integer |
|
|
204 | - t.datetime "created_at" | |
|
205 | - t.datetime "updated_at" | |
|
192 | + create_table "submission_view_logs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
193 | + t.integer "user_id" | |
|
194 | + t.integer "submission_id" | |
|
195 | + t.datetime "created_at", null: false | |
|
196 | + t.datetime "updated_at", null: false | |
|
206 | 197 | end |
|
207 | 198 | |
|
208 | - create_table "submissions", force: :cascade do |t| | |
|
209 |
- t.integer |
|
|
210 |
- t.integer |
|
|
211 |
- t.integer |
|
|
199 | + create_table "submissions", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
200 | + t.integer "user_id" | |
|
201 | + t.integer "problem_id" | |
|
202 | + t.integer "language_id" | |
|
212 | 203 |
t.text |
|
213 | - t.binary "binary", limit: 65535 | |
|
204 | + t.binary "binary" | |
|
214 | 205 | t.datetime "submitted_at" |
|
215 | 206 | t.datetime "compiled_at" |
|
216 |
- t.text |
|
|
207 | + t.text "compiler_message", limit: 16777215 | |
|
217 | 208 | t.datetime "graded_at" |
|
218 |
- t.integer |
|
|
219 |
- t.text |
|
|
220 |
- t.integer |
|
|
221 |
- t.string |
|
|
222 |
- t.float |
|
|
223 |
- t.integer |
|
|
224 |
- t.integer |
|
|
225 |
- t.string |
|
|
209 | + t.integer "points" | |
|
210 | + t.text "grader_comment", limit: 16777215 | |
|
211 | + t.integer "number" | |
|
212 | + t.string "source_filename" | |
|
213 | + t.float "max_runtime" | |
|
214 | + t.integer "peak_memory" | |
|
215 | + t.integer "effective_code_length" | |
|
216 | + t.string "ip_address" | |
|
217 | + t.index ["submitted_at"], name: "index_submissions_on_submitted_at" | |
|
218 | + t.index ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true | |
|
219 | + t.index ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id" | |
|
226 | 220 | end |
|
227 | 221 | |
|
228 | - add_index "submissions", ["user_id", "problem_id", "number"], name: "index_submissions_on_user_id_and_problem_id_and_number", unique: true, using: :btree | |
|
229 | - add_index "submissions", ["user_id", "problem_id"], name: "index_submissions_on_user_id_and_problem_id", using: :btree | |
|
230 | - | |
|
231 | - create_table "tags", force: :cascade do |t| | |
|
232 | - t.string "name", limit: 255, null: false | |
|
233 | - t.text "description", limit: 65535 | |
|
222 | + create_table "tags", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
223 | + t.string "name", null: false | |
|
224 | + t.text "description" | |
|
234 | 225 |
t.boolean |
|
235 | 226 |
t.datetime "created_at", |
|
236 | 227 |
t.datetime "updated_at", |
|
237 | 228 | end |
|
238 | 229 | |
|
239 | - create_table "tasks", force: :cascade do |t| | |
|
240 |
- t.integer |
|
|
230 | + create_table "tasks", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
231 | + t.integer "submission_id" | |
|
241 | 232 | t.datetime "created_at" |
|
242 |
- t.integer |
|
|
233 | + t.integer "status" | |
|
243 | 234 | t.datetime "updated_at" |
|
235 | + t.index ["submission_id"], name: "index_tasks_on_submission_id" | |
|
244 | 236 | end |
|
245 | 237 | |
|
246 | - add_index "tasks", ["submission_id"], name: "index_tasks_on_submission_id", using: :btree | |
|
247 | - | |
|
248 | - create_table "test_pairs", force: :cascade do |t| | |
|
249 |
- t. |
|
|
250 | - t.text "input", limit: 16777215 | |
|
251 | - t.text "solution", limit: 16777215 | |
|
252 | - t.datetime "created_at" | |
|
253 | - t.datetime "updated_at" | |
|
238 | + create_table "test_pairs", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
239 | + t.integer "problem_id" | |
|
240 | + t.text "input", limit: 4294967295 | |
|
241 | + t.text "solution", limit: 4294967295 | |
|
242 | + t.datetime "created_at", null: false | |
|
243 | + t.datetime "updated_at", null: false | |
|
254 | 244 | end |
|
255 | 245 | |
|
256 | - create_table "test_requests", force: :cascade do |t| | |
|
257 |
- t.integer |
|
|
258 |
- t.integer |
|
|
259 |
- t.integer |
|
|
260 |
- t.string |
|
|
261 |
- t.string |
|
|
262 |
- t.string |
|
|
263 |
- t.integer |
|
|
264 | - t.datetime "updated_at" | |
|
246 | + create_table "test_requests", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
247 | + t.integer "user_id" | |
|
248 | + t.integer "problem_id" | |
|
249 | + t.integer "submission_id" | |
|
250 | + t.string "input_file_name" | |
|
251 | + t.string "output_file_name" | |
|
252 | + t.string "running_stat" | |
|
253 | + t.integer "status" | |
|
254 | + t.datetime "updated_at", null: false | |
|
265 | 255 | t.datetime "submitted_at" |
|
266 | 256 | t.datetime "compiled_at" |
|
267 |
- t.text |
|
|
257 | + t.text "compiler_message", limit: 16777215 | |
|
268 | 258 | t.datetime "graded_at" |
|
269 |
- t.string |
|
|
270 | - t.datetime "created_at" | |
|
271 |
- t.float |
|
|
272 |
- t.string |
|
|
273 |
- t.integer |
|
|
259 | + t.string "grader_comment" | |
|
260 | + t.datetime "created_at", null: false | |
|
261 | + t.float "running_time" | |
|
262 | + t.string "exit_status" | |
|
263 | + t.integer "memory_usage" | |
|
264 | + t.index ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id" | |
|
274 | 265 | end |
|
275 | 266 | |
|
276 | - add_index "test_requests", ["user_id", "problem_id"], name: "index_test_requests_on_user_id_and_problem_id", using: :btree | |
|
277 | - | |
|
278 | - create_table "testcases", force: :cascade do |t| | |
|
279 |
- t.integer |
|
|
280 | - t.integer "num", limit: 4 | |
|
281 | - t.integer "group", limit: 4 | |
|
282 | - t.integer "score", limit: 4 | |
|
267 | + create_table "testcases", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=latin1", force: :cascade do |t| | |
|
268 | + t.integer "problem_id" | |
|
269 | + t.integer "num" | |
|
270 | + t.integer "group" | |
|
271 | + t.integer "score" | |
|
283 | 272 |
t.text |
|
284 | 273 |
t.text |
|
285 | - t.datetime "created_at" | |
|
286 | - t.datetime "updated_at" | |
|
274 | + t.datetime "created_at", null: false | |
|
275 | + t.datetime "updated_at", null: false | |
|
276 | + t.index ["problem_id"], name: "index_testcases_on_problem_id" | |
|
287 | 277 | end |
|
288 | 278 | |
|
289 | - add_index "testcases", ["problem_id"], name: "index_testcases_on_problem_id", using: :btree | |
|
290 | - | |
|
291 | - create_table "user_contest_stats", force: :cascade do |t| | |
|
292 | - t.integer "user_id", limit: 4 | |
|
279 | + create_table "user_contest_stats", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
280 | + t.integer "user_id" | |
|
293 | 281 | t.datetime "started_at" |
|
294 | - t.datetime "created_at" | |
|
295 | - t.datetime "updated_at" | |
|
282 | + t.datetime "created_at", null: false | |
|
283 | + t.datetime "updated_at", null: false | |
|
296 | 284 |
t.boolean |
|
297 | 285 | end |
|
298 | 286 | |
|
299 | - create_table "users", force: :cascade do |t| | |
|
287 | + create_table "users", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| | |
|
300 | 288 |
t.string |
|
301 |
- t.string |
|
|
302 |
- t.string |
|
|
289 | + t.string "full_name" | |
|
290 | + t.string "hashed_password" | |
|
303 | 291 |
t.string |
|
304 |
- t.string |
|
|
305 |
- t.string |
|
|
306 |
- t.integer |
|
|
307 |
- t.integer |
|
|
292 | + t.string "alias" | |
|
293 | + t.string "email" | |
|
294 | + t.integer "site_id" | |
|
295 | + t.integer "country_id" | |
|
308 | 296 |
t.boolean |
|
309 | 297 | t.datetime "created_at" |
|
310 | 298 | t.datetime "updated_at" |
|
311 |
- t.string |
|
|
299 | + t.string "section" | |
|
312 | 300 |
t.boolean |
|
313 |
- t.string |
|
|
314 |
- t.string |
|
|
301 | + t.string "remark" | |
|
302 | + t.string "last_ip" | |
|
303 | + t.index ["login"], name: "index_users_on_login", unique: true | |
|
315 | 304 | end |
|
316 | 305 | |
|
317 | - add_index "users", ["login"], name: "index_users_on_login", unique: true, using: :btree | |
|
318 | - | |
|
319 | 306 | add_foreign_key "problems_tags", "problems" |
|
320 | 307 | add_foreign_key "problems_tags", "tags" |
|
321 | 308 | end |
You need to be logged in to leave comments.
Login now