Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Teams not being created for Moodle courses. #1733

Open
vdiscipio opened this issue Jul 14, 2021 · 5 comments
Open

Teams not being created for Moodle courses. #1733

vdiscipio opened this issue Jul 14, 2021 · 5 comments
Assignees
Labels
Feature - teams integration Issue type - help wanted General questions on how to use the plugins, e.g. configurations etc. Plugin - local_o365 Status - In Progress WIP

Comments

@vdiscipio
Copy link

Moodle 3.11
Microsoft 365 Integration local_office365 3.10.120201109

The plugin is installed and passes all tests. In Site administration -> Plugins -> Local plugins -> Microsoft 365 Integration -> Sync Settings under course sync the "All Features Enabled" is checked. The process only created 2 courses when ran from scheduler and shows no errors when ran from the command line. We have 580 courses and have verified all have at least a "teacher" role assigned to a person.

select * from mdl_local_o365_objects where type = "group"; shows 4 entries and course and courseteam entry for the 2 courses that have teams created.

the table mdl_local_o365_teams_cache has the same number of rows as the teams admin center shows.
select * from mdl_local_o365_coursegroupdata; returns the empty set.

running the scheduled task from the command line yields no errors and creates no teams.

php /srv/www/htdocs/admin/tool/task/cli/schedule_task.php --execute="\local_o365\task\groupcreate"
Execute scheduled task: Create user groups in Microsoft 365 (local_o365\task\groupcreate)
All courses have a group recorded.
Attempting to fetch teams
Build existing cache records cache
Update cache records
Delete old cache records
... used 3836 dbqueries
... used 18.624874830246 seconds
Scheduled task complete: Create user groups in Microsoft 365 (local_o365\task\groupcreate)

Any thoughts on what to check or how to get the teams created for the courses would be appreciated.

@vdiscipio
Copy link
Author

Since the original post above, 2 more course teams were created, but there is nothing special or differentiating between the 4 total courses that have teams and the 578 courses that do not.

@weilai-irl weilai-irl self-assigned this Jul 26, 2021
@weilai-irl
Copy link
Collaborator

Hi @vdiscipio,

The plugins haven't been officially tested on Moodle 3.11 yet. We are setting up an environment for Moodle 3.11 at this moment and will perform tests as soon as it's done, and release a version of the plugins for 3.11 in the coming weeks.

However, I don't expect issues like this to happen as none of the changes in the 3.11 seems could have caused this.

For the first thing to check, could you confirm the visibility of the Moodle courses please. In the current design, only visible Moodle courses are synced to Team.

If all courses are set to be shown to students, could you run the following query in your database, and let me know how many records are returned please.

SELECT crs.*
FROM mdl_course crs
LEFT JOIN mdl_local_o365_objects obj ON obj.type = 'group' AND obj.subtype = 'course' AND obj.moodleid = crs.id
WHERE obj.id IS NULL AND crs.id != 1 AND crs.visible != 0;

This is essentially the script used to gather all courses that need to be synced.

Please let me know what you have found.

Regards,
Lai

@weilai-irl weilai-irl added Feature - teams integration Issue type - help wanted General questions on how to use the plugins, e.g. configurations etc. Plugin - local_o365 Status - In Progress WIP labels Jul 26, 2021
@vdiscipio
Copy link
Author

Lai,

I must have missed the release note on the course visibility required to create a course team. We have a lot of our faculty like to fully build the course before making it visible. At this point we have used PowerShell to create all the teams courses and associated them with Moodle courses in the interface. Below is the output from the sql you asked as well as a list of all visible courses.

MariaDB [moodle]> SELECT id, shortname FROM mdl_course WHERE visible != 0;
+-----+----------------------+
| id | shortname |
+-----+----------------------+
| 1 | Moodle |
| 5 | EDTC-10000-03-SC |
| 8 | EDTC-10000-04-SC |
| 9 | EDTC-10000-05-SC |
| 126 | PHIL-21300-01-2122FA |
| 462 | FYSM-10100-10-2122FA |
+-----+----------------------+
6 rows in set (0.001 sec)

MariaDB [moodle]> SELECT crs.*
-> FROM mdl_course crs
-> LEFT JOIN mdl_local_o365_objects obj ON obj.type = 'group' AND obj.subtype = 'course' AND obj.moodleid = crs.id
-> WHERE obj.id IS NULL AND crs.id != 1 AND crs.visible != 0;
Empty set (0.003 sec)

MariaDB [moodle]>

@weilai-irl
Copy link
Collaborator

Hi @vdiscipio,

The requirement of course being visible to be synced was implemented before we took over the maintenance of the plugins, so it must have been part of the original requirement. I'm not sure how valid it is now.

If your case, you can create a simple patch to remove the AND crs.visible != 0 at

WHERE obj.id IS NULL AND crs.id != ? AND crs.visible != 0';
to allow teams to be created for all courses, regardless of visibility setting. You will need to maintain the patch yourself though.

Alternatively you can log a request to make this an option so that site admins to decide if course visibility is considered when doing course sync.

Regards,
Lai

@darius-m
Copy link
Contributor

darius-m commented Oct 1, 2021

Hello, @weilai-irl,
The visibility part of the query may have been a fix for the course copying issue (#1448) that I have proposed in the past. Unfortunately, at that point I could not figure an alternative that could be used to differentiate between "finished" courses and the ones that are currently being processed for copies. I do not know a better solution for that issue, but the course-team renaming synchronization may be a better alternative (with the proper warning message for the naming sync option, where if disabled copied courses may end up with the wrong names).
An option to disable synchronization for hidden courses may still be useful, since students would be added to a team created for a course they cannot see.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature - teams integration Issue type - help wanted General questions on how to use the plugins, e.g. configurations etc. Plugin - local_o365 Status - In Progress WIP
Projects
None yet
Development

No branches or pull requests

3 participants