2007-07-04 09:34:17 +00:00
|
|
|
<?php // $Id$
|
|
|
|
|
|
|
|
// This file defines settingpages and externalpages under the "grades" section
|
|
|
|
|
|
|
|
// General settings
|
|
|
|
|
2007-10-07 18:15:57 +00:00
|
|
|
require_once $CFG->libdir.'/grade/constants.php';
|
|
|
|
|
2007-07-24 05:27:46 +00:00
|
|
|
$temp = new admin_settingpage('gradessettings', get_string('gradessettings', 'grades'));
|
2007-07-04 09:34:17 +00:00
|
|
|
$temp->add(new admin_setting_special_gradeexport());
|
2007-07-23 08:23:25 +00:00
|
|
|
// enable outcomes checkbox
|
2007-07-24 05:27:46 +00:00
|
|
|
$temp->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('configenableoutcomes', 'grades'), 0, PARAM_INT));
|
2007-08-31 04:35:06 +00:00
|
|
|
// enable publishing in exports/imports
|
2007-08-31 18:42:50 +00:00
|
|
|
$temp->add(new admin_setting_configcheckbox('gradepublishing', get_string('gradepublishing', 'grades'), get_string('configgradepublishing', 'grades'), 0, PARAM_INT));
|
2007-10-07 18:15:57 +00:00
|
|
|
|
|
|
|
$temp->add(new admin_setting_configselect('grade_displaytype', get_string('gradedisplaytype', 'grades'),
|
|
|
|
get_string('configgradedisplaytype', 'grades'), GRADE_DISPLAY_TYPE_REAL,
|
|
|
|
array(GRADE_DISPLAY_TYPE_REAL => get_string('real', 'grades'),
|
|
|
|
GRADE_DISPLAY_TYPE_PERCENTAGE => get_string('percentage', 'grades'),
|
|
|
|
GRADE_DISPLAY_TYPE_LETTER => get_string('letter', 'grades'))));
|
|
|
|
|
|
|
|
$temp->add(new admin_setting_configselect('grade_decimalpoints', get_string('decimalpoints', 'grades'),
|
|
|
|
get_string('configdecimalpoints', 'grades'), 2,
|
|
|
|
array( '0' => '0',
|
|
|
|
'1' => '1',
|
|
|
|
'2' => '2',
|
|
|
|
'3' => '3',
|
|
|
|
'4' => '4',
|
|
|
|
'5' => '5')));
|
|
|
|
|
2007-07-04 09:34:17 +00:00
|
|
|
$ADMIN->add('grades', $temp);
|
|
|
|
|
2007-07-30 22:56:45 +00:00
|
|
|
/// Scales and outcomes
|
|
|
|
|
|
|
|
$scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
|
|
|
|
$ADMIN->add('grades', $scales);
|
|
|
|
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
|
|
|
|
$ADMIN->add('grades', $outcomes);
|
2007-09-28 20:12:43 +00:00
|
|
|
$letters = new admin_externalpage('letters', get_string('letters', 'grades'), $CFG->wwwroot.'/grade/edit/letter/edit.php', 'moodle/grade:manageletters');
|
|
|
|
$ADMIN->add('grades', $letters);
|
2007-07-30 22:56:45 +00:00
|
|
|
|
2007-09-14 08:54:46 +00:00
|
|
|
/// Grade category settings
|
|
|
|
$temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'));
|
2007-10-07 18:15:57 +00:00
|
|
|
|
2007-09-14 08:54:46 +00:00
|
|
|
$strnoforce = get_string('noforce', 'grades');
|
|
|
|
|
|
|
|
// Aggregation type
|
|
|
|
$options = array(-1 => $strnoforce,
|
|
|
|
GRADE_AGGREGATE_MEAN =>get_string('aggregatemean', 'grades'),
|
|
|
|
GRADE_AGGREGATE_MEDIAN =>get_string('aggregatemedian', 'grades'),
|
|
|
|
GRADE_AGGREGATE_MIN =>get_string('aggregatemin', 'grades'),
|
|
|
|
GRADE_AGGREGATE_MAX =>get_string('aggregatemax', 'grades'),
|
|
|
|
GRADE_AGGREGATE_MODE =>get_string('aggregatemode', 'grades'),
|
|
|
|
GRADE_AGGREGATE_WEIGHTED_MEAN =>get_string('aggregateweightedmean', 'grades'),
|
|
|
|
GRADE_AGGREGATE_EXTRACREDIT_MEAN=>get_string('aggregateextracreditmean', 'grades'));
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_aggregation', get_string('aggregation', 'grades'), get_string('aggregationhelp', 'grades'), -1, $options));
|
2007-09-14 08:54:46 +00:00
|
|
|
|
|
|
|
$options = array(-1 => $strnoforce, 0 => get_string('forceoff', 'grades'), 1 => get_string('forceon', 'grades'));
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
|
2007-09-14 08:54:46 +00:00
|
|
|
get_string('aggregateonlygradedhelp', 'grades'), -1, $options));
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
|
2007-09-14 08:54:46 +00:00
|
|
|
get_string('aggregateoutcomeshelp', 'grades'), -1, $options));
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_aggregatesubcats', get_string('aggregatesubcats', 'grades'),
|
2007-09-14 08:54:46 +00:00
|
|
|
get_string('aggregatesubcatshelp', 'grades'), -1, $options));
|
|
|
|
|
|
|
|
$options = array(-1 => $strnoforce, 0 => get_string('none'));
|
|
|
|
for ($i=1; $i<=20; $i++) {
|
|
|
|
$options[$i] = $i;
|
|
|
|
}
|
|
|
|
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_keephigh', get_string('keephigh', 'grades'),
|
2007-09-14 08:54:46 +00:00
|
|
|
get_string('keephighhelp', 'grades'), -1, $options));
|
2007-09-14 17:21:30 +00:00
|
|
|
$temp->add(new admin_setting_configselect('grade_droplow', get_string('droplow', 'grades'),
|
2007-09-14 08:54:46 +00:00
|
|
|
get_string('droplowhelp', 'grades'), -1, $options));
|
|
|
|
|
|
|
|
$ADMIN->add('grades', $temp);
|
2007-07-30 22:56:45 +00:00
|
|
|
|
2007-07-04 09:34:17 +00:00
|
|
|
// The plugins must implement a settings.php file that adds their admin settings to the $settings object
|
|
|
|
|
|
|
|
// Reports
|
|
|
|
|
|
|
|
$first = true;
|
|
|
|
foreach (get_list_of_plugins('grade/report') as $plugin) {
|
|
|
|
// Include all the settings commands for this plugin if there are any
|
2007-07-23 08:23:25 +00:00
|
|
|
if ($first) {
|
2007-07-30 22:56:45 +00:00
|
|
|
$ADMIN->add('grades', new admin_category('gradereports', get_string('reportsettings', 'grades')));
|
2007-07-23 08:23:25 +00:00
|
|
|
$first = false;
|
2007-07-24 05:27:46 +00:00
|
|
|
}
|
|
|
|
|
2007-07-30 22:56:45 +00:00
|
|
|
if (file_exists($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php')) {
|
2007-07-04 09:34:17 +00:00
|
|
|
|
|
|
|
$settings = new admin_settingpage('gradereport'.$plugin, get_string('modulename', 'gradereport_'.$plugin));
|
|
|
|
include_once($CFG->dirroot.'/grade/report/'.$plugin.'/settings.php');
|
|
|
|
$ADMIN->add('gradereports', $settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Imports
|
|
|
|
|
|
|
|
$first = true;
|
|
|
|
foreach (get_list_of_plugins('grade/import') as $plugin) {
|
2007-07-23 08:23:25 +00:00
|
|
|
|
2007-07-04 09:34:17 +00:00
|
|
|
// Include all the settings commands for this plugin if there are any
|
|
|
|
if (file_exists($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php')) {
|
|
|
|
if ($first) {
|
|
|
|
$ADMIN->add('grades', new admin_category('gradeimports', get_string('imports')));
|
|
|
|
$first = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$settings = new admin_settingpage('gradeimport'.$plugin, get_string('modulename', 'gradeimport_'.$plugin));
|
|
|
|
include_once($CFG->dirroot.'/grade/import/'.$plugin.'/settings.php');
|
|
|
|
$ADMIN->add('gradeimports', $settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Exports
|
|
|
|
|
|
|
|
$first = true;
|
|
|
|
foreach (get_list_of_plugins('grade/export') as $plugin) {
|
|
|
|
// Include all the settings commands for this plugin if there are any
|
|
|
|
if (file_exists($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php')) {
|
|
|
|
if ($first) {
|
|
|
|
$ADMIN->add('grades', new admin_category('gradeexports', get_string('exports')));
|
|
|
|
$first = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
$settings = new admin_settingpage('gradeexport'.$plugin, get_string('modulename', 'gradeexport_'.$plugin));
|
|
|
|
include_once($CFG->dirroot.'/grade/export/'.$plugin.'/settings.php');
|
|
|
|
$ADMIN->add('gradeexports', $settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|