增加每份编程作品的测试结果的记录
This commit is contained in:
parent
4606cf7c28
commit
0b66097bfb
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
|
@ -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
|
Loading…
Reference in New Issue