Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add a course to an existing user in moodle remotely?

Tags:

php

ldap

moodle

I'm using LDAP to create users in Moodle. However, after creating an user (adding to LDAP and running the sync script) i want to enroll that user to a course. How one does that? :)

like image 279
Torres Avatar asked Jul 21 '11 20:07

Torres


People also ask

How do I add multiple users to a Moodle course?

Re: How to enrol one user into multiple courses at once? You can go to site admin --> courses --> select your course --> users --> Enrolled users. From the list of users, click on the Assign Role icon against the user and select the required Role to be assigned.


1 Answers

If by "remotely" you mean via a remote script, the one option is to use the SOAP webservices module:

  • https://github.com/patrickpollet/moodlews
  • http://docs.moodle.org/20/en/Web_Services:OK_Tech_Web_Services

This module works with Moodle 1.9 and 2.0 and provides access to methods for user creation, course creation, and enrollment along with much else.

I'm currently using this module in a Moodle 1.9 installation as my sole enrollment process (without creating courses via LDAP on login), but there is no reason you couldn't write a script that looks through your course groups and adds any missing users to the matching Moodle courses them by calling the SOAP methods.

like image 140
Adam Franco Avatar answered Sep 23 '22 00:09

Adam Franco