diff --git a/lang/en/grades.php b/lang/en/grades.php index bd9273e9436..02676d6b03b 100644 --- a/lang/en/grades.php +++ b/lang/en/grades.php @@ -308,7 +308,7 @@ $string['gradepass'] = 'Grade to pass'; $string['gradepass_help'] = 'This setting determines the minimum grade required to pass. The value is used in activity and course completion, and in the gradebook, where pass grades are highlighted in green and fail grades in red.'; $string['gradepassgreaterthangrade'] = 'The grade to pass can not be greater than the maximum possible grade {$a}'; $string['gradepointdefault'] = 'Grade point default'; -$string['gradepointdefault_help'] = 'This setting determines the default value for the grade point value available in an activity.'; +$string['gradepointdefault_help'] = 'This setting determines the default value for the grade point value available in a grade item.'; $string['gradepointdefault_validateerror'] = 'This setting must be an integer between 1 and the grade point maximum.'; $string['gradepointmax'] = 'Grade point maximum'; $string['gradepointmax_help'] = 'This setting determines the maximum grade point value available in an activity.'; diff --git a/lib/grade/grade_item.php b/lib/grade/grade_item.php index d0e11c14613..145b6deeff7 100644 --- a/lib/grade/grade_item.php +++ b/lib/grade/grade_item.php @@ -257,6 +257,20 @@ class grade_item extends grade_object { */ public $dependson_cache = null; + /** + * Constructor. Optionally (and by default) attempts to fetch corresponding row from the database + * + * @param array $params An array with required parameters for this grade object. + * @param bool $fetch Whether to fetch corresponding row from the database or not, + * optional fields might not be defined if false used + */ + public function __construct($params = null, $fetch = true) { + global $CFG; + // Set grademax from $CFG->gradepointdefault . + self::set_properties($this, array('grademax' => $CFG->gradepointdefault)); + parent::__construct($params, $fetch); + } + /** * In addition to update() as defined in grade_object, handle the grade_outcome and grade_scale objects. * Force regrading if necessary, rounds the float numbers using php function,