学生作品匿评分配表

sw_new_course
sw 10 years ago
parent 3abfaed081
commit 08b469fa3c

@ -4,4 +4,5 @@ class StudentWork < ActiveRecord::Base
belongs_to :homework_common belongs_to :homework_common
belongs_to :user belongs_to :user
has_many :student_works_evaluation_distributions, :dependent => :destroy
end end

@ -0,0 +1,7 @@
#学生作品匿评分配表
class StudentWorksEvaluationDistribution < ActiveRecord::Base
attr_accessible :student_work_id, :user_id
belongs_to :student_work
belongs_to :user
end

@ -84,6 +84,7 @@ class User < Principal
#作业相关关系 #作业相关关系
has_many :homework_commons, :dependent => :destroy has_many :homework_commons, :dependent => :destroy
has_many :student_works, :dependent => :destroy has_many :student_works, :dependent => :destroy
has_many :student_works_evaluation_distributions, :dependent => :destroy
#end #end
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)}, has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},

@ -0,0 +1,10 @@
class CreateStudentWorksEvaluationDistributions < ActiveRecord::Migration
def change
create_table :student_works_evaluation_distributions do |t|
t.integer :student_work_id
t.integer :user_id
t.timestamps
end
end
end

@ -11,7 +11,7 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150519022200) do ActiveRecord::Schema.define(:version => 20150519023821) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -1211,6 +1211,13 @@ ActiveRecord::Schema.define(:version => 20150519022200) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "student_works_evaluation_distributions", :force => true do |t|
t.integer "student_work_id"
t.integer "user_id"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "students_for_courses", :force => true do |t| create_table "students_for_courses", :force => true do |t|
t.integer "student_id" t.integer "student_id"
t.integer "course_id" t.integer "course_id"

Loading…
Cancel
Save