@ -7,6 +7,6 @@ class ExerciseChoice < ApplicationRecord
scope :find_choice_custom, lambda {|k,v| where("#{k} = ?",v)} #根据传入的参数查找问题
scope :left_choice_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题
validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" }
# validates :choice_text, length: { maximum: 500, too_long: "不能超过500个字符" }
end
@ -16,7 +16,7 @@ class ExerciseQuestion < ApplicationRecord
scope :left_question_choose, lambda {|k,v| where("#{k} > ?",v)} #根据传入的参数查找问题
scope :find_objective_questions, -> {where("question_type != ?",4)} #查找全部客观题
validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" }
# validates :question_title, length: { maximum: 1000, too_long: "不能超过1000个字符" }
def question_type_name