ch_open.php 506 B

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