2 require_once $CFG->libdir
.'/formslib.php';
4 class grade_export_form
extends moodleform
{
5 function definition (){
7 include_once($CFG->libdir
.'/pear/HTML/QuickForm/advcheckbox.php');
8 $mform =& $this->_form
;
9 $mform->addElement('header', 'general', get_string('gradeitemsinc', 'grades')); // TODO: localize
10 $id = $this->_customdata
['id']; // course id
11 $mform->addElement('hidden', 'id', $id);
12 if ($grade_items = grade_item
::fetch_all(array('courseid'=>$id))) {
13 foreach ($grade_items as $grade_item) {
14 $element = new HTML_QuickForm_advcheckbox('itemids[]', null, $grade_item->itemname
, array('selected'=>'selected'), array(0, $grade_item->id
));
15 $element->setChecked(1);
16 $mform->addElement($element);
19 $this->add_action_buttons(false, get_string('submit'));