Refactoring core_course_get_cources arguments propsal

Refactoring core_course_get_cources arguments propsal

by Gennady Kolomoets -
Number of replies: 0

According to the Moodle Web Services API (v.2.8.1) documentation core_course_get_courses  function takes a list of course identifiers as argument. If the list is empty, it returns the data of all the courses. 

However, I see no easy way to obtain the id of the desired course on the client side because ids are assigned by server. The Web interface of the Moodle site provides the ability to search course by it name, but Web Services API has not the similar function.

Therefore, I propose to change the argument of the core_course_get_courses function to the criteria, that is a name-value pairs, in the same way as was done for the core_course_get_categories function.

This change will make the function more versatile and will enable the selection of courses on several criteria.

Average of ratings: -