glossaryid)) { error("Glossary ID was incorrect"); } if (! $course = get_record('course', 'id', $glossary->course)) { error("Course ID was incorrect"); } if (! $cm = get_coursemodule_from_instance('glossary', $glossary->id, $course->id)) { error("Course Module ID was incorrect"); } require_login($course, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); if (!$glossary->assessed) { error("This activity does not use ratings"); } if (!has_capability('mod/glossary:manageentries', $context) and $USER->id != $entry->userid) { error("You can only look at results for your own entries"); } switch ($sort) { case 'firstname': $sqlsort = "u.firstname ASC"; break; case 'rating': $sqlsort = "r.rating ASC"; break; default: $sqlsort = "r.time ASC"; } $scalemenu = make_grades_menu($glossary->scale); $strratings = get_string('ratings', 'glossary'); $strrating = get_string('rating', 'glossary'); $strname = get_string('name'); $strtime = get_string('time'); print_header("$strratings: $entry->concept"); if (!$ratings = glossary_get_ratings($entry->id, $sqlsort)) { error("No ratings for this entry: \"$entry->concept\""); } else { echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; foreach ($ratings as $rating) { if (has_capability('mod/glossary:manageentries', $context)) { echo ''; } else { echo ''; } echo ''; echo ''; echo ''; echo ''; echo "\n"; } echo "
 id&sort=firstname\">$strnameid&sort=rating\">$strratingid&sort=time\">$strtime
'; print_user_picture($rating->id, $glossary->course, $rating->picture, false, false, true); echo ''.fullname($rating).''.$scalemenu[$rating->rating].''.userdate($rating->time).'
"; echo "
"; } close_window_button(); print_footer('none'); ?>