rating MDL-24558 added better handling for when there are no ratings submitted
authorAndrew Davis <andrew@affinitysoftware.net>
Thu, 7 Oct 2010 08:25:59 +0000 (08:25 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Thu, 7 Oct 2010 08:25:59 +0000 (08:25 +0000)
rating/index.php

index eb02ea5..774509f 100644 (file)
@@ -79,7 +79,8 @@ $ratingoptions->sort = $sqlsort;
 $rm = new rating_manager();
 $ratings = $rm->get_all_ratings_for_item($ratingoptions);
 if (!$ratings) {
-    print_error('noresult', 'forum', '', format_string($itemid));
+    $msg = get_string('noratings','rating');
+    echo html_writer::tag('div', $msg, array('class'=>'mdl-align'));
 } else {
     $sortargs = "contextid=$contextid&amp;itemid=$itemid&amp;scaleid=$scaleid";
     if($popup) {