socialforge/app/models/exercise.rb

10 lines
438 B
Ruby
Raw Normal View History

class Exercise < ActiveRecord::Base
#exercise_status: 1,新建2发布3关闭
include Redmine::SafeAttributes
belongs_to :user
belongs_to :course ,:touch => true
has_many :exercise_questions, :dependent => :destroy,:order => "#{ExerciseQuestion.table_name}.question_number"
has_many :exercise_users, :dependent => :destroy
has_many :users, :through => :exercise_users #该测试被哪些用户提交答案过
end