Quantcast
Channel: Web services
Viewing all articles
Browse latest Browse all 2364

Re: Course Contents on mobile app

$
0
0
by Juan Leyva.  

The function core_course_get_contents returns:

Sections

 - Modules in each section (activities or resources)

 -- If the module is a resource it returns a list of the files used by this resource in the "contents" attribute

That attribute is an array of files, there you will have a fileurl attribute that is the downloadURL for the file (if you are using Web Services you should append the WS token)

Example of URL returned:

http://xxmoodle.net/mobile/moodle25/webservice/pluginfile.php/29/mod_resource/content/3/MontBlancE.pdf?forcedownload=1

How you need to modify the URL to download the file:

http://xxmoodle.net/mobile/moodle25/webservice/pluginfile.php/29/mod_resource/content/3/MontBlancE.pdf?forcedownload=1&token=ABCDEFG...

Here you have a sample response of that WS:

https://github.com/moodlehq/moodlemobile/blob/master/emulator/core_course_get_contents.json

Cheers, Juan


Viewing all articles
Browse latest Browse all 2364


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>