foreach ($ratings as $rating) {
echo '<tr class="ratingitemheader">';
echo "<td>";
- if($courseid) {
- echo $OUTPUT->user_picture($rating, array('courseid'=>$courseid));
+ if($course && $course->id) {
+ echo $OUTPUT->user_picture($rating, array('courseid'=>$course->id));
} else {
echo $OUTPUT->user_picture($rating);
}
public static function load_ratings_for_item($context, $itemid, $sort) {
global $DB;
+ $userfields = user_picture::fields('u');
$sql = "SELECT r.id, r.rating, r.itemid, r.userid, r.timemodified,
- u.firstname, u.lastname, u.imagealt, u.picture
+ $userfields
FROM {rating} r
LEFT JOIN {user} u ON r.userid = u.id
WHERE r.contextid = :contextid AND
$scaleobj = new stdClass();
$scalemax = null;
- //todo we could look for a scale id on each item to allow each item to use a different scale
+ //we could look for a scale id on each item to allow each item to use a different scale
if($scaleid < 0 ) { //if its a scale (not numeric)
$scalerecord = $DB->get_record('scale', array('id' => -$scaleid));