#encoding: utf-8 class QuestionBank < ActiveRecord::Base belongs_to :user belongs_to :course_list #attr_accessible :container_id, :container_type, :quotes def bank_type type = "" case self.container_type when 'Common' type = "普通作业" when 'Shixun' type = "实训作业" when 'Group' type = "分组作业" when 'Exercise' type = "试卷" when 'Poll' type = "问卷" end type end end