type = FREE_ANSWER; } /** * function which redifines Question::createAnswersForm * @param the formvalidator instance */ function createAnswersForm ($form) { $form -> addElement('text','weighting',get_lang('Weighting'),'size="5"'); if(!empty($this->id)) { $form -> setDefaults(array('weighting' => float_format($this->weighting, 1))); } else { $form -> setDefaults(array('weighting' => '10')); } } /** * abstract function which creates the form to create / edit the answers of the question * @param the formvalidator instance */ function processAnswersCreation($form) { $this -> weighting = $form -> getSubmitValue('weighting'); $this->save(); } } endif; ?>