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; $gradeimporter = $this->_customdata; $mform->addElement('text', 'name', get_string('name', 'gradeimporter'), array('size'=>'64')); $mform->setType('name', PARAM_TEXT); $mform->addRule('name', get_string('error_nameField', 'gradeimporter'), 'required', null, 'client'); $this->standard_intro_elements(get_string('description', 'gradeimporter')); $mform->addElement('filemanager', 'submissionFiles', getString('submissionFiles', 'gradeimporter'), null, array('subdirs' => 1, 'maxbytes' => $maxbytes, 'areamaxbytes' => $maxbytes, 'maxfiles' => -1, 'accepted_types' => array('*'), 'return_types' => FILE_INTERNAL | FILE_EXTERNAL)); //restrict accepted types to compacted? $mform->addHelpButton('submissionFiles', 'helpsubmissionfiles', 'gradeimporter'); //csv delimiter $csv_delimiter = array(); $csv_delimiter[1] = ','; /*$csv_delimiter[2] = ';'; $csv_delimiter[3] = ':'; $csv_delimiter[4] = '\t'; */ $mform->addElement('select', 'csv_delimiter', get_string('choose_type_activity', 'iassign'), $csv_delimiter, array('onChange' => 'config_type(this.value);')); $mform->setDefault('csv_delimiter', 1); // default csv_delimiter = 3 $mform->addHelpButton('csv_delimiter', 'helpcsvdelimiter', 'gradeimporter'); //submissionType //if the grades go into the gradebook or not $radioarray = array(); $radioarray[] = $mform->createElement('radio', 'gradebook', '', get_string('gradebookY','gradeimporter'), 1, $attributes); $radioarray[] = $mform->createElement('radio', 'gradebook', '', get_string('gradebookN', 'gradeimporter'), 0, $attributes); $mform->addgroup($radioarray, 'radioar', '', array(' '), false); $mform->setDefault('gradebook', 0); //if students can se this submission or not $visibilityar = array(); $visibilityar[] = $mform->createElement('radio', 'visibility', '', get_string('visibilityY','gradeimporter'), 1, $attributes); $visibilityar[] = $mform->createElement('radio', 'visibility', '', get_string('visibilityN','gradeimporter'), 0, $attributes); $mform->addgroup($visibilityar, 'radioar', '', array(' '), false); $mform->setDefault('visibility', 1); $this->add_action_buttons(); } }