dataid)) { error("Data ID is incorrect"); } if (!$course = get_record('course', 'id', $data->course)) { error("Course is misconfigured"); } if (!$cm = get_coursemodule_from_instance('data', $data->id, $course->id)) { error("Course Module ID was incorrect"); } require_login($course->id, false, $cm); $context = get_context_instance(CONTEXT_MODULE, $cm->id); if (!$data->assessed) { error("This activity does not use ratings"); } if (!data_isowner($record->id) and !has_capability('mod/data:viewrating', $context) and !has_capability('mod/data:rate', $context)) { error("You can not view ratings"); } switch ($sort) { case 'firstname': $sqlsort = "u.firstname ASC"; break; case 'rating': $sqlsort = "r.rating ASC"; break; default: $sqlsort = "r.id ASC"; } $scalemenu = make_grades_menu($data->scale); $strratings = get_string('ratings', 'data'); $strrating = get_string('rating', 'data'); $strname = get_string('name'); print_header($strratings); if (!$ratings = data_get_ratings($record->id, $sqlsort)) { error("No ratings for this record!"); } else { echo "
"; echo " | id&sort=firstname\">$strname | "; echo "$strrating | "; echo "
---|---|---|
'; print_user_picture($rating->id, $data->course, $rating->picture, false, false, true); echo ' | '; echo ''.fullname($rating).' | '; echo ''.$scalemenu[$rating->rating].' | '; echo "