o365-moodle icon indicating copy to clipboard operation
o365-moodle copied to clipboard

Team not created from group

Open cbrherms opened this issue 3 years ago • 1 comments

Moodle Version: 3.9.16 local_o365 Version: 3.9.10


We currently create courses on Moodle from SDS, and thus they already have a group associated with them from when they were created in 365 from SDS itself. This appears to be correctly showing as linked from within Moodle.

What I have noticed though, is I can't seem to create a team from group in the "Manage Teams Connections" page. When I click create team for the associated course, page reloads after a short while saying "Team was created successfully for the course", but nothing on 365 and no change to the entry on the manage page - even after updating cache.

create group

group created

Logs wise, I just have the following entry in the groupecreate task each time for the course above's courseid:

Attempting to create team for course #1018...
Create team for course #1018
Syncing to group "329c24ab-6689-4a91-b15b-332aba1583c9"
Could not create team for course #1018. Reason: Could not create team from group. Please check group exists and group has owner.

On the 365 group, there is a user who is owner, and other users that are members. During the SDS sync, this added the owner as "lecturer" and the members as "student" (though it does also add the student role to the lecturer as well). Checking permissions on the course context, lecturer has 'local/o365:teamowner', and the students have 'local/o365:teammember'.

So, unsure where might be amiss on this one, unless the moodle plugin cannot create a class team from group when the group already exists (though a tutor can do it themselves from within teams).

cbrherms avatar Sep 03 '22 23:09 cbrherms

Hi @cbrherms,

I confirm the workflow you described is not how the SDS sync feature is designed.

For SDS classes, Teams can (and should) be created directly from SDS, rather than from Moodle. Please refer to Microsoft documentation at https://docs.microsoft.com/en-us/schooldatasync/creating-class-teams-with-sds on how to do it.

When setting up SDS sync, the option "Teams creation enabled" (local_o365 | sdsteamsenabled) indicates whether Teams are already created from SDS classes. The setting for the option only decides if Moodle marks the course to be connected to a Team or not.

The plugins should not try to create a Team for an SDS class, because an SDS class may not be a standard group, therefore may contain other metadata which may result in unexpected behaviour if using a Graph API to create Teams. Note the SDS sync feature has been updated accordingly for the plugins for Moodle 3.10 and 3.11 in the March 2022 release to reflect this. Moodle 4.0 version was created after this fix was applied, so also has it. Moodle 3.9 version had been out of feature support at the time, so didn't contain the fix. The fix was in commit at https://github.com/microsoft/o365-moodle/commit/b06a5a3ed38e13d2463740ce9438be9e8c9ecad8. Feel free to cherry pick it if needed, but you will need to support it yourself going forward, until you upgrade to a supported version.

After the fix is applied, site admins will not be able to see the actions for courses synced from SDS. Please see the attached screenshot for an example.

Regards, Lai Screenshot 2022-09-06 at 11 06 58

weilai-irl avatar Sep 06 '22 10:09 weilai-irl