socialforge/app/models/homework_common.rb

14 lines
629 B
Ruby

#老师布置的作业表
#homework_type: 1:普通作业;2:匿评作业;3:编程作业
class HomeworkCommon < ActiveRecord::Base
attr_accessible :name, :user_id, :description, :publish_time, :end_time, :homework_type, :late_penalty, :course_id
belongs_to :course
belongs_to :user
has_one :homework_detail_manual, :dependent => :destroy
has_one :homework_detail_programing, :dependent => :destroy
has_many :homework_tests, :dependent => :destroy
has_many :student_works, :dependent => :destroy
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
end