Merge branch 'MDL-74398' of https://github.com/call-learning/moodle
This commit is contained in:
@@ -282,9 +282,9 @@ EOF;
|
||||
/**
|
||||
* Get the current groupid if set.
|
||||
*
|
||||
* @return null|int
|
||||
* @return int
|
||||
*/
|
||||
public function get_group_id(): ?int {
|
||||
public function get_group_id(): int {
|
||||
return empty($this->groupid) ? 0 : $this->groupid;
|
||||
}
|
||||
|
||||
@@ -294,7 +294,8 @@ EOF;
|
||||
* @return bool
|
||||
*/
|
||||
public function uses_groups(): bool {
|
||||
return $this->groupid !== null;
|
||||
$groupmode = groups_get_activity_groupmode($this->get_cm());
|
||||
return $groupmode != NOGROUPS;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,7 +306,7 @@ EOF;
|
||||
public function get_group_name(): ?string {
|
||||
$groupid = $this->get_group_id();
|
||||
|
||||
if ($groupid === null) {
|
||||
if (!$this->uses_groups()) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user