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.
pgfqe6ch8/app/models/poll_question.rb

23 lines
548 B

#encoding: utf-8
class PollQuestion < ActiveRecord::Base
# attr_accessible :is_necessary, :polls_id, :question_title, :question_type
include Redmine::SafeAttributes
belongs_to :poll
has_many :poll_answers, :order => "#{PollAnswer.table_name}.answer_position",:dependent => :destroy
has_many :poll_votes, :dependent => :destroy
def question_type_name
case self.question_type
when 1
"单选题"
when 2
"多选题"
when 3
"主观题"
when 4
"多行主观题"
end
end
end