*/
-$string['pluginname'] = 'Feedback comments';
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this feedback method will be enabled by default for all new assignments.';
$string['enabled'] = 'Feedback comments';
$string['enabled_help'] = 'If enabled, the marker can leave feedback comments for each submission. ';
+$string['pluginname'] = 'Feedback comments';
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file defines the admin settings for this plugin
+ *
+ * @package assignsubmission_comments
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$settings->add(new admin_setting_configcheckbox('assignfeedback_comments/default',
+ new lang_string('default', 'assignfeedback_comments'),
+ new lang_string('default_help', 'assignfeedback_comments'), 0));
+
*/
$string['configmaxbytes'] = 'Maximum file size';
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this feedback method will be enabled by default for all new assignments.';
$string['enabled'] = 'File feedback';
$string['enabled_help'] = 'If enabled, the teacher will be able to upload files with feedback when marking the assignments. These files may be, but are not limited to marked up student submissions, documents with comments or spoken audio feedback. ';
$string['file'] = 'Feedback files';
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file defines the admin settings for this plugin
+ *
+ * @package assignsubmission_onlinetext
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$settings->add(new admin_setting_configcheckbox('assignfeedback_file/default',
+ new lang_string('default', 'assignfeedback_file'),
+ new lang_string('default_help', 'assignfeedback_file'), 0));
+
$show = array();
$grader = array();
+ $showrecentsubmissions = get_config('mod_assign', 'showrecentsubmissions');
+
foreach($submissions as $submission) {
if (!array_key_exists($submission->cmid, $modinfo->get_cms())) {
continue;
$context = context_module::instance($submission->cmid);
// the act of sumbitting of assignment may be considered private - only graders will see it if specified
- if (empty($CFG->assign_showrecentsubmissions)) {
+ if (empty($showrecentsubmissions)) {
if (!array_key_exists($cm->id, $grader)) {
$grader[$cm->id] = has_capability('moodle/grade:viewall',$context);
}
$modinfo->groups = groups_get_user_groups($course->id); // load all my groups and cache it in modinfo
}
+ $showrecentsubmissions = get_config('mod_assign', 'showrecentsubmissions');
$show = array();
$usersgroups = groups_get_all_groups($course->id, $USER->id, $cm->groupingid);
if (is_array($usersgroups)) {
continue;
}
// the act of submitting of assignment may be considered private - only graders will see it if specified
- if (empty($CFG->assign_showrecentsubmissions)) {
+ if (empty($showrecentsubmissions)) {
if (!$grader) {
continue;
}
/** @var stdClass the course this assign instance belongs to */
private $course;
+
+ /** @var stdClass the admin config for all assign instances */
+ private $adminconfig;
+
/** @var assign_renderer the custom renderer for this module */
private $output;
return assign_grade_item_update($assign, $param);
}
+ /** Load and cache the admin config for this module
+ *
+ * @return stdClass the plugin config
+ */
+ public function get_admin_config() {
+ if ($this->adminconfig) {
+ return $this->adminconfig;
+ }
+ $this->adminconfig = get_config('mod_assign');
+ return $this->adminconfig;
+ }
+
/**
* Update the calendar entries for this assignment
$mform->addElement('selectyesno', $plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', $plugin->get_name());
$mform->addHelpButton($plugin->get_subtype() . '_' . $plugin->get_type() . '_enabled', 'enabled', $plugin->get_subtype() . '_' . $plugin->get_type());
- $setting = $plugin->get_subtype() . '_' . $plugin->get_type() . '_default';
- $default = $CFG->$setting;
+ $default = get_config($plugin->get_subtype() . '_' . $plugin->get_type(), 'default');
if ($plugin->get_config('enabled') !== false) {
$default = $plugin->is_enabled();
}
}
$grade->grader= $USER->id;
- $gradebookplugin = $CFG->assign_feedback_plugin_for_gradebook;
+ $adminconfig = $this->get_admin_config();
+ $gradebookplugin = $adminconfig->feedback_plugin_for_gradebook;
// call save in plugins
foreach ($this->feedbackplugins as $plugin) {
$menu['assignfeedback_' . $type] = new lang_string('pluginname', 'assignfeedback_' . $type);
}
}
- $settings->add(new admin_setting_configselect('assign_feedback_plugin_for_gradebook',
+
+ // The default here is feedback_comments (if it exists)
+ $settings->add(new admin_setting_configselect('assign/feedback_plugin_for_gradebook',
new lang_string('feedbackpluginforgradebook', 'mod_assign'),
new lang_string('feedbackplugin', 'mod_assign'), 'feedback_comments', $menu));
- $settings->add(new admin_setting_configcheckbox('assign_showrecentsubmissions',
+ $settings->add(new admin_setting_configcheckbox('assign/showrecentsubmissions',
new lang_string('showrecentsubmissions', 'assign'),
new lang_string('configshowrecentsubmissions', 'assign'), 0));
- $settings->add(new admin_setting_heading('assign_defaultplugins',
- new lang_string('defaultplugins', 'assign'), ''));
-
- foreach (get_plugin_list('assignsubmission') as $type => $notused) {
- $visible = !get_config('assignsubmission_' . $type, 'disabled');
- if ($visible) {
- $settings->add(new admin_setting_configcheckbox('assignsubmission_' . $type . '_default',
- new lang_string('enabled', 'assignsubmission_' . $type),
- new lang_string('enabled_help', 'assignsubmission_' . $type), 0));
-
- }
- }
- foreach (get_plugin_list('assignfeedback') as $type => $notused) {
- $visible = !get_config('assignfeedback_' . $type, 'disabled');
- if ($visible) {
- $settings->add(new admin_setting_configcheckbox('assignfeedback_' . $type . '_default',
- new lang_string('enabled', 'assignfeedback_' . $type),
- new lang_string('enabled_help', 'assignfeedback_' . $type), 0));
-
- }
- }
-
}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this submission method will be enabled by default for all new assignments.';
$string['enabled'] = 'Submission comments';
$string['enabled_help'] = 'If enabled, students can leave comments on their own submission. This can be used to let students alert the marker about which files the master file is in cases of inter-linked files, for instance.
';
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file defines the admin settings for this plugin
+ *
+ * @package assignsubmission_comments
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$settings->add(new admin_setting_configcheckbox('assignsubmission_comments/default',
+ new lang_string('default', 'assignsubmission_comments'),
+ new lang_string('default_help', 'assignsubmission_comments'), 0));
+
$string['configmaxbytes'] = 'Maximum file size';
+$string['countfiles'] = '{$a} files';
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this submission method will be enabled by default for all new assignments.';
$string['enabled'] = 'File submissions';
$string['enabled_help'] = 'If enabled, students are able to upload one or more files as their submission.';
$string['file'] = 'File submissions';
$string['pluginname'] = 'File submissions';
$string['siteuploadlimit'] = 'Site upload limit';
$string['submissionfilearea'] = 'Uploaded submission files';
-$string['countfiles'] = '{$a} files';
$mform->setDefault('assignsubmission_file_maxfiles', $defaultmaxfilesubmissions);
$mform->disabledIf('assignsubmission_file_maxfiles', 'assignsubmission_file_enabled', 'eq', 0);
- $choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, $CFG->assignsubmission_file_maxbytes);
+ $choices = get_max_upload_sizes($CFG->maxbytes, $COURSE->maxbytes, get_config('assignsubmission_file', 'maxbytes'));
if ($COURSE->maxbytes == 0) {
$choices[0] = get_string('siteuploadlimit', 'assignsubmission_file');
} else {
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
+
+// Note this is on by default
+$settings->add(new admin_setting_configcheckbox('assignsubmission_file/default',
+ new lang_string('default', 'assignsubmission_file'),
+ new lang_string('default_help', 'assignsubmission_file'), 1));
+
if (isset($CFG->maxbytes)) {
- $settings->add(new admin_setting_configselect('assignsubmission_file_maxbytes',
- get_string('maximumsubmissionsize', 'assignsubmission_file'),
- get_string('configmaxbytes', 'assignsubmission_file'), 1048576, get_max_upload_sizes($CFG->maxbytes)));
+ $settings->add(new admin_setting_configselect('assignsubmission_file/maxbytes',
+ new lang_string('maximumsubmissionsize', 'assignsubmission_file'),
+ new lang_string('configmaxbytes', 'assignsubmission_file'), 1048576, get_max_upload_sizes($CFG->maxbytes)));
}
*/
$string['allowonlinetextsubmissions'] = 'Enabled';
+$string['default'] = 'Enabled by default';
+$string['default_help'] = 'If set, this submission method will be enabled by default for all new assignments.';
$string['enabled'] = 'Online text';
$string['enabled_help'] = 'If enabled, students are able to type rich text directly into an editor field for their submission.';
$string['nosubmission'] = 'Nothing has been submitted for this assignment';
--- /dev/null
+<?php
+// This file is part of Moodle - http://moodle.org/
+//
+// Moodle is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// Moodle is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
+
+/**
+ * This file defines the admin settings for this plugin
+ *
+ * @package assignsubmission_onlinetext
+ * @copyright 2012 NetSpot {@link http://www.netspot.com.au}
+ * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
+ */
+
+$settings->add(new admin_setting_configcheckbox('assignsubmission_onlinetext/default',
+ new lang_string('default', 'assignsubmission_onlinetext'),
+ new lang_string('default_help', 'assignsubmission_onlinetext'), 0));
+