public function definition() { $item = $this->_customdata['item']; $common = $this->_customdata['common']; $positionlist = $this->_customdata['positionlist']; $position = $this->_customdata['position']; $mform =& $this->_form; $mform->addElement('header', 'general', get_string($this->type, 'local_evaluations')); $mform->addElement('advcheckbox', 'required', get_string('required', 'local_evaluations'), '' , null , array(0, 1)); $mform->addElement('text', 'name', get_string('item_name', 'local_evaluations'), array('size'=>EVALUATION_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addRule('name', get_string('missingmcname','local_evaluations'), 'required', null, 'client'); $mform->addElement('text', 'label', get_string('item_label', 'local_evaluations'), array('size'=>EVALUATION_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addElement('select', 'itemsize', get_string('textfield_size', 'local_evaluations').' ', array_slice(range(0, 255), 5, 255, true)); $mform->addElement('select', 'itemmaxlength', get_string('textfield_maxlength', 'local_evaluations').' ', array_slice(range(0, 255), 5, 255, true)); parent::definition(); $this->set_data($item); }
public function definition() { global $CFG; $item = $this->_customdata['item']; $common = $this->_customdata['common']; $presentationoptions = $this->_customdata['presentationoptions']; $positionlist = $this->_customdata['positionlist']; $position = $this->_customdata['position']; // $classid = $this->_customdata['clid']; // $classid = $this->_customdata['cmid']; $mform =& $this->_form; $mform->addElement('hidden', 'required', 0); $mform->setType('required', PARAM_INT); $mform->addElement('hidden', 'clid', 0); $mform->setType('clid', PARAM_INT); $mform->addElement('hidden', 'cmid', 0); $mform->setType('cmid', PARAM_INT); $mform->addElement('hidden', 'name', 'label'); $mform->setType('template', PARAM_ALPHA); $mform->addElement('hidden', 'label', '-'); $mform->setType('label', PARAM_ALPHA); $mform->addElement('header', 'general', get_string($this->type, 'local_evaluations')); $mform->addElement('editor', 'presentation_editor', get_string('label_name', 'local_evaluations'), null, $presentationoptions); $mform->addRule('presentation_editor', get_string('missingmcname','local_evaluations'), 'required', null, 'client'); $mform->setType('presentation_editor', PARAM_RAW); parent::definition(); $this->set_data($item); }
public function definition() { $item = $this->_customdata['item']; $common = $this->_customdata['common']; $positionlist = $this->_customdata['positionlist']; $position = $this->_customdata['position']; $mform =& $this->_form; $mform->addElement('header', 'general', get_string($this->type, 'local_evaluations')); $mform->addElement('advcheckbox', 'required', get_string('required', 'local_evaluations'), '' , null , array(0, 1)); $mform->addElement('text', 'name', get_string('item_name', 'local_evaluations'), array('size'=>EVALUATION_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addRule('name', get_string('missingmcname','local_evaluations'), 'required', null, 'client'); $mform->addElement('text', 'label', get_string('item_label', 'local_evaluations'), array('size'=>EVALUATION_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addElement('select', 'horizontal', get_string('adjustment', 'local_evaluations').' ', array(0 => get_string('vertical', 'local_evaluations'), 1 => get_string('horizontal', 'local_evaluations'))); $mform->addElement('select', 'subtype', get_string('multichoicetype', 'local_evaluations').' ', array('r'=>get_string('radio', 'local_evaluations'), 'd'=>get_string('dropdown', 'local_evaluations'))); $mform->addElement('selectyesno', 'ignoreempty', get_string('do_not_analyse_empty_submits', 'local_evaluations')); $mform->addElement('selectyesno', 'hidenoselect', get_string('hide_no_select_option', 'local_evaluations')); $mform->addElement('static', 'hint', get_string('multichoice_values', 'local_evaluations'), get_string('use_one_line_for_each_value', 'local_evaluations')); $this->values = $mform->addElement('textarea', 'values', '', 'wrap="virtual" rows="10" cols="65"'); $mform->addRule('values', get_string('missingvalues','local_evaluations'), 'required', null, 'client'); parent::definition(); $this->set_data($item); }
public function definition() { $item = $this->_customdata['item']; $common = $this->_customdata['common']; $positionlist = $this->_customdata['positionlist']; $position = $this->_customdata['position']; $mform =& $this->_form; $mform->addElement('header', 'general', get_string($this->type, 'local_evaluations')); $mform->addElement('advcheckbox', 'required', get_string('required', 'local_evaluations'), '' , null , array(0, 1)); $mform->addElement('text', 'name', get_string('item_name', 'local_evaluations'), array('size'=>EVALUATION_ITEM_NAME_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addRule('name', get_string('missingmcname','local_evaluations'), 'required', null, 'client'); $mform->addElement('text', 'label', get_string('item_label', 'local_evaluations'), array('size'=>EVALUATION_ITEM_LABEL_TEXTBOX_SIZE, 'maxlength'=>255)); $mform->addElement('text', 'rangefrom', get_string('numeric_range_from', 'local_evaluations'), array('size'=>10, 'maxlength'=>10)); $mform->setType('rangefrom', PARAM_INT); $mform->addElement('text', 'rangeto', get_string('numeric_range_to', 'local_evaluations'), array('size'=>10, 'maxlength'=>10)); $mform->setType('rangeto', PARAM_INT); parent::definition(); $this->set_data($item); }