Description:
merge from java-bm, fix profile issue and modify application.rb.SAMPLE
Commit status:
[Not Reviewed]
References:
merge algo
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r436:cafc387838eb - - 4 files changed: 34 inserted, 29 deleted

@@ -1,28 +1,29
1 1 <h1>Problem stat: <%= @problem.name %></h1>
2 2
3 3 <i>This is just a hack. Really not efficient.</i><br/><br/>
4 4
5 5 <% if @submissions!=nil %>
6 6 <table class="info">
7 7 <tr class="info-head">
8 8 <th>login</th>
9 9 <th>name</th>
10 10 <th>submitted_at</th>
11 11 <th>points</th>
12 12 <th>comment</th>
13 13 </tr>
14 14 <% count = 0 %>
15 15 <% @submissions.each do |sub| %>
16 + <% next unless sub.user %>
16 17 <tr class="<%= (count % 2 ==0) ? "info-even" : "info-odd" %>">
17 18 <td><%= sub.user.login %></td>
18 19 <td><%= sub.user.full_name if sub.user %></td>
19 20 <td><%= sub.submitted_at.to_s %></td>
20 21 <td><%= sub.points %></td>
21 22 <td><div style="font-family: monospace"><%= sub.grader_comment %></div></td>
22 23 </tr>
23 24 <% count += 1 %>
24 25 <% end %>
25 26 </table>
26 27 <% else %>
27 28 No submission
28 29 <% end %>
@@ -1,40 +1,46
1 1 - content_for :header do
2 2 = javascript_include_tag 'new'
3 3
4 4 %script{:type=>"text/javascript"}
5 5 $(function () {
6 6 $('#submission_table').tablesorter({widgets: ['zebra','filter']});
7 7 });
8 8
9 + :css
10 + .fix-width {
11 + font-family: Droid Sans Mono,Consolas, monospace, mono, Courier New, Courier;
12 + }
13 +
9 14 %h1= @user.full_name + ' Profile'
10 15
11 16 %h2 Basic info
12 17 <b>Login:</b> #{@user.login} <br/>
13 18 <b>Full name:</b> #{@user.full_name} <br />
14 19
15 20
16 21 %h2 Problem Stat
17 22
18 23 %h2 Submissions
19 24
20 25 %table.tablesorter-cafe#submission_table
21 26 %thead
22 27 %tr
23 28 %th ID
24 29 %th Problem code
25 30 %th Problem name
26 31 %th Language
27 32 %th Result
28 33 %th Score
29 34 %tbody
30 35 - @submission.each do |s|
36 + - next unless s.problem
31 37 %tr
32 38 %td= link_to "#{s.id}", controller: "graders", action: "submission", id: s.id
33 39 %td= s.problem.name
34 40 %td= s.problem.full_name
35 41 %td= s.language.pretty_name
36 - %td{style: 'font-family: Droid Sans Mono,Consolas, monospace, mono'}= s.grader_comment
42 + %td.fix-width= s.grader_comment
37 43 %td= s.points/s.problem.full_score * 100
38 44
39 45
40 46
@@ -15,50 +15,51
15 15 # Application configuration should go into files in config/initializers
16 16 # -- all .rb files in that directory are automatically loaded.
17 17
18 18 # Custom directories with classes and modules you want to be autoloadable.
19 19 config.autoload_paths += %W(#{config.root}/lib)
20 20
21 21 # Only load the plugins named here, in the order given (default is alphabetical).
22 22 # :all can be used as a placeholder for all plugins not explicitly named.
23 23 # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
24 24
25 25 # Activate observers that should always be running.
26 26 # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
27 27
28 28 # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
29 29 # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
30 30 config.time_zone = 'UTC'
31 31
32 32 # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
33 33 # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
34 34 config.i18n.default_locale = :en
35 35
36 36 # Configure the default encoding used in templates for Ruby 1.9.
37 37 config.encoding = "utf-8"
38 38
39 39 # Configure sensitive parameters which will be filtered from the log file.
40 40 config.filter_parameters += [:password]
41 41
42 42 # Enable escaping HTML in JSON.
43 43 config.active_support.escape_html_entities_in_json = true
44 44
45 45 # Use SQL instead of Active Record's schema dumper when creating the database.
46 46 # This is necessary if your schema can't be completely dumped by the schema dumper,
47 47 # like if you have constraints or database-specific column types
48 48 # config.active_record.schema_format = :sql
49 49
50 50 # Enforce whitelist mode for mass assignment.
51 51 # This will create an empty whitelist of attributes available for mass-assignment for all models
52 52 # in your app. As such, your models will need to explicitly whitelist or blacklist accessible
53 53 # parameters by using an attr_accessible or attr_protected declaration.
54 54 config.active_record.whitelist_attributes = false
55 55
56 56 # Enable the asset pipeline
57 57 config.assets.enabled = true
58 58
59 59 # Version of your assets, change this if you want to expire all your assets
60 60 config.assets.version = '1.0'
61 61
62 62 config.assets.precompile += ['announcement_refresh.js','effects.js','site_update.js','graders.css','problems.css']
63 + config.assets.precompile += ['new.js','tablesorter-theme.cafe.css']
63 64 end
64 65 end
@@ -1,245 +1,242
1 1 # encoding: UTF-8
2 2 # This file is auto-generated from the current state of the database. Instead
3 3 # of editing this file, please use the migrations feature of Active Record to
4 4 # incrementally modify your database, and then regenerate this schema definition.
5 5 #
6 6 # Note that this schema.rb definition is the authoritative source for your
7 7 # database schema. If you need to create the application database on another
8 8 # system, you should be using db:schema:load, not running all the migrations
9 9 # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10 10 # you'll amass, the slower it'll run and the greater likelihood for issues).
11 11 #
12 12 # It's strongly recommended to check this file into your version control system.
13 13
14 14 ActiveRecord::Schema.define(:version => 20140826095949) 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", :limit => 16777215
19 19 t.boolean "published"
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
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
27 27
28 28 create_table "contests", :force => true do |t|
29 29 t.string "title"
30 30 t.boolean "enabled"
31 31 t.datetime "created_at", :null => false
32 32 t.datetime "updated_at", :null => false
33 33 t.string "name"
34 34 end
35 35
36 36 create_table "contests_problems", :id => false, :force => true do |t|
37 37 t.integer "contest_id"
38 38 t.integer "problem_id"
39 39 end
40 40
41 41 create_table "contests_users", :id => false, :force => true do |t|
42 42 t.integer "contest_id"
43 43 t.integer "user_id"
44 44 end
45 45
46 46 create_table "countries", :force => true do |t|
47 47 t.string "name"
48 48 t.datetime "created_at", :null => false
49 49 t.datetime "updated_at", :null => false
50 50 end
51 51
52 52 create_table "descriptions", :force => true do |t|
53 - t.text "body"
53 + t.text "body", :limit => 16777215
54 54 t.boolean "markdowned"
55 - t.datetime "created_at", :null => false
56 - t.datetime "updated_at", :null => false
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", :null => false
64 - t.datetime "updated_at", :null => false
65 - t.text "description"
63 + t.datetime "created_at", :null => false
64 + t.datetime "updated_at", :null => false
65 + t.text "description", :limit => 16777215
66 66 end
67 67
68 68 create_table "grader_processes", :force => true do |t|
69 69 t.string "host", :limit => 20
70 70 t.integer "pid"
71 71 t.string "mode"
72 72 t.boolean "active"
73 73 t.datetime "created_at", :null => false
74 74 t.datetime "updated_at", :null => false
75 75 t.integer "task_id"
76 76 t.string "task_type"
77 77 t.boolean "terminated"
78 78 end
79 79
80 80 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
81 81
82 82 create_table "languages", :force => true do |t|
83 83 t.string "name", :limit => 10
84 84 t.string "pretty_name"
85 85 t.string "ext", :limit => 10
86 86 t.string "common_ext"
87 87 end
88 88
89 89 create_table "logins", :force => true do |t|
90 90 t.string "user_id"
91 91 t.string "ip_address"
92 92 t.datetime "created_at", :null => false
93 93 t.datetime "updated_at", :null => false
94 94 end
95 95
96 96 create_table "messages", :force => true do |t|
97 97 t.integer "sender_id"
98 98 t.integer "receiver_id"
99 99 t.integer "replying_message_id"
100 - t.text "body"
100 + t.text "body", :limit => 16777215
101 101 t.boolean "replied"
102 - t.datetime "created_at", :null => false
103 - t.datetime "updated_at", :null => false
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|
107 107 t.string "name", :limit => 30
108 108 t.string "full_name"
109 109 t.integer "full_score"
110 110 t.date "date_added"
111 111 t.boolean "available"
112 112 t.string "url"
113 113 t.integer "description_id"
114 114 t.boolean "test_allowed"
115 115 t.boolean "output_only"
116 116 t.string "description_filename"
117 117 end
118 118
119 119 create_table "rights", :force => true do |t|
120 120 t.string "name"
121 121 t.string "controller"
122 122 t.string "action"
123 123 end
124 124
125 125 create_table "rights_roles", :id => false, :force => true do |t|
126 126 t.integer "right_id"
127 127 t.integer "role_id"
128 128 end
129 129
130 130 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
131 131
132 132 create_table "roles", :force => true do |t|
133 133 t.string "name"
134 134 end
135 135
136 136 create_table "roles_users", :id => false, :force => true do |t|
137 137 t.integer "role_id"
138 138 t.integer "user_id"
139 139 end
140 140
141 141 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
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", :limit => 16777215
146 146 t.datetime "updated_at"
147 147 end
148 148
149 149 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
150 150 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
151 151
152 152 create_table "sites", :force => true do |t|
153 153 t.string "name"
154 154 t.boolean "started"
155 155 t.datetime "start_time"
156 156 t.datetime "created_at", :null => false
157 157 t.datetime "updated_at", :null => false
158 158 t.integer "country_id"
159 159 t.string "password"
160 160 end
161 161
162 162 create_table "submissions", :force => true do |t|
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", :limit => 16777215
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", :limit => 16777215
171 171 t.datetime "graded_at"
172 172 t.integer "points"
173 - t.text "grader_comment"
173 + t.text "grader_comment", :limit => 16777215
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 176 end
180 177
181 178 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
182 179 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
183 180
184 181 create_table "tasks", :force => true do |t|
185 182 t.integer "submission_id"
186 183 t.datetime "created_at"
187 184 t.integer "status"
188 185 t.datetime "updated_at"
189 186 end
190 187
191 188 create_table "test_pairs", :force => true do |t|
192 189 t.integer "problem_id"
193 - t.text "input", :limit => 16777215
194 - t.text "solution", :limit => 16777215
195 - t.datetime "created_at", :null => false
196 - t.datetime "updated_at", :null => false
190 + t.text "input", :limit => 2147483647
191 + t.text "solution", :limit => 2147483647
192 + t.datetime "created_at", :null => false
193 + t.datetime "updated_at", :null => false
197 194 end
198 195
199 196 create_table "test_requests", :force => true do |t|
200 197 t.integer "user_id"
201 198 t.integer "problem_id"
202 199 t.integer "submission_id"
203 200 t.string "input_file_name"
204 201 t.string "output_file_name"
205 202 t.string "running_stat"
206 203 t.integer "status"
207 - t.datetime "updated_at", :null => false
204 + t.datetime "updated_at", :null => false
208 205 t.datetime "submitted_at"
209 206 t.datetime "compiled_at"
210 - t.text "compiler_message"
207 + t.text "compiler_message", :limit => 16777215
211 208 t.datetime "graded_at"
212 209 t.string "grader_comment"
213 - t.datetime "created_at", :null => false
210 + t.datetime "created_at", :null => false
214 211 t.float "running_time"
215 212 t.string "exit_status"
216 213 t.integer "memory_usage"
217 214 end
218 215
219 216 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
220 217
221 218 create_table "user_contest_stats", :force => true do |t|
222 219 t.integer "user_id"
223 220 t.datetime "started_at"
224 221 t.datetime "created_at", :null => false
225 222 t.datetime "updated_at", :null => false
226 223 t.boolean "forced_logout"
227 224 end
228 225
229 226 create_table "users", :force => true do |t|
230 227 t.string "login", :limit => 50
231 228 t.string "full_name"
232 229 t.string "hashed_password"
233 230 t.string "salt", :limit => 5
234 231 t.string "alias"
235 232 t.string "email"
236 233 t.integer "site_id"
237 234 t.integer "country_id"
238 235 t.boolean "activated", :default => false
239 236 t.datetime "created_at"
240 237 t.datetime "updated_at"
241 238 end
242 239
243 240 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
244 241
245 242 end
You need to be logged in to leave comments. Login now