Require parameters for method "core_course_create_courses" using REST webservices

Require parameters for method "core_course_create_courses" using REST webservices

by Praneeth D -
Number of replies: 3
Hello,

Can someone please help me to get the list of all parameters available for the method "core_course_create_courses" (possibly with syntax) and the purpose of each parameter?

Also would like to understand courseformatoptions.

We are using Moodle 2.0 version. We are integrating through the REST webservices.

Thanks,
Praneeth


Average of ratings: -
In reply to Praneeth D

Re: Require parameters for method "core_course_create_courses" using REST webservices

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Take a look at the function create_courses_parameters here:

https://github.com/moodle/moodle/blob/master/course/externallib.php


In reply to Davo Smith

Re: Require parameters for method "core_course_create_courses" using REST webservices

by Praneeth D -

Hi Davo,

 Thanks for sharing the details. Our goal is to align the courses as shown below-

 Main Category

                Thesis1 Thesis Course1

                                CourseTemplate

                 Thesis2 Thesis Course2

                                CourseTemplate

                 Thesis3 Thesis Course3

                                CourseTemplate

 Note:

·         The CategoryID for the "Main Category" is 7.

·         We have created a Template "CourseTemplate" under the "Main Category". This template should be added to all the courses mapped under "Main Category". This template would be common for all courses (say, Thesis1 Thesis Course1, Thesis2 Thesis Course2, Thesis3 Thesis Course3 & etc)

·         The ID value for the "CourseTemplate" is 111.

 

 &wstoken=xxxxxxxx

&wsfunction=core_course_create_courses

&courses[0][fullname]=Thesis Course1

&courses[0][shortname]=Thesis1

&courses[0][categoryid]=7 (category id of “Main Category”)

&courses[0][idnumber]=000000000349 (Optional value)

&courses[0][courseformatoptions][0][name]=Template (static text)

&courses[0][courseformatoptions][0][value]=111 (id value for the template “CourseTemplate”)

 

But the value did not meet the requirement. We are able to achive to create the courses Thesis1 Thesis Course1, Thesis1 Thesis Course1 & Thesis1 Thesis Course1 but the template "CourseTemplate" is not getting added under these courses.

 

Please help.

Thanks,

Praneeth

In reply to Davo Smith

Re: Require parameters for method "core_course_create_courses" using REST webservices

by Praneeth D -

Hi Davo,

 Thanks for sharing the details. Our goal is to align the courses as shown below-

 Main Category

                Thesis1 Thesis Course1

                                CourseTemplate

                 Thesis2 Thesis Course2

                                CourseTemplate

                 Thesis3 Thesis Course3

                                CourseTemplate

 Note:

·         The CategoryID for the "Main Category" is 7.

·         We have created a Template "CourseTemplate" under the "Main Category". This template should be added to all the courses mapped under "Main Category". This template would be common for all courses (say, Thesis1 Thesis Course1, Thesis2 Thesis Course2, Thesis3 Thesis Course3 & etc)

·         The ID value for the "CourseTemplate" is 111.

 

 &wstoken=xxxxxxxx

&wsfunction=core_course_create_courses

&courses[0][fullname]=Thesis Course1

&courses[0][shortname]=Thesis1

&courses[0][categoryid]=7 (category id of “Main Category”)

&courses[0][idnumber]=000000000349 (Optional value)

&courses[0][courseformatoptions][0][name]=Template (static text)

&courses[0][courseformatoptions][0][value]=111 (id value for the template “CourseTemplate”)

 

But the value did not meet the requirement. We are able to achive to create the courses Thesis1 Thesis Course1, Thesis1 Thesis Course1 & Thesis1 Thesis Course1 but the template "CourseTemplate" is not getting added under these courses.


Thanks,

Praneeth