Description:
[web] changed column type for running_time in test_requests, display new stat info git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@162 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r82:8ff8f19e9fbb - - 3 files changed: 9 inserted, 4 deleted

@@ -1,22 +1,27
1 = user_title_bar(@user)
1 = user_title_bar(@user)
2
2
3 - %div{:style => "text-align: center"}
3 + %div{:style => "text-align: center; font-size: 12px"}
4 = "Problem: #{@test_request.problem.full_name}"
4 = "Problem: #{@test_request.problem.full_name}"
5 %br/
5 %br/
6 = "Submission: #{@test_request.submission.number}"
6 = "Submission: #{@test_request.submission.number}"
7 %br/
7 %br/
8 = "Test submitted at: #{format_short_time(@test_request.submitted_at)}"
8 = "Test submitted at: #{format_short_time(@test_request.submitted_at)}"
9 %br/
9 %br/
10 - = simple_format((@test_request.running_stat or ''))
10 + = "Execution time: #{@test_request.running_time} s."
11 + %br/
12 + = "Memory usage: #{@test_request.memory_usage}"
13 + %br/
14 + %b= @test_request.exit_status
15 + %br/
11
16
12 - if @test_request.compiler_message!=nil and @test_request.compiler_message!=''
17 - if @test_request.compiler_message!=nil and @test_request.compiler_message!=''
13 %b Compiler Message
18 %b Compiler Message
14 %div{:style => "border: 1px solid black; background: lightgrey"}
19 %div{:style => "border: 1px solid black; background: lightgrey"}
15 = simple_format((@test_request.compiler_message or ''))
20 = simple_format((@test_request.compiler_message or ''))
16
21
17 %b Input
22 %b Input
18 %div{:style => "border: 1px solid black; background: lightgrey"}
23 %div{:style => "border: 1px solid black; background: lightgrey"}
19 - if @test_request.input_file_name!=nil
24 - if @test_request.input_file_name!=nil
20 = simple_format(read_textfile(@test_request.input_file_name,2048))
25 = simple_format(read_textfile(@test_request.input_file_name,2048))
21
26
22 %b Output
27 %b Output
@@ -1,13 +1,13
1 class AddRunstatColumnsToTestRequest < ActiveRecord::Migration
1 class AddRunstatColumnsToTestRequest < ActiveRecord::Migration
2 def self.up
2 def self.up
3 - add_column :test_requests, :running_time, :time
3 + add_column :test_requests, :running_time, :float
4 add_column :test_requests, :exit_status, :string
4 add_column :test_requests, :exit_status, :string
5 add_column :test_requests, :memory_usage, :integer
5 add_column :test_requests, :memory_usage, :integer
6 end
6 end
7
7
8 def self.down
8 def self.down
9 remove_column :test_requests, :running_time
9 remove_column :test_requests, :running_time
10 remove_column :test_requests, :exit_status
10 remove_column :test_requests, :exit_status
11 remove_column :test_requests, :memory_usage
11 remove_column :test_requests, :memory_usage
12 end
12 end
13 end
13 end
@@ -110,25 +110,25
110 t.integer "submission_id"
110 t.integer "submission_id"
111 t.string "input_file_name"
111 t.string "input_file_name"
112 t.string "output_file_name"
112 t.string "output_file_name"
113 t.string "running_stat"
113 t.string "running_stat"
114 t.integer "status"
114 t.integer "status"
115 t.datetime "updated_at"
115 t.datetime "updated_at"
116 t.datetime "submitted_at"
116 t.datetime "submitted_at"
117 t.datetime "compiled_at"
117 t.datetime "compiled_at"
118 t.text "compiler_message"
118 t.text "compiler_message"
119 t.datetime "graded_at"
119 t.datetime "graded_at"
120 t.string "grader_comment"
120 t.string "grader_comment"
121 t.datetime "created_at"
121 t.datetime "created_at"
122 - t.time "running_time"
122 + t.float "running_time"
123 t.string "exit_status"
123 t.string "exit_status"
124 t.integer "memory_usage"
124 t.integer "memory_usage"
125 end
125 end
126
126
127 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
127 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
128
128
129 create_table "users", :force => true do |t|
129 create_table "users", :force => true do |t|
130 t.string "login", :limit => 10
130 t.string "login", :limit => 10
131 t.string "full_name"
131 t.string "full_name"
132 t.string "hashed_password"
132 t.string "hashed_password"
133 t.string "salt", :limit => 5
133 t.string "salt", :limit => 5
134 t.string "alias"
134 t.string "alias"
You need to be logged in to leave comments. Login now