|
@@ -0,0 +1,43 @@
|
|
|
|
+<?php
|
|
|
|
+ if (!defined('MOODLE_INTERNAL')) {
|
|
|
|
+ die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ require_once($CFG->dirroot.'/course/moodleform_mod.php');
|
|
|
|
+ require_once($CFG->dirroot.'/mod/gradeImporter/lib.php');
|
|
|
|
+
|
|
|
|
+ class mod_submission_form extends moodleform_mod{
|
|
|
|
+
|
|
|
|
+ function definition(){
|
|
|
|
+ global $CFG, $DB, $OUTPUT;
|
|
|
|
+
|
|
|
|
+ $mform =& $this->_form;
|
|
|
|
+
|
|
|
|
+ $mform->addElement('text', 'name', get_string('submissionName', 'formStrings'), array('size'=>'64'));
|
|
|
|
+ $mform->setType('name', PARAM_TEXT);
|
|
|
|
+ $mform->addRule('name', get_string('error_submissionNameField', 'formtrings'), 'required', null, 'client');
|
|
|
|
+
|
|
|
|
+ $mform->addElement('text', 'type', getString('submissionType', 'formStrings'), array('size'=>'64'));
|
|
|
|
+ $mform->setType('type', PARAM_TEXT);
|
|
|
|
+ $mform->addRule('type', get_string('error_submission', 'formStrings'), 'required', null, 'client');
|
|
|
|
+
|
|
|
|
+ $this->standard_intro_elements(get_string('description', 'formStrings'));
|
|
|
|
+
|
|
|
|
+ $mform->addElement('filemanager', 'submissionFiles', getString('submissionFiles', 'formStrings'), null,
|
|
|
|
+ array('subdirs' => 1, 'maxbytes' => $maxbytes, 'areamaxbytes' => $maxbytes, 'maxfiles' => -1,
|
|
|
|
+ 'accepted_types' => array('*'), 'return_types' => FILE_INTERNAL | FILE_EXTERNAL));
|
|
|
|
+ //restrict accepted types to compacted?
|
|
|
|
+
|
|
|
|
+ $ynoptions = array(0 => get_string('gradebookY', 'formStrings'),
|
|
|
|
+ 1 => get_string('gradebookN', 'formStrings'));
|
|
|
|
+
|
|
|
|
+ $ynoptions = array(0 => get_string('visibilityOff', 'formStrings'),
|
|
|
|
+ 1 => get_string('visibilityOn', 'formStrings'));
|
|
|
|
+
|
|
|
|
+ $this->standard_coursemodule_elements();
|
|
|
|
+
|
|
|
|
+ $this->add_action_buttons();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+?>
|