ch_comment.php 637 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /* For licensing terms, see /license.txt */
  3. /**
  4. * Class ch_comment.
  5. */
  6. class ch_comment extends survey_question
  7. {
  8. /**
  9. * @param FormValidator $form
  10. * @param array $questionData
  11. * @param string $answers
  12. */
  13. public function render(FormValidator $form, $questionData = [], $answers = '')
  14. {
  15. if (is_array($answers)) {
  16. $content = implode('', $answers);
  17. } else {
  18. $content = $answers;
  19. }
  20. $name = 'question'.$questionData['question_id'];
  21. $form->addTextarea($name, null);
  22. $form->setDefaults([$name => $answers]);
  23. }
  24. }