require_once($CFG->dirroot.'/rating/lib.php');
if ($data->assessed!=RATING_AGGREGATE_NONE) {
$ratingoptions = new stdclass();
- $ratingoptions->context = $cm->context;
+ $ratingoptions->context = $context;
$ratingoptions->items = $records;
$ratingoptions->aggregate = $data->assessed;//the aggregation method
$ratingoptions->scaleid = $data->scale;
//load ratings
if ($forum->assessed!=RATING_AGGREGATE_NONE) {
$ratingoptions = new stdclass();
- $ratingoptions->context = $cm->context;
+ $ratingoptions->context = $modcontext;
$ratingoptions->items = $posts;
$ratingoptions->aggregate = $forum->assessed;//the aggregation method
$ratingoptions->scaleid = $forum->scale;
require_once($CFG->dirroot.'/rating/lib.php');
if ($glossary->assessed!=RATING_AGGREGATE_NONE) {
$ratingoptions = new stdclass();
- $ratingoptions->context = $cm->context;
+ $ratingoptions->context = $context;
$ratingoptions->items = $allentries;
$ratingoptions->aggregate = $glossary->assessed;//the aggregation method
$ratingoptions->scaleid = $glossary->scale;