MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / admin / settings / grades.php
blob0859c75c3565c5427defd45972da503e0d2418f9
1 <?php // $Id$
3 // This file defines settingpages and externalpages under the "grades" section
5 // General settings
7 $temp = new admin_settingpage('gradessettings', get_string('gradessettings', 'grades'));
8 $temp->add(new admin_setting_special_gradeexport());
9 // enable outcomes checkbox
10 $temp->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('configenableoutcomes', 'grades'), 0, PARAM_INT));
11 // enable publishing in exports/imports
12 $temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('configgradepublishing', 'grades'), 0, PARAM_INT));
13 $ADMIN->add('grades', $temp);
15 /// Scales and outcomes
17 $scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
18 $ADMIN->add('grades', $scales);
19 $outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
20 $ADMIN->add('grades', $outcomes);
21 $letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/edit.php', 'moodle/grade:manageletters');
22 $ADMIN->add('grades', $letters);
24 /// Grade category settings
25 require_once $CFG->libdir . '/grade/constants.php';
26 $temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'));
27 $strnoforce = get_string('noforce', 'grades');
29 // Aggregation type
30 $options = array(-1 => $strnoforce,
31 GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', 'grades'),
32 GRADE_AGGREGATE_MEDIAN =>get_string('aggregatemedian', 'grades'),
33 GRADE_AGGREGATE_MIN =>get_string('aggregatemin', 'grades'),
34 GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
35 GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
36 GRADE_AGGREGATE_WEIGHTED_MEAN =>get_string('aggregateweightedmean', 'grades'),
37 GRADE_AGGREGATE_EXTRACREDIT_MEAN=>get_string('aggregateextracreditmean', 'grades'));
38 $temp->add(new admin_setting_configselect('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregationhelp', 'grades'), -1, $options));
40 $options = array(-1 => $strnoforce, 0 => get_string('forceoff', 'grades'), 1 => get_string('forceon', 'grades'));
41 $temp->add(new admin_setting_configselect('grade_aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
42 get_string('aggregateonlygradedhelp', 'grades'), -1, $options));
43 $temp->add(new admin_setting_configselect('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
44 get_string('aggregateoutcomeshelp', 'grades'), -1, $options));
45 $temp->add(new admin_setting_configselect('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'),
46 get_string('aggregatesubcatshelp', 'grades'), -1, $options));
48 $options = array(-1 => $strnoforce, 0 => get_string('none'));
49 for ($i=1; $i<=20; $i++) {
50 $options[$i] = $i;
53 $temp->add(new admin_setting_configselect('grade_keephigh', get_string('keephigh', 'grades'),
54 get_string('keephighhelp', 'grades'), -1, $options));
55 $temp->add(new admin_setting_configselect('grade_droplow', get_string('droplow', 'grades'),
56 get_string('droplowhelp', 'grades'), -1, $options));
58 $ADMIN->add('grades', $temp);
60 // The plugins must implement a settings.php file that adds their admin settings to the $settings object
62 // Reports
64 $first = true;
65 foreach (get_list_of_plugins('grade/report') as $plugin) {
66 // Include all the settings commands for this plugin if there are any
67 if ($first) {
68 $ADMIN->add('grades', new admin_category('gradereports', get_string('reportsettings', 'grades')));
69 $first = false;
72 if (file_exists($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php')) {
74 $settings = new admin_settingpage('gradereport'.$plugin, get_string('modulename', 'gradereport_'.$plugin));
75 include_once($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php');
76 $ADMIN->add('gradereports', $settings);
80 // Imports
82 $first = true;
83 foreach (get_list_of_plugins('grade/import') as $plugin) {
85 // Include all the settings commands for this plugin if there are any
86 if (file_exists($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php')) {
87 if ($first) {
88 $ADMIN->add('grades', new admin_category('gradeimports', get_string('imports')));
89 $first = false;
92 $settings = new admin_settingpage('gradeimport'.$plugin, get_string('modulename', 'gradeimport_'.$plugin));
93 include_once($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php');
94 $ADMIN->add('gradeimports', $settings);
99 // Exports
101 $first = true;
102 foreach (get_list_of_plugins('grade/export') as $plugin) {
103 // Include all the settings commands for this plugin if there are any
104 if (file_exists($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php')) {
105 if ($first) {
106 $ADMIN->add('grades', new admin_category('gradeexports', get_string('exports')));
107 $first = false;
110 $settings = new admin_settingpage('gradeexport'.$plugin, get_string('modulename', 'gradeexport_'.$plugin));
111 include_once($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php');
112 $ADMIN->add('gradeexports', $settings);