From: gbateson Date: Sat, 17 Mar 2007 13:42:47 +0000 (+0000) Subject: fix HotPot reports for groups (MDL-8944) X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6dc323a7ba259b397cd1ae38f0c015c2886b4ce9;p=moodle.git fix HotPot reports for groups (MDL-8944) --- diff --git a/mod/hotpot/report.php b/mod/hotpot/report.php index 13883d8465..53871214e0 100644 --- a/mod/hotpot/report.php +++ b/mod/hotpot/report.php @@ -83,12 +83,13 @@ // check for groups if (preg_match('/^group(\d*)$/', $formdata['reportusers'], $matches)) { + $formdata['reportusers'] = 'group'; + $formdata['reportgroupid'] = 0; // validate groupid - if (is_numeric($matches[1]) && get_field('groups', 'courseid', 'id', $matches[1])===$course->id) { - $formdata['reportusers'] = 'group'; - $formdata['reportgroupid'] = $matches[1]; - } else { - $formdata['reportgroupid'] = 0; // groupid is invalid + if ($groups = groups_get_groups_names($course->id)) { + if (isset($groups[$matches[1]])) { + $formdata['reportgroupid'] = $matches[1]; + } } }