Has anyone else come across this? When using the chat module, our students have found that if they type a forward slash / at the beginning of their chat line it completely removes their username from that line of chat. The problem that arises from this is that a teacher does not know who typed in what. Does anyone have any suggestions or ideas?
We are currently using moodle version Moodle 1.7+ (2006101009)
Hi, Ross. You should probably file this in the tracker so it gets fixed for good. Here's a quick fix that seems to work:
1) Edit the file mod/chat/lib.php (save a backup copy first so you can put things back if it doesn't work)
2) Locate the function chat_format_message_manually
3) Scroll down until you see this code:
else if (substr($text, 0, 1) == '/') { /// It's a user command
if (substr($text, 0, 4) == "/me ") {
$outinfo = $message->strtime;
$outmain = $sender->firstname.' '.substr($text, 4);
} else {
$outinfo = $message->strtime;
$outmain = $text;
Change:
$outmain = $text;
to:
$outmain = $sender->firstname.' '.$text;
Students are inventive creatures, aren't they?
1) Edit the file mod/chat/lib.php (save a backup copy first so you can put things back if it doesn't work)
2) Locate the function chat_format_message_manually
3) Scroll down until you see this code:
else if (substr($text, 0, 1) == '/') { /// It's a user command
if (substr($text, 0, 4) == "/me ") {
$outinfo = $message->strtime;
$outmain = $sender->firstname.' '.substr($text, 4);
} else {
$outinfo = $message->strtime;
$outmain = $text;
Change:
$outmain = $text;
to:
$outmain = $sender->firstname.' '.$text;
Students are inventive creatures, aren't they?
P.S. in case it's not clear, there's a blank space between the two single quotes in:
$outmain = $sender->firstname.' '.$text;
$outmain = $sender->firstname.' '.$text;
Awesome. Worked like a charm! Thanks.