MDL-18229 gradebook: Updating code to Moodle standard.