Quiz Completion - Send Data

Quiz Completion - Send Data

by Ian Overholt -
Number of replies: 2

This may be a developer question, but I am looking to send data to an external database, when a student completes a specific quiz in a course. This quiz is like the final exam and I want the data sent to another system that will process the completion. Is this possible, what file do I look for/at? The version of Moodle does not matter, because we are willing to upgrade/downgrade versions. 

Average of ratings: -
In reply to Ian Overholt

Re: Quiz Completion - Send Data

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

If you want to do this as a batch process, look at the Moodle gradebook or the quiz reports. You can export all the students grades from there in a range of simple formats that other system should be able to import.

Alternatively, if you want this to be (near) instantaneous, then you will have to write a bit of code. Moodle has an events API, which lets you write a bit of code (for example in a local plug-in) that listens for the quiz_submitted attempt, and then sends a message to another system.

In reply to Tim Hunt

Re: Quiz Completion - Send Data

by Ian Overholt -

The instantaneous solution is what we are looking for. The system should hopefully be automated. Any advice for working with the events API? I am bit of a greenhorn, I tend to write in a procedural mindset instead of OOP. This makes working with Moodle's code rather painful for me.