Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create Moodle course dynamically using API

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?

like image 279
Johnny Zghaib Avatar asked Sep 26 '22 14:09

Johnny Zghaib


1 Answers

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

like image 64
Marina Avatar answered Sep 30 '22 06:09

Marina