app/models/questionnaire.rb
# rearrange question content to be answered

rearrange question content to be answered
rearrange question content to be answered
def modifier!
    new_record? or return 
    question or return    
    if question_type.blank?
      errors.add "question_type", "回答方式が与えられていません．選んでください．"
    else
      question_content = question + Separator_Of_Question_And_Options;
      if (question_type == 'textarea')
        question_content += '' ;
      else
        if option_text.blank?
          errors.add "option_text", "選択肢がありません．｢選択肢の追加」により作成してください"
        else
          question_content += option_text.join(Separator_Of_Options)
          self.option_count = option_text.size
        end
      end
    end
    errors.empty? or fail ActiveRecord::RecordInvalid.new(self)
    self.question = question_content;
  end
def modifier! new_record? or return question or return if question_type . blank? errors . add "question_type" , "回答方式が与えられていません．選んでください．"
 else question_content = question + Separator_Of_Question_And_Options ; if ( question_type == 'textarea' ) question_content += '' ; else if option_text . blank? errors . add "option_text" , "選択肢がありません．｢選択肢の追加」により作成してください"
 else question_content += option_text . join ( Separator_Of_Options ) self . option_count = option_text . size end end end errors . empty? or fail ActiveRecord :: RecordInvalid . new ( self ) self . question = question_content ; end
rearrange question content to be answered
rearrange question content to be answered
# do nothing when making answer template.
 # do nothing when receiving answers.
