diff --git a/renderables.php b/renderables.php index 16fe825..a5482ca 100644 --- a/renderables.php +++ b/renderables.php @@ -257,10 +257,12 @@ class attforblock_take_data implements renderable { private $att; public function __construct(attforblock $att) { - if ($att->pageparams->grouptype) + if ($att->pageparams->grouptype) { $this->users = $att->get_users($att->pageparams->grouptype); - else + } + else { $this->users = $att->get_users($att->pageparams->group); + } $this->pageparams = $att->pageparams; $this->perm = $att->perm; diff --git a/take.php b/take.php index 4f74e14..b7415d4 100644 --- a/take.php +++ b/take.php @@ -22,7 +22,6 @@ $pageparams = new att_take_page_params(); $id = required_param('id', PARAM_INT); $pageparams->sessionid = required_param('sessionid', PARAM_INT); $pageparams->grouptype = required_param('grouptype', PARAM_INT); -$pageparams->group = optional_param('group', null, PARAM_INT); $pageparams->sort = optional_param('sort', null, PARAM_INT); $pageparams->copyfrom = optional_param('copyfrom', null, PARAM_INT); $pageparams->viewmode = optional_param('viewmode', null, PARAM_INT); @@ -34,6 +33,8 @@ $att = $DB->get_record('attforblock', array('id' => $cm->instance), ' require_login($course, true, $cm); +$pageparams->group = groups_get_activity_group($cm, true); + $pageparams->init($course->id); $att = new attforblock($att, $cm, $course, $PAGE->context, $pageparams);