2 // This file is part of Moodle - http://moodle.org/
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
18 * Definitions of constants for gradebook
20 * @package core_grades
22 * @copyright 2007 Nicolas Connault
23 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26 defined('MOODLE_INTERNAL') ||
die();
28 // Category aggregation types
31 * GRADE_AGGREGATE_MEAN - Use the category mean for grade aggregation.
33 define('GRADE_AGGREGATE_MEAN', 0);
36 * GRADE_AGGREGATE_MEDIAN - Use the category median for grade aggregation.
38 define('GRADE_AGGREGATE_MEDIAN', 2);
41 * GRADE_AGGREGATE_MIN - Use the category minimum grade for grade aggregation.
43 define('GRADE_AGGREGATE_MIN', 4);
46 * GRADE_AGGREGATE_MAX - Use the category maximum grade for grade aggregation.
48 define('GRADE_AGGREGATE_MAX', 6);
51 * GRADE_AGGREGATE_MEDIAN - Use the category mode for grade aggregation.
53 define('GRADE_AGGREGATE_MODE', 8);
56 * GRADE_AGGREGATE_WEIGHTED_MEAN - Use a weighted mean of grades in the category for grade aggregation. Weights can be manually set.
58 define('GRADE_AGGREGATE_WEIGHTED_MEAN', 10);
61 * GRADE_AGGREGATE_WEIGHTED_MEAN2 - Use a simple weighted mean of grades in the category for grade aggregation.
63 define('GRADE_AGGREGATE_WEIGHTED_MEAN2', 11);
66 * GRADE_AGGREGATE_EXTRACREDIT_MEAN - Use the category mean for grade aggregation and include support for extra credit.
68 define('GRADE_AGGREGATE_EXTRACREDIT_MEAN', 12);
71 * GRADE_AGGREGATE_WEIGHTED_MEAN2 - Use the sum of grades in the category for grade aggregation.
73 define('GRADE_AGGREGATE_SUM', 13);
78 * GRADE_TYPE_NONE - Ungraded.
80 define('GRADE_TYPE_NONE', 0);
83 * GRADE_TYPE_NONE - The grade is a numeric value
85 define('GRADE_TYPE_VALUE', 1);
88 * GRADE_TYPE_NONE - The grade is a value from the set of values available in a grade scale.
90 define('GRADE_TYPE_SCALE', 2);
93 * GRADE_TYPE_NONE - Feedback only.
95 define('GRADE_TYPE_TEXT', 3);
98 // grade_update() return status
101 * GRADE_UPDATE_OK - Grade updated completed successfully.
103 define('GRADE_UPDATE_OK', 0);
106 * GRADE_UPDATE_FAILED - Grade updated failed.
108 define('GRADE_UPDATE_FAILED', 1);
111 * GRADE_UPDATE_MULTIPLE - Grade update failed because there are multiple grade items with the same itemnumber for this activity.
113 define('GRADE_UPDATE_MULTIPLE', 2);
116 * GRADE_UPDATE_DELETED - Grade item cannot be updated as it is locked
118 define('GRADE_UPDATE_ITEM_LOCKED', 4);
121 // Grade tables history tracking actions
124 * GRADE_HISTORY_INSERT - A grade item was inserted
126 define('GRADE_HISTORY_INSERT', 1);
129 * GRADE_HISTORY_UPDATE - A grade item was updated
131 define('GRADE_HISTORY_UPDATE', 2);
134 * GRADE_HISTORY_INSERT - A grade item was deleted
136 define('GRADE_HISTORY_DELETE', 3);
138 // Display style constants
141 * GRADE_DISPLAY_TYPE_DEFAULT - Grade display type can be set at 3 levels: grade_item, course setting and site. Use the display type from the higher level.
143 define('GRADE_DISPLAY_TYPE_DEFAULT', 0);
146 * GRADE_DISPLAY_TYPE_REAL - Display the grade as a decimal number.
148 define('GRADE_DISPLAY_TYPE_REAL', 1);
151 * GRADE_DISPLAY_TYPE_PERCENTAGE - Display the grade as a percentage.
153 define('GRADE_DISPLAY_TYPE_PERCENTAGE', 2);
156 * GRADE_DISPLAY_TYPE_LETTER - Display the grade as a letter grade. For example, A, B, C, D or F.
158 define('GRADE_DISPLAY_TYPE_LETTER', 3);
161 * GRADE_DISPLAY_TYPE_REAL_PERCENTAGE - Display the grade as a decimal number and a percentage.
163 define('GRADE_DISPLAY_TYPE_REAL_PERCENTAGE', 12);
166 * GRADE_DISPLAY_TYPE_REAL_LETTER - Display the grade as a decimal number and a letter grade.
168 define('GRADE_DISPLAY_TYPE_REAL_LETTER', 13);
171 * GRADE_DISPLAY_TYPE_LETTER_REAL - Display the grade as a letter grade and a decimal number.
173 define('GRADE_DISPLAY_TYPE_LETTER_REAL', 31);
176 * GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE - Display the grade as a letter grade and a percentage.
178 define('GRADE_DISPLAY_TYPE_LETTER_PERCENTAGE', 32);
181 * GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER - Display the grade as a percentage and a letter grade.
183 define('GRADE_DISPLAY_TYPE_PERCENTAGE_LETTER', 23);
186 * GRADE_DISPLAY_TYPE_PERCENTAGE_REAL - Display the grade as a percentage and a decimal number.
188 define('GRADE_DISPLAY_TYPE_PERCENTAGE_REAL', 21);
191 * GRADE_REPORT_AGGREGATION_POSITION_FIRST - Display the course totals before the individual activity grades
193 define('GRADE_REPORT_AGGREGATION_POSITION_FIRST', 0);
196 * GRADE_REPORT_AGGREGATION_POSITION_LAST - Display the course totals after the individual activity grades
198 define('GRADE_REPORT_AGGREGATION_POSITION_LAST', 1);
200 // What to do if category or course total contains a hidden item
203 * GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN - If the category or course total contains a hidden item hide the total from students.
205 define('GRADE_REPORT_HIDE_TOTAL_IF_CONTAINS_HIDDEN', 0);
208 * GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN - If the category or course total contains a hidden item show the total to students minus grades from the hidden items.
210 define('GRADE_REPORT_SHOW_TOTAL_IF_CONTAINS_HIDDEN', 1);
213 * GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN - If the category or course total contains a hidden item show students the real total including marks from hidden items.
215 define('GRADE_REPORT_SHOW_REAL_TOTAL_IF_CONTAINS_HIDDEN', 2);
218 * GRADE_REPORT_PREFERENCE_DEFAULT - Use the setting from site preferences.
220 define('GRADE_REPORT_PREFERENCE_DEFAULT', 'default');
223 * GRADE_REPORT_PREFERENCE_INHERIT - Inherit the setting value from the parent.
225 define('GRADE_REPORT_PREFERENCE_INHERIT', 'inherit'); // means inherit from parent
228 * GRADE_REPORT_PREFERENCE_UNUSED - Unused constant.
230 define('GRADE_REPORT_PREFERENCE_UNUSED', -1);
233 * GRADE_REPORT_MEAN_ALL - Include all grade items including those where the student hasn't received a grade when calculating the mean.
235 define('GRADE_REPORT_MEAN_ALL', 0);
238 * GRADE_REPORT_MEAN_GRADED - Only include grade items where the student has a grade when calculating the mean.
240 define('GRADE_REPORT_MEAN_GRADED', 1);
243 * GRADE_NAVMETHOD_DROPDOWN - Display a drop down box to allow navigation within the gradebook
245 define('GRADE_NAVMETHOD_DROPDOWN', 0);
248 * GRADE_NAVMETHOD_TABS - Display tabs to allow navigation within the gradebook
250 define('GRADE_NAVMETHOD_TABS', 1);
253 * GRADE_NAVMETHOD_TABS - Display both a drop down and tabs to allow navigation within the gradebook
255 define('GRADE_NAVMETHOD_COMBO', 2);