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:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r82:8ff8f19e9fbb - - 3 files changed: 9 inserted, 4 deleted
@@ -1,27 +1,32 | |||
|
1 | 1 | = user_title_bar(@user) |
|
2 | 2 | |
|
3 | - %div{:style => "text-align: center"} | |
|
3 | + %div{:style => "text-align: center; font-size: 12px"} | |
|
4 | 4 | = "Problem: #{@test_request.problem.full_name}" |
|
5 | 5 | %br/ |
|
6 | 6 | = "Submission: #{@test_request.submission.number}" |
|
7 | 7 | %br/ |
|
8 | 8 | = "Test submitted at: #{format_short_time(@test_request.submitted_at)}" |
|
9 | 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 | 17 | - if @test_request.compiler_message!=nil and @test_request.compiler_message!='' |
|
13 | 18 | %b Compiler Message |
|
14 | 19 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
15 | 20 | = simple_format((@test_request.compiler_message or '')) |
|
16 | 21 | |
|
17 | 22 | %b Input |
|
18 | 23 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
19 | 24 | - if @test_request.input_file_name!=nil |
|
20 | 25 | = simple_format(read_textfile(@test_request.input_file_name,2048)) |
|
21 | 26 | |
|
22 | 27 | %b Output |
|
23 | 28 | %div{:style => "border: 1px solid black; background: lightgrey"} |
|
24 | 29 | - if @test_request.output_file_name!=nil |
|
25 | 30 | = simple_format(read_textfile(@test_request.output_file_name,2048)) |
|
26 | 31 | - else |
|
27 | 32 | (no output) |
@@ -1,13 +1,13 | |||
|
1 | 1 | class AddRunstatColumnsToTestRequest < ActiveRecord::Migration |
|
2 | 2 | def self.up |
|
3 |
- add_column :test_requests, :running_time, :t |
|
|
3 | + add_column :test_requests, :running_time, :float | |
|
4 | 4 | add_column :test_requests, :exit_status, :string |
|
5 | 5 | add_column :test_requests, :memory_usage, :integer |
|
6 | 6 | end |
|
7 | 7 | |
|
8 | 8 | def self.down |
|
9 | 9 | remove_column :test_requests, :running_time |
|
10 | 10 | remove_column :test_requests, :exit_status |
|
11 | 11 | remove_column :test_requests, :memory_usage |
|
12 | 12 | end |
|
13 | 13 | end |
@@ -26,115 +26,115 | |||
|
26 | 26 | t.boolean "active" |
|
27 | 27 | t.datetime "created_at" |
|
28 | 28 | t.datetime "updated_at" |
|
29 | 29 | t.integer "task_id" |
|
30 | 30 | end |
|
31 | 31 | |
|
32 | 32 | add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid" |
|
33 | 33 | |
|
34 | 34 | create_table "languages", :force => true do |t| |
|
35 | 35 | t.string "name", :limit => 10 |
|
36 | 36 | t.string "pretty_name" |
|
37 | 37 | t.string "ext", :limit => 10 |
|
38 | 38 | end |
|
39 | 39 | |
|
40 | 40 | create_table "problems", :force => true do |t| |
|
41 | 41 | t.string "name", :limit => 30 |
|
42 | 42 | t.string "full_name" |
|
43 | 43 | t.integer "full_score" |
|
44 | 44 | t.date "date_added" |
|
45 | 45 | t.boolean "available" |
|
46 | 46 | t.string "url" |
|
47 | 47 | end |
|
48 | 48 | |
|
49 | 49 | create_table "rights", :force => true do |t| |
|
50 | 50 | t.string "name" |
|
51 | 51 | t.string "controller" |
|
52 | 52 | t.string "action" |
|
53 | 53 | end |
|
54 | 54 | |
|
55 | 55 | create_table "rights_roles", :id => false, :force => true do |t| |
|
56 | 56 | t.integer "right_id" |
|
57 | 57 | t.integer "role_id" |
|
58 | 58 | end |
|
59 | 59 | |
|
60 | 60 | add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id" |
|
61 | 61 | |
|
62 | 62 | create_table "roles", :force => true do |t| |
|
63 | 63 | t.string "name" |
|
64 | 64 | end |
|
65 | 65 | |
|
66 | 66 | create_table "roles_users", :id => false, :force => true do |t| |
|
67 | 67 | t.integer "role_id" |
|
68 | 68 | t.integer "user_id" |
|
69 | 69 | end |
|
70 | 70 | |
|
71 | 71 | add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id" |
|
72 | 72 | |
|
73 | 73 | create_table "sessions", :force => true do |t| |
|
74 | 74 | t.string "session_id" |
|
75 | 75 | t.text "data" |
|
76 | 76 | t.datetime "updated_at" |
|
77 | 77 | end |
|
78 | 78 | |
|
79 | 79 | add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" |
|
80 | 80 | add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" |
|
81 | 81 | |
|
82 | 82 | create_table "submissions", :force => true do |t| |
|
83 | 83 | t.integer "user_id" |
|
84 | 84 | t.integer "problem_id" |
|
85 | 85 | t.integer "language_id" |
|
86 | 86 | t.text "source" |
|
87 | 87 | t.binary "binary" |
|
88 | 88 | t.datetime "submitted_at" |
|
89 | 89 | t.datetime "compiled_at" |
|
90 | 90 | t.text "compiler_message" |
|
91 | 91 | t.datetime "graded_at" |
|
92 | 92 | t.integer "points" |
|
93 | 93 | t.text "grader_comment" |
|
94 | 94 | t.integer "number" |
|
95 | 95 | end |
|
96 | 96 | |
|
97 | 97 | add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true |
|
98 | 98 | add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id" |
|
99 | 99 | |
|
100 | 100 | create_table "tasks", :force => true do |t| |
|
101 | 101 | t.integer "submission_id" |
|
102 | 102 | t.datetime "created_at" |
|
103 | 103 | t.integer "status" |
|
104 | 104 | t.datetime "updated_at" |
|
105 | 105 | end |
|
106 | 106 | |
|
107 | 107 | create_table "test_requests", :force => true do |t| |
|
108 | 108 | t.integer "user_id" |
|
109 | 109 | t.integer "problem_id" |
|
110 | 110 | t.integer "submission_id" |
|
111 | 111 | t.string "input_file_name" |
|
112 | 112 | t.string "output_file_name" |
|
113 | 113 | t.string "running_stat" |
|
114 | 114 | t.integer "status" |
|
115 | 115 | t.datetime "updated_at" |
|
116 | 116 | t.datetime "submitted_at" |
|
117 | 117 | t.datetime "compiled_at" |
|
118 | 118 | t.text "compiler_message" |
|
119 | 119 | t.datetime "graded_at" |
|
120 | 120 | t.string "grader_comment" |
|
121 | 121 | t.datetime "created_at" |
|
122 |
- t.t |
|
|
122 | + t.float "running_time" | |
|
123 | 123 | t.string "exit_status" |
|
124 | 124 | t.integer "memory_usage" |
|
125 | 125 | end |
|
126 | 126 | |
|
127 | 127 | add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id" |
|
128 | 128 | |
|
129 | 129 | create_table "users", :force => true do |t| |
|
130 | 130 | t.string "login", :limit => 10 |
|
131 | 131 | t.string "full_name" |
|
132 | 132 | t.string "hashed_password" |
|
133 | 133 | t.string "salt", :limit => 5 |
|
134 | 134 | t.string "alias" |
|
135 | 135 | t.string "email" |
|
136 | 136 | end |
|
137 | 137 | |
|
138 | 138 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
139 | 139 | |
|
140 | 140 | end |
You need to be logged in to leave comments.
Login now