Exposing quiz results via web services

Exposing quiz results via web services

by Luis de Vasconcelos -
Number of replies: 3

I finally managed to install a copy of Moodle 2 to play around with... So far I'm impressed!

One thing that got me excited is the Web Services function.

Using these web services will I be able to expose student details (usernames) and their quiz grades to external consumers?

For example, if my HR system needs to know whether a particular student has attempted a specific quiz and what his grade was, will I be able expose that data (the quiz result) to the HR system via the web services function so that HR can retrieve it when required?

Thanks.

Average of ratings: -
In reply to Luis de Vasconcelos

Re: Exposing quiz results via web services

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
The web services infrastructure is there, however, we have not had time to implement all the functions that everyone will want yet. The functions have only been implemented in some core parts of the code (course, user and group, I think).

However, for getting grade information in and out of Moodle, look at the gradebook. In particular, look at the XML export. We use that at the OU to automatically transfer scores to and from other systems. (We had to write some glue code to do the automation.)
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Exposing quiz results via web services

by Luis de Vasconcelos -

Thanks Tim. I want to broadcast the student grades to another system. That system will allow or prevent students from doing certain things, depending on their quiz grades. So I don't think an XML export will work. The other system doesn't have an import facility - and I don't want to store grades in it.

So, I'll probably have to write a MSSQL stored procedure to expose the grades from the Moodle gradebook...

Do I need to create a tracker issue to request that the web services be extended to the quiz and gradebook parts of Moodle? Or is this already a planned for a future version?

But so far, Moodle 2 looks really great!

In reply to Luis de Vasconcelos

Re: Exposing quiz results via web services

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Any modern programming language can load data from an XML file. It is no harder than getting data from a database, you just have to use different library functions. And most programming languages will happily fetch the XML file from a URL.

You can assume that quiz web services will be implemented at some point.