This commit is contained in:
Andrew Nicols 2023-06-08 11:31:51 +08:00
commit 46ba6e83f8
No known key found for this signature in database
GPG Key ID: 6D1E3157C8CFBF14
2 changed files with 10 additions and 13 deletions

View File

@ -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';

View File

@ -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');
}
/**