protected function get_grouping_id(\core_availability\info $info) {
        if ($this->activitygrouping) {
            $groupingid = $info->get_course_module()->groupingid;
            if (!$groupingid) {
                throw new \coding_exception(
                        'Not supposed to be able to turn on activitygrouping when no grouping');
            }
            return $groupingid;
        } else {
            return $this->groupingid;
        }
    }