Permalink
Browse files

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

…MOODLE_23_STABLE
  • Loading branch information...
2 parents df79fff + 46ba9fd commit 906ad7d27aa7144b744edad029e07835b844288b @danpoltawski danpoltawski committed Nov 5, 2012
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/outputrenderers.php
View
@@ -1642,7 +1642,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 906ad7d

Please sign in to comment.