discussion)) { error("Discussion ID was incorrect"); } if (! $forum = get_record("forum", "id", $discussion->forum)) { error("Forum ID was incorrect"); } if (! $course = get_record("course", "id", $forum->course)) { error("Course ID was incorrect"); } if (!isteacher($course->id) and $USER->id != $post->userid) { error("You can only look at results for posts you own"); } if (!isset($sort)) { $sort = "r.time"; } $scalemenu = make_grades_menu($forum->scale); $strratings = get_string("ratings", "forum"); $strrating = get_string("rating", "forum"); $strname = get_string("name"); $strtime = get_string("time"); print_header("$strratings: $post->subject"); if (!$ratings = forum_get_ratings($post->id, $sort)) { error("No ratings for this post: \"$post->subject\""); } else { echo ""; echo ""; echo ""; echo "cellcontent2\">"; } else { echo "cellcontent\">"; } echo "\n"; } echo "
 id&sort=u.firstname>$strname"; echo "id&sort=r.rating>$strrating"; echo "id&sort=r.time>$strtime"; foreach ($ratings as $rating) { if (isteacher($discussion->course, $rating->id)) { echo "
"; print_user_picture($rating->id, $forum->course, $rating->picture); echo "

$rating->firstname $rating->lastname

"; echo "

".$scalemenu[$rating->rating]."

"; echo "

".userdate($rating->time)."

"; echo "
"; echo "
"; } close_window_button(); ?>