core_course_get_contents not returning all information

core_course_get_contents not returning all information

by Luca Viggiani -
Number of replies: 4

Hi, this is my first experience in using Moodle default web service.

I'm already successfully consuming some of the methods (REST format) to get information about learner, its enrollments and course contents. However, whean calling core_course_get_contents, according to the documentation, I would expect more information about each object contained in the modules array. For example:

modules   //list of module
list of (
object {
id int //activity id
url string Optional //activity url
name string //activity module name
instance int Optional //instance id
description string Optional //activity description
visible int Optional //is the module visible
modicon string //activity icon url
modname string //activity module type
modplural string //activity module plural name
availability string Optional //module availability settings
In my case, I need to get the availability information of a SCORM 1.2 Lesson (module). I have set the availability (both start and end) in module settings in Moodle, but that information is not returned by the WS. I only get id, indent, instance, modicon, modname, modplural, name, url, visible

This happens with Moodle 2.7.7.

Thanks!

Average of ratings: -
In reply to Luca Viggiani

Re: core_course_get_contents not returning all information

by Luca Viggiani -

...in addition I also to get module contents (SCORM zip file) URL to dowload, but no contents are returned. This happens also in Moodle 2.8 and 2.9RC1.

Please note that within Moodle Web interface, in module Edit page I can download the original SCORM zip file.

In reply to Luca Viggiani

Re: core_course_get_contents not returning all information

by Juan Leyva -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Hi,

as far as I know this Web Service is just for getting generic/standard/common information about a module (all the moodle modules has some fields that are mandatory), you are not going to be able to find specific information for a module (like the link to the SCORM zip package).

We are developing Web Services specific for getting modules information (like mod_data_get_databases_by_courses and mod_forum_get_forums_by_courses)

Regarding availability information, "Modules availability" should be enabled at site and the course level and the user you are using for requesting the information via web services should have permissions (teacher or admin) to see the module settings


Cheers, Juan

In reply to Luca Viggiani

Re: core_course_get_contents not returning all information

by Kathir Rajaraman -

Hi Luca

My requirement is same to your requirements. So how to get course contents and scrom package file ? Kindly request to you plz provide code to me ? 'kathir04on@gmail.com' is my personal mail id. Am waiting for your email or post.


Thanks & Regards

Kathirvel R

In reply to Luca Viggiani

Re: core_course_get_contents not returning all information

by Kathir Rajaraman -

Hi Luva,

I have small doubt. How to create the webservice ? how to call the function as core_course_get_contents ?

How to course contents send to android ?

Can you send me sample code ? This is my personal email id kathir04on@gmail.com . Kindly request to your provide  sample code


Thanks

Kathirvel.R