Does anyone know how to display the username (i.e. login name) of the students, and not just their name? This would be particularly useful in the screens where the lists of students are displayed such as the quiz, gradebook, and survey screens. The display of login names on student profiles, recent activity you be nice too.
Sometimes students log in via LDAP (Is that right? LMAP? or something) using their student number of something that is very easy to manage and the rolls (things that we do role calls with) are often in student number (i.e. login name) order.
Added to that, in the Japanese language there is often confusion about the order of the names, the characters they write their names in, and how to read student names in ideogram (hence, perhaps the use of numbers more often). The use of the login name would be a real plus.
If anyone knows the php variable then we may be able to hack something. For example might this work?
print ($$userid);
The ability to decided whether student usernames are displayed at a course level, immediately prior to all occurences of the users name (for ordering), would be a ideal.
On behalf (in Japanese) of taka kago and come to think of it myself. It would definately be a very useful function.
Thank you,
Tim
Takemoto
to have logging names aside of names one small change in one file:
moodle/lib/weblib.php
around line 1045
$fullname = fullname($user, true);
add
$fullname = fullname($user, true)."{".$user->username."}";
You may add elsewhere if you want and change { for what you want.
Not tested in japanese
Bye,
Bernard
Thanks Bernard, Martin
So fast!
I will pass that on.
Tim
Hi. This is taka kago in Japan.
Some days before I asked about this problem in Japanese Forum.( Thank you Tim.)
I will explain about my request in detail.
I want to add moodle login account for list of students. Because we are managing student's with number. You explained about the fullname() function. Maybe, if I modify this function I will be able to view student list with login id, but I want to sort this list with login id in any activitys, and I want to export a result of quiz and so on. So please tell me how to modify the php source code .
function fullname($user, $override=false) {
if (!empty($user->username)) {
return $user->username;
} else {
return $user->lastname;
}
}
Thank you very much for your commnet.
I understood your explanation. I will try it on next Tuesday.
(I'm home now. So I can't modify source code in server working on Windows IIS)
But in the future, I want to view both login id (ex: s001,s002...) and real name (in Japanese lastname+firstname).
And please add a optional settig for each course:
"show username", name order "username + last name + firstname"
sorry, my cheep English.
function fullname($user, $override=false) {
global $CFG, $SESSION;
if (!isset($user->firstname) and !isset($user->lastname)) {
return '';
}
Is what I have currently in lib/moodlelib.php
Frankly, I find it hard to believe that this isn't a standard feature. Being able to list usernames against names is a basic requirement for me and, I'm sure, many other users.
I'd be most grateful if someone could edit moodlelib.php to add this function and post it so I can simply drop the file in to replace the old one.
Has anyone got this working? I am using 1.9.2..
Thanks
Karen