Skip to content

Commit

Permalink
Merge branch 'MDL-50371' of https://github.com/danielneis/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Aug 12, 2015
2 parents 01fdb04 + b6d1812 commit 28a614a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lang/en/grades.php
Expand Up @@ -308,7 +308,7 @@
$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.';
Expand Down
14 changes: 14 additions & 0 deletions lib/grade/grade_item.php
Expand Up @@ -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,
Expand Down

0 comments on commit 28a614a

Please sign in to comment.