Permalink
Browse files

Merge branch 'MDL-33621_m22' of git://github.com/rwijaya/moodle into …

…MOODLE_22_STABLE
  • Loading branch information...
2 parents 3fd59e3 + e2398ac commit e262ca4250c2a211626cbf81716ac3e5d129e8a2 @danpoltawski danpoltawski committed Nov 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/outputrenderers.php
View
@@ -1530,7 +1530,13 @@ function render_rating(rating $rating) {
$ratinghtml .= html_writer::empty_tag('input', $attributes);
if (!$rating->settings->scale->isnumeric) {
- $ratinghtml .= $this->help_icon_scale($rating->settings->scale->courseid, $rating->settings->scale);
+ // If a global scale, try to find current course ID from the context
+ if (empty($rating->settings->scale->courseid) and $coursecontext = $rating->context->get_course_context(false)) {
+ $courseid = $coursecontext->instanceid;
+ } else {
+ $courseid = $rating->settings->scale->courseid;
+ }
+ $ratinghtml .= $this->help_icon_scale($courseid, $rating->settings->scale);
}
$ratinghtml .= html_writer::end_tag('span');
$ratinghtml .= html_writer::end_tag('div');

0 comments on commit e262ca4

Please sign in to comment.