General developer forum

Mobile API to get quiz data ?

 
Picture of Ravi Kant
Mobile API to get quiz data ?
 

Is there any moodle api to get all the questions data for a given quiz

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Mobile API to get quiz data ?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

Yes.

 
Average of ratings: -
Picture of Ravi Kant
Re: Mobile API to get quiz data ?
 
Thanks, can you please suggest me the API name.
 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Mobile API to get quiz data ?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers

If you have to ask us every time you need to know the name of a function in an API, your development will go very slowly. You need to be able to find this out yourself. There are at least to places you can look:

In the Moodle UI, in the admin menu, is the place where you can configure web services. That has a list of all the functions.

Or, you can look in the code, in mod/quiz/db/services.php.

 
Average of ratings: -
Picture of Ravi Kant
Re: Mobile API to get quiz data ?
 

Thanks a lot, is there any API to fetch Question data for a Quiz?

 
Average of ratings: -
Tim at Lone Pine Koala Sanctuary
Re: Mobile API to get quiz data ?
Core developersDocumentation writersParticularly helpful MoodlersPlugin developers
'mod_quiz_get_attempt_review' => array(
'classname' => 'mod_quiz_external',
'methodname' => 'get_attempt_review',
'description' => 'Returns review information for the given finished attempt, can be used by users or teachers.',
'type' => 'read',
'capabilities' => 'mod/quiz:reviewmyattempts',
'services' => array(MOODLE_OFFICIAL_MOBILE_SERVICE)
),

https://github.com/moodle/moodle/blob/master/mod/quiz/classes/external.php#L1384

https://github.com/moodle/moodle/blob/master/mod/quiz/classes/external.php#L865 shows that the return value includes question data.

 
Average of ratings: -