Get List of courses and roles

Re: Get List of courses and roles

by Trinh Nguyen -
Number of replies: 0

From the Moodle version 2.5.1 onwards, you can use these following function to get course(s):

  • Get a specific course with ID:
$course = get_course($course_id);

  • Get all courses:
$courses = get_courses();


Read the Moodle's Data Manipulation API for more information: 

http://docs.moodle.org/dev/Data_manipulation_API