mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 06:18:28 +01:00
Merge branch 'MDL-37621-master' of git://github.com/damyon/moodle
This commit is contained in:
commit
ab8e5e795d
@ -107,8 +107,8 @@ $string['cutoffdate'] = 'Cut-off date';
|
||||
$string['cutoffdate_help'] = 'If set, the assignment will not accept submissions after this date without an extension.';
|
||||
$string['cutoffdatevalidation'] = 'The cut-off date cannot be earlier than the due date.';
|
||||
$string['cutoffdatefromdatevalidation'] = 'Cut-off date must be after the allow submissions from date.';
|
||||
$string['defaultplugins'] = 'Default assignment settings';
|
||||
$string['defaultplugins_help'] = 'These settings define the defaults for all new assignments.';
|
||||
$string['defaultsettings'] = 'Default assignment settings';
|
||||
$string['defaultsettings_help'] = 'These settings define the defaults for all new assignments.';
|
||||
$string['defaultteam'] = 'Default group';
|
||||
$string['deleteallsubmissions'] = 'Delete all submissions';
|
||||
$string['deletepluginareyousure'] = 'Delete assignment plugin {$a}: are you sure?';
|
||||
|
@ -81,12 +81,10 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$options = array('optional'=>true);
|
||||
$mform->addElement('date_time_selector', 'allowsubmissionsfromdate', $name, $options);
|
||||
$mform->addHelpButton('allowsubmissionsfromdate', 'allowsubmissionsfromdate', 'assign');
|
||||
$mform->setDefault('allowsubmissionsfromdate', time());
|
||||
|
||||
$name = get_string('duedate', 'assign');
|
||||
$mform->addElement('date_time_selector', 'duedate', $name, array('optional'=>true));
|
||||
$mform->addHelpButton('duedate', 'duedate', 'assign');
|
||||
$mform->setDefault('duedate', time()+7*24*3600);
|
||||
|
||||
$name = get_string('cutoffdate', 'assign');
|
||||
$mform->addElement('date_time_selector', 'cutoffdate', $name, array('optional'=>true));
|
||||
@ -95,7 +93,6 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('alwaysshowdescription', 'assign');
|
||||
$mform->addElement('checkbox', 'alwaysshowdescription', $name);
|
||||
$mform->addHelpButton('alwaysshowdescription', 'alwaysshowdescription', 'assign');
|
||||
$mform->setDefault('alwaysshowdescription', 1);
|
||||
$mform->disabledIf('alwaysshowdescription', 'allowsubmissionsfromdate[enabled]', 'notchecked');
|
||||
|
||||
$assignment->add_all_plugin_settings($mform);
|
||||
@ -105,14 +102,12 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('submissiondrafts', 'assign');
|
||||
$mform->addElement('selectyesno', 'submissiondrafts', $name);
|
||||
$mform->addHelpButton('submissiondrafts', 'submissiondrafts', 'assign');
|
||||
$mform->setDefault('submissiondrafts', 0);
|
||||
|
||||
if (empty($config->submissionstatement)) {
|
||||
$mform->addElement('hidden', 'requiresubmissionstatement', 0);
|
||||
} else if (empty($config->requiresubmissionstatement)) {
|
||||
$name = get_string('requiresubmissionstatement', 'assign');
|
||||
$mform->addElement('selectyesno', 'requiresubmissionstatement', $name);
|
||||
$mform->setDefault('requiresubmissionstatement', 0);
|
||||
$mform->addHelpButton('requiresubmissionstatement',
|
||||
'requiresubmissionstatementassignment',
|
||||
'assign');
|
||||
@ -127,14 +122,12 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
ASSIGN_ATTEMPT_REOPEN_METHOD_UNTILPASS => get_string('attemptreopenmethod_untilpass', 'mod_assign')
|
||||
);
|
||||
$mform->addElement('select', 'attemptreopenmethod', get_string('attemptreopenmethod', 'mod_assign'), $options);
|
||||
$mform->setDefault('attemptreopenmethod', ASSIGN_ATTEMPT_REOPEN_METHOD_NONE);
|
||||
$mform->addHelpButton('attemptreopenmethod', 'attemptreopenmethod', 'mod_assign');
|
||||
|
||||
$options = array(ASSIGN_UNLIMITED_ATTEMPTS => get_string('unlimitedattempts', 'mod_assign'));
|
||||
$options += array_combine(range(1, 30), range(1, 30));
|
||||
$mform->addElement('select', 'maxattempts', get_string('maxattempts', 'mod_assign'), $options);
|
||||
$mform->addHelpButton('maxattempts', 'maxattempts', 'assign');
|
||||
$mform->setDefault('maxattempts', -1);
|
||||
$mform->disabledIf('maxattempts', 'attemptreopenmethod', 'eq', ASSIGN_ATTEMPT_REOPEN_METHOD_NONE);
|
||||
|
||||
$mform->addElement('header', 'groupsubmissionsettings', get_string('groupsubmissionsettings', 'assign'));
|
||||
@ -142,12 +135,10 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('teamsubmission', 'assign');
|
||||
$mform->addElement('selectyesno', 'teamsubmission', $name);
|
||||
$mform->addHelpButton('teamsubmission', 'teamsubmission', 'assign');
|
||||
$mform->setDefault('teamsubmission', 0);
|
||||
|
||||
$name = get_string('requireallteammemberssubmit', 'assign');
|
||||
$mform->addElement('selectyesno', 'requireallteammemberssubmit', $name);
|
||||
$mform->addHelpButton('requireallteammemberssubmit', 'requireallteammemberssubmit', 'assign');
|
||||
$mform->setDefault('requireallteammemberssubmit', 0);
|
||||
$mform->disabledIf('requireallteammemberssubmit', 'teamsubmission', 'eq', 0);
|
||||
$mform->disabledIf('requireallteammemberssubmit', 'submissiondrafts', 'eq', 0);
|
||||
|
||||
@ -161,7 +152,6 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('teamsubmissiongroupingid', 'assign');
|
||||
$mform->addElement('select', 'teamsubmissiongroupingid', $name, $options);
|
||||
$mform->addHelpButton('teamsubmissiongroupingid', 'teamsubmissiongroupingid', 'assign');
|
||||
$mform->setDefault('teamsubmissiongroupingid', 0);
|
||||
$mform->disabledIf('teamsubmissiongroupingid', 'teamsubmission', 'eq', 0);
|
||||
|
||||
$mform->addElement('header', 'notifications', get_string('notifications', 'assign'));
|
||||
@ -169,12 +159,10 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('sendnotifications', 'assign');
|
||||
$mform->addElement('selectyesno', 'sendnotifications', $name);
|
||||
$mform->addHelpButton('sendnotifications', 'sendnotifications', 'assign');
|
||||
$mform->setDefault('sendnotifications', 1);
|
||||
|
||||
$name = get_string('sendlatenotifications', 'assign');
|
||||
$mform->addElement('selectyesno', 'sendlatenotifications', $name);
|
||||
$mform->addHelpButton('sendlatenotifications', 'sendlatenotifications', 'assign');
|
||||
$mform->setDefault('sendlatenotifications', 1);
|
||||
$mform->disabledIf('sendlatenotifications', 'sendnotifications', 'eq', 1);
|
||||
|
||||
// Plagiarism enabling form.
|
||||
@ -187,12 +175,12 @@ class mod_assign_mod_form extends moodleform_mod {
|
||||
$name = get_string('blindmarking', 'assign');
|
||||
$mform->addElement('selectyesno', 'blindmarking', $name);
|
||||
$mform->addHelpButton('blindmarking', 'blindmarking', 'assign');
|
||||
$mform->setDefault('blindmarking', 0);
|
||||
if ($assignment->has_submissions_or_grades() ) {
|
||||
$mform->freeze('blindmarking');
|
||||
}
|
||||
|
||||
$this->standard_coursemodule_elements();
|
||||
$this->apply_admin_defaults();
|
||||
|
||||
$this->add_action_buttons();
|
||||
|
||||
|
@ -86,4 +86,142 @@ if ($ADMIN->fulltree) {
|
||||
$description,
|
||||
0));
|
||||
|
||||
$name = new lang_string('defaultsettings', 'mod_assign');
|
||||
$description = new lang_string('defaultsettings_help', 'mod_assign');
|
||||
$settings->add(new admin_setting_heading('defaultsettings', $name, $description));
|
||||
|
||||
$name = new lang_string('alwaysshowdescription', 'mod_assign');
|
||||
$description = new lang_string('alwaysshowdescription_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/alwaysshowdescription',
|
||||
$name,
|
||||
$description,
|
||||
1);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('allowsubmissionsfromdate', 'mod_assign');
|
||||
$description = new lang_string('allowsubmissionsfromdate_help', 'mod_assign');
|
||||
$setting = new admin_setting_configduration('assign/allowsubmissionsfromdate',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, true);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('duedate', 'mod_assign');
|
||||
$description = new lang_string('duedate_help', 'mod_assign');
|
||||
$setting = new admin_setting_configduration('assign/duedate',
|
||||
$name,
|
||||
$description,
|
||||
604800);
|
||||
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, true);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('cutoffdate', 'mod_assign');
|
||||
$description = new lang_string('cutoffdate_help', 'mod_assign');
|
||||
$setting = new admin_setting_configduration('assign/cutoffdate',
|
||||
$name,
|
||||
$description,
|
||||
1209600);
|
||||
$setting->set_enabled_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('submissiondrafts', 'mod_assign');
|
||||
$description = new lang_string('submissiondrafts_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/submissiondrafts',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
// Constants from locallib.php
|
||||
$options = array(
|
||||
'none' => get_string('attemptreopenmethod_none', 'mod_assign'),
|
||||
'manual' => get_string('attemptreopenmethod_manual', 'mod_assign'),
|
||||
'untilpass' => get_string('attemptreopenmethod_untilpass', 'mod_assign')
|
||||
);
|
||||
$name = new lang_string('attemptreopenmethod', 'mod_assign');
|
||||
$description = new lang_string('attemptreopenmethod_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/attemptreopenmethod',
|
||||
$name,
|
||||
$description,
|
||||
'none',
|
||||
$options);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
// Constants from locallib.php
|
||||
$options = array(-1 => get_string('unlimitedattempts', 'mod_assign'));
|
||||
$options += array_combine(range(1, 30), range(1, 30));
|
||||
$name = new lang_string('maxattempts', 'mod_assign');
|
||||
$description = new lang_string('maxattempts_help', 'mod_assign');
|
||||
$setting = new admin_setting_configselect('assign/maxattempts',
|
||||
$name,
|
||||
$description,
|
||||
-1,
|
||||
$options);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('teamsubmission', 'mod_assign');
|
||||
$description = new lang_string('teamsubmission_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/teamsubmission',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('requireallteammemberssubmit', 'mod_assign');
|
||||
$description = new lang_string('requireallteammemberssubmit_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/requireallteammemberssubmit',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('sendnotifications', 'mod_assign');
|
||||
$description = new lang_string('sendnotifications_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/sendnotifications',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('sendlatenotifications', 'mod_assign');
|
||||
$description = new lang_string('sendlatenotifications_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/sendlatenotifications',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
$name = new lang_string('blindmarking', 'mod_assign');
|
||||
$description = new lang_string('blindmarking_help', 'mod_assign');
|
||||
$setting = new admin_setting_configcheckbox('assign/blindmarking',
|
||||
$name,
|
||||
$description,
|
||||
0);
|
||||
$setting->set_advanced_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$setting->set_locked_flag_options(admin_setting_flag::ENABLED, false);
|
||||
$settings->add($setting);
|
||||
|
||||
}
|
||||
|
@ -25,7 +25,7 @@
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$module->component = 'mod_assign'; // Full name of the plugin (used for diagnostics).
|
||||
$module->version = 2013050100; // The current module version (Date: YYYYMMDDXX).
|
||||
$module->version = 2013061100; // The current module version (Date: YYYYMMDDXX).
|
||||
$module->requires = 2013050100; // Requires this Moodle version.
|
||||
$module->cron = 60;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user