, Ghent University
*
* @version January 2007
*/
public function createForm($survey_data, $form_content)
{
parent::createForm($survey_data, $form_content);
$this->html .= '
';
$this->html .= ' '.get_lang('Display').' ';
$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('Answer options').' ';
$this->html .= ' ';
$total_number_of_answers = count($form_content['answers']);
$question_values = [];
// 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 .= ''.($key + 1).' ';
$this->html .= ''.api_return_html_area('answers['.$key.']', api_html_entity_decode(stripslashes($form_content['answers'][$key])), '', '', null, ['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++;
}
}
}
/**
* @param FormValidator $form
* @param array $questionData
* @param array $answers
*/
public function render(FormValidator $form, $questionData = [], $answers = [])
{
$question = new ch_yesno();
$question->render($form, $questionData, $answers);
}
}