MDL-38710 assign: fix missing setType calls

This commit is contained in:
Dan Poltawski
2013-04-17 13:50:23 +08:00
committed by Damyon Wiese
parent 9b81eef05d
commit 68d646f3eb
8 changed files with 41 additions and 0 deletions
+4
View File
@@ -69,9 +69,13 @@ class mod_assign_extension_form extends moodleform {
get_string('extensionduedate', 'assign'), array('optional'=>true));
$mform->setDefault('extensionduedate', $finaldate);
$mform->addElement('hidden', 'id', $coursemoduleid);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'userid', $userid);
$mform->setType('userid', PARAM_INT);
$mform->addElement('hidden', 'selectedusers', $batchusers);
$mform->setType('selectedusers', PARAM_TEXT);
$mform->addElement('hidden', 'action', 'saveextension');
$mform->setType('action', PARAM_ALPHA);
$this->add_action_buttons(true, get_string('savechanges', 'assign'));
if ($data) {
@@ -66,12 +66,19 @@ class assignfeedback_file_batch_upload_files_form extends moodleform {
$this->set_data($data);
$mform->addElement('hidden', 'id', $params['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'operation', 'plugingradingbatchoperation_file_uploadfiles');
$mform->setType('operation', PARAM_ALPHAEXT);
$mform->addElement('hidden', 'action', 'viewpluginpage');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'pluginaction', 'uploadfiles');
$mform->setType('pluginaction', PARAM_ALPHA);
$mform->addElement('hidden', 'plugin', 'file');
$mform->setType('plugin', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setType('pluginsubtype', PARAM_PLUGIN);
$mform->addElement('hidden', 'selectedusers', implode(',', $params['users']));
$mform->setType('selectedusers', PARAM_TEXT);
$this->add_action_buttons(true, get_string('uploadfiles', 'assignfeedback_file'));
}
@@ -115,11 +115,17 @@ class assignfeedback_file_import_zip_form extends moodleform implements renderab
}
$mform->addElement('hidden', 'id', $assignment->get_course_module()->id);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'viewpluginpage');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'confirm', 'true');
$mform->setType('confirm', PARAM_INT);
$mform->addElement('hidden', 'plugin', 'file');
$mform->setTYpe('plugin', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setTYpe('pluginsubtype', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginaction', 'uploadzip');
$mform->setType('pluginaction', PARAM_ALPHA);
if (count($updates)) {
$this->add_action_buttons(true, get_string('confirm'));
} else {
@@ -56,10 +56,15 @@ class assignfeedback_file_upload_zip_form extends moodleform {
$mform->addHelpButton('feedbackzip', 'feedbackzip', 'assignfeedback_file');
$mform->addElement('hidden', 'id', $params['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'viewpluginpage');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'pluginaction', 'uploadzip');
$mform->setType('pluginaction', PARAM_ALPHA);
$mform->addElement('hidden', 'plugin', 'file');
$mform->setType('plugin', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setType('pluginsubtype', PARAM_PLUGIN);
$this->add_action_buttons(true, get_string('importfeedbackfiles', 'assignfeedback_file'));
}
@@ -164,14 +164,23 @@ class assignfeedback_offline_import_grades_form extends moodleform implements re
}
$mform->addElement('hidden', 'id', $assignment->get_course_module()->id);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'viewpluginpage');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'confirm', 'true');
$mform->setType('confirm', PARAM_BOOL);
$mform->addElement('hidden', 'plugin', 'offline');
$mform->setType('plugin', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setType('pluginsubtype', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginaction', 'uploadgrades');
$mform->setType('pluginaction', PARAM_ALPHA);
$mform->addElement('hidden', 'importid', $gradeimporter->importid);
$mform->setType('importid', PARAM_INT);
$mform->addElement('hidden', 'ignoremodified', $ignoremodified);
$mform->setType('ignoremodified', PARAM_BOOL);
$mform->addElement('hidden', 'draftid', $draftid);
$form->setType('draftid', PARAM_INT);
if ($update) {
$this->add_action_buttons(true, get_string('confirm'));
} else {
@@ -59,10 +59,15 @@ class assignfeedback_offline_upload_grades_form extends moodleform {
$mform->addHelpButton('ignoremodified', 'ignoremodified', 'assignfeedback_offline');
$mform->addElement('hidden', 'id', $params['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'action', 'viewpluginpage');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'pluginaction', 'uploadgrades');
$mform->setType('pluginaction', PARAM_ALPHA);
$mform->addElement('hidden', 'plugin', 'offline');
$mform->setType('plugin', PARAM_PLUGIN);
$mform->addElement('hidden', 'pluginsubtype', 'assignfeedback');
$mform->setType('pluginsubtype', PARAM_PLUGIN);
$this->add_action_buttons(true, get_string('uploadgrades', 'assignfeedback_offline'));
}
@@ -66,9 +66,13 @@ class mod_assign_grading_batch_operations_form extends moodleform {
}
$mform->addElement('hidden', 'action', 'gradingbatchoperation');
$mform->setType('action', PARAM_ALPHA);
$mform->addElement('hidden', 'id', $instance['cm']);
$mform->setType('id', PARAM_INT);
$mform->addElement('hidden', 'selectedusers', '', array('class'=>'selectedusers'));
$mform->setType('selectedusers', PARAM_TEXT);
$mform->addElement('hidden', 'returnaction', 'grading');
$mform->setType('returnaction', PARAM_ALPHA);
$objs = array();
$objs[] =& $mform->createElement('select', 'operation', get_string('chooseoperation', 'assign'), $options);
+1
View File
@@ -117,6 +117,7 @@ class mod_assign_mod_form extends moodleform_mod {
} else {
$mform->addElement('hidden', 'requiresubmissionstatement', 1);
}
$mform->setType('requiresubmissionstatement', PARAM_BOOL);
$options = array(
ASSIGN_ATTEMPT_REOPEN_METHOD_NONE => get_string('attemptreopenmethod_none', 'mod_assign'),