type = MULTIPLE_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="1"'); $puce->freeze(); $group[] = $puce; $group[] = FormValidator :: createElement ('checkbox', 'correct['.$i.']', null, null, $i); $group[] = FormValidator :: createElement ('html_editor', 'answer['.$i.']',null, 'style="vertical-align:middle" cols="30"'); $group[] = FormValidator :: createElement ('html_editor', 'comment['.$i.']',null, 'style="vertical-align:middle" cols="30"'); $group[] = FormValidator :: createElement ('text', 'weighting['.$i.']',null, 'style="vertical-align:middle" size="5" value="0"'); $form -> addGroup($group, null, null, ' | '); $form -> addElement ('html', ' |