增加每份编程作品的测试结果的记录

This commit is contained in:
sw 2015-07-15 15:21:26 +08:00
parent 4606cf7c28
commit 0b66097bfb
4 changed files with 21 additions and 0 deletions

View File

@ -2,4 +2,5 @@ class HomeworkTest < ActiveRecord::Base
attr_accessible :input, :output, :homework_common_id
belongs_to :homework_common
has_one :student_work_test
end

View File

@ -7,6 +7,7 @@ class StudentWork < ActiveRecord::Base
has_many :student_works_evaluation_distributions, :dependent => :destroy
has_many :student_works_scores, :dependent => :destroy
belongs_to :project
has_one :student_work_test
acts_as_attachable
end

View File

@ -0,0 +1,6 @@
class StudentWorkTest < ActiveRecord::Base
attr_accessible :student_work_id, :homework_test_id
belongs_to :homework_test
belongs_to :student_work
end

View File

@ -0,0 +1,13 @@
class CreateTestResult < ActiveRecord::Migration
def up
create_table :student_work_test do |t|
t.integer :student_work_id
t.integer :homework_test_id
t.integer :result
t.timestamps
end
end
def down
end
end