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/exercise_bank_question.rb

23 lines
612 B

class ExerciseBankQuestion < ApplicationRecord
belongs_to :exercise_bank
belongs_to :shixun
has_many :exercise_bank_shixun_challenges,:dependent => :destroy
has_many :exercise_bank_choices, :dependent => :destroy
has_many :exercise_bank_standard_answers, :dependent => :destroy
#attr_accessible :question_number, :question_score, :question_title, :question_type
def question_type_name
case self.question_type
when 1
"单选题"
when 2
"多选题"
when 3
"填空题"
when 4
"简答题"
when 5
"实训题"
end
end
end