Skip to content

Commit

Permalink
MDL-11278 Admin settings page completed, implementation of settings i…
Browse files Browse the repository at this point in the history
…n the gradebook coming up next.
  • Loading branch information
nicolasconnault committed Sep 14, 2007
1 parent 00374cc commit 5346166
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 44 deletions.
35 changes: 35 additions & 0 deletions admin/settings/grades.php
Expand Up @@ -19,6 +19,41 @@
$outcomes = new admin_externalpage('outcomes', get_string('outcomes', 'grades'), $CFG->wwwroot.'/grade/edit/outcome/index.php', 'moodle/grade:manage');
$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

Expand Down
6 changes: 5 additions & 1 deletion lang/en_utf8/grades.php
Expand Up @@ -27,7 +27,7 @@
$string['aggregation'] = 'Aggregation';
$string['aggregationcoef'] = 'Aggregation coefficient';
$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['aggregationview'] = 'Aggregation view';
$string['allgrades'] = 'All grades by category';
Expand Down Expand Up @@ -143,6 +143,8 @@
$string['feedbacksaved'] = 'Feedback saved';
$string['finalgrade'] = 'Final grade';
$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['forstudents'] = 'For Students';
$string['full'] = 'Full';
Expand All @@ -154,6 +156,7 @@
$string['gradeboundary'] = 'Letter grade boundary';
$string['gradecategory'] = 'Grade Category';
$string['gradecategoryhelp'] = 'Grade Category Help';
$string['gradecategorysettings'] = 'Grade Category Settings';
$string['gradedon'] = 'Graded $a';
$string['gradedisplaytype'] = 'Grade display type';
$string['gradeexceptions'] = 'Grade Exceptions';
Expand Down Expand Up @@ -261,6 +264,7 @@
$string['nocategories'] = 'Grade categories could not be added or found for this course';
$string['nocategoryname'] = 'No category name was given.';
$string['nocategoryview'] = 'No category to view by';
$string['noforce'] = 'Do not force';
$string['nogradeletters'] = 'No grade letters set';
$string['nogradesreturned'] = 'No grades returned';
$string['noidnumber'] = 'No id number';
Expand Down
46 changes: 3 additions & 43 deletions lib/gradelib.php
@@ -1,13 +1,12 @@
<?php // $Id$

///////////////////////////////////////////////////////////////////////////
// //
// NOTICE OF COPYRIGHT //
// //
// 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 //
// it under the terms of the GNU General Public License as published by //
Expand All @@ -32,46 +31,7 @@
* @package moodlecore
*/

// category aggregation types
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/constants.php');

require_once($CFG->libdir . '/grade/grade_category.php');
require_once($CFG->libdir . '/grade/grade_item.php');
Expand Down

0 comments on commit 5346166

Please sign in to comment.