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
