Display Student Name in Assignment texts

Re: Display Student Name in Assignment texts

by Paula Edmiston -
Number of replies: 0
I don't know if you'd find this a desirable compromise ... I am placing the user's name at the top of the window, replacing the logout links. The person's name is a logout link and when you hover the link the link title shows up saying "logout".

Edited two files: one for the moodle home page and one for subsequent pages.

1. display the user name on the home page, centered just under the logo

edit theme/mm/header.html at about line 17, just under the line that calls the logo (in the standard logo theme, but note that theme/mm is my personal theme) I inserted this:

<!-- paula added display of user name next line -->
<br><center><font size="1">
<a href="/cweb/login/logout.php" title="Logout"><? echo "$USER->firstname $USER->lastname"; ?><$
</font></center><!-- stop paula -->


2. Now, replace the existing text "logout" link with the user name as logout link. again, the title attribute provides a reminder label when you hover the link. Edit lib/weblib.php at about line 597

// paula this replaces the logout link text with the user name - replace the following line
// $menu = "<FONT SIZE=2><A TARGET=_parent HREF="$CFG->wwwroot/login/logout.php" >".get_string("logout")."</A></FONT>";
// with this new line

$menu = "<FONT SIZE=2><A title="Logout" TARGET=_parent HREF="$CFG->wwwroot/login/logout.php">$USER->firstname $USER->lastname</A></FONT>";

// stop paula

Please notice that on that line of code above 'stop paula' it should be one unbroken line but it wraps in this window.