You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
class ExerciseShixunAnswer < ApplicationRecord
|
|
|
|
|
belongs_to :exercise_question
|
|
|
|
|
belongs_to :user
|
|
|
|
|
belongs_to :exercise_shixun_challenge
|
|
|
|
|
has_many :exercise_answer_comments, :dependent => :destroy
|
|
|
|
|
# status 0: 未通过, 1:通过
|
|
|
|
|
# attr_accessible :answer_text, :score, :status
|
|
|
|
|
scope :search_shixun_answers, lambda {|name,ids| where("#{name}":ids)}
|
|
|
|
|
scope :search_shixun_keys, lambda { |name,key| where("#{name} = ?",key)}
|
|
|
|
|
scope :shixun_no_full_scores, lambda { |score| where("score > 0.0 AND score < ?",score)}
|
|
|
|
|
scope :score_reviewed, lambda {where("score is not NULL AND score >= ?",0.0)} #是否评分
|
|
|
|
|
|
|
|
|
|
end
|