type = UNIQUE_ANSWER; } /** * function which redifines Question::createAnswersForm * @param the formvalidator instance * @param the answers number to display */ function createAnswersForm ($form) { global $fck_attribute; $fck_attribute = array(); $fck_attribute['Width'] = '300px'; $fck_attribute['Height'] = '100px'; $fck_attribute['ToolbarSet'] = 'Small'; $fck_attribute['Config']['IMUploadPath'] = 'upload/test/'; $fck_attribute['Config']['FlashUploadPath'] = 'upload/test/'; $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2; $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); $html='
| '.get_lang('Number').' | '.get_lang('True').' | '.get_lang('Answer').' | '.get_lang('Comment').' | '.get_lang('Weighting').' | |
| '); $group = array(); $puce = FormValidator :: createElement ('text', null,null,'value="'.$i.'"'); $puce->freeze(); $group[] = $puce; $group[] = FormValidator :: createElement ('radio', 'correct', null, null, $i); $group[] = FormValidator :: createElement ('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle"'); $group[] = FormValidator :: createElement ('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle"'); $group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, 'style="vertical-align:middle" size="5" value="0"'); $form -> addGroup($group, null, null, ' | '); $form -> addElement ('html', ' |