mirrored from git://git.moodle.org/moodle.git
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grade import/export fixes to use forms lib
- Loading branch information
toyomoyo
committed
May 24, 2007
1 parent
2186f72
commit 3f8bcf7
Showing
7 changed files
with
137 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php // $Id$ | ||
require_once $CFG->libdir.'/formslib.php'; | ||
|
||
class grade_export_form extends moodleform { | ||
function definition (){ | ||
global $CFG; | ||
include_once($CFG->libdir.'/pear/HTML/QuickForm/advcheckbox.php'); | ||
$mform =& $this->_form; | ||
$id = $this->_customdata['id']; // course id | ||
$mform->addElement('hidden', 'id', $id); | ||
if ($grade_items = grade_get_items($id)) { | ||
foreach ($grade_items as $grade_item) { | ||
$element = new HTML_QuickForm_advcheckbox('itemids[]', null, $grade_item->itemname, array('selected'=>'selected'), array(0, $grade_item->id)); | ||
$element->setChecked(1); | ||
$mform->addElement($element); | ||
} | ||
} | ||
$this->add_action_buttons(false, get_string('submit')); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php // $Id$ | ||
require_once $CFG->libdir.'/formslib.php'; | ||
|
||
class grade_export_txt_form extends moodleform { | ||
function definition (){ | ||
global $CFG; | ||
include_once($CFG->libdir.'/pear/HTML/QuickForm/advcheckbox.php'); | ||
$mform =& $this->_form; | ||
$id = $this->_customdata['id']; // course id | ||
$mform->addElement('hidden', 'id', $id); | ||
if ($grade_items = grade_get_items($id)) { | ||
foreach ($grade_items as $grade_item) { | ||
$element = new HTML_QuickForm_advcheckbox('itemids[]', null, $grade_item->itemname, array('selected'=>'selected'), array(0, $grade_item->id)); | ||
$element->setChecked(1); | ||
$mform->addElement($element); | ||
} | ||
} | ||
|
||
include_once($CFG->libdir.'/pear/HTML/QuickForm/radio.php'); | ||
$radio = array(); | ||
$radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('tab'), 'tab'); | ||
$radio[] = &MoodleQuickForm::createElement('radio', 'separator', null, get_string('comma'), 'comma'); | ||
$mform->addGroup($radio, 'separator', get_string('separator'), ' ', false); | ||
$mform->setDefault('separator', 'comma'); | ||
|
||
$this->add_action_buttons(false, get_string('submit')); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
$plugin->version = 2007052201; | ||
$plugin->requires = 2007051801; | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters