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 + }
@@ -1,35 +1,37
1 1 # See http://help.github.com/ignore-files/ for more about ignoring files.
2 2 #
3 3 # If you find yourself ignoring temporary files generated by your text editor
4 4 # or operating system, you probably want to add a global ignore instead:
5 5 # git config --global core.excludesfile ~/.gitignore_global
6 6
7 7 # Ignore bundler config
8 8 /.bundle
9 9
10 10 # Ignore the default SQLite database.
11 11 /db/*.sqlite3
12 12
13 13 # Ignore all logfiles and tempfiles.
14 14 /log/*.log
15 15 /tmp
16 16
17 17 *~
18 18
19 19 /vendor/plugins/rails_upgrade
20 20
21 21 #ignore public assets???
22 22 /public/assets
23 23 /public
24 24
25 25 /data
26 26
27 27 #ignore .orig and .swp
28 28 *.orig
29 29 *.swp
30 30
31 31 #ignore rvm setting file
32 32 #.ruby-gemset
33 33 #.ruby-version
34 34
35 35 /config/secrets.yml
36 +
37 + /.byebug_history
@@ -9,119 +9,119
9 9 # The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
10 10 gem "sprockets-rails"
11 11
12 12 gem 'activerecord-session_store'
13 13 gem 'puma'
14 14
15 15 # Reduces boot times through caching; required in config/boot.rb
16 16 gem 'bootsnap', require: false
17 17
18 18 # Bundle edge Rails instead:
19 19 # gem 'rails', :git => 'git://github.com/rails/rails.git'
20 20
21 21 #---------------- database ---------------------
22 22 #the database
23 23 gem 'mysql2'
24 24 #for testing
25 25 gem 'sqlite3'
26 26 #gem 'rails-controller-testing'
27 27 #for dumping database into yaml
28 28 #gem 'yaml_db'
29 29
30 30
31 31 #------------- assset pipeline -----------------
32 32 # Gems used only for assets and not required
33 33 # in production environments by default.
34 34 #sass-rails is depricated
35 35 #gem 'sass-rails'
36 36 gem 'sassc-rails'
37 37 gem 'coffee-rails'
38 38 gem 'material_icons'
39 39
40 40 # See https://github.com/sstephenson/execjs#readme for more supported runtimes
41 41 # gem 'therubyracer', :platforms => :ruby
42 42
43 43 gem "importmap-rails", "~> 1.1"
44 44 # gem 'uglifier'
45 45
46 46 gem 'haml'
47 47 gem 'haml-rails'
48 48
49 49 # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks
50 50 #gem 'turbolinks', '~> 5'
51 51 # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
52 52 gem 'jbuilder'
53 53
54 54
55 55 #in-place editor
56 56 gem 'best_in_place', git: "https://github.com/mmotherwell/best_in_place"
57 57
58 58 # jquery addition
59 59 gem 'jquery-rails'
60 60 #gem 'jquery-ui-rails'
61 61 #gem 'jquery-timepicker-addon-rails'
62 62 #gem 'jquery-tablesorter'
63 63 #gem 'jquery-countdown-rails'
64 64
65 65 #syntax highlighter
66 66 gem 'rouge'
67 67
68 68 #bootstrap add-ons
69 69 #gem 'bootstrap-sass', '~> 3.4.1'
70 70 gem 'bootstrap', '~> 5.2'
71 71 #gem 'bootstrap-switch-rails'
72 72 #gem 'bootstrap-toggle-rails'
73 73 #gem 'autoprefixer-rails'
74 74 gem 'momentjs-rails'
75 75 #gem 'rails_bootstrap_sortable'
76 76 #gem 'bootstrap-datepicker-rails'
77 77 #gem 'bootstrap3-datetimepicker-rails', '~> 4.17.47'
78 78 #gem 'jquery-datatables-rails'
79 79
80 80 #----------- user interface -----------------
81 81 gem 'simple_form'
82 82 #select 2
83 83 #gem 'select2-rails'
84 84 #ace editor
85 85 gem 'ace-rails-ap'
86 86 #paginator
87 87 #gem 'will_paginate', '~> 3.0.7'
88 88
89 89 gem 'mail'
90 90 gem 'rdiscount'
91 91 gem 'dynamic_form'
92 92 gem 'in_place_editing'
93 93 #gem 'verification', :git => 'https://github.com/sikachu/verification.git'
94 94
95 95
96 96 #---------------- testiing -----------------------
97 97 gem 'minitest-reporters'
98 98
99 99 #---------------- for console --------------------
100 100 gem 'fuzzy-string-match'
101 101
102 102
103 103 group :development, :test do
104 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 106 end
107 107
108 108 group :development do
109 109 # Access an interactive console on exception pages or by calling 'console' anywhere in the code.
110 110 gem 'web-console', '>= 3.3.0'
111 111 gem 'listen', '>= 3.0.5', '< 3.2'
112 112 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
113 113 gem 'spring'
114 114 gem 'spring-watcher-listen', '~> 2.0.0'
115 115
116 116 # Add speed badges [https://github.com/MiniProfiler/rack-mini-profiler]
117 117 # gem "rack-mini-profiler"
118 118 end
119 119
120 120 group :test do
121 121 # Adds support for Capybara system testing and selenium driver
122 122 gem 'capybara'
123 123 gem 'selenium-webdriver'
124 124 gem 'webdrivers'
125 125 end
126 126
127 127
@@ -1,353 +1,342
1 1 GIT
2 2 remote: https://github.com/mmotherwell/best_in_place
3 3 revision: 88eb3052623a9a6cd346864d2aca05021c2f80d0
4 4 specs:
5 5 best_in_place (3.1.1)
6 6 actionpack (>= 3.2)
7 7 railties (>= 3.2)
8 8
9 9 GEM
10 10 remote: https://rubygems.org/
11 11 specs:
12 12 RubyInline (3.12.6)
13 13 ZenTest (~> 4.3)
14 14 ZenTest (4.12.1)
15 15 ace-rails-ap (4.4)
16 16 actioncable (7.0.4)
17 17 actionpack (= 7.0.4)
18 18 activesupport (= 7.0.4)
19 19 nio4r (~> 2.0)
20 20 websocket-driver (>= 0.6.1)
21 21 actionmailbox (7.0.4)
22 22 actionpack (= 7.0.4)
23 23 activejob (= 7.0.4)
24 24 activerecord (= 7.0.4)
25 25 activestorage (= 7.0.4)
26 26 activesupport (= 7.0.4)
27 27 mail (>= 2.7.1)
28 28 net-imap
29 29 net-pop
30 30 net-smtp
31 31 actionmailer (7.0.4)
32 32 actionpack (= 7.0.4)
33 33 actionview (= 7.0.4)
34 34 activejob (= 7.0.4)
35 35 activesupport (= 7.0.4)
36 36 mail (~> 2.5, >= 2.5.4)
37 37 net-imap
38 38 net-pop
39 39 net-smtp
40 40 rails-dom-testing (~> 2.0)
41 41 actionpack (7.0.4)
42 42 actionview (= 7.0.4)
43 43 activesupport (= 7.0.4)
44 44 rack (~> 2.0, >= 2.2.0)
45 45 rack-test (>= 0.6.3)
46 46 rails-dom-testing (~> 2.0)
47 47 rails-html-sanitizer (~> 1.0, >= 1.2.0)
48 48 actiontext (7.0.4)
49 49 actionpack (= 7.0.4)
50 50 activerecord (= 7.0.4)
51 51 activestorage (= 7.0.4)
52 52 activesupport (= 7.0.4)
53 53 globalid (>= 0.6.0)
54 54 nokogiri (>= 1.8.5)
55 55 actionview (7.0.4)
56 56 activesupport (= 7.0.4)
57 57 builder (~> 3.1)
58 58 erubi (~> 1.4)
59 59 rails-dom-testing (~> 2.0)
60 60 rails-html-sanitizer (~> 1.1, >= 1.2.0)
61 61 activejob (7.0.4)
62 62 activesupport (= 7.0.4)
63 63 globalid (>= 0.3.6)
64 64 activemodel (7.0.4)
65 65 activesupport (= 7.0.4)
66 66 activerecord (7.0.4)
67 67 activemodel (= 7.0.4)
68 68 activesupport (= 7.0.4)
69 69 activerecord-session_store (2.0.0)
70 70 actionpack (>= 5.2.4.1)
71 71 activerecord (>= 5.2.4.1)
72 72 multi_json (~> 1.11, >= 1.11.2)
73 73 rack (>= 2.0.8, < 3)
74 74 railties (>= 5.2.4.1)
75 75 activestorage (7.0.4)
76 76 actionpack (= 7.0.4)
77 77 activejob (= 7.0.4)
78 78 activerecord (= 7.0.4)
79 79 activesupport (= 7.0.4)
80 80 marcel (~> 1.0)
81 81 mini_mime (>= 1.1.0)
82 82 activesupport (7.0.4)
83 83 concurrent-ruby (~> 1.0, >= 1.0.2)
84 84 i18n (>= 1.6, < 2)
85 85 minitest (>= 5.1)
86 86 tzinfo (~> 2.0)
87 87 addressable (2.8.1)
88 88 public_suffix (>= 2.0.2, < 6.0)
89 89 ansi (1.5.0)
90 90 autoprefixer-rails (10.4.7.0)
91 91 execjs (~> 2)
92 92 bindex (0.8.1)
93 93 bootsnap (1.13.0)
94 94 msgpack (~> 1.2)
95 - bootstrap (5.2.0)
95 + bootstrap (5.2.1)
96 96 autoprefixer-rails (>= 9.1.0)
97 - popper_js (>= 2.11.5, < 3)
97 + popper_js (>= 2.11.6, < 3)
98 98 sassc-rails (>= 2.0.0)
99 99 builder (3.2.4)
100 + byebug (11.1.3)
100 101 capybara (3.37.1)
101 102 addressable
102 103 matrix
103 104 mini_mime (>= 0.1.3)
104 105 nokogiri (~> 1.8)
105 106 rack (>= 1.6.0)
106 107 rack-test (>= 0.6.3)
107 108 regexp_parser (>= 1.5, < 3.0)
108 109 xpath (~> 3.2)
109 110 childprocess (4.1.0)
110 111 coffee-rails (5.0.0)
111 112 coffee-script (>= 2.2.0)
112 113 railties (>= 5.2.0)
113 114 coffee-script (2.4.1)
114 115 coffee-script-source
115 116 execjs
116 117 coffee-script-source (1.12.2)
117 118 concurrent-ruby (1.1.10)
118 119 crass (1.0.6)
119 - debug (1.6.2)
120 - irb (>= 1.3.6)
121 - reline (>= 0.3.1)
122 120 digest (3.1.0)
123 121 dynamic_form (1.1.4)
124 122 erubi (1.11.0)
125 123 erubis (2.7.0)
126 124 execjs (2.8.1)
127 125 ffi (1.15.5)
128 126 fuzzy-string-match (1.0.1)
129 127 RubyInline (>= 3.8.6)
130 128 globalid (1.0.0)
131 129 activesupport (>= 5.0)
132 130 haml (5.2.2)
133 131 temple (>= 0.8.0)
134 132 tilt
135 133 haml-rails (2.0.1)
136 134 actionpack (>= 5.1)
137 135 activesupport (>= 5.1)
138 136 haml (>= 4.0.6, < 6.0)
139 137 html2haml (>= 1.0.1)
140 138 railties (>= 5.1)
141 139 html2haml (2.2.0)
142 140 erubis (~> 2.7.0)
143 141 haml (>= 4.0, < 6)
144 142 nokogiri (>= 1.6.0)
145 143 ruby_parser (~> 3.5)
146 144 i18n (1.12.0)
147 145 concurrent-ruby (~> 1.0)
148 146 importmap-rails (1.1.5)
149 147 actionpack (>= 6.0.0)
150 148 railties (>= 6.0.0)
151 149 in_place_editing (1.2.0)
152 - io-console (0.5.11)
153 - irb (1.4.1)
154 - reline (>= 0.3.0)
155 150 jbuilder (2.11.5)
156 151 actionview (>= 5.0.0)
157 152 activesupport (>= 5.0.0)
158 153 jquery-rails (4.5.0)
159 154 rails-dom-testing (>= 1, < 3)
160 155 railties (>= 4.2.0)
161 156 thor (>= 0.14, < 2.0)
162 157 listen (3.0.8)
163 158 rb-fsevent (~> 0.9, >= 0.9.4)
164 159 rb-inotify (~> 0.9, >= 0.9.7)
165 - loofah (2.18.0)
160 + loofah (2.19.0)
166 161 crass (~> 1.0.2)
167 162 nokogiri (>= 1.5.9)
168 163 mail (2.7.1)
169 164 mini_mime (>= 0.1.1)
170 165 marcel (1.0.2)
171 166 material_icons (2.2.1)
172 167 railties (>= 3.2)
173 168 matrix (0.4.2)
174 169 method_source (1.0.0)
175 170 mini_mime (1.1.2)
176 171 minitest (5.16.3)
177 172 minitest-reporters (1.5.0)
178 173 ansi
179 174 builder
180 175 minitest (>= 5.0)
181 176 ruby-progressbar
182 177 momentjs-rails (2.29.4.1)
183 178 railties (>= 3.1)
184 179 msgpack (1.5.6)
185 180 multi_json (1.15.0)
186 181 mysql2 (0.5.4)
187 182 net-imap (0.2.3)
188 183 digest
189 184 net-protocol
190 185 strscan
191 186 net-pop (0.1.1)
192 187 digest
193 188 net-protocol
194 189 timeout
195 190 net-protocol (0.1.3)
196 191 timeout
197 192 net-smtp (0.3.1)
198 193 digest
199 194 net-protocol
200 195 timeout
201 196 nio4r (2.5.8)
202 - nokogiri (1.13.8-x86_64-darwin)
203 - racc (~> 1.4)
204 197 nokogiri (1.13.8-x86_64-linux)
205 198 racc (~> 1.4)
206 - popper_js (2.11.5)
199 + popper_js (2.11.6)
207 200 public_suffix (5.0.0)
208 201 puma (5.6.5)
209 202 nio4r (~> 2.0)
210 203 racc (1.6.0)
211 204 rack (2.2.4)
212 205 rack-test (2.0.2)
213 206 rack (>= 1.3)
214 207 rails (7.0.4)
215 208 actioncable (= 7.0.4)
216 209 actionmailbox (= 7.0.4)
217 210 actionmailer (= 7.0.4)
218 211 actionpack (= 7.0.4)
219 212 actiontext (= 7.0.4)
220 213 actionview (= 7.0.4)
221 214 activejob (= 7.0.4)
222 215 activemodel (= 7.0.4)
223 216 activerecord (= 7.0.4)
224 217 activestorage (= 7.0.4)
225 218 activesupport (= 7.0.4)
226 219 bundler (>= 1.15.0)
227 220 railties (= 7.0.4)
228 221 rails-dom-testing (2.0.3)
229 222 activesupport (>= 4.2.0)
230 223 nokogiri (>= 1.6)
231 224 rails-html-sanitizer (1.4.3)
232 225 loofah (~> 2.3)
233 226 railties (7.0.4)
234 227 actionpack (= 7.0.4)
235 228 activesupport (= 7.0.4)
236 229 method_source
237 230 rake (>= 12.2)
238 231 thor (~> 1.0)
239 232 zeitwerk (~> 2.5)
240 233 rake (13.0.6)
241 234 rb-fsevent (0.11.2)
242 235 rb-inotify (0.10.1)
243 236 ffi (~> 1.0)
244 237 rdiscount (2.2.0.2)
245 238 regexp_parser (2.5.0)
246 - reline (0.3.1)
247 - io-console (~> 0.5)
248 239 rexml (3.2.5)
249 240 rouge (4.0.0)
250 241 ruby-progressbar (1.11.0)
251 242 ruby_parser (3.19.1)
252 243 sexp_processor (~> 4.16)
253 244 rubyzip (2.3.2)
254 245 sassc (2.4.0)
255 246 ffi (~> 1.9)
256 247 sassc-rails (2.1.2)
257 248 railties (>= 4.0.0)
258 249 sassc (>= 2.0)
259 250 sprockets (> 3.0)
260 251 sprockets-rails
261 252 tilt
262 253 selenium-webdriver (4.4.0)
263 254 childprocess (>= 0.5, < 5.0)
264 255 rexml (~> 3.2, >= 3.2.5)
265 256 rubyzip (>= 1.2.2, < 3.0)
266 257 websocket (~> 1.0)
267 258 sexp_processor (4.16.1)
268 259 simple_form (5.1.0)
269 260 actionpack (>= 5.2)
270 261 activemodel (>= 5.2)
271 262 spring (2.1.1)
272 263 spring-watcher-listen (2.0.1)
273 264 listen (>= 2.7, < 4.0)
274 265 spring (>= 1.2, < 3.0)
275 266 sprockets (4.1.1)
276 267 concurrent-ruby (~> 1.0)
277 268 rack (> 1, < 3)
278 269 sprockets-rails (3.4.2)
279 270 actionpack (>= 5.2)
280 271 activesupport (>= 5.2)
281 272 sprockets (>= 3.0.0)
282 - sqlite3 (1.5.0-x86_64-darwin)
283 273 sqlite3 (1.5.0-x86_64-linux)
284 274 strscan (3.0.4)
285 275 temple (0.8.2)
286 276 thor (1.2.1)
287 277 tilt (2.0.11)
288 278 timeout (0.3.0)
289 279 tzinfo (2.0.5)
290 280 concurrent-ruby (~> 1.0)
291 281 web-console (4.2.0)
292 282 actionview (>= 6.0.0)
293 283 activemodel (>= 6.0.0)
294 284 bindex (>= 0.4.0)
295 285 railties (>= 6.0.0)
296 - webdrivers (5.0.0)
286 + webdrivers (5.1.0)
297 287 nokogiri (~> 1.6)
298 288 rubyzip (>= 1.3.0)
299 289 selenium-webdriver (~> 4.0)
300 290 websocket (1.2.9)
301 291 websocket-driver (0.7.5)
302 292 websocket-extensions (>= 0.1.0)
303 293 websocket-extensions (0.1.5)
304 294 xpath (3.2.0)
305 295 nokogiri (~> 1.8)
306 296 zeitwerk (2.6.0)
307 297
308 298 PLATFORMS
309 - x86_64-darwin-20
310 299 x86_64-linux
311 300
312 301 DEPENDENCIES
313 302 ace-rails-ap
314 303 activerecord-session_store
315 304 best_in_place!
316 305 bootsnap
317 306 bootstrap (~> 5.2)
307 + byebug
318 308 capybara
319 309 coffee-rails
320 - debug
321 310 dynamic_form
322 311 fuzzy-string-match
323 312 haml
324 313 haml-rails
325 314 importmap-rails (~> 1.1)
326 315 in_place_editing
327 316 jbuilder
328 317 jquery-rails
329 318 listen (>= 3.0.5, < 3.2)
330 319 mail
331 320 material_icons
332 321 minitest-reporters
333 322 momentjs-rails
334 323 mysql2
335 324 puma
336 325 rails (~> 7.0)
337 326 rdiscount
338 327 rouge
339 328 sassc-rails
340 329 selenium-webdriver
341 330 simple_form
342 331 spring
343 332 spring-watcher-listen (~> 2.0.0)
344 333 sprockets-rails
345 334 sqlite3
346 335 web-console (>= 3.3.0)
347 336 webdrivers
348 337
349 338 RUBY VERSION
350 339 ruby 3.1.2p20
351 340
352 341 BUNDLED WITH
353 342 2.3.22
@@ -1,13 +1,14
1 1 //main entry point for sprocket
2 - //= require jquery
2 + //= require jquery3
3 + //= require jquery_ujs
3 4 //= require moment
4 5 //= require moment/th
5 6 //= require ace-rails-ap
6 7 //= require ace/mode-c_cpp
7 8 //= require ace/mode-python
8 9 //= require ace/mode-ruby
9 10 //= require ace/mode-pascal
10 11 //= require ace/mode-javascript
11 12 //= require ace/mode-java
12 13 //= require ace/theme-merbivore
13 14
@@ -1,600 +1,185
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 22 //@import "jquery-ui-timepicker-addon";
23 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 + @import "my_bootstrap_var";
29 30 @import "bootstrap";
30 31 @import "select2/select2.min";
31 32 @import "select2/select2-bootstrap-5-theme.min";
32 33
33 34 //@import bootstrap3-switch
34 35 //@import "bootstrap-toggle";
35 36 //@import "bootstrap-sortable";
36 37 //@import "bootstrap-datepicker3";
37 38 //@import "bootstrap-datetimepicker";
38 39 //@import "datatables.net-bs/css/dataTables.bootstrap.min";
39 40 //@import "datatables.net-buttons-bs/css/buttons.bootstrap.min";
40 41
41 42 //new import
42 43 @import 'datatables/datatables.min';
43 44 @import 'material_icons';
44 45
45 46 //bootstrap navbar color (from)
47 + /*
46 48 $bgDefault: #19197b;
47 49 $bgHighlight: #06064b;
48 50 $colDefault: #8e8eb4;
49 51 $colHighlight: #ffffff;
50 52 $dropDown: false;
51 53
52 54 @font-face {
53 55 font-family: 'Glyphicons Halflings';
54 56 src: font-path('bootstrap/glyphicons-halflings-regular.eot');
55 57 src: font-path('bootstrap/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
56 58 font-path('bootstrap/glyphicons-halflings-regular.woff') format('woff'),
57 59 font-path('bootstrap/glyphicons-halflings-regular.ttf') format('truetype'),
58 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 67 .navbar-default {
63 68 background-color: $bgDefault;
64 69 border-color: $bgHighlight;
65 70
66 71 .navbar-brand {
67 72 color: $colDefault;
68 73
69 74 &:hover, &:focus {
70 75 color: $colHighlight;
71 76 }
72 77 }
73 78
74 79 .navbar-text {
75 80 color: $colDefault;
76 81 }
77 82
78 83 .navbar-nav {
79 84 > li {
80 85 > a {
81 86 color: $colDefault;
82 87
83 88 &:hover, &:focus {
84 89 color: $colHighlight;
85 90 }
86 91 }
87 92
88 93 @if $dropDown {
89 94 > .dropdown-menu {
90 95 background-color: $bgDefault;
91 96
92 97 > li {
93 98 > a {
94 99 color: $colDefault;
95 100
96 101 &:hover, &:focus {
97 102 color: $colHighlight;
98 103 background-color: $bgHighlight;
99 104 }
100 105 }
101 106
102 107 > .divider {
103 108 background-color: $bgHighlight;
104 109 }
105 110 }
106 111 }
107 112 }
108 113 }
109 114
110 115 @if $dropDown {
111 116 .open .dropdown-menu > .active {
112 117 > a, > a:hover, > a:focus {
113 118 color: $colHighlight;
114 119 background-color: $bgHighlight;
115 120 }
116 121 }
117 122 }
118 123
119 124 > .active {
120 125 > a, > a:hover, > a:focus {
121 126 color: $colHighlight;
122 127 background-color: $bgHighlight;
123 128 }
124 129 }
125 130
126 131 > .open {
127 132 > a, > a:hover, > a:focus {
128 133 color: $colHighlight;
129 134 background-color: $bgHighlight;
130 135 }
131 136 }
132 137 }
133 138
134 139 .navbar-toggle {
135 140 border-color: $bgHighlight;
136 141
137 142 &:hover, &:focus {
138 143 background-color: $bgHighlight;
139 144 }
140 145
141 146 .icon-bar {
142 147 background-color: $colDefault;
143 148 }
144 149 }
145 150
146 151 .navbar-collapse,
147 152 .navbar-form {
148 153 border-color: $colDefault;
149 154 }
150 155
151 156 .navbar-link {
152 157 color: $colDefault;
153 158
154 159 &:hover {
155 160 color: $colHighlight;
156 161 }
157 162 }
158 163 }
159 164
160 165
161 166 @media (max-width: 767px) {
162 167 .navbar-default .navbar-nav .open .dropdown-menu {
163 168 > li > a {
164 169 color: $colDefault;
165 170
166 171 &:hover, &:focus {
167 172 color: $colHighlight;
168 173 }
169 174 }
170 175
171 176 > .active {
172 177 > a, > a:hover, > a:focus {
173 178 color: $colHighlight;
174 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,61 +1,53
1 1 // Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
2 2 //import "@hotwired/turbo-rails"
3 3 //import "controllers"
4 4 //
5 5
6 - //import "my_sprocket"
7 - import "pdfmake"
8 - import "pdfmake-vfs"
9 - import "jszip"
10 6
11 7 //bootstrap
12 8 import "bootstrap"
13 9 window.bootstrap = bootstrap
14 - console.log($); // ok
15 - console.log(bootstrap)
16 - console.log(JSZip);
17 10
18 11 //datatable
19 12 //import 'datatables-bundle'
13 + import "pdfmake"
14 + import "pdfmake-vfs"
15 + import "jszip"
20 16 import "datatables"
21 17 import "datatables-bs5"
22 18 import "datatables-editor"
23 19 import "datatables-editor-bs5"
24 20 import "datatables-autofill"
25 21 import "datatables-autofill-bs5"
26 22 import "datatables-button"
27 23 import "datatables-button-bs5"
28 24 import "datatables-button-colvis"
29 25 import "datatables-button-html5"
30 26 import "datatables-button-print"
31 27 import "datatables-colrecorder"
32 28 import "datatables-datetime"
33 29 import "datatables-fixedcolumns"
34 30 import "datatables-fixedheader"
35 31 import "datatables-keytable"
36 32 import "datatables-responsive"
37 33 import "datatables-responsive-bs5"
38 34 import "datatables-rowgroup"
39 35 import "datatables-rowreorder"
40 36 import "datatables-scroller"
41 37 import "datatables-searchbuilder"
42 38 import "datatables-searchbuilder-bs5"
43 39 import "datatables-searchpanes"
44 40 import "datatables-searchpanes-bs5"
45 41 import "datatables-select"
46 42 import "datatables-staterestore"
47 43 import "datatables-staterestore-bs5"
48 44 /* */
49 45
50 46 import "select2"
51 47
52 - //import "ace-rails-ap"
53 - //import "ace/theme-merbivore"
54 - //import "ace/mode-python"
55 -
56 48 //my own customization
57 49 import 'custom'
58 50
59 51
60 52 console.log('application.js ready')
61 53
@@ -1,51 +1,56
1 1 $(document).on('change', '.btn-file :file', function() {
2 2 var input, label, numFiles;
3 3 input = $(this);
4 4 numFiles = input.get(0).files ? input.get(0).files.length : 1;
5 5 label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
6 6 input.trigger('fileselect', [numFiles, label]);
7 7 });
8 8
9 9 $(function() {
10 10 var e;
11 - $(".select2").select2({});
11 + $(".select2").select2({
12 + theme: "bootstrap-5",
13 + //selectionCssClass: "select2--small",
14 + //dropdownCssClass: "select2--small",
15 + });
16 +
12 17 $('.btn-file :file').on('fileselect', function(event, numFiles, label) {
13 18 var input, log;
14 19 input = $(this).parents('.input-group').find(':text');
15 20 log = numFiles > 1 ? numFiles + ' files selected' : label;
16 21 if (input.length) {
17 22 input.val(log);
18 23 } else {
19 24 if (log) {
20 25 alert(log);
21 26 }
22 27 }
23 28 });
24 29 $(".go-button").on('click', function(event) {
25 30 var link, url;
26 31 link = $(this).attr("data-source");
27 32 url = $(link).val();
28 33 if (url) {
29 34 window.location.href = url;
30 35 }
31 36 });
32 37 $('.ajax-toggle').on('click', function(event) {
33 38 var target;
34 39 target = $(event.target);
35 40 target.removeClass('btn-default');
36 41 target.removeClass('btn-success');
37 42 target.addClass('btn-warning');
38 43 target.text('...');
39 44 });
40 45 if ($("#editor").length > 0) {
41 46 e = ace.edit("editor");
42 47 e.setTheme('ace/theme/merbivore');
43 48 e.getSession().setTabSize(2);
44 49 e.getSession().setUseSoftTabs(true);
45 50 }
46 51
47 52 //jQuery(".best_in_place").best_in_place();
48 53 });
49 54
50 55 // ---
51 56 // generated by coffee-script 1.9.2
@@ -1,3 +1,3
1 1 class ApplicationRecord < ActiveRecord::Base
2 - self.abstract_class = true
2 + primary_abstract_class
3 3 end
@@ -1,170 +1,170
1 - class Submission < ActiveRecord::Base
1 + class Submission < ApplicationRecord
2 2
3 3 enum tag: {default: 0, model: 1}, _prefix: true
4 4
5 5 belongs_to :language
6 6 belongs_to :problem
7 7 belongs_to :user
8 8
9 9 before_validation :assign_problem
10 10 before_validation :assign_language
11 11
12 12 validates_presence_of :source
13 13 validates_length_of :source, :maximum => 100_000, :allow_blank => true, :message => 'code too long, the limit is 100,000 bytes'
14 14 validates_length_of :source, :minimum => 1, :allow_blank => true, :message => 'too short'
15 15 validate :must_have_valid_problem
16 16 validate :must_specify_language
17 17
18 18 has_one :task
19 19
20 20 before_save :assign_latest_number_if_new_recond
21 21
22 22 def self.find_last_by_user_and_problem(user_id, problem_id)
23 23 where("user_id = ? AND problem_id = ?",user_id,problem_id).last
24 24 end
25 25
26 26 def self.find_all_last_by_problem(problem_id)
27 27 # need to put in SQL command, maybe there's a better way
28 28 Submission.includes(:user).find_by_sql("SELECT * FROM submissions " +
29 29 "WHERE id = " +
30 30 "(SELECT MAX(id) FROM submissions AS subs " +
31 31 "WHERE subs.user_id = submissions.user_id AND " +
32 32 "problem_id = " + problem_id.to_s + " " +
33 33 "GROUP BY user_id) " +
34 34 "ORDER BY user_id")
35 35 end
36 36
37 37 def self.find_in_range_by_user_and_problem(user_id, problem_id,since_id,until_id)
38 38 records = Submission.where(problem_id: problem_id,user_id: user_id)
39 39 records = records.where('id >= ?',since_id) if since_id and since_id > 0
40 40 records = records.where('id <= ?',until_id) if until_id and until_id > 0
41 41 records.all
42 42 end
43 43
44 44 def self.find_last_for_all_available_problems(user_id)
45 45 submissions = Array.new
46 46 problems = Problem.available_problems
47 47 problems.each do |problem|
48 48 sub = Submission.find_last_by_user_and_problem(user_id, problem.id)
49 49 submissions << sub if sub!=nil
50 50 end
51 51 submissions
52 52 end
53 53
54 54 def self.find_by_user_problem_number(user_id, problem_id, number)
55 55 where("user_id = ? AND problem_id = ? AND number = ?",user_id,problem_id,number).first
56 56 end
57 57
58 58 def self.find_all_by_user_problem(user_id, problem_id)
59 59 where("user_id = ? AND problem_id = ?",user_id,problem_id)
60 60 end
61 61
62 62 def download_filename
63 63 if self.problem.output_only
64 64 return self.source_filename
65 65 else
66 66 timestamp = self.submitted_at.localtime.strftime("%H%M%S")
67 67 return "#{self.problem.name}-#{timestamp}.#{self.language.ext}"
68 68 end
69 69 end
70 70
71 71 protected
72 72
73 73 def self.find_option_in_source(option, source)
74 74 if source==nil
75 75 return nil
76 76 end
77 77 i = 0
78 78 source.each_line do |s|
79 79 if s =~ option
80 80 words = s.split
81 81 return words[1]
82 82 end
83 83 i = i + 1
84 84 if i==10
85 85 return nil
86 86 end
87 87 end
88 88 return nil
89 89 end
90 90
91 91 def self.find_language_in_source(source, source_filename="")
92 92 langopt = find_option_in_source(/^LANG:/,source)
93 93 if langopt
94 - return (Language.find_by_name(langopt) ||
94 + return (Language.find_by_name(langopt) ||
95 95 Language.find_by_pretty_name(langopt))
96 96 else
97 97 if source_filename
98 98 return Language.find_by_extension(source_filename.split('.').last)
99 99 else
100 100 return nil
101 101 end
102 102 end
103 103 end
104 104
105 105 def self.find_problem_in_source(source, source_filename="")
106 106 prob_opt = find_option_in_source(/^TASK:/,source)
107 107 if problem = Problem.find_by_name(prob_opt)
108 108 return problem
109 109 else
110 110 if source_filename
111 111 return Problem.find_by_name(source_filename.split('.').first)
112 112 else
113 113 return nil
114 114 end
115 115 end
116 116 end
117 117
118 118 def assign_problem
119 119 if self.problem_id!=-1
120 120 begin
121 121 self.problem = Problem.find(self.problem_id)
122 122 rescue ActiveRecord::RecordNotFound
123 123 self.problem = nil
124 124 end
125 125 else
126 126 self.problem = Submission.find_problem_in_source(self.source,
127 127 self.source_filename)
128 128 end
129 129 end
130 130
131 131 def assign_language
132 132 if self.language == nil
133 133 self.language = Submission.find_language_in_source(self.source,
134 134 self.source_filename)
135 135 end
136 136 end
137 137
138 138 # validation codes
139 139 def must_specify_language
140 140 return if self.source==nil
141 141
142 142 # for output_only tasks
143 143 return if self.problem!=nil and self.problem.output_only
144 144
145 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 147 end
148 148 end
149 149
150 150 def must_have_valid_problem
151 151 return if self.source==nil
152 152 if self.problem==nil
153 - errors.add('problem',"must be specified.")
153 + errors.add(:problem,:blank,'aaa')
154 154 else
155 155 #admin always have right
156 156 return if self.user.admin?
157 157
158 158 #check if user has the right to submit the problem
159 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 160 end
161 161 end
162 162
163 163 # callbacks
164 164 def assign_latest_number_if_new_recond
165 165 return if !self.new_record?
166 166 latest = Submission.find_last_by_user_and_problem(self.user_id, self.problem_id)
167 167 self.number = (latest==nil) ? 1 : latest.number + 1;
168 168 end
169 169
170 170 end
@@ -1,26 +1,19
1 1
2 2 %tr
3 3 %td{:align => "center"}
4 4 = submission.number
5 5 %td.text-right
6 6 = link_to "##{submission.id}", submission_path(submission.id)
7 7 %td
8 8 = l submission.submitted_at, format: :long
9 9 = "( #{time_ago_in_words(submission.submitted_at)} ago)"
10 10 %td
11 11 = submission.source_filename
12 12 = " (#{submission.language.pretty_name}) "
13 13 = link_to '[load]', download_submission_path(submission)
14 14 %td
15 - - if submission.graded_at
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 - = "]"
15 + = render 'submission_short', submission: submission, show_button: false, problem_id: submission&.problem&.id
23 16 %td
24 17 = render :partial => 'compiler_message', :locals => {:compiler_message => submission.compiler_message }
25 18 %td
26 19 = link_to 'Edit', edit_submission_path(submission.id), class: 'btn btn-success'
@@ -1,32 +1,33
1 1 - if submission.nil?
2 2 = "-"
3 3 - else
4 - %strong= "Submission ID:"
5 - = submission.id
6 - %br
4 + - if local_assigns[:show_id]
5 + .row
6 + .col-3.text-secondary
7 + Sub ID:
8 + %strong.col-9= submission.id
7 9 - unless submission.graded_at
8 - %strong= t 'main.submitted_at:'
9 - = format_full_time_ago(submission.submitted_at.localtime)
10 + .row
11 + .col-3.text-secondary= t 'main.submitted_at'
12 + %strong.col-9= format_full_time_ago(submission.submitted_at.localtime)
10 13 - else
11 - %strong= t 'main.graded_at:'
12 - = format_full_time_ago(submission.graded_at.localtime)
13 - %br
14 + .row
15 + .col-3.text-secondary= t 'main.graded_at'
16 + %strong.col-9= format_full_time_ago(submission.graded_at.localtime)
14 17 - if GraderConfiguration['ui.show_score']
15 - %strong=t 'main.score'
16 - = "#{(submission.points*100/submission.problem.full_score).to_i} "
17 - = " ["
18 - %tt
19 - = submission.grader_comment
20 - = "]"
21 - %br
22 - %strong View:
23 - - if GraderConfiguration.show_grading_result
24 - = link_to '[detailed result]', :action => 'result', :id => submission.id
25 - - if submission.graded_at
26 - = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-xs btn-info'}
27 - -#
28 - %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
29 - =t 'main.cmp_msg'
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'
18 + .row
19 + .col-3.text-secondary=t 'main.score'
20 + %strong.col-9
21 + = (submission.points*100/submission.problem.full_score).to_i
22 + %tt.grader-comment
23 + = " [#{submission.grader_comment}]"
24 + - if local_assigns[:show_button]
25 + - if submission.graded_at
26 + - if GraderConfiguration.show_grading_result
27 + = link_to '[detailed result]', :action => 'result', :id => submission.id
28 + = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-sm btn-info'}
29 + = link_to "#{t 'main.src_link'}",download_submission_path(submission), class: 'btn btn-sm btn-info'
30 + = link_to "#{t 'main.submissions_link'}", problem_submissions_path(submission.problem.id), class: 'btn btn-sm btn-info'
31 + - if GraderConfiguration.show_testcase
32 + = link_to "testcases", show_problem_testcases_path(submission.problem.id), class: 'btn btn-sm btn-info'
32 33
@@ -1,25 +1,27
1 1 <!DOCTYPE html>
2 2 %html
3 3 %head
4 4 %title= GraderConfiguration['contest.name']
5 5 = stylesheet_link_tag "application", params[:controller], :media => "all"
6 6 = csrf_meta_tags
7 7 = csp_meta_tag
8 8 = javascript_include_tag :my_app
9 9 -# = javascript_import_module_tag('prepend_jquery')
10 10 = javascript_importmap_tags
11 11 = content_for :header
12 12 = yield :head
13 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 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 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 21 %body
20 22 - unless local_assigns[:skip_header]
21 23 = render 'layouts/header'
22 24
23 25 /= content_tag(:p,flash[:notice],class: 'alert alert-success') if flash[:notice]!=nil
24 26 = flash_messages
25 27 = yield
@@ -1,26 +1,27
1 - .card-body
1 + %li.list-group-item
2 2 .card-title
3 - = announcement.title
4 - - if @current_user and @current_user.admin?
5 - = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
3 + %h1
4 + = announcement.title
5 + - if @current_user and @current_user.admin?
6 + = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-sm btn-outline-secondary'
6 7 .card-subtitle
7 8 = "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
8 9 .card-text
9 10 = markdown(announcement.body)
10 11
11 12
12 13 -#
13 14 %li.list-group-item
14 15 %strong
15 16 - if @current_user and @current_user.admin?
16 17 = link_to 'Edit', edit_announcement_path(announcement), class: 'btn btn-xs btn-default'
17 18 %small= "(updated #{time_ago_in_words(announcement.updated_at)} ago on #{announcement.updated_at})"
18 19
19 20 %br
20 21 = markdown(announcement.body)
21 22 :javascript
22 23 Announcement.updateRecentId(#{announcement.id});
23 24 - if (defined? announcement_effect) and announcement_effect
24 25 :javascript
25 26 $("announcement-#{announcement.id}").blindDown({duration: 0.2});
26 27 $("announcement-#{announcement.id}").appear({duration: 0.5, queue: 'end'});
@@ -1,22 +1,22
1 1 %tr
2 2 %td
3 3 - if @current_user and @current_user.admin?
4 4 = link_to problem.name, stat_problem_path(problem)
5 5 - else
6 6 = "#{problem.name}"
7 7 %td
8 8 = "#{problem.full_name}"
9 9
10 10 %br
11 11 = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, problem
12 12 %td
13 13 = @prob_submissions[problem.id][:count]
14 14 -#= link_to "[subs]", main_submission_path(problem.id)
15 15 %td
16 - = render :partial => 'submission_short',
17 - :locals => {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id }
16 + = render partial: 'submission_short',
17 + locals: {:submission => @prob_submissions[problem.id][:submission], :problem_name => problem.name, :problem_id => problem.id, show_button: true }
18 18 %td
19 19 - if @prob_submissions[problem.id][:submission]
20 20 = link_to 'Edit', edit_submission_path(@prob_submissions[problem.id][:submission]), class: 'btn btn-success'
21 21 - else
22 22 = link_to 'New', direct_edit_problem_submissions_path(problem.id), class: 'btn btn-success'
@@ -1,68 +1,68
1 1 - content_for :head do
2 2 = javascript_include_tag "announcement_refresh"
3 3
4 4 = user_title_bar(@user)
5 5 - if @user.section
6 6 passcode for CP Unofficial Logo voting is
7 7 %strong= @user.section
8 8 %br
9 9
10 10 - if (GraderConfiguration.contest_mode?) and (@user.site!=nil) and (@user.site.started!=true)
11 11 %p=t 'main.start_soon'
12 12
13 13 .row
14 14 .col-md-7
15 15 - if GraderConfiguration.show_submitbox_to?(@user)
16 16 .card.border-primary
17 17 .card-header.text-bg-primary
18 18 Submission
19 19 .card-body
20 20 = render 'submission_box'
21 21 - if GraderConfiguration.show_tasks_to?(@user)
22 22 - if not GraderConfiguration.multicontests?
23 23 %table.table.table-striped.table-condensed
24 24 %thead
25 25 %tr
26 26 %th Task name
27 27 %th Full name
28 28 %th # of sub(s)
29 29 %th Results
30 30 %th
31 31 %tbody
32 32 = render :partial => 'problem', :collection => @problems
33 33 - else
34 34 - @contest_problems.each do |cp|
35 35 - if cp[:problems].length > 0
36 36 %h2{:class =>'contest-title'}
37 37 = "#{cp[:contest] ? cp[:contest].title : 'Public problems'}"
38 38 %table.info
39 39 %tr.info-head
40 40 %th Task name
41 41 %th Full name
42 42 %th # of sub(s)
43 43 %th Results
44 44 %th
45 45 = render :partial => 'problem', :collection => cp[:problems]
46 46 .col-md-5
47 47 .card
48 48 .card-header
49 49 Announcement
50 - = link_to 'Manage', announcements_path, class: 'btn btn-small'
51 - .card-body
50 + = link_to 'Manage', announcements_path, class: 'btn btn-secondary btn-sm'
51 + %ul.list-group.list-group-flush
52 52 = render :partial => 'announcement', :collection => @announcements
53 -
54 - %script{:type => 'text/javascript'}
55 - = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';"
56 - Announcement.registerRefreshEventTimer();
53 + -#
54 + %script{:type => 'text/javascript'}
55 + = "Announcement.refreshUrl = '#{url_for :controller => 'main', :action => 'announcements'}';".html_safe
56 + Announcement.registerRefreshEventTimer();
57 57
58 58 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
59 59 .modal-dialog.modal-lg{role:'document'}
60 60 .modal-content
61 61 .modal-header
62 62 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
63 63 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
64 64 %h4 Compiler message
65 65 .modal-body
66 66 %pre#compiler_msg
67 67 .modal-footer
68 68 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
@@ -1,4 +1,4
1 1 :plain
2 2 $("#compiler_msg").html("#{j @submission.compiler_message}");
3 - $("#compiler").modal();
3 + $("#compiler").modal('show');
4 4
@@ -1,88 +1,120
1 1 %textarea#text_sourcecode{style: "display:none"}~ @source
2 2 .container
3 3 .row
4 4 .col-md-12
5 5 %h2 Live submit
6 6
7 7 .row
8 8 .col-md-12
9 9 .alert.alert-info
10 10 Write your code in the following box, choose language, and click submit button when finished
11 11 .row
12 12 .col-md-8
13 13 %div#editor{style: 'height: 500px; border-radius: 7px; font-size: 14px;'}
14 14 .col-md-4
15 - - # submission form
16 - = form_tag({controller: :main, :action => 'submit'}, :multipart => true, class: 'form') do
17 -
18 - = hidden_field_tag 'editor_text', @source
19 - = hidden_field_tag 'submission[problem_id]', @problem.id
20 - .form-group
21 - = label_tag "Task:"
22 - = text_field_tag 'asdf', "#{@problem.long_name}", class: 'form-control', disabled: true
23 - .form-group
24 - = label_tag "Description:"
25 - = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem
15 + -# submission form
16 + .card.mb-3
17 + .card-header
18 + Submission
19 + .card-body
20 + = form_with url: submit_main_path, :multipart => true, class: 'form' do |form|
21 + = hidden_field_tag 'editor_text', @source
22 + = hidden_field_tag 'submission[problem_id]', @problem.id
23 + .row.mb-2
24 + .col-md-4
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
28 - = label_tag 'Language:'
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"
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
46 + -# latest submission status
47 + .card
48 + .card-header.text-bg-info.border-info
43 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
45 - .panel-body
46 - %div#latest_status
47 - - if @submission
48 - = render :partial => 'submission_short',
49 - :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
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
51 + .card-body
52 + #latest_status
50 53
51 54 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
52 55 .modal-dialog.modal-lg{role:'document'}
53 56 .modal-content
54 57 .modal-header
55 58 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
56 59 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
57 60 %h4 Compiler message
58 61 .modal-body
59 62 %pre#compiler_msg
60 63 - if @submission
61 64 = @submission.compiler_message
62 65 .modal-footer
63 66 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
64 67
65 68 :javascript
66 69 $(document).ready(function() {
67 - e = ace.edit("editor")
70 + var e = ace.edit("editor")
68 71 e.setValue($("#text_sourcecode").val());
69 72 e.gotoLine(1);
70 73 $("#language_id").trigger('change');
71 74
72 75 $("#load_file").on('change',function(evt) {
73 76 var file = evt.target.files[0];
74 77 var reader = new FileReader();
75 78 reader.onload = function(theFile) {
76 79 var e = ace.edit("editor")
77 80 e.setValue(theFile.target.result);
78 81 e.gotoLine(1);
79 82 };
80 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 113 //brython();
114 + $('#refresh').click()
115 +
84 116 });
85 117
86 118
87 119
88 120
@@ -1,2 +1,2
1 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,29 +1,31
1 - .panel.panel-info
2 - .panel-heading
1 + .card.border-info.mb-2
2 + .card-header.text-bg-info.border-info
3 3 Select Problems
4 - .panel-body
5 - .form-inline
6 - = select 'submission',
7 - 'problem_id',
8 - @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_submissions_url(p.id)]},
9 - { selected: (@problem ? problem_submissions_url(@problem) : -1) },
10 - { class: 'select2 form-control'}
11 - %button.btn.btn-primary.btn-sm.go-button#problem_go{data: {source: '#submission_problem_id'}} Go
4 + .card-body
5 + .row
6 + .col-6
7 + = select 'submission',
8 + 'problem_id',
9 + @problems.collect {|p| ["[#{p.name}] #{p.full_name}", problem_submissions_url(p.id)]},
10 + { selected: (@problem ? problem_submissions_url(@problem) : -1) },
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 15 - if @problem!=nil
14 16 %h2= "Task: #{@problem.full_name} (#{@problem.name})"
15 17
16 18 - if @submissions!=nil
17 19 - if @submissions.length>0
18 20 %table.table
19 21 %thead
20 22 %th No.
21 23 %th.text-right #
22 24 %th At
23 25 %th Source
24 26 %th Result
25 27 %th{:width => "300px"} Compiler message
26 28 %th
27 29 = render :partial => 'submission', :collection => @submissions
28 30 - else
29 31 No submission
@@ -1,128 +1,128
1 1 %h1= "Submission: #{@submission.id}"
2 2
3 3 %textarea#data{style: "display:none;"}
4 4 :preserve
5 5 #{@submission.source}
6 6
7 7 //%div.highlight{:style => "border: 1px solid black;"}
8 8 //=@formatted_code.html_safe
9 9
10 10
11 11 .containter
12 12 .row
13 13 .col-md-7
14 14 %h2 Source Code
15 15 .col-md-5
16 16 %h2 Stat
17 17 .row
18 18 .col-md-7
19 19 %div#editor{ style: "font-size: 14px; height: 400px; border-radius:5px;" }
20 20 :javascript
21 21 e = ace.edit("editor")
22 22 e.setOptions({ maxLines: Infinity })
23 23 e.setValue($("#data").text())
24 24 e.gotoLine(1)
25 25 e.getSession().setMode("#{get_ace_mode(@submission.language)}")
26 26 e.setReadOnly(true)
27 27 .col-md-5
28 28 %table.table.table-striped
29 29 %tr
30 30 %td.text-right
31 31 %strong User
32 32 %td
33 33 - if @current_user.admin? ||@current_user == @submission.user
34 34 - if @submission.user
35 35 = link_to "#{@submission.user.login}", stat_user_path(@submission.user)
36 36 = @submission.user.full_name
37 37 - else
38 38 = "(n/a)"
39 39 - else
40 40 = '-- REDACTED --'
41 41 %tr
42 42 %td.text-right
43 43 %strong Task
44 44 %td
45 45 - if @submission.problem!=nil
46 46 = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem)
47 47 = @submission.problem.full_name
48 48 = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @submission.problem
49 49 - else
50 50 = "(n/a)"
51 51 %tr
52 52 %td.text-right
53 53 %strong Tries
54 54 %td= @submission.number
55 55 %tr
56 56 %td.text-right
57 57 %strong Language
58 58 %td= @submission.language.pretty_name
59 59 %tr
60 60 %td.text-right
61 61 %strong Submitted
62 62 %td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})
63 63 %tr
64 64 %td.text-right
65 65 %strong Graded
66 66 - if @submission.graded_at
67 67 %td #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)})
68 68 - else
69 69 %td -
70 70 %tr
71 71 %td.text-right
72 72 %strong Points
73 73 %td #{@submission.points}/#{@submission.try(:problem).try(:full_score)}
74 74 %tr
75 75 %td.text-right
76 76 %strong Comment
77 77 %td #{@submission.grader_comment}
78 78 %tr
79 79 %td.text-right
80 80 %strong Runtime (s)
81 81 %td #{@submission.max_runtime}
82 82 %tr
83 83 %td.text-right
84 84 %strong Memory (kb)
85 85 %td #{@submission.peak_memory}
86 86 %tr
87 87 %td.text-right
88 88 %strong Compiler result
89 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 91 view
92 92 %tr
93 93 %td.text-right
94 94 %strong Grading Task Status
95 95 %td
96 96 = @task.status_str if @task
97 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 99 - if @current_user.has_role?('ta')
100 100 %tr
101 101 %td.text-right
102 102 %strong IP
103 103 %td #{@submission.ip_address}
104 104 %tr
105 105 %td.text-right
106 106 %strong Model solution
107 107 %td
108 108 - if @submission.tag_model?
109 109 YES
110 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 112 - else
113 113 No
114 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 118 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
119 119 .modal-dialog.modal-lg{role:'document'}
120 120 .modal-content
121 121 .modal-header
122 122 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
123 123 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} &times;
124 124 %h4 Compiler message
125 125 .modal-body
126 126 %pre#compiler_msg= @submission.compiler_message
127 127 .modal-footer
128 128 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
@@ -1,56 +1,57
1 1 # Pin npm packages by running ./bin/importmap
2 2
3 3 #entry point
4 4 pin "application"
5 5 pin "prepend_jquery"
6 6 pin "my_sprocket"
7 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 11 pin "bootstrap", to: "bootstrap.bundle.min.js", preload: true
11 12 #no need popper, because bundled already in bootstrap
12 13 #pin "@popperjs/core", to: "https://ga.jspm.io/npm:@popperjs/core@2.11.6/lib/index.js"
13 14
14 15 # datatable
15 16 # I have to fix vfs_font.js for this to work
16 17 pin "jszip", to: "jszip.min.js"
17 18 pin "pdfmake"
18 19 pin "pdfmake-vfs", to: 'datatables/pdfmake-0.1.36/vfs_fonts.js'
19 20
20 21 pin "datatables-bundle", to: 'datatables/datatables.js'
21 22 pin "datatables", to: "datatables/DataTables-1.12.1/js/jquery.dataTables.js"
22 23 pin "datatables-bs5", to: "datatables/DataTables-1.12.1/js/dataTables.bootstrap5.js"
23 24 pin "datatables-editor", to: "datatables/Editor-2.0.9/js/dataTables.editor.js"
24 25 pin "datatables-editor-bs5", to: "datatables/Editor-2.0.9/js/editor.bootstrap5.min.js"
25 26 pin "datatables-autofill", to: "datatables/AutoFill-2.4.0/js/dataTables.autoFill.js"
26 27 pin "datatables-autofill-bs5", to: "datatables/AutoFill-2.4.0/js/autoFill.bootstrap5.js"
27 28 pin "datatables-button", to: "datatables/Buttons-2.2.3/js/dataTables.buttons.js"
28 29 pin "datatables-button-bs5", to: "datatables/Buttons-2.2.3/js/buttons.bootstrap5.js"
29 30 pin "datatables-button-colvis", to: "datatables/Buttons-2.2.3/js/buttons.colVis.js"
30 31 pin "datatables-button-html5", to: "datatables/Buttons-2.2.3/js/buttons.html5.js"
31 32 pin "datatables-button-print", to: "datatables/Buttons-2.2.3/js/buttons.print.js"
32 33 pin "datatables-colrecorder", to: "datatables/ColReorder-1.5.6/js/dataTables.colReorder.js"
33 34 pin "datatables-datetime", to: "datatables/DateTime-1.1.2/js/dataTables.dateTime.js"
34 35 pin "datatables-fixedcolumns", to: "datatables/FixedColumns-4.1.0/js/dataTables.fixedColumns.js"
35 36 pin "datatables-fixedheader", to: "datatables/FixedHeader-3.2.4/js/dataTables.fixedHeader.js"
36 37 pin "datatables-keytable", to: "datatables/KeyTable-2.7.0/js/dataTables.keyTable.js"
37 38 pin "datatables-responsive", to: "datatables/Responsive-2.3.0/js/dataTables.responsive.js"
38 39 pin "datatables-responsive-bs5", to: "datatables/Responsive-2.3.0/js/responsive.bootstrap5.js"
39 40 pin "datatables-rowgroup", to: "datatables/RowGroup-1.2.0/js/dataTables.rowGroup.js"
40 41 pin "datatables-rowreorder", to: "datatables/RowReorder-1.2.8/js/dataTables.rowReorder.js"
41 42 pin "datatables-scroller", to: "datatables/Scroller-2.0.7/js/dataTables.scroller.js"
42 43 pin "datatables-searchbuilder", to: "datatables/SearchBuilder-1.3.4/js/dataTables.searchBuilder.js"
43 44 pin "datatables-searchbuilder-bs5", to: "datatables/SearchBuilder-1.3.4/js/searchBuilder.bootstrap5.js"
44 45 pin "datatables-searchpanes", to: "datatables/SearchPanes-2.0.2/js/dataTables.searchPanes.js"
45 46 pin "datatables-searchpanes-bs5", to: "datatables/SearchPanes-2.0.2/js/searchPanes.bootstrap5.js"
46 47 pin "datatables-select", to: "datatables/Select-1.4.0/js/dataTables.select.js"
47 48 pin "datatables-staterestore", to: "datatables/StateRestore-1.1.1/js/dataTables.stateRestore.js"
48 49 pin "datatables-staterestore-bs5", to: "datatables/StateRestore-1.1.1/js/stateRestore.bootstrap5.js"
49 50
50 51 #select2
51 52 pin "select2", to: "select2.min.js"
52 53
53 54 #my local js
54 55 pin "custom", to: "custom.js"
55 56
56 57 #pin "ace-rails-ap"
@@ -1,25 +1,25
1 1 # Be sure to restart your server when you modify this file.
2 2 #
3 3 # This file contains migration options to ease your Rails 5.0 upgrade.
4 4 #
5 5 # Once upgraded flip defaults one by one to migrate to the new default.
6 6 #
7 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 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 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 17 # Make Ruby 2.4 preserve the timezone of the receiver when calling `to_time`.
18 18 # Previous versions had false.
19 - ActiveSupport.to_time_preserves_timezone = false
19 + #ActiveSupport.to_time_preserves_timezone = false
20 20
21 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 24 # Do not halt callback chains when a callback returns false. Previous versions had true.
25 25 # ActiveSupport.halt_callback_chains_on_return_false = true
@@ -1,144 +1,145
1 1 # Sample localization file for English. Add more files in this directory for other locales.
2 2 # See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
3 3
4 4 en:
5 5 cancel: 'Cancel'
6 6
7 7 login_label: 'Login'
8 8 full_name_label: 'Full name'
9 9 email_label: 'E-mail'
10 10 password_label: 'Password'
11 11
12 12 go_ahead_to: "Go ahead to "
13 13 go_back_to: "Go back to "
14 14 login_page: "login page"
15 15 home_page: "home page"
16 16
17 17 menu:
18 18 main: 'Main'
19 19 messages: 'Messages'
20 20 tasks: 'Tasks'
21 21 submissions: 'Submissions'
22 22 test: 'Test'
23 23 hall_of_fame: 'Hall of Fame'
24 24 help: 'Help'
25 25 settings: 'Settings'
26 26 log_out: 'Log out'
27 27
28 28 title_bar:
29 29 current_time: "Current time is"
30 30 remaining_time: "Time left: "
31 31 contest_not_started: "The contest has not started."
32 32
33 33 login:
34 34 message: 'Please login to see the problem list'
35 35 login_submit: 'Login'
36 36 participation: 'Want to participate?'
37 37 please: 'Please'
38 38 register: 'register'
39 39 forget_password: 'Forget password?'
40 40
41 41 main:
42 42 start_soon: "The contest at your site will start soon. Please wait."
43 43 specified_in_header: "Specified in header"
44 44
45 - problem_desc: "desc"
46 - submitted_at: "Submitted at"
47 - graded_at: "Graded at"
48 - score: "score: "
45 + problem_desc: desc
46 + submission_id: Sub ID
47 + submitted_at: Submitted
48 + graded_at: Graded
49 + score: score
49 50 cmp_msg: "compiler msg"
50 51 src_link: "src"
51 52 submissions_link: "submissions"
52 53
53 54 confirm_contest_start:
54 55 box_title: "Contest confirmation"
55 56 contest_list: "You will participate in contest:"
56 57 timer_starts_after_click: "The timer will start after you click the start button."
57 58 start_button: "Start!"
58 59 start_button_confirm: "Are you sure?"
59 60
60 61 test:
61 62 title: "Test Interface"
62 63 intro: "You can test your submission with your own test data on the grading environment using this test interface."
63 64 disabled_at_end_announcement: "<b>Note:</b> Test interface will be disabled in the last 30 minutes of the contest time on your site."
64 65
65 66 registration:
66 67 title: "New user registration"
67 68
68 69 description: "Please enter your information below. Please make sure your e-mail is correct, because you will have to confirm the registration through an e-mail we send to that e-mail address."
69 70
70 71 successful_title: "Registration successful"
71 72
72 73 login_guide: "Only a-z, A-Z, 0-9 and _. Can be at most 20 characters long"
73 74 email_guide: "Please make sure that your e-mail is correct.<br/>You'll need to verify your account by email."
74 75 register: "Register"
75 76
76 77 email_body: "Hello %{full_name},
77 78
78 79 You have registered for %{contest_name}
79 80
80 81 Your login is: %{login}
81 82
82 83 Your password is: %{password}
83 84
84 85 Please follow the link:
85 86
86 87 %{activation_url}
87 88
88 89 to activate your user account.
89 90
90 91 If you did not register, please ignore this e-mail
91 92 and report this event to %{admin_email}.
92 93
93 94 Thanks!"
94 95
95 96 email_sent: "We have sent a confimation message to your e-mail. (Please also check the Junk mail box."
96 97 email_verify_at: "Please check at %{email} and confirm."
97 98
98 99 activation_sucessful_title: "User activated"
99 100 account_activated: "Your account has been activated."
100 101
101 102 activation_failed_title: "Activation failed"
102 103
103 104 errors:
104 105 header: "Errors occured during registration"
105 106 email:
106 107 title: "Errors in sending registration confirmation"
107 108 expl: "<h2>Your user account has been created, but the system cannot send you the confirmation e-mail.</h2>
108 109 Maybe there's a problem in the configuration. Please report the admin at %{email}.<br/>Thank you!"
109 110 activation:
110 111 email_exists: "A user with this E-mail exists."
111 112 invalid: "Your activation code is invalid. Please check again."
112 113
113 114 password_retrieval:
114 115 header: "Password retrieval"
115 116 instructions: "Please enter the e-mail address that you used to register."
116 117 button_label: "Request new password"
117 118 no_email: "No user with that e-mail address."
118 119 email_body: "Hello %{full_name},
119 120
120 121 You have requested for new password for %{contest_name}. We have generated it for you:
121 122
122 123 user name: %{login}
123 124 password: %{password}
124 125
125 126 If you didn't ask for new password or you're not the person who registered,
126 127 please ignore this e-mail and inform %{admin_email} of this mistake.
127 128
128 129 Thanks!"
129 130
130 131 contest:
131 132 notification:
132 133 email_subject: "[%{contest_title_name}] You have been upgraded to %{contest_name}"
133 134 email_body: "Congratulations %{full_name},
134 135
135 136 You have advanced to contest %{contest_name} in %{contest_title_name}.
136 137
137 138 You can now log-in and start participating in that contest.
138 139
139 140 Cheers!
140 141 -%{contest_title_name} Admin"
141 142
142 143 help:
143 144 how_to_submit: "How to submit"
144 145 must_specify_language: "You <b>must</b> specify the language you are using in your program header. You can optionally specify the task you are submitting to."
deleted file
deleted file
deleted file
deleted file
You need to be logged in to leave comments. Login now