From 10b81f7b0db87bbca9f431b4e9fa3a85aaf03f7b Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 1 Jul 2026 16:23:59 +0200 Subject: util: add getName if the separation between first and lastname is not needed --- js/utils-prod.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'js/utils-prod.js') diff --git a/js/utils-prod.js b/js/utils-prod.js index 119870c..ab8e311 100644 --- a/js/utils-prod.js +++ b/js/utils-prod.js @@ -3,7 +3,7 @@ export function isTeacher() { || document.body.classList.contains('editing'); } -export function getCurrentName() { +export function getFirstAndLastname() { let firstname = ""; let lastname = ""; @@ -15,6 +15,10 @@ export function getCurrentName() { return [firstname, lastname]; } +export function getName() { + return document.querySelector("div.user-name").textContent; +} + export function getUserId() { // M is exported by Moodle return M.cfg.userid; -- cgit v1.2.3