From 6dc323a7ba259b397cd1ae38f0c015c2886b4ce9 Mon Sep 17 00:00:00 2001 From: gbateson Date: Sat, 17 Mar 2007 13:42:47 +0000 Subject: [PATCH] fix HotPot reports for groups (MDL-8944) --- mod/hotpot/report.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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]; + } } } -- 2.39.5