I'm not very familiary with moodle but I'm trying to understand how it works.
I'm trying to find a way to automaticaly create a course for a specific user. I have an external form where the user can register as a teacher. I give a registration code to each teacher, and they can only register if they insert that code. When they successfuly register I wanted to automaticaly create a course, based on an existing one, and assign that newly registered user as a teacher in that course. Is it possible? I'm trying to do it directly on the database. I've already managed to do the registration process, it creates the new user and assigns it a permission level for teacher. But how can I create/duplicate a course without having to backup/restore an existing one?