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

r870:9386e234b7f9 - - 29 files changed: 587 inserted, 683 deleted

@@ -0,0 +1,1
1 + $font-size-base: 0.875rem;
@@ -0,0 +1,416
1 +
2 + .secondnavbar {
3 + top: 50px;
4 + }
5 +
6 + // --------------- bootstrap file upload ----------------------
7 + .btn-file {
8 + position: relative;
9 + overflow: hidden;
10 + }
11 +
12 + .btn-file input[type=file] {
13 + position: absolute;
14 + top: 0;
15 + right: 0;
16 + min-width: 100%;
17 + min-height: 100%;
18 + font-size: 100px;
19 + text-align: right;
20 + filter: alpha(opacity = 0);
21 + opacity: 0;
22 + outline: none;
23 + background: white;
24 + cursor: inherit;
25 + display: block;
26 + }
27 +
28 + body {
29 + //font-size: 13px
30 + font-family: 'Krub', Tahoma, "sans-serif";
31 + margin: 10px;
32 + padding: 10px;
33 + padding-top: 60px;
34 + }
35 +
36 + // ------------------ bootstrap sortable --------------------
37 + table.sortable th {
38 + padding-right: 20px !important;
39 +
40 + span.sign {
41 + right: (-15px) !important;
42 + }
43 +
44 + &.text-right {
45 + padding-left: 20px !important;
46 + padding-right: 8px !important;
47 +
48 + &:after, span.sign {
49 + left: (-15px) !important;
50 + }
51 + }
52 + }
53 +
54 + input {
55 + font-family: Tahoma, "sans-serif";
56 + }
57 +
58 + h1 {
59 + color: #334488;
60 + }
61 +
62 + h2 {
63 + color: #5566bb;
64 + }
65 +
66 + hr {
67 + border-top: 1px solid #dddddd;
68 + border-bottom: 1px solid #eeeeee;
69 + }
70 +
71 + //#a
72 + // color: #6666cc
73 + // text-decoration: none
74 + //
75 + // &:link, &:visited
76 + // color: #6666cc
77 + // text-decoration: none
78 + //
79 + // &:hover, &:focus
80 + // color: #111166
81 + // text-decoration: none
82 +
83 + div {
84 + &.userbar {
85 + line-height: 1.5em;
86 + text-align: right;
87 + font-size: 12px;
88 + }
89 +
90 + &.title {
91 + padding: 10px 0px;
92 + line-height: 1.5em;
93 + font-size: 13px;
94 +
95 + span.contest-over-msg {
96 + font-size: 15px;
97 + color: red;
98 + }
99 +
100 + table {
101 + width: 100%;
102 + font-weight: bold;
103 + }
104 +
105 + td {
106 + &.left-col {
107 + text-align: left;
108 + vertical-align: top;
109 + color: #444444;
110 + }
111 +
112 + &.right-col {
113 + text-align: right;
114 + vertical-align: top;
115 + font-size: 18px;
116 + color: #116699;
117 + }
118 + }
119 + }
120 + }
121 +
122 + table.info {
123 + margin: 10px 0;
124 + border: 1px solid #666666;
125 + border-collapse: collapse;
126 + font-size: 12px;
127 +
128 + th {
129 + border: 1px solid #666666;
130 + line-height: 1.5em;
131 + padding: 0 0.5em;
132 + }
133 +
134 + td {
135 + border-left: 1px solid #666666;
136 + border-right: 1px solid #666666;
137 + line-height: 1.5em;
138 + padding: 0 0.5em;
139 + }
140 + }
141 +
142 + tr {
143 + &.info-head {
144 + background: #777777;
145 + color: white;
146 + }
147 +
148 + &.info-odd {
149 + background: #eeeeee;
150 + }
151 +
152 + &.info-even {
153 + background: #fcfcfc;
154 + }
155 + }
156 +
157 + @mixin basicbox {
158 + background: #eeeeff;
159 + border: 1px dotted #99aaee;
160 + padding: 5px;
161 + margin: 10px 0px;
162 + color: black;
163 + font-size: 13px;
164 + }
165 +
166 + .infobox {
167 + @include basicbox;
168 + }
169 +
170 + .submitbox {
171 + @include basicbox;
172 + }
173 +
174 + .errorExplanation {
175 + border: 1px dotted gray;
176 + color: #bb2222;
177 + padding: 5px 15px 5px 15px;
178 + margin-bottom: 5px;
179 + background-color: white;
180 + font-weight: normal;
181 +
182 + h2 {
183 + color: #cc1111;
184 + font-weight: bold;
185 + }
186 + }
187 +
188 + table.uinfo {
189 + border-collapse: collapse;
190 + border: 1px solid black;
191 + font-size: 13px;
192 + }
193 +
194 + td.uinfo {
195 + vertical-align: top;
196 + border: 1px solid black;
197 + padding: 5px;
198 + }
199 +
200 + th.uinfo {
201 + background: lightgreen;
202 + vertical-align: top;
203 + text-align: right;
204 + border: 1px solid black;
205 + padding: 5px;
206 + }
207 +
208 + div {
209 + &.compilermsgbody {
210 + font-family: monospace;
211 + }
212 +
213 + &.task-menu {
214 + text-align: center;
215 + font-size: 13px;
216 + line-height: 1.75em;
217 + font-weight: bold;
218 + border-top: 1px dashed gray;
219 + border-bottom: 1px dashed gray;
220 + margin-top: 2px;
221 + margin-bottom: 4px;
222 + }
223 + }
224 +
225 + table.taskdesc {
226 + border: 2px solid #dddddd;
227 + border-collapse: collapse;
228 + margin: 10px auto;
229 + width: 90%;
230 + font-size: 13px;
231 +
232 + p {
233 + font-size: 13px;
234 + }
235 +
236 + tr.name {
237 + border: 2px solid #dddddd;
238 + background: #dddddd;
239 + color: #333333;
240 + font-weight: bold;
241 + font-size: 14px;
242 + line-height: 1.5em;
243 + text-align: center;
244 + }
245 +
246 + td {
247 + &.desc-odd {
248 + padding: 5px;
249 + padding-left: 20px;
250 + background: #fefeee;
251 + }
252 +
253 + &.desc-even {
254 + padding: 5px;
255 + padding-left: 20px;
256 + background: #feeefe;
257 + }
258 + }
259 + }
260 +
261 + .announcementbox {
262 + margin: 10px 0px;
263 + background: #bbddee;
264 + padding: 1px;
265 +
266 + span.title {
267 + font-weight: bold;
268 + color: #224455;
269 + padding-left: 10px;
270 + line-height: 1.6em;
271 + }
272 + }
273 +
274 + .announcement {
275 + margin: 2px;
276 + background: white;
277 + padding: 1px;
278 + padding-left: 10px;
279 + padding-right: 10px;
280 + padding-top: 5px;
281 + padding-bottom: 5px;
282 + }
283 +
284 + .announcement p {
285 + font-size: 12px;
286 + margin: 2px;
287 + }
288 +
289 + .pub-info {
290 + text-align: right;
291 + font-style: italic;
292 + font-size: 9px;
293 +
294 + p {
295 + text-align: right;
296 + font-style: italic;
297 + font-size: 9px;
298 + }
299 + }
300 +
301 + .announcement {
302 + .toggles {
303 + font-weight: normal;
304 + float: right;
305 + font-size: 80%;
306 + }
307 +
308 + .announcement-title {
309 + font-weight: bold;
310 + }
311 + }
312 +
313 + div {
314 + &.message {
315 + margin: 10px 0 0;
316 +
317 + div {
318 + &.message {
319 + margin: 0 0 0 30px;
320 + }
321 +
322 + &.body {
323 + border: 2px solid #dddddd;
324 + background: #fff8f8;
325 + padding-left: 5px;
326 + }
327 +
328 + &.reply-body {
329 + border: 2px solid #bbbbbb;
330 + background: #fffff8;
331 + padding-left: 5px;
332 + }
333 +
334 + &.stat {
335 + font-size: 10px;
336 + line-height: 1.75em;
337 + padding: 0 5px;
338 + color: #333333;
339 + background: #dddddd;
340 + font-weight: bold;
341 + }
342 +
343 + &.message div.stat {
344 + font-size: 10px;
345 + line-height: 1.75em;
346 + padding: 0 5px;
347 + color: #444444;
348 + background: #bbbbbb;
349 + font-weight: bold;
350 + }
351 + }
352 + }
353 +
354 + &.contest-title {
355 + color: white;
356 + text-align: center;
357 + line-height: 2em;
358 + }
359 +
360 + &.registration-desc, &.test-desc {
361 + border: 1px dotted gray;
362 + background: #f5f5f5;
363 + padding: 5px;
364 + margin: 10px 0;
365 + font-size: 12px;
366 + line-height: 1.5em;
367 + }
368 + }
369 +
370 + h2.contest-title {
371 + margin-top: 5px;
372 + margin-bottom: 5px;
373 + }
374 +
375 +
376 +
377 + .grader-comment {
378 + word-wrap: break-word;
379 + font-family: consolas;
380 + }
381 +
382 +
383 + golden-btn + .golden-btn { margin-top: 1em; }
384 +
385 + .golden-btn {
386 + display: inline-block;
387 + outline: none;
388 + font-family: inherit;
389 + box-sizing: border-box;
390 + border: none;
391 + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
392 + inset 0 -2px 5px 1px rgba(139,66,8,1),
393 + inset 0 -1px 1px 3px rgba(250,227,133,1);
394 + background-image: linear-gradient(160deg, #a54e07, #b47e11, #fef1a2, #bc881b, #a54e07) !important;
395 + border: 1px solid #a55d07;
396 + color: rgb(120,50,5);
397 + text-shadow: 0 2px 2px rgba(250, 227, 133, 1);
398 + cursor: pointer;
399 + transition: all .2s ease-in-out;
400 + background-size: 100% 100%;
401 + background-position:center;
402 + }
403 + .golden-btn:focus,
404 + .golden-btn:hover {
405 + background-size: 150% 150%;
406 + box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23),
407 + inset 0 -2px 5px 1px #b17d10,
408 + inset 0 -1px 1px 3px rgba(250,227,133,1);
409 + border: 1px solid rgba(165,93,7,.6);
410 + color: rgba(120,50,5,.8);
411 + }
412 + .golden-btn:active {
413 + box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
414 + inset 0 -2px 5px 1px #b17d10,
415 + inset 0 -1px 1px 3px rgba(250,227,133,1);
416 + }
@@ -24,12 +24,14
24
24
25 /data
25 /data
26
26
27 #ignore .orig and .swp
27 #ignore .orig and .swp
28 *.orig
28 *.orig
29 *.swp
29 *.swp
30
30
31 #ignore rvm setting file
31 #ignore rvm setting file
32 #.ruby-gemset
32 #.ruby-gemset
33 #.ruby-version
33 #.ruby-version
34
34
35 /config/secrets.yml
35 /config/secrets.yml
36 +
37 + /.byebug_history
@@ -93,25 +93,25
93 #gem 'verification', :git => 'https://github.com/sikachu/verification.git'
93 #gem 'verification', :git => 'https://github.com/sikachu/verification.git'
94
94
95
95
96 #---------------- testiing -----------------------
96 #---------------- testiing -----------------------
97 gem 'minitest-reporters'
97 gem 'minitest-reporters'
98
98
99 #---------------- for console --------------------
99 #---------------- for console --------------------
100 gem 'fuzzy-string-match'
100 gem 'fuzzy-string-match'
101
101
102
102
103 group :development, :test do
103 group :development, :test do
104 # Call 'byebug' anywhere in the code to stop execution and get a debugger console
104 # Call 'byebug' anywhere in the code to stop execution and get a debugger console
105 - gem 'debug', platforms: [:mri, :mingw, :x64_mingw]
105 + gem 'byebug'
106 end
106 end
107
107
108 group :development do
108 group :development do
109 # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
109 # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
110 gem 'web-console', '>= 3.3.0'
110 gem 'web-console', '>= 3.3.0'
111 gem 'listen', '>= 3.0.5', '< 3.2'
111 gem 'listen', '>= 3.0.5', '< 3.2'
112 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
112 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
113 gem 'spring'
113 gem 'spring'
114 gem 'spring-watcher-listen', '~> 2.0.0'
114 gem 'spring-watcher-listen', '~> 2.0.0'
115
115
116 # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
116 # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
117 # gem "rack-mini-profiler"
117 # gem "rack-mini-profiler"
@@ -83,51 +83,49
83 concurrent-ruby (~> 1.0, >= 1.0.2)
83 concurrent-ruby (~> 1.0, >= 1.0.2)
84 i18n (>= 1.6, < 2)
84 i18n (>= 1.6, < 2)
85 minitest (>= 5.1)
85 minitest (>= 5.1)
86 tzinfo (~> 2.0)
86 tzinfo (~> 2.0)
87 addressable (2.8.1)
87 addressable (2.8.1)
88 public_suffix (>= 2.0.2, < 6.0)
88 public_suffix (>= 2.0.2, < 6.0)
89 ansi (1.5.0)
89 ansi (1.5.0)
90 autoprefixer-rails (10.4.7.0)
90 autoprefixer-rails (10.4.7.0)
91 execjs (~> 2)
91 execjs (~> 2)
92 bindex (0.8.1)
92 bindex (0.8.1)
93 bootsnap (1.13.0)
93 bootsnap (1.13.0)
94 msgpack (~> 1.2)
94 msgpack (~> 1.2)
95 - bootstrap (5.2.0)
95 + bootstrap (5.2.1)
96 autoprefixer-rails (>= 9.1.0)
96 autoprefixer-rails (>= 9.1.0)
97 - popper_js (>= 2.11.5, < 3)
97 + popper_js (>= 2.11.6, < 3)
98 sassc-rails (>= 2.0.0)
98 sassc-rails (>= 2.0.0)
99 builder (3.2.4)
99 builder (3.2.4)
100 + byebug (11.1.3)
100 capybara (3.37.1)
101 capybara (3.37.1)
101 addressable
102 addressable
102 matrix
103 matrix
103 mini_mime (>= 0.1.3)
104 mini_mime (>= 0.1.3)
104 nokogiri (~> 1.8)
105 nokogiri (~> 1.8)
105 rack (>= 1.6.0)
106 rack (>= 1.6.0)
106 rack-test (>= 0.6.3)
107 rack-test (>= 0.6.3)
107 regexp_parser (>= 1.5, < 3.0)
108 regexp_parser (>= 1.5, < 3.0)
108 xpath (~> 3.2)
109 xpath (~> 3.2)
109 childprocess (4.1.0)
110 childprocess (4.1.0)
110 coffee-rails (5.0.0)
111 coffee-rails (5.0.0)
111 coffee-script (>= 2.2.0)
112 coffee-script (>= 2.2.0)
112 railties (>= 5.2.0)
113 railties (>= 5.2.0)
113 coffee-script (2.4.1)
114 coffee-script (2.4.1)
114 coffee-script-source
115 coffee-script-source
115 execjs
116 execjs
116 coffee-script-source (1.12.2)
117 coffee-script-source (1.12.2)
117 concurrent-ruby (1.1.10)
118 concurrent-ruby (1.1.10)
118 crass (1.0.6)
119 crass (1.0.6)
119 - debug (1.6.2)
120 - irb (>= 1.3.6)
121 - reline (>= 0.3.1)
122 digest (3.1.0)
120 digest (3.1.0)
123 dynamic_form (1.1.4)
121 dynamic_form (1.1.4)
124 erubi (1.11.0)
122 erubi (1.11.0)
125 erubis (2.7.0)
123 erubis (2.7.0)
126 execjs (2.8.1)
124 execjs (2.8.1)
127 ffi (1.15.5)
125 ffi (1.15.5)
128 fuzzy-string-match (1.0.1)
126 fuzzy-string-match (1.0.1)
129 RubyInline (>= 3.8.6)
127 RubyInline (>= 3.8.6)
130 globalid (1.0.0)
128 globalid (1.0.0)
131 activesupport (>= 5.0)
129 activesupport (>= 5.0)
132 haml (5.2.2)
130 haml (5.2.2)
133 temple (>= 0.8.0)
131 temple (>= 0.8.0)
@@ -140,38 +138,35
140 railties (>= 5.1)
138 railties (>= 5.1)
141 html2haml (2.2.0)
139 html2haml (2.2.0)
142 erubis (~> 2.7.0)
140 erubis (~> 2.7.0)
143 haml (>= 4.0, < 6)
141 haml (>= 4.0, < 6)
144 nokogiri (>= 1.6.0)
142 nokogiri (>= 1.6.0)
145 ruby_parser (~> 3.5)
143 ruby_parser (~> 3.5)
146 i18n (1.12.0)
144 i18n (1.12.0)
147 concurrent-ruby (~> 1.0)
145 concurrent-ruby (~> 1.0)
148 importmap-rails (1.1.5)
146 importmap-rails (1.1.5)
149 actionpack (>= 6.0.0)
147 actionpack (>= 6.0.0)
150 railties (>= 6.0.0)
148 railties (>= 6.0.0)
151 in_place_editing (1.2.0)
149 in_place_editing (1.2.0)
152 - io-console (0.5.11)
153 - irb (1.4.1)
154 - reline (>= 0.3.0)
155 jbuilder (2.11.5)
150 jbuilder (2.11.5)
156 actionview (>= 5.0.0)
151 actionview (>= 5.0.0)
157 activesupport (>= 5.0.0)
152 activesupport (>= 5.0.0)
158 jquery-rails (4.5.0)
153 jquery-rails (4.5.0)
159 rails-dom-testing (>= 1, < 3)
154 rails-dom-testing (>= 1, < 3)
160 railties (>= 4.2.0)
155 railties (>= 4.2.0)
161 thor (>= 0.14, < 2.0)
156 thor (>= 0.14, < 2.0)
162 listen (3.0.8)
157 listen (3.0.8)
163 rb-fsevent (~> 0.9, >= 0.9.4)
158 rb-fsevent (~> 0.9, >= 0.9.4)
164 rb-inotify (~> 0.9, >= 0.9.7)
159 rb-inotify (~> 0.9, >= 0.9.7)
165 - loofah (2.18.0)
160 + loofah (2.19.0)
166 crass (~> 1.0.2)
161 crass (~> 1.0.2)
167 nokogiri (>= 1.5.9)
162 nokogiri (>= 1.5.9)
168 mail (2.7.1)
163 mail (2.7.1)
169 mini_mime (>= 0.1.1)
164 mini_mime (>= 0.1.1)
170 marcel (1.0.2)
165 marcel (1.0.2)
171 material_icons (2.2.1)
166 material_icons (2.2.1)
172 railties (>= 3.2)
167 railties (>= 3.2)
173 matrix (0.4.2)
168 matrix (0.4.2)
174 method_source (1.0.0)
169 method_source (1.0.0)
175 mini_mime (1.1.2)
170 mini_mime (1.1.2)
176 minitest (5.16.3)
171 minitest (5.16.3)
177 minitest-reporters (1.5.0)
172 minitest-reporters (1.5.0)
@@ -190,29 +185,27
190 strscan
185 strscan
191 net-pop (0.1.1)
186 net-pop (0.1.1)
192 digest
187 digest
193 net-protocol
188 net-protocol
194 timeout
189 timeout
195 net-protocol (0.1.3)
190 net-protocol (0.1.3)
196 timeout
191 timeout
197 net-smtp (0.3.1)
192 net-smtp (0.3.1)
198 digest
193 digest
199 net-protocol
194 net-protocol
200 timeout
195 timeout
201 nio4r (2.5.8)
196 nio4r (2.5.8)
202 - nokogiri (1.13.8-x86_64-darwin)
203 - racc (~> 1.4)
204 nokogiri (1.13.8-x86_64-linux)
197 nokogiri (1.13.8-x86_64-linux)
205 racc (~> 1.4)
198 racc (~> 1.4)
206 - popper_js (2.11.5)
199 + popper_js (2.11.6)
207 public_suffix (5.0.0)
200 public_suffix (5.0.0)
208 puma (5.6.5)
201 puma (5.6.5)
209 nio4r (~> 2.0)
202 nio4r (~> 2.0)
210 racc (1.6.0)
203 racc (1.6.0)
211 rack (2.2.4)
204 rack (2.2.4)
212 rack-test (2.0.2)
205 rack-test (2.0.2)
213 rack (>= 1.3)
206 rack (>= 1.3)
214 rails (7.0.4)
207 rails (7.0.4)
215 actioncable (= 7.0.4)
208 actioncable (= 7.0.4)
216 actionmailbox (= 7.0.4)
209 actionmailbox (= 7.0.4)
217 actionmailer (= 7.0.4)
210 actionmailer (= 7.0.4)
218 actionpack (= 7.0.4)
211 actionpack (= 7.0.4)
@@ -234,26 +227,24
234 actionpack (= 7.0.4)
227 actionpack (= 7.0.4)
235 activesupport (= 7.0.4)
228 activesupport (= 7.0.4)
236 method_source
229 method_source
237 rake (>= 12.2)
230 rake (>= 12.2)
238 thor (~> 1.0)
231 thor (~> 1.0)
239 zeitwerk (~> 2.5)
232 zeitwerk (~> 2.5)
240 rake (13.0.6)
233 rake (13.0.6)
241 rb-fsevent (0.11.2)
234 rb-fsevent (0.11.2)
242 rb-inotify (0.10.1)
235 rb-inotify (0.10.1)
243 ffi (~> 1.0)
236 ffi (~> 1.0)
244 rdiscount (2.2.0.2)
237 rdiscount (2.2.0.2)
245 regexp_parser (2.5.0)
238 regexp_parser (2.5.0)
246 - reline (0.3.1)
247 - io-console (~> 0.5)
248 rexml (3.2.5)
239 rexml (3.2.5)
249 rouge (4.0.0)
240 rouge (4.0.0)
250 ruby-progressbar (1.11.0)
241 ruby-progressbar (1.11.0)
251 ruby_parser (3.19.1)
242 ruby_parser (3.19.1)
252 sexp_processor (~> 4.16)
243 sexp_processor (~> 4.16)
253 rubyzip (2.3.2)
244 rubyzip (2.3.2)
254 sassc (2.4.0)
245 sassc (2.4.0)
255 ffi (~> 1.9)
246 ffi (~> 1.9)
256 sassc-rails (2.1.2)
247 sassc-rails (2.1.2)
257 railties (>= 4.0.0)
248 railties (>= 4.0.0)
258 sassc (>= 2.0)
249 sassc (>= 2.0)
259 sprockets (> 3.0)
250 sprockets (> 3.0)
@@ -270,63 +261,61
270 activemodel (>= 5.2)
261 activemodel (>= 5.2)
271 spring (2.1.1)
262 spring (2.1.1)
272 spring-watcher-listen (2.0.1)
263 spring-watcher-listen (2.0.1)
273 listen (>= 2.7, < 4.0)
264 listen (>= 2.7, < 4.0)
274 spring (>= 1.2, < 3.0)
265 spring (>= 1.2, < 3.0)
275 sprockets (4.1.1)
266 sprockets (4.1.1)
276 concurrent-ruby (~> 1.0)
267 concurrent-ruby (~> 1.0)
277 rack (> 1, < 3)
268 rack (> 1, < 3)
278 sprockets-rails (3.4.2)
269 sprockets-rails (3.4.2)
279 actionpack (>= 5.2)
270 actionpack (>= 5.2)
280 activesupport (>= 5.2)
271 activesupport (>= 5.2)
281 sprockets (>= 3.0.0)
272 sprockets (>= 3.0.0)
282 - sqlite3 (1.5.0-x86_64-darwin)
283 sqlite3 (1.5.0-x86_64-linux)
273 sqlite3 (1.5.0-x86_64-linux)
284 strscan (3.0.4)
274 strscan (3.0.4)
285 temple (0.8.2)
275 temple (0.8.2)
286 thor (1.2.1)
276 thor (1.2.1)
287 tilt (2.0.11)
277 tilt (2.0.11)
288 timeout (0.3.0)
278 timeout (0.3.0)
289 tzinfo (2.0.5)
279 tzinfo (2.0.5)
290 concurrent-ruby (~> 1.0)
280 concurrent-ruby (~> 1.0)
291 web-console (4.2.0)
281 web-console (4.2.0)
292 actionview (>= 6.0.0)
282 actionview (>= 6.0.0)
293 activemodel (>= 6.0.0)
283 activemodel (>= 6.0.0)
294 bindex (>= 0.4.0)
284 bindex (>= 0.4.0)
295 railties (>= 6.0.0)
285 railties (>= 6.0.0)
296 - webdrivers (5.0.0)
286 + webdrivers (5.1.0)
297 nokogiri (~> 1.6)
287 nokogiri (~> 1.6)
298 rubyzip (>= 1.3.0)
288 rubyzip (>= 1.3.0)
299 selenium-webdriver (~> 4.0)
289 selenium-webdriver (~> 4.0)
300 websocket (1.2.9)
290 websocket (1.2.9)
301 websocket-driver (0.7.5)
291 websocket-driver (0.7.5)
302 websocket-extensions (>= 0.1.0)
292 websocket-extensions (>= 0.1.0)
303 websocket-extensions (0.1.5)
293 websocket-extensions (0.1.5)
304 xpath (3.2.0)
294 xpath (3.2.0)
305 nokogiri (~> 1.8)
295 nokogiri (~> 1.8)
306 zeitwerk (2.6.0)
296 zeitwerk (2.6.0)
307
297
308 PLATFORMS
298 PLATFORMS
309 - x86_64-darwin-20
310 x86_64-linux
299 x86_64-linux
311
300
312 DEPENDENCIES
301 DEPENDENCIES
313 ace-rails-ap
302 ace-rails-ap
314 activerecord-session_store
303 activerecord-session_store
315 best_in_place!
304 best_in_place!
316 bootsnap
305 bootsnap
317 bootstrap (~> 5.2)
306 bootstrap (~> 5.2)
307 + byebug
318 capybara
308 capybara
319 coffee-rails
309 coffee-rails
320 - debug
321 dynamic_form
310 dynamic_form
322 fuzzy-string-match
311 fuzzy-string-match
323 haml
312 haml
324 haml-rails
313 haml-rails
325 importmap-rails (~> 1.1)
314 importmap-rails (~> 1.1)
326 in_place_editing
315 in_place_editing
327 jbuilder
316 jbuilder
328 jquery-rails
317 jquery-rails
329 listen (>= 3.0.5, < 3.2)
318 listen (>= 3.0.5, < 3.2)
330 mail
319 mail
331 material_icons
320 material_icons
332 minitest-reporters
321 minitest-reporters
@@ -1,13 +1,14
1 //main entry point for sprocket
1 //main entry point for sprocket
2 - //= require jquery
2 + //= require jquery3
3 + //= require jquery_ujs
3 //= require moment
4 //= require moment
4 //= require moment/th
5 //= require moment/th
5 //= require ace-rails-ap
6 //= require ace-rails-ap
6 //= require ace/mode-c_cpp
7 //= require ace/mode-c_cpp
7 //= require ace/mode-python
8 //= require ace/mode-python
8 //= require ace/mode-ruby
9 //= require ace/mode-ruby
9 //= require ace/mode-pascal
10 //= require ace/mode-pascal
10 //= require ace/mode-javascript
11 //= require ace/mode-javascript
11 //= require ace/mode-java
12 //= require ace/mode-java
12 //= require ace/theme-merbivore
13 //= require ace/theme-merbivore
13
14
@@ -17,55 +17,60
17 //@import "jquery-ui";
17 //@import "jquery-ui";
18 //@import "jquery.ui.core";
18 //@import "jquery.ui.core";
19 //@import "jquery.ui.theme";
19 //@import "jquery.ui.theme";
20 //@import "jquery.ui.datepicker";
20 //@import "jquery.ui.datepicker";
21 //@import "jquery.ui.slider";
21 //@import "jquery.ui.slider";
22 //@import "jquery-ui-timepicker-addon";
22 //@import "jquery-ui-timepicker-addon";
23 //@import "jquery-tablesorter/theme.metro-dark";
23 //@import "jquery-tablesorter/theme.metro-dark";
24 //@import "jquery.countdown";
24 //@import "jquery.countdown";
25 //@import "tablesorter-theme.cafe";
25 //@import "tablesorter-theme.cafe";
26
26
27 //bootstrap
27 //bootstrap
28 //@import "bootstrap-sprockets";
28 //@import "bootstrap-sprockets";
29 + @import "my_bootstrap_var";
29 @import "bootstrap";
30 @import "bootstrap";
30 @import "select2/select2.min";
31 @import "select2/select2.min";
31 @import "select2/select2-bootstrap-5-theme.min";
32 @import "select2/select2-bootstrap-5-theme.min";
32
33
33 //@import bootstrap3-switch
34 //@import bootstrap3-switch
34 //@import "bootstrap-toggle";
35 //@import "bootstrap-toggle";
35 //@import "bootstrap-sortable";
36 //@import "bootstrap-sortable";
36 //@import "bootstrap-datepicker3";
37 //@import "bootstrap-datepicker3";
37 //@import "bootstrap-datetimepicker";
38 //@import "bootstrap-datetimepicker";
38 //@import "datatables.net-bs/css/dataTables.bootstrap.min";
39 //@import "datatables.net-bs/css/dataTables.bootstrap.min";
39 //@import "datatables.net-buttons-bs/css/buttons.bootstrap.min";
40 //@import "datatables.net-buttons-bs/css/buttons.bootstrap.min";
40
41
41 //new import
42 //new import
42 @import 'datatables/datatables.min';
43 @import 'datatables/datatables.min';
43 @import 'material_icons';
44 @import 'material_icons';
44
45
45 //bootstrap navbar color (from)
46 //bootstrap navbar color (from)
47 + /*
46 $bgDefault: #19197b;
48 $bgDefault: #19197b;
47 $bgHighlight: #06064b;
49 $bgHighlight: #06064b;
48 $colDefault: #8e8eb4;
50 $colDefault: #8e8eb4;
49 $colHighlight: #ffffff;
51 $colHighlight: #ffffff;
50 $dropDown: false;
52 $dropDown: false;
51
53
52 @font-face {
54 @font-face {
53 font-family: 'Glyphicons Halflings';
55 font-family: 'Glyphicons Halflings';
54 src: font-path('bootstrap/glyphicons-halflings-regular.eot');
56 src: font-path('bootstrap/glyphicons-halflings-regular.eot');
55 src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
57 src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
56 font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'),
58 font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'),
57 font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'),
59 font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'),
58 font-path('bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
60 font-path('bootstrap/glyphicons-halflings-regular.svg#glyphicons-halflingsregular') format('svg');
59 }
61 }
62 + */
63 +
64 + @import 'my_custom'
60
65
61 /*
66 /*
62 .navbar-default {
67 .navbar-default {
63 background-color: $bgDefault;
68 background-color: $bgDefault;
64 border-color: $bgHighlight;
69 border-color: $bgHighlight;
65
70
66 .navbar-brand {
71 .navbar-brand {
67 color: $colDefault;
72 color: $colDefault;
68
73
69 &:hover, &:focus {
74 &:hover, &:focus {
70 color: $colHighlight;
75 color: $colHighlight;
71 }
76 }
@@ -167,434 +172,14
167 color: $colHighlight;
172 color: $colHighlight;
168 }
173 }
169 }
174 }
170
175
171 > .active {
176 > .active {
172 > a, > a:hover, > a:focus {
177 > a, > a:hover, > a:focus {
173 color: $colHighlight;
178 color: $colHighlight;
174 background-color: $bgHighlight;
179 background-color: $bgHighlight;
175 }
180 }
176 }
181 }
177 }
182 }
178 }
183 }
179 -
180 */
184 */
181 - .secondnavbar {
182 - top: 50px;
183 - }
184 -
185 - // --------------- bootstrap file upload ----------------------
186 - .btn-file {
187 - position: relative;
188 - overflow: hidden;
189 - }
190 -
191 - .btn-file input[type=file] {
192 - position: absolute;
193 - top: 0;
194 - right: 0;
195 - min-width: 100%;
196 - min-height: 100%;
197 - font-size: 100px;
198 - text-align: right;
199 - filter: alpha(opacity = 0);
200 - opacity: 0;
201 - outline: none;
202 - background: white;
203 - cursor: inherit;
204 - display: block;
205 - }
206 -
207 - body {
208 - background: white image-url("topbg.jpg") repeat-x top center;
209 -
210 - //font-size: 13px
211 - //font-family: Tahoma, "sans-serif"
212 - margin: 10px;
213 - padding: 10px;
214 - padding-top: 60px;
215 - }
216 -
217 - // ------------------ bootstrap sortable --------------------
218 - table.sortable th {
219 - padding-right: 20px !important;
220 -
221 - span.sign {
222 - right: (-15px) !important;
223 - }
224 -
225 - &.text-right {
226 - padding-left: 20px !important;
227 - padding-right: 8px !important;
228 -
229 - &:after, span.sign {
230 - left: (-15px) !important;
231 - }
232 - }
233 - }
234 -
235 - input {
236 - font-family: Tahoma, "sans-serif";
237 - }
238 -
239 - h1 {
240 - font-size: 24px;
241 - color: #334488;
242 - line-height: 2em;
243 - }
244 -
245 - h2 {
246 - font-size: 18px;
247 - color: #5566bb;
248 - line-height: 1.5em;
249 - }
250 -
251 - hr {
252 - border-top: 1px solid #dddddd;
253 - border-bottom: 1px solid #eeeeee;
254 - }
255 -
256 - //#a
257 - // color: #6666cc
258 - // text-decoration: none
259 - //
260 - // &:link, &:visited
261 - // color: #6666cc
262 - // text-decoration: none
263 - //
264 - // &:hover, &:focus
265 - // color: #111166
266 - // text-decoration: none
267 -
268 - div {
269 - &.userbar {
270 - line-height: 1.5em;
271 - text-align: right;
272 - font-size: 12px;
273 - }
274 -
275 - &.title {
276 - padding: 10px 0px;
277 - line-height: 1.5em;
278 - font-size: 13px;
279 -
280 - span.contest-over-msg {
281 - font-size: 15px;
282 - color: red;
283 - }
284 -
285 - table {
286 - width: 100%;
287 - font-weight: bold;
288 - }
289 -
290 - td {
291 - &.left-col {
292 - text-align: left;
293 - vertical-align: top;
294 - color: #444444;
295 - }
296 -
297 - &.right-col {
298 - text-align: right;
299 - vertical-align: top;
300 - font-size: 18px;
301 - color: #116699;
302 - }
303 - }
304 - }
305 - }
306 -
307 - table.info {
308 - margin: 10px 0;
309 - border: 1px solid #666666;
310 - border-collapse: collapse;
311 - font-size: 12px;
312 -
313 - th {
314 - border: 1px solid #666666;
315 - line-height: 1.5em;
316 - padding: 0 0.5em;
317 - }
318 -
319 - td {
320 - border-left: 1px solid #666666;
321 - border-right: 1px solid #666666;
322 - line-height: 1.5em;
323 - padding: 0 0.5em;
324 - }
325 - }
326 -
327 - tr {
328 - &.info-head {
329 - background: #777777;
330 - color: white;
331 - }
332 -
333 - &.info-odd {
334 - background: #eeeeee;
335 - }
336 -
337 - &.info-even {
338 - background: #fcfcfc;
339 - }
340 - }
341 -
342 - @mixin basicbox {
343 - background: #eeeeff;
344 - border: 1px dotted #99aaee;
345 - padding: 5px;
346 - margin: 10px 0px;
347 - color: black;
348 - font-size: 13px;
349 - }
350 -
351 - .infobox {
352 - @include basicbox;
353 - }
354 -
355 - .submitbox {
356 - @include basicbox;
357 - }
358 -
359 - .errorExplanation {
360 - border: 1px dotted gray;
361 - color: #bb2222;
362 - padding: 5px 15px 5px 15px;
363 - margin-bottom: 5px;
364 - background-color: white;
365 - font-weight: normal;
366 -
367 - h2 {
368 - color: #cc1111;
369 - font-weight: bold;
370 - }
371 - }
372 -
373 - table.uinfo {
374 - border-collapse: collapse;
375 - border: 1px solid black;
376 - font-size: 13px;
377 - }
378 -
379 - td.uinfo {
380 - vertical-align: top;
381 - border: 1px solid black;
382 - padding: 5px;
383 - }
384
185
385 - th.uinfo {
386 - background: lightgreen;
387 - vertical-align: top;
388 - text-align: right;
389 - border: 1px solid black;
390 - padding: 5px;
391 - }
392 -
393 - div {
394 - &.compilermsgbody {
395 - font-family: monospace;
396 - }
397 -
398 - &.task-menu {
399 - text-align: center;
400 - font-size: 13px;
401 - line-height: 1.75em;
402 - font-weight: bold;
403 - border-top: 1px dashed gray;
404 - border-bottom: 1px dashed gray;
405 - margin-top: 2px;
406 - margin-bottom: 4px;
407 - }
408 - }
409 -
410 - table.taskdesc {
411 - border: 2px solid #dddddd;
412 - border-collapse: collapse;
413 - margin: 10px auto;
414 - width: 90%;
415 - font-size: 13px;
416 -
417 - p {
418 - font-size: 13px;
419 - }
420 -
421 - tr.name {
422 - border: 2px solid #dddddd;
423 - background: #dddddd;
424 - color: #333333;
425 - font-weight: bold;
426 - font-size: 14px;
427 - line-height: 1.5em;
428 - text-align: center;
429 - }
430 -
431 - td {
432 - &.desc-odd {
433 - padding: 5px;
434 - padding-left: 20px;
435 - background: #fefeee;
436 - }
437 -
438 - &.desc-even {
439 - padding: 5px;
440 - padding-left: 20px;
441 - background: #feeefe;
442 - }
443 - }
444 - }
445 -
446 - .announcementbox {
447 - margin: 10px 0px;
448 - background: #bbddee;
449 - padding: 1px;
450 -
451 - span.title {
452 - font-weight: bold;
453 - color: #224455;
454 - padding-left: 10px;
455 - line-height: 1.6em;
456 - }
457 - }
458 -
459 - .announcement {
460 - margin: 2px;
461 - background: white;
462 - padding: 1px;
463 - padding-left: 10px;
464 - padding-right: 10px;
465 - padding-top: 5px;
466 - padding-bottom: 5px;
467 - }
468 -
469 - .announcement p {
470 - font-size: 12px;
471 - margin: 2px;
472 - }
473 -
474 - .pub-info {
475 - text-align: right;
476 - font-style: italic;
477 - font-size: 9px;
478 -
479 - p {
480 - text-align: right;
481 - font-style: italic;
482 - font-size: 9px;
483 - }
484 - }
485 -
486 - .announcement {
487 - .toggles {
488 - font-weight: normal;
489 - float: right;
490 - font-size: 80%;
491 - }
492 -
493 - .announcement-title {
494 - font-weight: bold;
495 - }
496 - }
497 -
498 - div {
499 - &.message {
500 - margin: 10px 0 0;
501 -
502 - div {
503 - &.message {
504 - margin: 0 0 0 30px;
505 - }
506 -
507 - &.body {
508 - border: 2px solid #dddddd;
509 - background: #fff8f8;
510 - padding-left: 5px;
511 - }
512 -
513 - &.reply-body {
514 - border: 2px solid #bbbbbb;
515 - background: #fffff8;
516 - padding-left: 5px;
517 - }
518 -
519 - &.stat {
520 - font-size: 10px;
521 - line-height: 1.75em;
522 - padding: 0 5px;
523 - color: #333333;
524 - background: #dddddd;
525 - font-weight: bold;
526 - }
527 -
528 - &.message div.stat {
529 - font-size: 10px;
530 - line-height: 1.75em;
531 - padding: 0 5px;
532 - color: #444444;
533 - background: #bbbbbb;
534 - font-weight: bold;
535 - }
536 - }
537 - }
538 -
539 - &.contest-title {
540 - color: white;
541 - text-align: center;
542 - line-height: 2em;
543 - }
544 -
545 - &.registration-desc, &.test-desc {
546 - border: 1px dotted gray;
547 - background: #f5f5f5;
548 - padding: 5px;
549 - margin: 10px 0;
550 - font-size: 12px;
551 - line-height: 1.5em;
552 - }
553 - }
554 -
555 - h2.contest-title {
556 - margin-top: 5px;
557 - margin-bottom: 5px;
558 - }
559 -
560 -
561 -
562 - .grader-comment {
563 - word-wrap: break-word;
564 - }
565 -
566 -
567 - golden-btn + .golden-btn { margin-top: 1em; }
568 -
569 - .golden-btn {
570 - display: inline-block;
571 - outline: none;
572 - font-family: inherit;
573 - box-sizing: border-box;
574 - border: none;
575 - box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
576 - inset 0 -2px 5px 1px rgba(139,66,8,1),
577 - inset 0 -1px 1px 3px rgba(250,227,133,1);
578 - background-image: linear-gradient(160deg, #a54e07, #b47e11, #fef1a2, #bc881b, #a54e07) !important;
579 - border: 1px solid #a55d07;
580 - color: rgb(120,50,5);
581 - text-shadow: 0 2px 2px rgba(250, 227, 133, 1);
582 - cursor: pointer;
583 - transition: all .2s ease-in-out;
584 - background-size: 100% 100%;
585 - background-position:center;
586 - }
587 - .golden-btn:focus,
588 - .golden-btn:hover {
589 - background-size: 150% 150%;
590 - box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23),
591 - inset 0 -2px 5px 1px #b17d10,
592 - inset 0 -1px 1px 3px rgba(250,227,133,1);
593 - border: 1px solid rgba(165,93,7,.6);
594 - color: rgba(120,50,5,.8);
595 - }
596 - .golden-btn:active {
597 - box-shadow: 0 3px 6px rgba(0,0,0,.16), 0 3px 6px rgba(110,80,20,.4),
598 - inset 0 -2px 5px 1px #b17d10,
599 - inset 0 -1px 1px 3px rgba(250,227,133,1);
600 - }
@@ -1,31 +1,27
1 // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
1 // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2 //import "@hotwired/turbo-rails"
2 //import "@hotwired/turbo-rails"
3 //import "controllers"
3 //import "controllers"
4 //
4 //
5
5
6 - //import "my_sprocket"
7 - import "pdfmake"
8 - import "pdfmake-vfs"
9 - import "jszip"
10
6
11 //bootstrap
7 //bootstrap
12 import "bootstrap"
8 import "bootstrap"
13 window.bootstrap = bootstrap
9 window.bootstrap = bootstrap
14 - console.log($); // ok
15 - console.log(bootstrap)
16 - console.log(JSZip);
17
10
18 //datatable
11 //datatable
19 //import 'datatables-bundle'
12 //import 'datatables-bundle'
13 + import "pdfmake"
14 + import "pdfmake-vfs"
15 + import "jszip"
20 import "datatables"
16 import "datatables"
21 import "datatables-bs5"
17 import "datatables-bs5"
22 import "datatables-editor"
18 import "datatables-editor"
23 import "datatables-editor-bs5"
19 import "datatables-editor-bs5"
24 import "datatables-autofill"
20 import "datatables-autofill"
25 import "datatables-autofill-bs5"
21 import "datatables-autofill-bs5"
26 import "datatables-button"
22 import "datatables-button"
27 import "datatables-button-bs5"
23 import "datatables-button-bs5"
28 import "datatables-button-colvis"
24 import "datatables-button-colvis"
29 import "datatables-button-html5"
25 import "datatables-button-html5"
30 import "datatables-button-print"
26 import "datatables-button-print"
31 import "datatables-colrecorder"
27 import "datatables-colrecorder"
@@ -40,22 +36,18
40 import "datatables-scroller"
36 import "datatables-scroller"
41 import "datatables-searchbuilder"
37 import "datatables-searchbuilder"
42 import "datatables-searchbuilder-bs5"
38 import "datatables-searchbuilder-bs5"
43 import "datatables-searchpanes"
39 import "datatables-searchpanes"
44 import "datatables-searchpanes-bs5"
40 import "datatables-searchpanes-bs5"
45 import "datatables-select"
41 import "datatables-select"
46 import "datatables-staterestore"
42 import "datatables-staterestore"
47 import "datatables-staterestore-bs5"
43 import "datatables-staterestore-bs5"
48 /* */
44 /* */
49
45
50 import "select2"
46 import "select2"
51
47
52 - //import "ace-rails-ap"
53 - //import "ace/theme-merbivore"
54 - //import "ace/mode-python"
55 -
56 //my own customization
48 //my own customization
57 import 'custom'
49 import 'custom'
58
50
59
51
60 console.log('application.js ready')
52 console.log('application.js ready')
61
53
@@ -1,23 +1,28
1 $(document).on('change', '.btn-file :file', function() {
1 $(document).on('change', '.btn-file :file', function() {
2 var input, label, numFiles;
2 var input, label, numFiles;
3 input = $(this);
3 input = $(this);
4 numFiles = input.get(0).files ? input.get(0).files.length : 1;
4 numFiles = input.get(0).files ? input.get(0).files.length : 1;
5 label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
5 label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
6 input.trigger('fileselect', [numFiles, label]);
6 input.trigger('fileselect', [numFiles, label]);
7 });
7 });
8
8
9 $(function() {
9 $(function() {
10 var e;
10 var e;
11 - $(".select2").select2({});
11 + $(".select2").select2({
12 + theme: "bootstrap-5",
13 + //selectionCssClass: "select2--small",
14 + //dropdownCssClass: "select2--small",
15 + });
16 +
12 $('.btn-file :file').on('fileselect', function(event, numFiles, label) {
17 $('.btn-file :file').on('fileselect', function(event, numFiles, label) {
13 var input, log;
18 var input, log;
14 input = $(this).parents('.input-group').find(':text');
19 input = $(this).parents('.input-group').find(':text');
15 log = numFiles > 1 ? numFiles + ' files selected' : label;
20 log = numFiles > 1 ? numFiles + ' files selected' : label;
16 if (input.length) {
21 if (input.length) {
17 input.val(log);
22 input.val(log);
18 } else {
23 } else {
19 if (log) {
24 if (log) {
20 alert(log);
25 alert(log);
21 }
26 }
22 }
27 }
23 });
28 });
@@ -1,3 +1,3
1 class ApplicationRecord < ActiveRecord::Base
1 class ApplicationRecord < ActiveRecord::Base
2 - self.abstract_class = true
2 + primary_abstract_class
3 end
3 end
@@ -1,13 +1,13
1 - class Submission < ActiveRecord::Base
1 + class Submission < ApplicationRecord
2
2
3 enum tag: {default: 0, model: 1}, _prefix: true
3 enum tag: {default: 0, model: 1}, _prefix: true
4
4
5 belongs_to :language
5 belongs_to :language
6 belongs_to :problem
6 belongs_to :problem
7 belongs_to :user
7 belongs_to :user
8
8
9 before_validation :assign_problem
9 before_validation :assign_problem
10 before_validation :assign_language
10 before_validation :assign_language
11
11
12 validates_presence_of :source
12 validates_presence_of :source
13 validates_length_of :source, :maximum => 100_000, :allow_blank => true, :message => 'code too long, the limit is 100,000 bytes'
13 validates_length_of :source, :maximum => 100_000, :allow_blank => true, :message => 'code too long, the limit is 100,000 bytes'
@@ -82,25 +82,25
82 end
82 end
83 i = i + 1
83 i = i + 1
84 if i==10
84 if i==10
85 return nil
85 return nil
86 end
86 end
87 end
87 end
88 return nil
88 return nil
89 end
89 end
90
90
91 def self.find_language_in_source(source, source_filename="")
91 def self.find_language_in_source(source, source_filename="")
92 langopt = find_option_in_source(/^LANG:/,source)
92 langopt = find_option_in_source(/^LANG:/,source)
93 if langopt
93 if langopt
94 - return (Language.find_by_name(langopt) ||
94 + return (Language.find_by_name(langopt) ||
95 Language.find_by_pretty_name(langopt))
95 Language.find_by_pretty_name(langopt))
96 else
96 else
97 if source_filename
97 if source_filename
98 return Language.find_by_extension(source_filename.split('.').last)
98 return Language.find_by_extension(source_filename.split('.').last)
99 else
99 else
100 return nil
100 return nil
101 end
101 end
102 end
102 end
103 end
103 end
104
104
105 def self.find_problem_in_source(source, source_filename="")
105 def self.find_problem_in_source(source, source_filename="")
106 prob_opt = find_option_in_source(/^TASK:/,source)
106 prob_opt = find_option_in_source(/^TASK:/,source)
@@ -134,32 +134,32
134 self.source_filename)
134 self.source_filename)
135 end
135 end
136 end
136 end
137
137
138 # validation codes
138 # validation codes
139 def must_specify_language
139 def must_specify_language
140 return if self.source==nil
140 return if self.source==nil
141
141
142 # for output_only tasks
142 # for output_only tasks
143 return if self.problem!=nil and self.problem.output_only
143 return if self.problem!=nil and self.problem.output_only
144
144
145 if self.language == nil
145 if self.language == nil
146 - errors.add('source',"Cannot detect language. Did you submit a correct source file?")
146 + errors.add(:source,:invalid,message: "Cannot detect language. Did you submit a correct source file?")
147 end
147 end
148 end
148 end
149
149
150 def must_have_valid_problem
150 def must_have_valid_problem
151 return if self.source==nil
151 return if self.source==nil
152 if self.problem==nil
152 if self.problem==nil
153 - errors.add('problem',"must be specified.")
153 + errors.add(:problem,:blank,'aaa')
154 else
154 else
155 #admin always have right
155 #admin always have right
156 return if self.user.admin?
156 return if self.user.admin?
157
157
158 #check if user has the right to submit the problem
158 #check if user has the right to submit the problem
159 errors[:base] << "Authorization error: you have no right to submit to this problem" if (!self.user.available_problems.include?(self.problem)) and (self.new_record?)
159 errors[:base] << "Authorization error: you have no right to submit to this problem" if (!self.user.available_problems.include?(self.problem)) and (self.new_record?)
160 end
160 end
161 end
161 end
162
162
163 # callbacks
163 # callbacks
164 def assign_latest_number_if_new_recond
164 def assign_latest_number_if_new_recond
165 return if !self.new_record?
165 return if !self.new_record?
@@ -3,24 +3,17
3 %td{:align => "center"}
3 %td{:align => "center"}
4 = submission.number
4 = submission.number
5 %td.text-right
5 %td.text-right
6 = link_to "##{submission.id}", submission_path(submission.id)
6 = link_to "##{submission.id}", submission_path(submission.id)
7 %td
7 %td
8 = l submission.submitted_at, format: :long
8 = l submission.submitted_at, format: :long
9 = "( #{time_ago_in_words(submission.submitted_at)} ago)"
9 = "( #{time_ago_in_words(submission.submitted_at)} ago)"
10 %td
10 %td
11 = submission.source_filename
11 = submission.source_filename
12 = " (#{submission.language.pretty_name}) "
12 = " (#{submission.language.pretty_name}) "
13 = link_to '[load]', download_submission_path(submission)
13 = link_to '[load]', download_submission_path(submission)
14 %td
14 %td
15 - - if submission.graded_at
15 + = render 'submission_short', submission: submission, show_button: false, problem_id: submission&.problem&.id
16 - = "Graded at #{format_short_time(submission.graded_at)}."
17 - %br/
18 - = "Score: #{(submission.points*100/submission.problem.full_score).to_i} " if GraderConfiguration['ui.show_score']
19 - = " ["
20 - %tt
21 - = submission.grader_comment
22 - = "]"
23 %td
16 %td
24 = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message }
17 = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message }
25 %td
18 %td
26 = link_to 'Edit', edit_submission_path(submission.id), class: 'btn btn-success'
19 = link_to 'Edit', edit_submission_path(submission.id), class: 'btn btn-success'
@@ -1,32 +1,33
1 - if submission.nil?
1 - if submission.nil?
2 = "-"
2 = "-"
3 - else
3 - else
4 - %strong= "Submission ID:"
4 + - if local_assigns[:show_id]
5 - = submission.id
5 + .row
6 - %br
6 + .col-3.text-secondary
7 + Sub ID:
8 + %strong.col-9= submission.id
7 - unless submission.graded_at
9 - unless submission.graded_at
8 - %strong= t 'main.submitted_at:'
10 + .row
9 - = format_full_time_ago(submission.submitted_at.localtime)
11 + .col-3.text-secondary= t 'main.submitted_at'
12 + %strong.col-9= format_full_time_ago(submission.submitted_at.localtime)
10 - else
13 - else
11 - %strong= t 'main.graded_at:'
14 + .row
12 - = format_full_time_ago(submission.graded_at.localtime)
15 + .col-3.text-secondary= t 'main.graded_at'
13 - %br
16 + %strong.col-9= format_full_time_ago(submission.graded_at.localtime)
14 - if GraderConfiguration['ui.show_score']
17 - if GraderConfiguration['ui.show_score']
15 - %strong=t 'main.score'
18 + .row
16 - = "#{(submission.points*100/submission.problem.full_score).to_i} "
19 + .col-3.text-secondary=t 'main.score'
17 - = " ["
20 + %strong.col-9
18 - %tt
21 + = (submission.points*100/submission.problem.full_score).to_i
19 - = submission.grader_comment
22 + %tt.grader-comment
20 - = "]"
23 + = " [#{submission.grader_comment}]"
21 - %br
24 + - if local_assigns[:show_button]
22 - %strong View:
25 + - if submission.graded_at
23 - - if GraderConfiguration.show_grading_result
26 + - if GraderConfiguration.show_grading_result
24 - = link_to '[detailed result]', :action => 'result', :id => submission.id
27 + = link_to '[detailed result]', :action => 'result', :id => submission.id
25 - - if submission.graded_at
28 + = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-sm btn-info'}
26 - = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-xs btn-info'}
29 + = link_to "#{t 'main.src_link'}",download_submission_path(submission), class: 'btn btn-sm btn-info'
27 - -#
30 + = link_to "#{t 'main.submissions_link'}", problem_submissions_path(submission.problem.id), class: 'btn btn-sm btn-info'
28 - %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
31 + - if GraderConfiguration.show_testcase
29 - =t 'main.cmp_msg'
32 + = link_to "testcases", show_problem_testcases_path(submission.problem.id), class: 'btn btn-sm btn-info'
30 - = link_to "#{t 'main.src_link'}", download_submission_path(submission.id), class: 'btn btn-xs btn-info'
31 - = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info'
32
33
@@ -5,21 +5,23
5 = stylesheet_link_tag "application", params[:controller], :media => "all"
5 = stylesheet_link_tag "application", params[:controller], :media => "all"
6 = csrf_meta_tags
6 = csrf_meta_tags
7 = csp_meta_tag
7 = csp_meta_tag
8 = javascript_include_tag :my_app
8 = javascript_include_tag :my_app
9 -# = javascript_import_module_tag('prepend_jquery')
9 -# = javascript_import_module_tag('prepend_jquery')
10 = javascript_importmap_tags
10 = javascript_importmap_tags
11 = content_for :header
11 = content_for :header
12 = yield :head
12 = yield :head
13 -# %link{href:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css",rel:"stylesheet",integrity:"sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT",crossorigin:"anonymous"}
13 -# %link{href:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/css/bootstrap.min.css",rel:"stylesheet",integrity:"sha384-iYQeCzEYFbKjA/T2uDLTpkwGzCiq6soy8tYaI1GyVh/UjpbCx/TYkiZhlZB6+fzT",crossorigin:"anonymous"}
14 -# %script{src:"https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js",integrity:"sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3",crossorigin:"anonymous"}
14 -# %script{src:"https://cdn.jsdelivr.net/npm/@popperjs/core@2.11.6/dist/umd/popper.min.js",integrity:"sha384-oBqDVmMz9ATKxIep9tiCxS/Z9fNfEXiDAYTujMAeBAsjFuCZSmKbSSUnQlmh/jp3",crossorigin:"anonymous"}
15 -# %script{src:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js",integrity:"sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz",crossorigin:"anonymous"}
15 -# %script{src:"https://cdn.jsdelivr.net/npm/bootstrap@5.2.1/dist/js/bootstrap.bundle.min.js",integrity:"sha384-7VPbUDkoPSGFnVtYi0QogXtr74QeVeeIs99Qfg5YCF+TidwNdjvaKZX19NZ/e6oz",crossorigin:"anonymous"}
16
16
17 -
17 + <link rel="preconnect" href="https://fonts.googleapis.com">
18 + <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
19 + <link href="https://fonts.googleapis.com/css2?family=Bai+Jamjuree:ital@0;1&family=Krub:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&family=Sarabun:ital,wght@0,200;0,400;0,600;1,200;1,400;1,600&display=swap" rel="stylesheet">
18
20
19 %body
21 %body
20 - unless local_assigns[:skip_header]
22 - unless local_assigns[:skip_header]
21 = render 'layouts/header'
23 = render 'layouts/header'
22
24
23 /= content_tag(:p,flash[:notice],class: 'alert alert-success') if flash[:notice]!=nil
25 /= content_tag(:p,flash[:notice],class: 'alert alert-success') if flash[:notice]!=nil
24 = flash_messages
26 = flash_messages
25 = yield
27 = yield
@@ -1,17 +1,18
1 - .card-body
1 + %li.list-group-item
2 .card-title
2 .card-title
3 - = announcement.title
3 + %h1
4 - - if @current_user and @current_user.admin?
4 + = announcement.title
5 - = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
5 + - if @current_user and @current_user.admin?
6 + = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-sm btn-outline-secondary'
6 .card-subtitle
7 .card-subtitle
7 = "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
8 = "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
8 .card-text
9 .card-text
9 = markdown(announcement.body)
10 = markdown(announcement.body)
10
11
11
12
12 -#
13 -#
13 %li.list-group-item
14 %li.list-group-item
14 %strong
15 %strong
15 - if @current_user and @current_user.admin?
16 - if @current_user and @current_user.admin?
16 = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
17 = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
17 %small= "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
18 %small= "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
@@ -4,19 +4,19
4 = link_to problem.name, stat_problem_path(problem)
4 = link_to problem.name, stat_problem_path(problem)
5 - else
5 - else
6 = "#{problem.name}"
6 = "#{problem.name}"
7 %td
7 %td
8 = "#{problem.full_name}"
8 = "#{problem.full_name}"
9
9
10 %br
10 %br
11 = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem
11 = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem
12 %td
12 %td
13 = @prob_submissions[problem.id][:count]
13 = @prob_submissions[problem.id][:count]
14 -#= link_to "[subs]", main_submission_path(problem.id)
14 -#= link_to "[subs]", main_submission_path(problem.id)
15 %td
15 %td
16 - = render :partial => 'submission_short',
16 + = render partial: 'submission_short',
17 - :locals => {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id }
17 + locals: {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id, show_button: true }
18 %td
18 %td
19 - if @prob_submissions[problem.id][:submission]
19 - if @prob_submissions[problem.id][:submission]
20 = link_to 'Edit', edit_submission_path(@prob_submissions[problem.id][:submission]), class: 'btn btn-success'
20 = link_to 'Edit', edit_submission_path(@prob_submissions[problem.id][:submission]), class: 'btn btn-success'
21 - else
21 - else
22 = link_to 'New', direct_edit_problem_submissions_path(problem.id), class: 'btn btn-success'
22 = link_to 'New', direct_edit_problem_submissions_path(problem.id), class: 'btn btn-success'
@@ -38,31 +38,31
38 %table.info
38 %table.info
39 %tr.info-head
39 %tr.info-head
40 %th Task name
40 %th Task name
41 %th Full name
41 %th Full name
42 %th # of sub(s)
42 %th # of sub(s)
43 %th Results
43 %th Results
44 %th
44 %th
45 = render :partial => 'problem', :collection => cp[:problems]
45 = render :partial => 'problem', :collection => cp[:problems]
46 .col-md-5
46 .col-md-5
47 .card
47 .card
48 .card-header
48 .card-header
49 Announcement
49 Announcement
50 - = link_to 'Manage', announcements_path, class: 'btn btn-small'
50 + = link_to 'Manage', announcements_path, class: 'btn btn-secondary btn-sm'
51 - .card-body
51 + %ul.list-group.list-group-flush
52 = render :partial => 'announcement', :collection => @announcements
52 = render :partial => 'announcement', :collection => @announcements
53 -
53 + -#
54 - %script{:type => 'text/javascript'}
54 + %script{:type => 'text/javascript'}
55 - = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
55 + = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';".html_safe
56 - Announcement.registerRefreshEventTimer();
56 + Announcement.registerRefreshEventTimer();
57
57
58 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
58 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
59 .modal-dialog.modal-lg{role:'document'}
59 .modal-dialog.modal-lg{role:'document'}
60 .modal-content
60 .modal-content
61 .modal-header
61 .modal-header
62 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
62 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
63 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
63 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
64 %h4 Compiler message
64 %h4 Compiler message
65 .modal-body
65 .modal-body
66 %pre#compiler_msg
66 %pre#compiler_msg
67 .modal-footer
67 .modal-footer
68 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
68 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
@@ -1,4 +1,4
1 :plain
1 :plain
2 $("#compiler_msg").html("#{j @submission.compiler_message}");
2 $("#compiler_msg").html("#{j @submission.compiler_message}");
3 - $("#compiler").modal();
3 + $("#compiler").modal('show');
4
4
@@ -3,86 +3,118
3 .row
3 .row
4 .col-md-12
4 .col-md-12
5 %h2 Live submit
5 %h2 Live submit
6
6
7 .row
7 .row
8 .col-md-12
8 .col-md-12
9 .alert.alert-info
9 .alert.alert-info
10 Write your code in the following box, choose language, and click submit button when finished
10 Write your code in the following box, choose language, and click submit button when finished
11 .row
11 .row
12 .col-md-8
12 .col-md-8
13 %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'}
13 %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'}
14 .col-md-4
14 .col-md-4
15 - - # submission form
15 + -# submission form
16 - = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do
16 + .card.mb-3
17 -
17 + .card-header
18 - = hidden_field_tag 'editor_text', @source
18 + Submission
19 - = hidden_field_tag 'submission[problem_id]', @problem.id
19 + .card-body
20 - .form-group
20 + = form_with url: submit_main_path, :multipart => true, class: 'form' do |form|
21 - = label_tag "Task:"
21 + = hidden_field_tag 'editor_text', @source
22 - = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
22 + = hidden_field_tag 'submission[problem_id]', @problem.id
23 - .form-group
23 + .row.mb-2
24 - = label_tag "Description:"
24 + .col-md-4
25 - = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem
25 + = form.label "Task", class: 'col-form-label text-secondary'
26 + .col-md-8
27 + = form.label nil, "#{@problem.long_name}", class: 'col-form-label fw-bold'
28 + .row.mb-2
29 + .col-md-4
30 + = form.label "Description", class: 'col-form-label text-secondary'
31 + .col-md-8
32 + = link_to_description_if_any "[download] <span class='mi'>description</span>".html_safe, @problem
33 + .row.mb-2
34 + .col-md-4
35 + = form.label :language_id, 'Language', class: 'col-form-label text-secondary'
36 + .col-md-8
37 + = form.select :language_id, options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || @current_user.default_language || Language.find_by_pretty_name("Python").id || Language.first.id), {}, class: 'form-select', style: "width: 100px", id: 'language_id'
38 + .row.mb-2
39 + .col-12
40 + = form.file_field :load_file, class: 'form-control', id: 'load_file'
41 + .row.mb-2
42 + .col-12
43 + = submit_tag 'Submit', class: 'btn ' + (@submission && @submission.number >= 100 ? 'golden-btn' : 'btn-success'), id: 'live_submit',
44 + data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
26
45
27 - .form-group
46 + -# latest submission status
28 - = label_tag 'Language:'
47 + .card
29 - = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || @current_user.default_language || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px"
48 + .card-header.text-bg-info.border-info
30 - .form-group
31 - .input-group
32 - %span.input-group-btn
33 - %span.btn.btn-default.btn-file
34 - Browse
35 - = file_field_tag 'load_file'
36 - = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
37 - .form-group
38 - = submit_tag 'Submit', class: 'btn ' + (@submission && @submission.number >= 100 ? 'golden-btn' : 'btn-success'), id: 'live_submit',
39 - data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
40 - - # latest submission status
41 - .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
42 - .panel-heading
43 Latest Submission Status
49 Latest Submission Status
44 - = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
50 + = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), id: 'refresh', class: "btn btn-light btn-sm", remote: true if @submission
45 - .panel-body
51 + .card-body
46 - %div#latest_status
52 + #latest_status
47 - - if @submission
48 - = render :partial => 'submission_short',
49 - :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
50
53
51 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
54 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
52 .modal-dialog.modal-lg{role:'document'}
55 .modal-dialog.modal-lg{role:'document'}
53 .modal-content
56 .modal-content
54 .modal-header
57 .modal-header
55 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
58 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
56 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
59 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
57 %h4 Compiler message
60 %h4 Compiler message
58 .modal-body
61 .modal-body
59 %pre#compiler_msg
62 %pre#compiler_msg
60 - if @submission
63 - if @submission
61 = @submission.compiler_message
64 = @submission.compiler_message
62 .modal-footer
65 .modal-footer
63 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
66 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
64
67
65 :javascript
68 :javascript
66 $(document).ready(function() {
69 $(document).ready(function() {
67 - e = ace.edit("editor")
70 + var e = ace.edit("editor")
68 e.setValue($("#text_sourcecode").val());
71 e.setValue($("#text_sourcecode").val());
69 e.gotoLine(1);
72 e.gotoLine(1);
70 $("#language_id").trigger('change');
73 $("#language_id").trigger('change');
71
74
72 $("#load_file").on('change',function(evt) {
75 $("#load_file").on('change',function(evt) {
73 var file = evt.target.files[0];
76 var file = evt.target.files[0];
74 var reader = new FileReader();
77 var reader = new FileReader();
75 reader.onload = function(theFile) {
78 reader.onload = function(theFile) {
76 var e = ace.edit("editor")
79 var e = ace.edit("editor")
77 e.setValue(theFile.target.result);
80 e.setValue(theFile.target.result);
78 e.gotoLine(1);
81 e.gotoLine(1);
79 };
82 };
80 reader.readAsText(file)
83 reader.readAsText(file)
81 });
84 });
82
85
86 + $("#live_submit").on("click", function(event) {
87 + $("#editor_text").val(e.getValue());
88 + });
89 +
90 + $("#language_id").on("change", function(event) {
91 + text = $("#language_id option:selected").text();
92 + mode = 'ace/mode/c_cpp';
93 + switch (text) {
94 + case 'Pascal':
95 + mode = 'ace/mode/pascal';
96 + break;
97 + case 'C++':
98 + case 'C':
99 + mode = 'ace/mode/c_cpp';
100 + break;
101 + case 'Ruby':
102 + mode = 'ace/mode/ruby';
103 + break;
104 + case 'Python':
105 + mode = 'ace/mode/python';
106 + break;
107 + case 'Java':
108 + mode = 'ace/mode/java';
109 + }
110 + e.getSession().setMode(mode);
111 + });
112 +
83 //brython();
113 //brython();
114 + $('#refresh').click()
115 +
84 });
116 });
85
117
86
118
87
119
88
120
@@ -1,2 +1,2
1 :plain
1 :plain
2 - $("#latest_status").html("#{j render({partial: 'submission_short', locals: {submission: @submission, problem_name: @problem.name, problem_id: @problem.id}})}")
2 + $("#latest_status").html("#{j render({partial: 'submission_short', locals: {submission: @submission, show_id: true, show_button: true } })}")
@@ -1,23 +1,25
1 - .panel.panel-info
1 + .card.border-info.mb-2
2 - .panel-heading
2 + .card-header.text-bg-info.border-info
3 Select Problems
3 Select Problems
4 - .panel-body
4 + .card-body
5 - .form-inline
5 + .row
6 - = select 'submission',
6 + .col-6
7 - 'problem_id',
7 + = select 'submission',
8 - @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_submissions_url(p.id)]},
8 + 'problem_id',
9 - { selected: (@problem ? problem_submissions_url(@problem) : -1) },
9 + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_submissions_url(p.id)]},
10 - { class: 'select2 form-control'}
10 + { selected: (@problem ? problem_submissions_url(@problem) : -1) },
11 - %button.btn.btn-primary.btn-sm.go-button#problem_go{data: {source: '#submission_problem_id'}} Go
11 + { class: 'select2 form-control'}
12 + .col-6
13 + %a.btn.btn-primary.go-button#problem_go{data: {source: '#submission_problem_id'}} Go
12
14
13 - if @problem!=nil
15 - if @problem!=nil
14 %h2= "Task: #{@problem.full_name} (#{@problem.name})"
16 %h2= "Task: #{@problem.full_name} (#{@problem.name})"
15
17
16 - if @submissions!=nil
18 - if @submissions!=nil
17 - if @submissions.length>0
19 - if @submissions.length>0
18 %table.table
20 %table.table
19 %thead
21 %thead
20 %th No.
22 %th No.
21 %th.text-right #
23 %th.text-right #
22 %th At
24 %th At
23 %th Source
25 %th Source
@@ -78,50 +78,50
78 %tr
78 %tr
79 %td.text-right
79 %td.text-right
80 %strong Runtime (s)
80 %strong Runtime (s)
81 %td #{@submission.max_runtime}
81 %td #{@submission.max_runtime}
82 %tr
82 %tr
83 %td.text-right
83 %td.text-right
84 %strong Memory (kb)
84 %strong Memory (kb)
85 %td #{@submission.peak_memory}
85 %td #{@submission.peak_memory}
86 %tr
86 %tr
87 %td.text-right
87 %td.text-right
88 %strong Compiler result
88 %strong Compiler result
89 %td
89 %td
90 - %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
90 + %button.btn.btn-info.btn-sm{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
91 view
91 view
92 %tr
92 %tr
93 %td.text-right
93 %td.text-right
94 %strong Grading Task Status
94 %strong Grading Task Status
95 %td
95 %td
96 = @task.status_str if @task
96 = @task.status_str if @task
97 - if @current_user.admin?
97 - if @current_user.admin?
98 - = link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-xs'
98 + = link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-sm'
99 - if @current_user.has_role?('ta')
99 - if @current_user.has_role?('ta')
100 %tr
100 %tr
101 %td.text-right
101 %td.text-right
102 %strong IP
102 %strong IP
103 %td #{@submission.ip_address}
103 %td #{@submission.ip_address}
104 %tr
104 %tr
105 %td.text-right
105 %td.text-right
106 %strong Model solution
106 %strong Model solution
107 %td
107 %td
108 - if @submission.tag_model?
108 - if @submission.tag_model?
109 YES
109 YES
110 - if @current_user.has_role?('ta')
110 - if @current_user.has_role?('ta')
111 - = link_to "remove model status", set_tag_submission_path(@submission, tag: :default), class: 'btn btn-warning btn-xs'
111 + = link_to "remove model status", set_tag_submission_path(@submission, tag: :default), class: 'btn btn-warning btn-sm'
112 - else
112 - else
113 No
113 No
114 - if @current_user.has_role?('ta')
114 - if @current_user.has_role?('ta')
115 - = link_to "set as model solution", set_tag_submission_path(@submission, tag: :model), class: 'btn btn-success btn-xs'
115 + = link_to "set as model solution", set_tag_submission_path(@submission, tag: :model), class: 'btn btn-success btn-sm'
116
116
117
117
118 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
118 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
119 .modal-dialog.modal-lg{role:'document'}
119 .modal-dialog.modal-lg{role:'document'}
120 .modal-content
120 .modal-content
121 .modal-header
121 .modal-header
122 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
122 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
123 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
123 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
124 %h4 Compiler message
124 %h4 Compiler message
125 .modal-body
125 .modal-body
126 %pre#compiler_msg= @submission.compiler_message
126 %pre#compiler_msg= @submission.compiler_message
127 .modal-footer
127 .modal-footer
@@ -1,21 +1,22
1 # Pin npm packages by running ./bin/importmap
1 # Pin npm packages by running ./bin/importmap
2
2
3 #entry point
3 #entry point
4 pin "application"
4 pin "application"
5 pin "prepend_jquery"
5 pin "prepend_jquery"
6 pin "my_sprocket"
6 pin "my_sprocket"
7 pin_all_from "app/javascript/controllers", under: "controllers"
7 pin_all_from "app/javascript/controllers", under: "controllers"
8
8
9 - pin "jquery", to: 'jquery.js', preload: true
9 + #we don't need jquery in importmap because we use sprocket version
10 + #pin "jquery", to: 'jquery.js', preload: true
10 pin "bootstrap", to: "bootstrap.bundle.min.js", preload: true
11 pin "bootstrap", to: "bootstrap.bundle.min.js", preload: true
11 #no need popper, because bundled already in bootstrap
12 #no need popper, because bundled already in bootstrap
12 #pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js"
13 #pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js"
13
14
14 # datatable
15 # datatable
15 # I have to fix vfs_font.js for this to work
16 # I have to fix vfs_font.js for this to work
16 pin "jszip", to: "jszip.min.js"
17 pin "jszip", to: "jszip.min.js"
17 pin "pdfmake"
18 pin "pdfmake"
18 pin "pdfmake-vfs", to: 'datatables/pdfmake-0.1.36/vfs_fonts.js'
19 pin "pdfmake-vfs", to: 'datatables/pdfmake-0.1.36/vfs_fonts.js'
19
20
20 pin "datatables-bundle", to: 'datatables/datatables.js'
21 pin "datatables-bundle", to: 'datatables/datatables.js'
21 pin "datatables", to: "datatables/DataTables-1.12.1/js/jquery.dataTables.js"
22 pin "datatables", to: "datatables/DataTables-1.12.1/js/jquery.dataTables.js"
@@ -1,25 +1,25
1 # Be sure to restart your server when you modify this file.
1 # Be sure to restart your server when you modify this file.
2 #
2 #
3 # This file contains migration options to ease your Rails 5.0 upgrade.
3 # This file contains migration options to ease your Rails 5.0 upgrade.
4 #
4 #
5 # Once upgraded flip defaults one by one to migrate to the new default.
5 # Once upgraded flip defaults one by one to migrate to the new default.
6 #
6 #
7 # Read the Guide for Upgrading Ruby on Rails for more info on each option.
7 # Read the Guide for Upgrading Ruby on Rails for more info on each option.
8
8
9 - Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
9 + #Rails.application.config.action_controller.raise_on_unfiltered_parameters = true
10
10
11 # Enable per-form CSRF tokens. Previous versions had false.
11 # Enable per-form CSRF tokens. Previous versions had false.
12 - Rails.application.config.action_controller.per_form_csrf_tokens = false
12 + #Rails.application.config.action_controller.per_form_csrf_tokens = false
13
13
14 # Enable origin-checking CSRF mitigation. Previous versions had false.
14 # Enable origin-checking CSRF mitigation. Previous versions had false.
15 - Rails.application.config.action_controller.forgery_protection_origin_check = false
15 + #Rails.application.config.action_controller.forgery_protection_origin_check = false
16
16
17 # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
17 # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
18 # Previous versions had false.
18 # Previous versions had false.
19 - ActiveSupport.to_time_preserves_timezone = false
19 + #ActiveSupport.to_time_preserves_timezone = false
20
20
21 # Require `belongs_to` associations by default. Previous versions had false.
21 # Require `belongs_to` associations by default. Previous versions had false.
22 - Rails.application.config.active_record.belongs_to_required_by_default = false
22 + #Rails.application.config.active_record.belongs_to_required_by_default = false
23
23
24 # Do not halt callback chains when a callback returns false. Previous versions had true.
24 # Do not halt callback chains when a callback returns false. Previous versions had true.
25 # ActiveSupport.halt_callback_chains_on_return_false = true
25 # ActiveSupport.halt_callback_chains_on_return_false = true
@@ -33,28 +33,29
33 login:
33 login:
34 message: 'Please login to see the problem list'
34 message: 'Please login to see the problem list'
35 login_submit: 'Login'
35 login_submit: 'Login'
36 participation: 'Want to participate?'
36 participation: 'Want to participate?'
37 please: 'Please'
37 please: 'Please'
38 register: 'register'
38 register: 'register'
39 forget_password: 'Forget password?'
39 forget_password: 'Forget password?'
40
40
41 main:
41 main:
42 start_soon: "The contest at your site will start soon. Please wait."
42 start_soon: "The contest at your site will start soon. Please wait."
43 specified_in_header: "Specified in header"
43 specified_in_header: "Specified in header"
44
44
45 - problem_desc: "desc"
45 + problem_desc: desc
46 - submitted_at: "Submitted at"
46 + submission_id: Sub ID
47 - graded_at: "Graded at"
47 + submitted_at: Submitted
48 - score: "score: "
48 + graded_at: Graded
49 + score: score
49 cmp_msg: "compiler msg"
50 cmp_msg: "compiler msg"
50 src_link: "src"
51 src_link: "src"
51 submissions_link: "submissions"
52 submissions_link: "submissions"
52
53
53 confirm_contest_start:
54 confirm_contest_start:
54 box_title: "Contest confirmation"
55 box_title: "Contest confirmation"
55 contest_list: "You will participate in contest:"
56 contest_list: "You will participate in contest:"
56 timer_starts_after_click: "The timer will start after you click the start button."
57 timer_starts_after_click: "The timer will start after you click the start button."
57 start_button: "Start!"
58 start_button: "Start!"
58 start_button_confirm: "Are you sure?"
59 start_button_confirm: "Are you sure?"
59
60
60 test:
61 test:
deleted file
deleted file
deleted file
deleted file
You need to be logged in to leave comments. Login now