|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 // This file is part of Moodle - http://moodle.org/ 00004 // 00005 // Moodle is free software: you can redistribute it and/or modify 00006 // it under the terms of the GNU General Public License as published by 00007 // the Free Software Foundation, either version 3 of the License, or 00008 // (at your option) any later version. 00009 // 00010 // Moodle is distributed in the hope that it will be useful, 00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 // GNU General Public License for more details. 00014 // 00015 // You should have received a copy of the GNU General Public License 00016 // along with Moodle. If not, see <http://www.gnu.org/licenses/>. 00017 00029 defined('MOODLE_INTERNAL') || die(); 00030 00031 if ($ADMIN->fulltree) { 00032 require_once($CFG->dirroot.'/mod/workshop/locallib.php'); 00033 00034 $grades = workshop::available_maxgrades_list(); 00035 00036 $settings->add(new admin_setting_configselect('workshop/grade', get_string('submissiongrade', 'workshop'), 00037 get_string('configgrade', 'workshop'), 80, $grades)); 00038 00039 $settings->add(new admin_setting_configselect('workshop/gradinggrade', get_string('gradinggrade', 'workshop'), 00040 get_string('configgradinggrade', 'workshop'), 20, $grades)); 00041 00042 $options = array(); 00043 for ($i = 5; $i >= 0; $i--) { 00044 $options[$i] = $i; 00045 } 00046 $settings->add(new admin_setting_configselect('workshop/gradedecimals', get_string('gradedecimals', 'workshop'), 00047 get_string('configgradedecimals', 'workshop'), 0, $options)); 00048 00049 if (isset($CFG->maxbytes)) { 00050 $options = get_max_upload_sizes($CFG->maxbytes); 00051 $options[0] = get_string('courseuploadlimit'); 00052 $settings->add(new admin_setting_configselect('workshop/maxbytes', get_string('maxbytes', 'workshop'), 00053 get_string('configmaxbytes', 'workshop'), 0, $options)); 00054 } 00055 00056 $settings->add(new admin_setting_configselect('workshop/strategy', get_string('strategy', 'workshop'), 00057 get_string('configstrategy', 'workshop'), 'accumulative', workshop::available_strategies_list())); 00058 00059 $options = workshop::available_example_modes_list(); 00060 $settings->add(new admin_setting_configselect('workshop/examplesmode', get_string('examplesmode', 'workshop'), 00061 get_string('configexamplesmode', 'workshop'), workshop::EXAMPLES_VOLUNTARY, $options)); 00062 00063 // include the settings of allocation subplugins 00064 $allocators = get_plugin_list('workshopallocation'); 00065 foreach ($allocators as $allocator => $path) { 00066 if (file_exists($settingsfile = $path . '/settings.php')) { 00067 $settings->add(new admin_setting_heading('workshopallocationsetting'.$allocator, 00068 get_string('allocation', 'workshop') . ' - ' . get_string('pluginname', 'workshopallocation_' . $allocator), '')); 00069 include($settingsfile); 00070 } 00071 } 00072 00073 // include the settings of grading strategy subplugins 00074 $strategies = get_plugin_list('workshopform'); 00075 foreach ($strategies as $strategy => $path) { 00076 if (file_exists($settingsfile = $path . '/settings.php')) { 00077 $settings->add(new admin_setting_heading('workshopformsetting'.$strategy, 00078 get_string('strategy', 'workshop') . ' - ' . get_string('pluginname', 'workshopform_' . $strategy), '')); 00079 include($settingsfile); 00080 } 00081 } 00082 00083 // include the settings of grading evaluation subplugins 00084 $evaluations = get_plugin_list('workshopeval'); 00085 foreach ($evaluations as $evaluation => $path) { 00086 if (file_exists($settingsfile = $path . '/settings.php')) { 00087 $settings->add(new admin_setting_heading('workshopevalsetting'.$evaluation, 00088 get_string('evaluation', 'workshop') . ' - ' . get_string('pluginname', 'workshopeval_' . $evaluation), '')); 00089 include($settingsfile); 00090 } 00091 } 00092 00093 }