Adding users and enrolling in a course from external website

Adding users and enrolling in a course from external website

per Dale Collins -
Nombre de respostes: 2

Hi,

I am developing a site for a client and have built a redemption system on his business website that captures various student information.

The client would like the system to also add the student to the moodle database and auto enroll them in a group and course.

I have been successful in adding the student to users section of moodle but am unsure which tables handle the enrolments and groups.

Is there an enrollment API? or can anyone explain the process to me.

I am using v2.5

Thank you.

Mitjana de qualificacions: -
En resposta a Dale Collins

Re: Adding users and enrolling in a course from external website

per Farhan Karmali -
Imatge Core developers Imatge Plugin developers Imatge Testers

Hello,

Instead of inserting records in the tables yourself, use the Moodle APIs wherever possible.

For creating users, use

http://docs.moodle.org/24/en/External_database_authentication

For enrolling them in a course, you may use External Database Enrollment plugin
http://docs.moodle.org/22/en/External_database_enrolment

 

I hope that helps

En resposta a Farhan Karmali

Re: Adding users and enrolling in a course from external website

per Dale Collins -

Thank you for the answer,

I have mapped all the necessary fields required for the External database authentication but when i try to log in as one of the users i get the error message "Invalid login, please try again.

I have made these fields as basic as possible for testing purposes, 

username = firstname in ext

password = password in ext (plain text at this stage)

I am not getting any connection errors (will i, if this is an issue?)

Any ideas?