From 435fa054f14ed64444c4ba480770dcbfc90b7e09 Mon Sep 17 00:00:00 2001
From: Friederike Schwager <friederike.schwager@rwth-aachen.de>
Date: Mon, 19 Apr 2021 10:37:42 +0200
Subject: [PATCH] Display author of private/personal comments correctly on
 overview tab

---
 locallib.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/locallib.php b/locallib.php
index 79ac2e5..f1d628c 100644
--- a/locallib.php
+++ b/locallib.php
@@ -1548,7 +1548,7 @@ function pdfannotator_print_reports($reports, $thiscourse, $url, $currentpage, $
 function pdfannotator_questionstable_add_row($thiscourse, $table, $question, $urlparams, $showdropdown) {
 
     global $CFG, $PAGE;
-    if ($question->visibility != 'public') {
+    if ($question->visibility == 'anonymous') {
         $author = get_string('anonymous', 'pdfannotator');
     } else {
         $author = "<a href=" . $CFG->wwwroot . "/user/view.php?id=$question->userid&course=$thiscourse>" . pdfannotator_get_username($question->userid) . "</a>";
@@ -1609,7 +1609,7 @@ function pdfannotator_answerstable_add_row($thiscourse, $table, $answer, $cmid,
     $answerid = 'answer_' . $answer->answerid;
     $answerlink = "<a id=$answerid data-question=$answer->questionid href=$answer->link class='more'>$answer->answer</a>";
 
-    if ($answer->visibility != 'public') {
+    if ($answer->visibility == 'anonymous') {
         $answeredby = get_string('anonymous', 'pdfannotator');
     } else {
         $answeredby = "<a href=" . $CFG->wwwroot . "/user/view.php?id=$answer->userid&course=$thiscourse>" . pdfannotator_get_username($answer->userid) . "</a>";
-- 
GitLab