]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12146 grade item settings can be now configured as advanced, new advanced default...
authorskodak <skodak>
Thu, 15 Nov 2007 17:32:31 +0000 (17:32 +0000)
committerskodak <skodak>
Thu, 15 Nov 2007 17:32:31 +0000 (17:32 +0000)
admin/settings/appearance.php
admin/settings/grades.php
grade/edit/tree/item_form.php
lang/en_utf8/grades.php
lib/adminlib.php

index 68ccd986ac5b94a40aa08e6659a61e4e2c1da1bd..5bae9b3ec8bb9de58353f59b2032a5b4713e9b7c 100644 (file)
@@ -109,11 +109,6 @@ $temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
 $temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
 $ADMIN->add('appearance', $temp);
 
-// new CFG variable for gradebook (what roles to display)
-$temp = new admin_settingpage('gradebook', get_string('gradebook', 'admin'));
-$temp->add(new admin_setting_special_gradebookroles());
-$ADMIN->add('appearance', $temp);
-
 // new CFG variable for coursemanager (what roles to display)
 $temp = new admin_settingpage('coursemanager', get_string('coursemanager', 'admin'));
 $temp->add(new admin_setting_special_coursemanager());
index 7ee35a555acea569bef8ba8ea0dee957c0534d5a..74b2fa60e71e1b21fd6dd9db83703643d9c0d4d1 100644 (file)
@@ -9,7 +9,10 @@ if (has_capability('moodle/grade:manage', $systemcontext)
 
 require_once $CFG->libdir.'/grade/constants.php';
 
-$temp = new admin_settingpage('gradessettings', get_string('gradessettings', 'grades'), 'moodle/grade:manage');
+$temp = new admin_settingpage('gradessettings', get_string('generalsettings', 'grades'), 'moodle/grade:manage');
+
+// new CFG variable for gradebook (what roles to display)
+$temp->add(new admin_setting_special_gradebookroles());
 
 // enable outcomes checkbox
 $temp->add(new admin_setting_configcheckbox('enableoutcomes', get_string('enableoutcomes', 'grades'), get_string('configenableoutcomes', 'grades'), 0, PARAM_INT));
@@ -21,21 +24,6 @@ $temp->add(new admin_setting_configselect('grade_aggregationposition', get_strin
                                           array(GRADE_REPORT_AGGREGATION_POSITION_FIRST => get_string('positionfirst', 'grades'),
                                                 GRADE_REPORT_AGGREGATION_POSITION_LAST => get_string('positionlast', 'grades'))));
 
-$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')));
-
 $temp->add(new admin_setting_configcheckbox('grade_hiddenasdate', get_string('hiddenasdate', 'grades'), get_string('confighiddenasdate', 'grades'), 0, PARAM_INT));
 
 // enable publishing in exports/imports
@@ -100,6 +88,49 @@ $temp->add(new admin_setting_gradecat_combo('grade_droplow', get_string('droplow
 
 $ADMIN->add('grades', $temp);
 
+
+/// Grade item settings
+$temp = new admin_settingpage('gradeitemsettings', get_string('gradeitemsettings', 'grades'), 'moodle/grade:manage');
+
+
+$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')));
+
+$temp->add(new admin_setting_configmultiselect('grade_item_advanced', get_string('gradeitemadvanced', 'grades'), get_string('configgradeitemadvanced', 'grades'),
+                                               array('iteminfo', 'idnumber', 'gradepass', 'plusfactor', 'multfactor', 'display', 'decimals', 'hiddenuntil', 'locktime'),
+                                               array('iteminfo' => get_string('iteminfo', 'grades'),
+                                                     'idnumber' => get_string('idnumber'),
+                                                     'gradetype' => get_string('gradetype', 'grades'),
+                                                     'scaleid' => get_string('scale'),
+                                                     'grademin' => get_string('grademin', 'grades'),
+                                                     'grademax' => get_string('grademax', 'grades'),
+                                                     'gradepass' => get_string('gradepass', 'grades'),
+                                                     'plusfactor' => get_string('plusfactor', 'grades'),
+                                                     'multfactor' => get_string('multfactor', 'grades'),
+                                                     'display' => get_string('gradedisplaytype', 'grades'),
+                                                     'decimals' => get_string('decimalpoints', 'grades'),
+                                                     'hidden' => get_string('hidden', 'grades'),
+                                                     'hiddenuntil' => get_string('hiddenuntil', 'grades'),
+                                                     'locked' => get_string('locked', 'grades'),
+                                                     'locktime' => get_string('locktime', 'grades'),
+                                                     'aggregationcoef' => get_string('aggregationcoef', 'grades'),
+                                                     'parentcategory' => get_string('parentcategory', 'grades'))));
+
+$ADMIN->add('grades', $temp);
+
+
 /// Scales and outcomes
 
 $scales = new admin_externalpage('scales', get_string('scales'), $CFG->wwwroot.'/grade/edit/scale/index.php', 'moodle/grade:manage');
index bd23651c528c601c7b729b8cca8bd21386714dbb..153fa89d1737f3cd9dd1506c2a3b967e97f4bb12 100644 (file)
@@ -196,6 +196,15 @@ class edit_item_form extends moodleform {
         $gpr = $this->_customdata['gpr'];
         $gpr->add_mform_elements($mform);
 
+/// mark advanced according to site settings
+        if (isset($CFG->grade_item_advanced)) {
+            $advanced = explode(',', $CFG->grade_item_advanced);
+            foreach ($advanced as $el) {
+                if ($mform->elementExists($el)) {
+                    $mform->setAdvanced($el);
+                }
+            }
+        }
 //-------------------------------------------------------------------------------
         // buttons
         $this->add_action_buttons();
index 1659d4145b562459cc541dd72d97d4488baff4f9..b4e447575d596c35d47e7cca9165161fa70f8978 100644 (file)
@@ -77,6 +77,7 @@ $string['configgradedisplaytype'] = 'Grades can be shown as real grades, as perc
 $string['configgradeexportdisplaytype'] = 'Grades can be shown as real grades, as percentages (in reference to the minimum and maximum grades) or as letters (A, B, C etc..) during export. This can be overriden during export.';
 $string['configexportdecimalpoints'] = 'The number of decimal points to display for export. This can be overriden during export.';
 $string['configgradehistorylifetime'] = 'This specifies the length of time you want to keep history of changes in grade related tables. It is recommended to keep it as long as possible. If you experience performance problems or have limited database space, try to set lower value.';
+$string['configgradeitemadvanced'] = 'Select all elements that should be displayed as advanced when editing grade items.';
 $string['configgradeletter'] = 'A letter or other symbol used to represent a range of grades.';
 $string['configgradeletterdefault'] = 'A letter or other symbol used to represent a range of grades. Leave this field empty to use the site default (currently $a).';
 $string['configgradepublishing'] = 'Enable publishing in exports and imports: Exported grades can be accessed by accessing a URL, without having to log on to a Moodle site. Grades can be imported by accessing such a URL (which means that a moodle site can import grades published by another site). By default only administrators may use this feature, please educate users before adding required capabilities to other roles (dangers of bookmark sharing and download accelerators, IP restrictions, etc.).';
@@ -167,6 +168,7 @@ $string['forelementtypes'] = ' for the selected $a';
 $string['forstudents'] = 'For students';
 $string['full'] = 'Full';
 $string['fullmode'] = 'Full view';
+$string['generalsettings'] = 'General settings';
 $string['grade'] = 'Grade';
 $string['gradebook'] = 'Gradebook';
 $string['gradebookhiddenerror'] = 'The gradebook is currently set to hide everything from students.';
@@ -186,6 +188,7 @@ $string['gradeexportdecimalpoints'] = 'Grade export decimal points';
 $string['gradehelp'] = 'Grade Help';
 $string['gradehistorylifetime'] = 'Grade history lifetime';
 $string['gradeitem'] = 'Grade item';
+$string['gradeitemadvanced'] = 'Advanced grade item options';
 $string['gradeitemislocked'] = 'This activity is locked in the gradebook. Changes that are made to grades in this activity will not be copied to the gradebook until it is unlocked.';
 $string['gradeitemlocked'] = 'Grading locked';
 $string['gradeitemsinc'] = 'Grade items to be included';
@@ -194,6 +197,7 @@ $string['gradeitemmembersselected'] = 'Excluded from grading';
 $string['gradeitemnonmembers'] = 'Included in grading';
 $string['gradeitemremovemembers'] = 'Include in grading';
 $string['gradeitems'] = 'Grade items';
+$string['gradeitemsettings'] = 'Grade item settings';
 $string['gradeletter'] = 'Grade letter';
 $string['gradeletters'] = 'Grade letters';
 $string['gradeletterhelp'] = 'Grade letter Help';
index 69490e4bdfcf85517c89825c11436d1a9f058012..39fc53507f69c34b50cde77a864688c1bd724021 100644 (file)
@@ -2488,8 +2488,8 @@ class admin_setting_special_calendar_weekend extends admin_setting {
 
 }
 
-/*
- * this is used in config->appearance->gradeconfig
+/**
+ * this is used in config->grades
  */
 class admin_setting_special_gradebookroles extends admin_setting {
 
@@ -2851,7 +2851,7 @@ class admin_setting_gradecat_combo extends admin_setting {
             // the string cast is needed because key may be integer - 0 is equal to most strings!
             $return .= '<option value="'.$key.'"'.((string)$key==$value ? ' selected="selected"' : '').'>'.$val.'</option>';
         }
-        $return .= '</select>'; // TODO: localise
+        $return .= '</select>';
         $return .= '<label for="id_s_'.$this->name.'force">'.get_string('force').'</label><input type="checkbox" class="form-checkbox" id="id_s_'.$this->name.'force" name="s_'.$this->name.'[forced]" value="1" ' . ($forced ? 'checked="checked"' : '') . ' />';
         $return .= '<label for="id_s_'.$this->name.'adv">'.get_string('advanced').'</label><input type="checkbox" class="form-checkbox" id="id_s_'.$this->name.'adv" name="s_'.$this->name.'[adv]" value="1" ' . ($adv ? 'checked="checked"' : '') . ' />';
 
@@ -2859,8 +2859,9 @@ class admin_setting_gradecat_combo extends admin_setting {
     }
 }
 
+
 /**
- * Selection of grade report in user ptofile
+ * Selection of grade report in user profile
  */
 class admin_setting_grade_profilereport extends admin_setting_configselect {
     function admin_setting_grade_profilereport() {