Students hiding username by using forward slash /

Students hiding username by using forward slash /

by Ross Hendricks -
Number of replies: 4
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)
Average of ratings: -
In reply to Ross Hendricks

Re: Students hiding username by using forward slash /

by Tony Hursh -
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? smile


In reply to Tony Hursh

Re: Students hiding username by using forward slash /

by Tony Hursh -
P.S. in case it's not clear, there's a blank space between the two single quotes in:

$outmain = $sender->firstname.' '.$text;