MDL-11278 Admin settings page completed, implementation of settings in the gradebook coming up next.

This commit is contained in:
nicolasconnault 2007-09-14 08:54:46 +00:00
parent 00374cc5f0
commit 53461661ae
3 changed files with 43 additions and 44 deletions

View file

@ -19,6 +19,41 @@ $ADMIN->add('grades', $scales);
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage'); $outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
$ADMIN->add('grades', $outcomes); $ADMIN->add('grades', $outcomes);
/// Grade category settings
require_once $CFG->libdir . '/grade/constants.php';
$temp = new admin_settingpage('gradecategorysettings', get_string('gradecategorysettings', 'grades'));
$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'));
$temp->add(new admin_setting_configselect('aggregation', get_string('aggregation', 'grades'), get_string('aggregationhelp', 'grades'), -1, $options));
$options = array(-1 => $strnoforce, 0 => get_string('forceoff', 'grades'), 1 => get_string('forceon', 'grades'));
$temp->add(new admin_setting_configselect('aggregateonlygraded', get_string('aggregateonlygraded', 'grades'),
get_string('aggregateonlygradedhelp', 'grades'), -1, $options));
$temp->add(new admin_setting_configselect('aggregateoutcomes', get_string('aggregateoutcomes', 'grades'),
get_string('aggregateoutcomeshelp', 'grades'), -1, $options));
$temp->add(new admin_setting_configselect('aggregatesubcats', get_string('aggregatesubcats', 'grades'),
get_string('aggregatesubcatshelp', 'grades'), -1, $options));
$options = array(-1 => $strnoforce, 0 => get_string('none'));
for ($i=1; $i<=20; $i++) {
$options[$i] = $i;
}
$temp->add(new admin_setting_configselect('keephigh', get_string('keephigh', 'grades'),
get_string('keephighhelp', 'grades'), -1, $options));
$temp->add(new admin_setting_configselect('droplow', get_string('droplow', 'grades'),
get_string('droplowhelp', 'grades'), -1, $options));
$ADMIN->add('grades', $temp);
// The plugins must implement a settings.php file that adds their admin settings to the $settings object // The plugins must implement a settings.php file that adds their admin settings to the $settings object

View file

@ -27,7 +27,7 @@ $string['aggregateweightedmean'] = 'Weighted mean of grades';
$string['aggregation'] = 'Aggregation'; $string['aggregation'] = 'Aggregation';
$string['aggregationcoef'] = 'Aggregation coefficient'; $string['aggregationcoef'] = 'Aggregation coefficient';
$string['aggregationcoefhelp'] = 'Weight applied to all grades in this grade item during aggregation with other grade items.'; $string['aggregationcoefhelp'] = 'Weight applied to all grades in this grade item during aggregation with other grade items.';
$string['aggregation'] = 'Aggregation'; $string['aggregationhelp'] = 'Strategy used to aggregate grades across all students in a course.';
$string['aggregationposition'] = 'Aggregation position'; $string['aggregationposition'] = 'Aggregation position';
$string['aggregationview'] = 'Aggregation view'; $string['aggregationview'] = 'Aggregation view';
$string['allgrades'] = 'All grades by category'; $string['allgrades'] = 'All grades by category';
@ -143,6 +143,8 @@ $string['feedbackview'] = 'View feedback';
$string['feedbacksaved'] = 'Feedback saved'; $string['feedbacksaved'] = 'Feedback saved';
$string['finalgrade'] = 'Final grade'; $string['finalgrade'] = 'Final grade';
$string['finalgradehelp'] = 'The final grade (cached) after all calculations are performed.'; $string['finalgradehelp'] = 'The final grade (cached) after all calculations are performed.';
$string['forceoff'] = 'Force: Off';
$string['forceon'] = 'Force: On';
$string['forelementtypes'] = ' for the selected $a'; $string['forelementtypes'] = ' for the selected $a';
$string['forstudents'] = 'For Students'; $string['forstudents'] = 'For Students';
$string['full'] = 'Full'; $string['full'] = 'Full';
@ -154,6 +156,7 @@ $string['gradebookhistories'] = 'Grade histories';
$string['gradeboundary'] = 'Letter grade boundary'; $string['gradeboundary'] = 'Letter grade boundary';
$string['gradecategory'] = 'Grade Category'; $string['gradecategory'] = 'Grade Category';
$string['gradecategoryhelp'] = 'Grade Category Help'; $string['gradecategoryhelp'] = 'Grade Category Help';
$string['gradecategorysettings'] = 'Grade Category Settings';
$string['gradedon'] = 'Graded $a'; $string['gradedon'] = 'Graded $a';
$string['gradedisplaytype'] = 'Grade display type'; $string['gradedisplaytype'] = 'Grade display type';
$string['gradeexceptions'] = 'Grade Exceptions'; $string['gradeexceptions'] = 'Grade Exceptions';
@ -261,6 +264,7 @@ $string['no'] = 'No';
$string['nocategories'] = 'Grade categories could not be added or found for this course'; $string['nocategories'] = 'Grade categories could not be added or found for this course';
$string['nocategoryname'] = 'No category name was given.'; $string['nocategoryname'] = 'No category name was given.';
$string['nocategoryview'] = 'No category to view by'; $string['nocategoryview'] = 'No category to view by';
$string['noforce'] = 'Do not force';
$string['nogradeletters'] = 'No grade letters set'; $string['nogradeletters'] = 'No grade letters set';
$string['nogradesreturned'] = 'No grades returned'; $string['nogradesreturned'] = 'No grades returned';
$string['noidnumber'] = 'No id number'; $string['noidnumber'] = 'No id number';

View file

@ -1,13 +1,12 @@
<?php // $Id$ <?php // $Id$
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT // // NOTICE OF COPYRIGHT //
// // // //
// Moodle - Modular Object-Oriented Dynamic Learning Environment // // Moodle - Modular Object-Oriented Dynamic Learning Environment //
// http://moodle.com // // http://moodle.org //
// // // //
// Copyright (C) 2001-2003 Martin Dougiamas http://dougiamas.com // // Copyright (C) 1999 onwards Martin Dougiamas http://moodle.com //
// // // //
// This program is free software; you can redistribute it and/or modify // // This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by // // it under the terms of the GNU General Public License as published by //
@ -32,46 +31,7 @@
* @package moodlecore * @package moodlecore
*/ */
// category aggregation types require_once($CFG->libdir . '/grade/constants.php');
define('GRADE_AGGREGATE_MEAN', 0);
define('GRADE_AGGREGATE_MEDIAN', 2);
define('GRADE_AGGREGATE_MIN', 4);
define('GRADE_AGGREGATE_MAX', 6);
define('GRADE_AGGREGATE_MODE', 8);
define('GRADE_AGGREGATE_WEIGHTED_MEAN', 10);
define('GRADE_AGGREGATE_EXTRACREDIT_MEAN', 12);
// grade types
define('GRADE_TYPE_NONE', 0);
define('GRADE_TYPE_VALUE', 1);
define('GRADE_TYPE_SCALE', 2);
define('GRADE_TYPE_TEXT', 3);
// grade_update() return status
define('GRADE_UPDATE_OK', 0);
define('GRADE_UPDATE_FAILED', 1);
define('GRADE_UPDATE_MULTIPLE', 2);
define('GRADE_UPDATE_ITEM_DELETED', 3);
define('GRADE_UPDATE_ITEM_LOCKED', 4);
// Grate teables history tracking actions
define('GRADE_HISTORY_INSERT', 1);
define('GRADE_HISTORY_UPDATE', 2);
define('GRADE_HISTORY_DELETE', 3);
define('GRADE_REPORT_AGGREGATION_POSITION_LEFT', 0);
define('GRADE_REPORT_AGGREGATION_POSITION_RIGHT', 1);
define('GRADE_REPORT_AGGREGATION_VIEW_FULL', 0);
define('GRADE_REPORT_AGGREGATION_VIEW_AGGREGATES_ONLY', 1);
define('GRADE_REPORT_AGGREGATION_VIEW_GRADES_ONLY', 2);
define('GRADE_REPORT_GRADE_DISPLAY_TYPE_REAL', 0);
define('GRADE_REPORT_GRADE_DISPLAY_TYPE_PERCENTAGE', 1);
define('GRADE_REPORT_GRADE_DISPLAY_TYPE_LETTER', 2);
define('GRADE_REPORT_PREFERENCE_DEFAULT', 'default');
define('GRADE_REPORT_PREFERENCE_INHERIT', 'inherit');
define('GRADE_REPORT_PREFERENCE_UNUSED', -1);
define('GRADE_REPORT_MEAN_ALL', 0);
define('GRADE_REPORT_MEAN_GRADED', 1);
require_once($CFG->libdir . '/grade/grade_category.php'); require_once($CFG->libdir . '/grade/grade_category.php');
require_once($CFG->libdir . '/grade/grade_item.php'); require_once($CFG->libdir . '/grade/grade_item.php');