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.
educoder/app/models/item_bank.rb

25 lines
685 B

class ItemBank < ApplicationRecord
# difficulty: 1 简单 2 适中 3 困难
# item_type: 0 单选 1 多选 2 判断 3 填空 4 简答 5 实训 6 编程
# 试卷的问题类型
SINGLE = 0 #单选题
MULTIPLE = 1 #多选题
JUDGMENT = 2 #判断题
COMPLETION = 3 # 填空题
SUBJECTIVE = 4 # 主观题
PRACTICAL = 5 #实训题
PROGRAM = 6 #编程题
belongs_to :user
belongs_to :sub_repertoire
has_one :item_analysis, dependent: :destroy
has_many :item_choices, dependent: :destroy
has_many :item_baskets, dependent: :destroy
has_many :item_bank_tag_repertoires, dependent: :destroy
def analysisi
item_analysis&.analysis
end
end