From: Florent Bruneau Date: Sun, 30 Jan 2011 14:15:39 +0000 (+0100) Subject: Support multiline text answers. X-Git-Tag: xorg/1.1.0~166 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=ced5514d4f188ea4933f94c58e75d27351647410;p=platal.git Support multiline text answers. Signed-off-by: Florent Bruneau --- 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