first let me make a confession. I'm a total newbie to Moodle, and did not know exactly how to compose a search term that would let me find the information in existing forum threads. Sorry if there is, I overlooked or never found it. But I promise, I have tried my best...
I have been tasked very recently with creating an integration between Moodle and an external system (based on Atlassian Confluence) that is used to manage people, their personal work-related risks, and instructive courses they need to attend as a result of their occupation(s). The Confluence system has workflows (done with Comala Workflow) to schedule and track courses but they will actually be attended in Moodle. The specification claims that there needs to be a close tracking of Moodle activities in the Comala workflows which brought me to a plugin called Moodle Tool Trigger. I assumed it might be possible to use the event system to update the Comala workflows with REST calls. However, even though Moodle Tool Trigger has a huge list of supported, the course-related events in particular are missing out on the quiz context.
I would need to let the external workflows know the following events and progress:
- when a participant starts a course
- when a participant suspends / resumes / completes the tutorial part of the course
- when a participant starts the quiz that is the end part of each course
- whether the quiz was completed in the time period given
- whether the quiz was completed successfully (minimum threshold of questions answered correctly) or not
Based on these events, the workflow needs to decide whether a participant needs to repeat a course (on failing), or when the next time comes to refresh and attend another such course (on success).
I'm a bit lost in the huge list of events in Moodle Tool Trigger where no event description has an info about exactly when it will fire. The list of events with "quiz" in their name is rather slim and would not contain what I apparently need. I have created a lot of event handlers that would send me e-mails, just for testing, and only few give my anything useful at all, moreover, things get very silent around quiz attendance.
The next thing I found via Google is Tin Can which may or may not be included in xAPI nowadays. Github sources for Tin Can are scarce and there is no documentation as it seems. An early version is available and points to a continued enhanced Github repository which is a dead link. Not too reassuring. Anyway it would appear to fill in the quiz events that I am looking for. xAPI-based events are not offered in Moodle Tool Trigger so both might be totally different playfields with no link between them. xAPI seems to be a really extensive beast that is not easily learned in just a few hours of trial and error.
I am not asking for a complete solution on this, rather just a few pointers and advice. For instance, it might be intentional that quiz events are not available because quiz participation, particularly in the failing scenario, might have been considered private and nobody else's concern than the participant's. This would mean that the specification that I'm trying to fulfill needs adjustments. If there is a way, would I better start learning how to write my own Moodle plugin in PHP (which I would have to learn first, too), or are there plugins more suitable for the purpose described? Could I use Moodle's REST API as a fallback to poll for quiz results periodically? I would certainly prefer a very close monitoring and workflows without waiting periods that would confuse people. Events are the medium of choice but it looks like I have a long way to go.
Any help is welcome and very appreciated!