From ced5514d4f188ea4933f94c58e75d27351647410 Mon Sep 17 00:00:00 2001 From: Florent Bruneau Date: Sun, 30 Jan 2011 15:15:39 +0100 Subject: [PATCH 1/1] Support multiline text answers. Signed-off-by: Florent Bruneau --- htdocs/javascript/survey.js | 1 + modules/survey/question.inc.php | 13 +++++++++++++ templates/survey/edit.questions.tpl | 11 ++++++++++- templates/survey/vote.questions.tpl | 16 +++++++++++++--- 4 files changed, 37 insertions(+), 4 deletions(-) diff --git a/htdocs/javascript/survey.js b/htdocs/javascript/survey.js index 1b30014..80614a9 100644 --- a/htdocs/javascript/survey.js +++ b/htdocs/javascript/survey.js @@ -152,6 +152,7 @@ if (!q) { q = { qid: id }; } + console.log(q); var question = $("#q_edit_new").tmpl(q); var type = question .find('select[name$="[type]"]') diff --git a/modules/survey/question.inc.php b/modules/survey/question.inc.php index bd206ad..c29af36 100644 --- a/modules/survey/question.inc.php +++ b/modules/survey/question.inc.php @@ -91,6 +91,19 @@ class SurveyQuestion extends PlDBTableEntry } return $answer; } + + public function export() + { + $export = parent::export(); + if (isset($export['parameters'])) { + foreach ($export['parameters'] as $key=>$value) { + $export[$key] = $value; + } + unset($export['parameters']); + } + return $export; + } + } class SurveyQuestionGroup extends SurveyQuestion implements SurveyQuestionContainer diff --git a/templates/survey/edit.questions.tpl b/templates/survey/edit.questions.tpl index be29c27..866607b 100644 --- a/templates/survey/edit.questions.tpl +++ b/templates/survey/edit.questions.tpl @@ -36,7 +36,7 @@ Section