Description:
started grader_process
git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@54 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
r29:cf924ea7dc0a - - 8 files changed: 72 inserted, 1 deleted
@@ -0,0 +1,17 | |||
|
1 | + class GraderProcess < ActiveRecord::Base | |
|
2 | + | |
|
3 | + def self.find_by_ip_and_pid(ip,pid) | |
|
4 | + return GraderProcess.find(:first, | |
|
5 | + :conditions => { | |
|
6 | + :ip => ip, | |
|
7 | + :pid => pid | |
|
8 | + }) | |
|
9 | + end | |
|
10 | + | |
|
11 | + def self.report_active(ip,pid,mode) | |
|
12 | + end | |
|
13 | + | |
|
14 | + def self.report_inactive(ip,pid,mode) | |
|
15 | + end | |
|
16 | + | |
|
17 | + end |
@@ -0,0 +1,16 | |||
|
1 | + class CreateGraderProcesses < ActiveRecord::Migration | |
|
2 | + def self.up | |
|
3 | + create_table :grader_processes do |t| | |
|
4 | + t.column :ip, :string, :limit => 20 | |
|
5 | + t.column :pid, :integer | |
|
6 | + t.column :mode, :string | |
|
7 | + t.column :active, :boolean | |
|
8 | + t.timestamps | |
|
9 | + end | |
|
10 | + add_index :grader_processes, ["ip","pid"] | |
|
11 | + end | |
|
12 | + | |
|
13 | + def self.down | |
|
14 | + drop_table :grader_processes | |
|
15 | + end | |
|
16 | + end |
@@ -0,0 +1,7 | |||
|
1 | + # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html | |
|
2 | + | |
|
3 | + # one: | |
|
4 | + # column: value | |
|
5 | + # | |
|
6 | + # two: | |
|
7 | + # column: value |
@@ -0,0 +1,8 | |||
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | |
|
2 | + | |
|
3 | + class GradersControllerTest < ActionController::TestCase | |
|
4 | + # Replace this with your real tests. | |
|
5 | + def test_truth | |
|
6 | + assert true | |
|
7 | + end | |
|
8 | + end |
@@ -0,0 +1,8 | |||
|
1 | + require File.dirname(__FILE__) + '/../test_helper' | |
|
2 | + | |
|
3 | + class GraderProcessTest < ActiveSupport::TestCase | |
|
4 | + # Replace this with your real tests. | |
|
5 | + def test_truth | |
|
6 | + assert true | |
|
7 | + end | |
|
8 | + end |
@@ -1,94 +1,105 | |||
|
1 | 1 | # This file is auto-generated from the current state of the database. Instead of editing this file, |
|
2 | 2 | # please use the migrations feature of ActiveRecord to incrementally modify your database, and |
|
3 | 3 | # then regenerate this schema definition. |
|
4 | 4 | # |
|
5 | 5 | # Note that this schema.rb definition is the authoritative source for your database schema. If you need |
|
6 | 6 | # to create the application database on another system, you should be using db:schema:load, not running |
|
7 | 7 | # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
8 | 8 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
9 | 9 | # |
|
10 | 10 | # It's strongly recommended to check this file into your version control system. |
|
11 | 11 | |
|
12 |
- ActiveRecord::Schema.define(:version => 1 |
|
|
12 | + ActiveRecord::Schema.define(:version => 14) do | |
|
13 | + | |
|
14 | + create_table "grader_processes", :force => true do |t| | |
|
15 | + t.string "ip", :limit => 20 | |
|
16 | + t.integer "pid" | |
|
17 | + t.string "mode" | |
|
18 | + t.boolean "active" | |
|
19 | + t.datetime "created_at" | |
|
20 | + t.datetime "updated_at" | |
|
21 | + end | |
|
22 | + | |
|
23 | + add_index "grader_processes", ["ip", "pid"], :name => "index_grader_processes_on_ip_and_pid" | |
|
13 | 24 | |
|
14 | 25 | create_table "languages", :force => true do |t| |
|
15 | 26 | t.string "name", :limit => 10 |
|
16 | 27 | t.string "pretty_name" |
|
17 | 28 | t.string "ext", :limit => 10 |
|
18 | 29 | end |
|
19 | 30 | |
|
20 | 31 | create_table "problems", :force => true do |t| |
|
21 | 32 | t.string "name", :limit => 30 |
|
22 | 33 | t.string "full_name" |
|
23 | 34 | t.integer "full_score" |
|
24 | 35 | t.date "date_added" |
|
25 | 36 | t.boolean "available" |
|
26 | 37 | t.string "url" |
|
27 | 38 | end |
|
28 | 39 | |
|
29 | 40 | create_table "rights", :force => true do |t| |
|
30 | 41 | t.string "name" |
|
31 | 42 | t.string "controller" |
|
32 | 43 | t.string "action" |
|
33 | 44 | end |
|
34 | 45 | |
|
35 | 46 | create_table "rights_roles", :id => false, :force => true do |t| |
|
36 | 47 | t.integer "right_id" |
|
37 | 48 | t.integer "role_id" |
|
38 | 49 | end |
|
39 | 50 | |
|
40 | 51 | add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id" |
|
41 | 52 | |
|
42 | 53 | create_table "roles", :force => true do |t| |
|
43 | 54 | t.string "name" |
|
44 | 55 | end |
|
45 | 56 | |
|
46 | 57 | create_table "roles_users", :id => false, :force => true do |t| |
|
47 | 58 | t.integer "role_id" |
|
48 | 59 | t.integer "user_id" |
|
49 | 60 | end |
|
50 | 61 | |
|
51 | 62 | add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id" |
|
52 | 63 | |
|
53 | 64 | create_table "sessions", :force => true do |t| |
|
54 | 65 | t.string "session_id" |
|
55 | 66 | t.text "data" |
|
56 | 67 | t.datetime "updated_at" |
|
57 | 68 | end |
|
58 | 69 | |
|
59 | 70 | add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id" |
|
60 | 71 | add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at" |
|
61 | 72 | |
|
62 | 73 | create_table "submissions", :force => true do |t| |
|
63 | 74 | t.integer "user_id" |
|
64 | 75 | t.integer "problem_id" |
|
65 | 76 | t.integer "language_id" |
|
66 | 77 | t.text "source" |
|
67 | 78 | t.binary "binary" |
|
68 | 79 | t.datetime "submitted_at" |
|
69 | 80 | t.datetime "compiled_at" |
|
70 | 81 | t.text "compiler_message" |
|
71 | 82 | t.datetime "graded_at" |
|
72 | 83 | t.integer "points" |
|
73 | 84 | t.text "grader_comment" |
|
74 | 85 | end |
|
75 | 86 | |
|
76 | 87 | add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id" |
|
77 | 88 | |
|
78 | 89 | create_table "tasks", :force => true do |t| |
|
79 | 90 | t.integer "submission_id" |
|
80 | 91 | t.datetime "created_at" |
|
81 | 92 | end |
|
82 | 93 | |
|
83 | 94 | create_table "users", :force => true do |t| |
|
84 | 95 | t.string "login", :limit => 10 |
|
85 | 96 | t.string "full_name" |
|
86 | 97 | t.string "hashed_password" |
|
87 | 98 | t.string "salt", :limit => 5 |
|
88 | 99 | t.string "alias" |
|
89 | 100 | t.string "email" |
|
90 | 101 | end |
|
91 | 102 | |
|
92 | 103 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
93 | 104 | |
|
94 | 105 | end |
You need to be logged in to leave comments.
Login now