去掉试卷题库的字数限制

courseware
cxt 5 years ago
parent 9bbcb3471d
commit 448151f51a

@ -5,6 +5,6 @@ class ExerciseBankChoice < 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

@ -11,7 +11,7 @@ class ExerciseBankQuestion < 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
case self.question_type

Loading…
Cancel
Save