3 // This file is part of Moodle - http://moodle.org/
5 // Moodle is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
10 // Moodle is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
19 * The workshop module configuration variables
21 * The values defined here are often used as defaults for all module instances.
24 * @subpackage workshop
25 * @copyright 2009 David Mudrak <david.mudrak@gmail.com>
26 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29 defined('MOODLE_INTERNAL') ||
die();
31 if ($ADMIN->fulltree
) {
32 require_once($CFG->dirroot
.'/mod/workshop/locallib.php');
34 $grades = workshop
::available_maxgrades_list();
36 $settings->add(new admin_setting_configselect('workshop/grade', get_string('submissiongrade', 'workshop'),
37 get_string('configgrade', 'workshop'), 80, $grades));
39 $settings->add(new admin_setting_configselect('workshop/gradinggrade', get_string('gradinggrade', 'workshop'),
40 get_string('configgradinggrade', 'workshop'), 20, $grades));
43 for ($i = 5; $i >= 0; $i--) {
46 $settings->add(new admin_setting_configselect('workshop/gradedecimals', get_string('gradedecimals', 'workshop'),
47 get_string('configgradedecimals', 'workshop'), 0, $options));
49 if (isset($CFG->maxbytes
)) {
50 $options = get_max_upload_sizes($CFG->maxbytes
);
51 $options[0] = get_string('courseuploadlimit');
52 $settings->add(new admin_setting_configselect('workshop/maxbytes', get_string('maxbytes', 'workshop'),
53 get_string('configmaxbytes', 'workshop'), 0, $options));
56 $settings->add(new admin_setting_configselect('workshop/strategy', get_string('strategy', 'workshop'),
57 get_string('configstrategy', 'workshop'), 'accumulative', workshop
::available_strategies_list()));
59 $options = workshop
::available_example_modes_list();
60 $settings->add(new admin_setting_configselect('workshop/examplesmode', get_string('examplesmode', 'workshop'),
61 get_string('configexamplesmode', 'workshop'), workshop
::EXAMPLES_VOLUNTARY
, $options));
63 // include the settings of allocation subplugins
64 $allocators = get_plugin_list('workshopallocation');
65 foreach ($allocators as $allocator => $path) {
66 if (file_exists($settingsfile = $path . '/settings.php')) {
67 $settings->add(new admin_setting_heading('workshopallocationsetting'.$allocator,
68 get_string('allocation', 'workshop') . ' - ' . get_string('pluginname', 'workshopallocation_' . $allocator), ''));
69 include($settingsfile);
73 // include the settings of grading strategy subplugins
74 $strategies = get_plugin_list('workshopform');
75 foreach ($strategies as $strategy => $path) {
76 if (file_exists($settingsfile = $path . '/settings.php')) {
77 $settings->add(new admin_setting_heading('workshopformsetting'.$strategy,
78 get_string('strategy', 'workshop') . ' - ' . get_string('pluginname', 'workshopform_' . $strategy), ''));
79 include($settingsfile);
83 // include the settings of grading evaluation subplugins
84 $evaluations = get_plugin_list('workshopeval');
85 foreach ($evaluations as $evaluation => $path) {
86 if (file_exists($settingsfile = $path . '/settings.php')) {
87 $settings->add(new admin_setting_heading('workshopevalsetting'.$evaluation,
88 get_string('evaluation', 'workshop') . ' - ' . get_string('pluginname', 'workshopeval_' . $evaluation), ''));
89 include($settingsfile);