Get quiz data

Get quiz data

by Raymond Mlambo -
Number of replies: 6

Hi guys,

How can I programmatically retrieve all of a student's questions and answers after doing a quiz? I know how to fetch the marks when student is done with the quiz. But I need to get all the data, i.e., questions, answers, and marks for each of the questions that the student did.


Average of ratings: -
In reply to Tim Hunt

Re: Get quiz data

by Raymond Mlambo -

Thanks a mil Tim. I apologise for my late feedback, I've been looking at this since yesterday to verify if I'd be getting the kind of data that I need. I managed to get the data that I need.

Here is a question though, pertaining to those who may need to get quiz data from an external system. Is there an API somewhere which one can use to fetch data based on perhaps a courseid, or a combination of courseid and userid?

Thanks again for the response above. It helped a lot, and I must say I understand a bit more of the relationship between the questions data and the quizzes.

In reply to Raymond Mlambo

Re: Get quiz 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

There are some external API functions for the quiz, to satisfy the needs of the mobile app. It would be possible to add more. The only reason that has not happened yet is that no one has had time, or needed it badly enough.

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: Get quiz data

by Raymond Mlambo -

Alright, I understand now. I'm gonna have to come up with something that can handle this need. I'm doing a local plugin and I'm sure I can expose this quiz data to an external system, like our CRM system.