|
|
@ -7,8 +7,6 @@ class ItemBanks::SaveItemForm
|
|
|
|
validates :sub_discipline_id, presence: true
|
|
|
|
validates :sub_discipline_id, presence: true
|
|
|
|
validates :item_type, presence: true, inclusion: {in: %W(SINGLE MULTIPLE JUDGMENT COMPLETION SUBJECTIVE PRACTICAL PROGRAM)}
|
|
|
|
validates :item_type, presence: true, inclusion: {in: %W(SINGLE MULTIPLE JUDGMENT COMPLETION SUBJECTIVE PRACTICAL PROGRAM)}
|
|
|
|
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
|
|
|
|
validates :difficulty, presence: true, inclusion: {in: 1..3}, numericality: { only_integer: true }
|
|
|
|
validates :name, presence: true, length: { maximum: 1000, too_long: "不能超过1000个字符" }
|
|
|
|
|
|
|
|
validates :analysis, length: { maximum: 5000, too_long: "不能超过5000个字符" }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def validate!
|
|
|
|
def validate!
|
|
|
|
super
|
|
|
|
super
|
|
|
@ -27,7 +25,6 @@ class ItemBanks::SaveItemForm
|
|
|
|
|
|
|
|
|
|
|
|
attr_accessor :choice_text, :is_answer
|
|
|
|
attr_accessor :choice_text, :is_answer
|
|
|
|
|
|
|
|
|
|
|
|
validates :choice_text, presence: true, length: { maximum: 500, too_long: "不能超过500个字符" }
|
|
|
|
|
|
|
|
validates :is_answer, presence: true, inclusion: {in: 0..1}, numericality: { only_integer: true }
|
|
|
|
validates :is_answer, presence: true, inclusion: {in: 0..1}, numericality: { only_integer: true }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|