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);
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");
}