type = MULTIPLE_ANSWER; } /** * function which redifines Question::createAnswersForm * @param the formvalidator instance * @param the answers number to display */ function createAnswersForm ($form) { $nb_answers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 2; $nb_answers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0)); $html='
| N° | True | Answer | Comment | 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 ('textarea', 'answer['.$i.']',null, 'style="vertical-align:middle" cols="30"'); $group[] = FormValidator :: createElement ('textarea', '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', ' |