MDL-9628 At the suggestion of Tim Hunt, interchanged the position of grade letter...
[moodle-pu.git] / question / export_form.php
blobd455055cb7c7c18bcf441977f9dc4e105a942691
1 <?php //$Id$
3 require_once($CFG->libdir.'/formslib.php');
5 class question_export_form extends moodleform {
7 function definition() {
8 $mform =& $this->_form;
10 $defaultcategory = $this->_customdata['defaultcategory'];
11 $contexts = $this->_customdata['contexts'];
12 $defaultfilename = $this->_customdata['defaultfilename'];
13 //--------------------------------------------------------------------------------
14 $mform->addElement('header','general', get_string('general', 'form'));
16 $mform->addElement('questioncategory', 'category', get_string('category','quiz'), compact('contexts'));
17 $mform->setDefault('category', $defaultcategory);
18 $mform->setHelpButton('category', array('exportcategory', get_string('exportcategory','question'), 'quiz'));
20 $categorygroup = array();
21 $categorygroup[] =& $mform->createElement('checkbox', 'cattofile', '', get_string('tofilecategory', 'question'));
22 $categorygroup[] =& $mform->createElement('checkbox', 'contexttofile', '', get_string('tofilecontext', 'question'));
23 $mform->addGroup($categorygroup, 'categorygroup', '', '', false);
24 $mform->disabledIf('categorygroup', 'cattofile', 'notchecked');
25 $mform->setDefault('cattofile', 1);
26 $mform->setDefault('contexttofile', 1);
29 $fileformatnames = get_import_export_formats('export');
30 $mform->addElement('select', 'format', get_string('fileformat','quiz'), $fileformatnames);
31 $mform->setDefault('format', 'gift');
32 $mform->setHelpButton('format', array('export', get_string('exportquestions', 'quiz'), 'quiz'));
34 $mform->addElement('text', 'exportfilename', get_string('exportname', 'quiz'), array('size'=>40));
35 $mform->setDefault('exportfilename', $defaultfilename);
36 $mform->setType('exportfilename', PARAM_CLEANFILE);
39 //--------------------------------------------------------------------------------
40 $this->add_action_buttons(false, get_string('exportquestions', 'quiz'));
41 //--------------------------------------------------------------------------------