Description:
add ip to submission
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r446:d9ae0ff1e3ea - - 5 files changed: 45 inserted, 26 deleted
@@ -0,0 +1,5 | |||
|
1 | + class AddIpToSubmissions < ActiveRecord::Migration | |
|
2 | + def change | |
|
3 | + add_column :submissions, :ip_address, :string | |
|
4 | + end | |
|
5 | + end |
@@ -67,6 +67,7 | |||
|
67 | 67 | @submission.source_filename = params['file'].original_filename |
|
68 | 68 | end |
|
69 | 69 | @submission.submitted_at = Time.new.gmtime |
|
70 | + @submission.ip_address = request.remote_ip | |
|
70 | 71 | |
|
71 | 72 | if GraderConfiguration.time_limit_mode? and user.contest_finished? |
|
72 | 73 | @submission.errors.add_to_base "The contest is over." |
@@ -50,6 +50,10 | |||
|
50 | 50 | %tr{class: cycle('info-even','info-odd')} |
|
51 | 51 | %td.field Memory (kb): |
|
52 | 52 | %td.value #{@submission.peak_memory} |
|
53 | + - if session[:admin] | |
|
54 | + %tr{class: cycle('info-even','info-odd')} | |
|
55 | + %td.field IP: | |
|
56 | + %td.value #{@submission.ip_address} | |
|
53 | 57 | |
|
54 | 58 | %h2 Source code |
|
55 | 59 | //%div.highlight{:style => "border: 1px solid black;"} |
@@ -31,6 +31,8 | |||
|
31 | 31 | %th Language |
|
32 | 32 | %th Result |
|
33 | 33 | %th Score |
|
34 | + - if session[:admin] | |
|
35 | + %th IP | |
|
34 | 36 | %tbody |
|
35 | 37 | - @submission.each do |s| |
|
36 | 38 | - next unless s.problem |
@@ -41,6 +43,8 | |||
|
41 | 43 | %td= s.language.pretty_name |
|
42 | 44 | %td.fix-width= s.grader_comment |
|
43 | 45 | %td= (s.points*100)/s.problem.full_score |
|
46 | + - if session[:admin] | |
|
47 | + %td= s.ip_address | |
|
44 | 48 | |
|
45 | 49 | |
|
46 | 50 |
@@ -11,16 +11,16 | |||
|
11 | 11 | # |
|
12 | 12 | # It's strongly recommended to check this file into your version control system. |
|
13 | 13 | |
|
14 |
- ActiveRecord::Schema.define(:version => 20140 |
|
|
14 | + ActiveRecord::Schema.define(:version => 20140917150629) do | |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", :force => true do |t| |
|
17 | 17 | t.string "author" |
|
18 |
- t.text "body" |
|
|
18 | + t.text "body" | |
|
19 | 19 | t.boolean "published" |
|
20 |
- t.datetime "created_at", |
|
|
21 |
- t.datetime "updated_at", |
|
|
22 |
- t.boolean "frontpage", |
|
|
23 |
- t.boolean "contest_only", |
|
|
20 | + t.datetime "created_at", :null => false | |
|
21 | + t.datetime "updated_at", :null => false | |
|
22 | + t.boolean "frontpage", :default => false | |
|
23 | + t.boolean "contest_only", :default => false | |
|
24 | 24 | t.string "title" |
|
25 | 25 | t.string "notes" |
|
26 | 26 | end |
@@ -50,19 +50,19 | |||
|
50 | 50 | end |
|
51 | 51 | |
|
52 | 52 | create_table "descriptions", :force => true do |t| |
|
53 |
- t.text "body" |
|
|
53 | + t.text "body" | |
|
54 | 54 | t.boolean "markdowned" |
|
55 |
- t.datetime "created_at", |
|
|
56 |
- t.datetime "updated_at", |
|
|
55 | + t.datetime "created_at", :null => false | |
|
56 | + t.datetime "updated_at", :null => false | |
|
57 | 57 | end |
|
58 | 58 | |
|
59 | 59 | create_table "grader_configurations", :force => true do |t| |
|
60 | 60 | t.string "key" |
|
61 | 61 | t.string "value_type" |
|
62 | 62 | t.string "value" |
|
63 |
- t.datetime "created_at", |
|
|
64 |
- t.datetime "updated_at", |
|
|
65 |
- t.text "description" |
|
|
63 | + t.datetime "created_at", :null => false | |
|
64 | + t.datetime "updated_at", :null => false | |
|
65 | + t.text "description" | |
|
66 | 66 | end |
|
67 | 67 | |
|
68 | 68 | create_table "grader_processes", :force => true do |t| |
@@ -97,10 +97,10 | |||
|
97 | 97 | t.integer "sender_id" |
|
98 | 98 | t.integer "receiver_id" |
|
99 | 99 | t.integer "replying_message_id" |
|
100 | - t.text "body", :limit => 16777215 | |
|
100 | + t.text "body" | |
|
101 | 101 | t.boolean "replied" |
|
102 |
- t.datetime "created_at", |
|
|
103 |
- t.datetime "updated_at", |
|
|
102 | + t.datetime "created_at", :null => false | |
|
103 | + t.datetime "updated_at", :null => false | |
|
104 | 104 | end |
|
105 | 105 | |
|
106 | 106 | create_table "problems", :force => true do |t| |
@@ -142,7 +142,7 | |||
|
142 | 142 | |
|
143 | 143 | create_table "sessions", :force => true do |t| |
|
144 | 144 | t.string "session_id" |
|
145 |
- t.text "data" |
|
|
145 | + t.text "data" | |
|
146 | 146 | t.datetime "updated_at" |
|
147 | 147 | end |
|
148 | 148 | |
@@ -163,16 +163,20 | |||
|
163 | 163 | t.integer "user_id" |
|
164 | 164 | t.integer "problem_id" |
|
165 | 165 | t.integer "language_id" |
|
166 |
- t.text "source" |
|
|
166 | + t.text "source" | |
|
167 | 167 | t.binary "binary" |
|
168 | 168 | t.datetime "submitted_at" |
|
169 | 169 | t.datetime "compiled_at" |
|
170 |
- t.text "compiler_message" |
|
|
170 | + t.text "compiler_message" | |
|
171 | 171 | t.datetime "graded_at" |
|
172 | 172 | t.integer "points" |
|
173 |
- t.text "grader_comment" |
|
|
173 | + t.text "grader_comment" | |
|
174 | 174 | t.integer "number" |
|
175 | 175 | t.string "source_filename" |
|
176 | + t.float "max_runtime" | |
|
177 | + t.integer "peak_memory" | |
|
178 | + t.integer "effective_code_length" | |
|
179 | + t.string "ip_address" | |
|
176 | 180 | end |
|
177 | 181 | |
|
178 | 182 | add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true |
@@ -187,10 +191,10 | |||
|
187 | 191 | |
|
188 | 192 | create_table "test_pairs", :force => true do |t| |
|
189 | 193 | t.integer "problem_id" |
|
190 |
- t.text "input", :limit => |
|
|
191 |
- t.text "solution", :limit => |
|
|
192 |
- t.datetime "created_at", |
|
|
193 |
- t.datetime "updated_at", |
|
|
194 | + t.text "input", :limit => 16777215 | |
|
195 | + t.text "solution", :limit => 16777215 | |
|
196 | + t.datetime "created_at", :null => false | |
|
197 | + t.datetime "updated_at", :null => false | |
|
194 | 198 | end |
|
195 | 199 | |
|
196 | 200 | create_table "test_requests", :force => true do |t| |
@@ -201,13 +205,13 | |||
|
201 | 205 | t.string "output_file_name" |
|
202 | 206 | t.string "running_stat" |
|
203 | 207 | t.integer "status" |
|
204 |
- t.datetime "updated_at", |
|
|
208 | + t.datetime "updated_at", :null => false | |
|
205 | 209 | t.datetime "submitted_at" |
|
206 | 210 | t.datetime "compiled_at" |
|
207 |
- t.text "compiler_message" |
|
|
211 | + t.text "compiler_message" | |
|
208 | 212 | t.datetime "graded_at" |
|
209 | 213 | t.string "grader_comment" |
|
210 |
- t.datetime "created_at", |
|
|
214 | + t.datetime "created_at", :null => false | |
|
211 | 215 | t.float "running_time" |
|
212 | 216 | t.string "exit_status" |
|
213 | 217 | t.integer "memory_usage" |
@@ -235,6 +239,7 | |||
|
235 | 239 | t.boolean "activated", :default => false |
|
236 | 240 | t.datetime "created_at" |
|
237 | 241 | t.datetime "updated_at" |
|
242 | + t.string "section" | |
|
238 | 243 | end |
|
239 | 244 | |
|
240 | 245 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
You need to be logged in to leave comments.
Login now