]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-11278 Admin settings page completed, implementation of settings in the gradebook...
authornicolasconnault <nicolasconnault>
Fri, 14 Sep 2007 08:54:46 +0000 (08:54 +0000)
committernicolasconnault <nicolasconnault>
Fri, 14 Sep 2007 08:54:46 +0000 (08:54 +0000)
admin/settings/grades.php
lang/en_utf8/grades.php
lib/gradelib.php

index 88863ee0326f77b69323a07a0c16e155c0cea736..96196dd63342d5afbf18020068626d21de90bc08 100644 (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');
 $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
 
index 96b531df5c8759247eb6b4973ecbce5b7c9b2a99..0fd5eab7044e92e596510ebcd0e4c58c1b9d5074 100644 (file)
@@ -27,7 +27,7 @@ $string['aggregateweightedmean'] = 'Weighted mean of grades';
 $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';
@@ -143,6 +143,8 @@ $string['feedbackview'] = 'View feedback';
 $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';
@@ -154,6 +156,7 @@ $string['gradebookhistories'] = 'Grade histories';
 $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';
@@ -261,6 +264,7 @@ $string['no'] = 'No';
 $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';
index de0a75b642d512d0701df906817ea63109425b8a..6b92779d853cc8c1dbbb5bca6117d528222b0309 100644 (file)
@@ -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  //
  * @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');