mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-77264' of https://github.com/paulholden/moodle
This commit is contained in:
commit
46ba6e83f8
@ -194,6 +194,7 @@ $string['errorupdatinggradecategoryaggregateoutcomes'] = 'Error updating the "In
|
||||
$string['errorupdatinggradecategoryaggregation'] = 'Error updating the aggregation type of grade category ID {$a->id}';
|
||||
$string['errorupdatinggradeitemaggregationcoef'] = 'Error updating the aggregation coefficient (weight or extra credit) of grade item ID {$a->id}';
|
||||
$string['eventgradedeleted'] = 'Grade deleted';
|
||||
$string['eventgradeexported'] = 'Grade exported';
|
||||
$string['eventgradeitemcreated'] = 'Grade item created';
|
||||
$string['eventgradeitemdeleted'] = 'Grade item deleted';
|
||||
$string['eventgradeitemupdated'] = 'Grade item updated';
|
||||
|
@ -14,20 +14,10 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
* Grade report viewed event.
|
||||
*
|
||||
* @package core
|
||||
* @copyright 2016 Zane Karl <zkarl@oid.ucla.edu>
|
||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||
*/
|
||||
|
||||
namespace core\event;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
/**
|
||||
* Grade report viewed event class.
|
||||
* Abstract grade report exported event class.
|
||||
*
|
||||
* @package core
|
||||
* @since Moodle 3.2
|
||||
@ -55,7 +45,7 @@ abstract class grade_exported extends base {
|
||||
public static function get_export_type() {
|
||||
$classname = explode('\\', get_called_class());
|
||||
$exporttype = explode('_', $classname[0]);
|
||||
return $exporttype[1];
|
||||
return $exporttype[1] ?? '';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -64,7 +54,13 @@ abstract class grade_exported extends base {
|
||||
* @return string
|
||||
*/
|
||||
public static function get_name() {
|
||||
return get_string('eventgradeexported', 'gradeexport_'. self::get_export_type());
|
||||
$component = 'gradeexport_' . self::get_export_type();
|
||||
if (get_string_manager()->string_exists('eventgradeexported', $component)) {
|
||||
return get_string('eventgradeexported', $component);
|
||||
}
|
||||
|
||||
// Fallback to generic name.
|
||||
return get_string('eventgradeexported', 'core_grades');
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user