]> git.mjollnir.org Git - moodle.git/commitdiff
Allow teachers to look at ratings for anyone
authormoodler <moodler>
Mon, 21 Oct 2002 08:44:56 +0000 (08:44 +0000)
committermoodler <moodler>
Mon, 21 Oct 2002 08:44:56 +0000 (08:44 +0000)
mod/forum/lib.php
mod/forum/report.php

index 3202b31742224dc19e222b58f8e6dc92735b72aa..cda277c48c689ef5fc8340e924f57310db11af24 100644 (file)
@@ -605,7 +605,12 @@ function forum_print_post(&$post, $courseid, $ownpost=false, $reply=false, $link
 
     echo "<DIV ALIGN=right><P ALIGN=right>";
     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);
index 8f1b3135791e763c755c210cc25d129e75287455..e4250830b6be8c68869285663e57b8b725a520e6 100644 (file)
         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");
     }