, Ghent University * @version January 2007 */ public function createForm($survey_data, $form_content) { parent::createForm($survey_data, $form_content); $this->html .= ' '; $this->html .= ' '.get_lang('DisplayAnswersHorVert').''; $this->html .= ' '; // Horizontal or vertical $this->html .= ' '; $this->html .= '  '; $this->html .= ' '; $this->html .= ' html .= 'checked="checked"'; } $this->html .= '/>'.get_lang('Horizontal').'
'; $this->html .= ' html .= 'checked="checked"'; } $this->html .= ' />'.get_lang('Vertical').''; $this->html .= ' '; $this->html .= '  '; $this->html .= ' '; $this->html .= '   '; // The options $this->html .= ' '; $this->html .= ' '.get_lang('AnswerOptions').''; $this->html .= ' '; $total_number_of_answers = count($form_content['answers']); $question_values = array(); // Values of question options if (is_array($form_content['values'])) { // Check if data is correct foreach ($form_content['values'] as $key => & $value) { $question_values [] = ''; } } $count = 0; if (is_array($form_content['answers'])) { foreach ($form_content['answers'] as $key => & $value) { $this->html .= ''; $this->html .= ''; $this->html .= ''.api_return_html_area('answers['.$key.']', api_html_entity_decode(stripslashes($form_content['answers'][$key])), '', '', null, array('ToolbarSet' => 'Survey', 'Width' => '100%', 'Height' => '120')).''; $this->html .= ''; if ($total_number_of_answers > 2) { $this->html .= $question_values[$count]; } if ($key < $total_number_of_answers - 1) { $this->html .= ''; } if ($key > 0) { $this->html .= ''; } if ($total_number_of_answers > 2) { $this->html .= ''; } $this->html .= ''; $this->html .= ''; $count++; } } // The buttons for adding or removing //$this->html .= parent :: add_remove_buttons($form_content); } /** * @param FormValidator $form * @param array $questionData * @param array $answers */ public function render(FormValidator $form, $questionData = array(), $answers = array()) { $question = new ch_yesno(); $question->render($form, $questionData, $answers); } }