From 53461661aec29067169167b8a6d855a5494ac6d3 Mon Sep 17 00:00:00 2001 From: nicolasconnault Date: Fri, 14 Sep 2007 08:54:46 +0000 Subject: [PATCH] MDL-11278 Admin settings page completed, implementation of settings in the gradebook coming up next. --- admin/settings/grades.php | 35 +++++++++++++++++++++++++++++ lang/en_utf8/grades.php | 6 ++++- lib/gradelib.php | 46 +++------------------------------------ 3 files changed, 43 insertions(+), 44 deletions(-) diff --git a/admin/settings/grades.php b/admin/settings/grades.php index 88863ee032..96196dd633 100644 --- a/admin/settings/grades.php +++ b/admin/settings/grades.php @@ -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 diff --git a/lang/en_utf8/grades.php b/lang/en_utf8/grades.php index 96b531df5c..0fd5eab704 100644 --- a/lang/en_utf8/grades.php +++ b/lang/en_utf8/grades.php @@ -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'; diff --git a/lib/gradelib.php b/lib/gradelib.php index de0a75b642..6b92779d85 100644 --- a/lib/gradelib.php +++ b/lib/gradelib.php @@ -1,13 +1,12 @@ libdir . '/grade/constants.php'); require_once($CFG->libdir . '/grade/grade_category.php'); require_once($CFG->libdir . '/grade/grade_item.php'); -- 2.39.5