Skip to content

Commit 31edc51

Browse files
Hide students name to teachers in edit update message, if they should be anonymous
1 parent 32430fe commit 31edc51

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

post.php

+7-2
Original file line numberDiff line numberDiff line change
@@ -622,8 +622,13 @@
622622
if ($realpost->userid == $USER->id) {
623623
$message .= get_string('postupdated', 'moodleoverflow');
624624
} else {
625-
$realuser = $DB->get_record('user', array('id' => $realpost->userid));
626-
$message .= get_string('editedpostupdated', 'moodleoverflow', fullname($realuser));
625+
if (\mod_moodleoverflow\anonymous::is_post_anonymous($discussion, $moodleoverflow, $realpost->userid)) {
626+
$name = get_string('anonymous', 'moodleoverflow');
627+
} else {
628+
$realuser = $DB->get_record('user', array('id' => $realpost->userid));
629+
$name = fullname($realuser);
630+
}
631+
$message .= get_string('editedpostupdated', 'moodleoverflow', $name);
627632
}
628633

629634
// Create a link to go back to the discussion.

0 commit comments

Comments
 (0)