public function export()
{
$export = parent::export();
- $export['questions'] = array();
+ $export['questions'] = $this->exportQuestions();
+ return $export;
+ }
+
+ public function exportQuestions()
+ {
+ $export = array();
foreach ($this->questions as $question) {
- $export['questions'][] = $question->export();
+ $export[] = $question->export();
}
return $export;
}
+ public function exportQuestionsToJSON()
+ {
+ return json_encode($this->exportQuestions());
+ }
+
/* Return an indicator of the progression of the survey:
* negative values means 'the survey is not started'
* 0 means 'the survey is in progress'