I have been trying to fetch course summary file through web-service externally.
i am using "core_course_get_courses" but it doesn't return course summary file. See the below returned information.
Can we have this ability inside this web-service or is there any other option for this? can anyone suggest a possibility to get course summary files externally using webservices?
Return course details
Arguments
options (Default to "Array ")
options - operator OR is used
General structure
Default to "Array
(
)
" //options - operator OR is used
object {
ids Optional //List of course id. If empty return all courses
except front page course.
list of (
int //Course id
)}
XML-RPC (PHP structure)
[options] =>
Array
(
[ids] =>
Array
(
[0] => int
)
)
REST (POST parameters)
options[ids][0]= int
Response
General structure
list of (
//course
object {
id int //course id
shortname string //course short name
categoryid int //category id
categorysortorder int Optional //sort order into the category
fullname string //full name
idnumber string Optional //id number
summary string //summary
summaryformat int //summary format (1 = HTML, 0 = MOODLE, 2 = PLAIN or 4 = MARKDOWN)
format string //course format: weeks, topics, social, site,..
showgrades int Optional //1 if grades are shown, otherwise 0
newsitems int Optional //number of recent items appearing on the course page
startdate int //timestamp when the course start
numsections int Optional //(deprecated, use courseformatoptions) number of weeks/topics
maxbytes int Optional //largest size of file that can be uploaded into the course
showreports int Optional //are activity report shown (yes = 1, no =0)
visible int Optional //1: available to student, 0:not available
hiddensections int Optional //(deprecated, use courseformatoptions) How the hidden sections in the course are displayed to students
groupmode int Optional //no group, separate, visible
groupmodeforce int Optional //1: yes, 0: no
defaultgroupingid int Optional //default grouping id
timecreated int Optional //timestamp when the course have been created
timemodified int Optional //timestamp when the course have been modified
enablecompletion int Optional //Enabled, control via completion and activity settings. Disbaled,
not shown in activity settings.
completionnotify int Optional //1: yes 0: no
lang string Optional //forced course language
forcetheme string Optional //name of the force theme
courseformatoptions Optional //additional options for particular course format
list of (
object {
name string //course format option name
value string //course format option value
}
)}
)
Ability to fetch Course Summary file via core_course_get_courses webservice
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Can anyone help help us with this please?
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Same issue here!!!
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Did you get any work around Gabriel ?
Can any help?
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Hi Nitin
I saw a post you made related to the forum web service issue and I am facing the same. The core_course_get_courses I am not using. The ones I use is:
Get Course Content:
core_course_get_contents
And to get the course list from a specifc user:
moodle_enrol_get_users_courses
To get the information I am using Ajax.
Let me know if you need any additional help!
Regards
Gab
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Hi. I'm facing the same issue right now..
It's harmful that we cannot get every fields related to a course via a dedicated and native webservice. I'm building a full "off moodle" gui for mobile, and I'm realizing that I will need to implement my own webservices very soon, even though there are a lot of native webservices, and I only need simple datas for my gui (like the url of the summary file...).
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
I see, And similar problems i am facing..
Someone from Moodle HQ should have answer to our question, but looks like they have missed this discussion.
Re: Ability to fetch Course Summary file via core_course_get_courses webservice
Dear all.
You might try execute this on your browser:
http://YOURWEBADDRESS/moodle/webservice/rest/server.php?wstoken=YOURTOKEN&wsfunction=core_course_get_courses&options[ids][0]=YOURCOURSEID&moodlewsrestformat=json
So you need to change this following value according your conditions.
1. YOURWEBADDRESS.
2. YOURTOKEN. To generate token: Administration menu-Site administration - plugins - Web serices - manage tokens.
3. YOURCOURSEID. Kindly check the id on mdl_course on your database.