microsoft / o365-moodle

Office 365 and Azure Active Directory plugins for Moodle
GNU General Public License v3.0
180 stars 137 forks source link

Calendar sync issues: synchronisation of activity events (quiz, assignments) #2283

Open AntonT76 opened 1 year ago

AntonT76 commented 1 year ago

Hello,

we did some tests with calendar synchronisation from Moodle to Outlook and we have noticed that some dates are missing: activity events like quiz closing dates, assignment due dates, ... these are events which are also placed in the Timeline-Block and Calendar of Moodle. I think the problem is that these events only have a point in time and not a time period (eg 30 minutes).

Are there any ideas or possibilites to implement a synchronisation of these events?

PS: see https://moodle.org/mod/forum/discuss.php?d=445704 for further discussions in Moodle forum.

We are using Moodle 4.1.1 and latest Microsoft Block Plugin (4.1.0 (2022112800)) and MS 365 Integration (4.1.1 (2022112805)).

thanks & br, Anton

avkeiller commented 1 year ago

Hi Anton We recently upgraded to Moodle 4.1.3 and then 4.1.5 and still encountered this error. To avoid deleting queries from the database, the simplest solution was to comment out the query directly from the DB. This seems to have solved the problem (for now).

local_o365

AntonT76 commented 1 year ago

Hi @avkeiller thanks for the tip. We have put the implementation of the synchronisation to the Outlook calendar on hold for now and it has low priority. But I will keep your solution in mind and try it out in our test system. br, Anton

Syxton commented 7 months ago

Has there been any movement on this? We had faculty notice today that dates in Moodle calendar get pushed to Teams on creation, but if the dates are edited in Moodle or deleted they remain on Teams as originally created.

weilai-irl commented 6 months ago

Hi all,

It looks like we are talking about a few different questions/issues here.

@AntonT76, the issue in original post is caused by fact that events created from activity modules, e.g. assignment due dates, quiz dates etc, are treated as course events, rather than personal events. As a result, in order for such events to be synchronised over to Outlook calendar, synchronisation will need to be configured for the course containing sync activities. The page that allows users to configure calendar sync, i.e. https://url.to.moodle/local/o365/ucp.php?action=calendar, would list all the calendars that the current Moodle has access to, i.e. personal calendar, site calendar (site admin only), and course calendar for each of the course the user is enrolled in. When an event is created in Moodle, an observer function would be called to collect all the users that can see this event, and check if calendar subscription from Moodle to Outlook has been configured, and if it's configured, than Graph API call will be made to add the event to Outlook calendar. I also confirm that the period of the event doesn't matter in this feature - all events, regardless of how long they last, would be synced to Outlook. Please find a screenshot of the calendar sync configuration page attached.

Screenshot 2024-04-09 at 14 50 52

@avkeiller, I'm not sure how your proposed changes are relevant in this issue. Maybe I'm missing some context? Your proposed change is used to update Outlook events in case a Moodle calendar event gets updated. I think we are talking about creation of the events for Moodle activity modules dates, which is different.

@Syxton, your comments suggest you are experiencing an issue where events are not updated. Please report it as a separate issue since it's different from the one originally posted. Also, did you apply the change proposed by @avkeiller? If so, this would be expected, as it skips the Graph API call to update Outlook event.

Regards, Lai