4
votes

I have been asked to create an engine that will take a course(name, short-name, category) from our local database and add it to moodle.

I am thinking of using Moodle API for this.

I tried using the webservice with no luck.

I need something like :

moodle_create_course($name, $short-name, $description, $category, $type)

Does anyone has an input?

1
Did you consider using the import form in /admin/tool/uploadcourse/index.php ? - gyc

1 Answers

4
votes

If you want to do it from PHP there is a function create_course() in course/lib.php

If you want to do it as a automatic sync tool, consider using CLI script in https://docs.moodle.org/en/Upload_courses tool

If you prefer REST, there is a web service for it called core_course_create_courses