From: moodler Date: Mon, 21 Oct 2002 08:44:56 +0000 (+0000) Subject: Allow teachers to look at ratings for anyone X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=2a3cda192ef28c363307e708f940a780c4c34f4a;p=moodle.git Allow teachers to look at ratings for anyone --- diff --git a/mod/forum/lib.php b/mod/forum/lib.php index 3202b31742..cda277c48c 100644 --- a/mod/forum/lib.php +++ b/mod/forum/lib.php @@ -605,7 +605,12 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link echo "

"; if ($rate && $USER->id) { - if ($USER->id == $post->userid) { + if (isteacher($courseid)) { + forum_print_ratings($post->id); + if ($USER->id != $post->userid) { + forum_print_rating($post->id, $USER->id); + } + } else if ($USER->id == $post->userid) { forum_print_ratings($post->id); } else { forum_print_rating($post->id, $USER->id); diff --git a/mod/forum/report.php b/mod/forum/report.php index 8f1b313579..e4250830b6 100644 --- a/mod/forum/report.php +++ b/mod/forum/report.php @@ -19,7 +19,11 @@ error("Forum ID was incorrect"); } - if ($USER->id != $post->user) { + if (! $course = get_record("course", "id", $forum->course)) { + error("Course ID was incorrect"); + } + + if (!isteacher($course->id) and $USER->id != $post->user) { error("You can only look at results for posts you own"); }