submission_form.php 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. if (!defined('MOODLE_INTERNAL')) {
  3. die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
  4. }
  5. require_once($CFG->dirroot.'/course/moodleform_mod.php');
  6. require_once($CFG->dirroot.'/mod/gradeImporter/lib.php');
  7. class mod_submission_form extends moodleform_mod{
  8. function definition(){
  9. global $CFG, $DB, $OUTPUT;
  10. $mform =& $this->_form;
  11. $mform->addElement('text', 'name', get_string('submissionName', 'formStrings'), array('size'=>'64'));
  12. $mform->setType('name', PARAM_TEXT);
  13. $mform->addRule('name', get_string('error_submissionNameField', 'formtrings'), 'required', null, 'client');
  14. $mform->addElement('text', 'type', getString('submissionType', 'formStrings'), array('size'=>'64'));
  15. $mform->setType('type', PARAM_TEXT);
  16. $mform->addRule('type', get_string('error_submission', 'formStrings'), 'required', null, 'client');
  17. $this->standard_intro_elements(get_string('description', 'formStrings'));
  18. $mform->addElement('filemanager', 'submissionFiles', getString('submissionFiles', 'formStrings'), null,
  19. array('subdirs' => 1, 'maxbytes' => $maxbytes, 'areamaxbytes' => $maxbytes, 'maxfiles' => -1,
  20. 'accepted_types' => array('*'), 'return_types' => FILE_INTERNAL | FILE_EXTERNAL));
  21. //restrict accepted types to compacted?
  22. $ynoptions = array(0 => get_string('gradebookY', 'formStrings'),
  23. 1 => get_string('gradebookN', 'formStrings'));
  24. $ynoptions = array(0 => get_string('visibilityOff', 'formStrings'),
  25. 1 => get_string('visibilityOn', 'formStrings'));
  26. $this->standard_coursemodule_elements();
  27. $this->add_action_buttons();
  28. }
  29. }
  30. ?>