From 3adfe33eaaaa7ce0c8737ea3161799c9483e7f6e Mon Sep 17 00:00:00 2001 From: Dan Marsden Date: Fri, 8 Jun 2018 13:13:20 +1200 Subject: [PATCH] CONTRIB-7325 add plagiarism api call when displaying forum content. --- renderer.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/renderer.php b/renderer.php index ab6d0240..08b03029 100644 --- a/renderer.php +++ b/renderer.php @@ -1184,7 +1184,7 @@ public function raw_post_subject($post) { * @author Mark Nielsen */ public function post_message($post, $cm, $search = '') { - global $OUTPUT; + global $OUTPUT, $CFG; $options = new stdClass; $options->para = false; @@ -1200,7 +1200,13 @@ public function post_message($post, $cm, $search = '') { if (!empty($search)) { $postcontent = highlight($search, $postcontent); } - + if (!empty($CFG->enableplagiarism)) { + require_once($CFG->libdir.'/plagiarismlib.php'); + $postcontent .= plagiarism_get_links(array('userid' => $post->userid, + 'content' => $post->message, + 'cmid' => $cm->id, + 'course' => $cm->course)); + } if (!empty($attachments)) { $postcontent .= "
".$attachments."
"; }