rating MDL-21657 changed ratings rendering to avoid a nonconstant element name
authorAndrew Davis <andrew@affinitysoftware.net>
Fri, 19 Mar 2010 02:24:44 +0000 (02:24 +0000)
committerAndrew Davis <andrew@affinitysoftware.net>
Fri, 19 Mar 2010 02:24:44 +0000 (02:24 +0000)
lib/outputrenderers.php
rating/rate.php

index 25e2911..294c7db 100644 (file)
@@ -1320,7 +1320,7 @@ END;
             }
 
             $scalearray = array(RATING_UNSET_RATING => $strrate.'...') + $scalearray;
-            $strratings .= html_writer::select($scalearray, 'rating'.$rating->itemid, $rating->rating, false, array('class'=>'postratingmenu ratinginput'));
+            $strratings .= html_writer::select($scalearray, 'rating', $rating->rating, false, array('class'=>'postratingmenu ratinginput','id'=>'menurating'.$rating->itemid));
 
             //output submit button
             $strratings .= '<span class="ratingsubmit"><input type="submit" class="postratingmenusubmit" id="postratingsubmit'.$rating->itemid.'" value="'.s(get_string('rate', 'rating')).'" />';
index f0f2aa0..ba2e1be 100644 (file)
@@ -34,7 +34,7 @@ require_once('lib.php');
 $contextid = required_param('contextid', PARAM_INT);
 $itemid = required_param('itemid', PARAM_INT);
 $scaleid = required_param('scaleid', PARAM_INT);
-$userrating = required_param('rating'.$itemid, PARAM_INT);
+$userrating = required_param('rating', PARAM_INT);
 $returnurl = optional_param('returnurl', null, PARAM_LOCALURL);//will only be supplied for non-ajax requests
 
 $result = new stdClass;