Skip to end of metadata
Go to start of metadata

Only for Moodle 1.x!

These instructions are for Moodle 1.x ONLY. If you are using Moodle 2, please read this thread in the LAMS Community


This animation shows how the LAMS and Moodle integration works.


Before you begin the LAMS2.0+ and Moodle 1.6.3+ integration, have a quick look at this animation, which shows how to configure LAMS and Moodle for the Integration.

Installation instructions

  1. Download the LAMS Moodle module
  2. Unzip the file
  3. Move the lamstwo directory to moodle/mod/
  4. (Optional) Move the lamstwo_status directory to moodle/blocks/
  5. Login as admin and go to admin, LAMS tables will be created automatically. In Moodle 1.7, you can go to the admin screen by changing the url to "http://<moodleserver>/moodle/admin/" (if you access Moodle as "http://<moodleserver>/moodle/") or "http://<moodleserver>/admin/" (if you access Moodle as "http://<moodleserver>/").
  6. Go to modules and click settings for LAMSv2 module and put the proper values in (as shown below)

When the Moodle module is installed in step 6. you should see output like:

Quick visual walkthru LAMS Integration with Moodle

Here are the steps you need to take to get LAMS and your LMS (in this case Moodle) to be integrated. In this example they are on the same server (my local PC) but that was only because it is easy for me to create a screenshot on my own PC.  I have LAMS installed on port 8080 and Moodle 1.7 installed on port 80.
OK, now let's get it on with the integration:

In the LAMS side

1. login in LAMS as a sysadmin (the user that you created at installation time)

2. Select the "Sys Admin" link.

3. Select "Maintain Integrated Servers".

4. Setup the fields as appropriate.

  • Id: this is the server identification string that we will use to individually identify the LMS server that will be "talking" to LAMS.
  • Key: this is the secret key that both systems will be used to encrypt the hash when doing authentication. Make sure you keep your server key private
  • Name: the server name
  • Description: (Optional) a meaningful server description
  • Prefix: the prefix that the usernames will have in LAMS. (usually just one or two letters will do)
  • Disabled: (Optional) check this box when you want to disable access to LAMS for this particular Moodle server
  • Organisation: (Deprecated) Either use an existing Group within LAMS (from the Group Adminstration screens) or create a new Group.
  • User Information URL: This is the callback userinfo URL that is used by LAMS to retrieve personal information about the user from the LMS.

    User Information URL: If you run Moodle using "http://<moodle_server>/moodle/" then the URL is


    If you run Moodle using "http://<moodle_server>/" then the URL is

  • External Server URL: (Optional) Base LMS URL used in tool adapter configuration
  • Timeout URL: (Unimplemented) A webpage that should be displayed if the LAMS/Moodle timeout trying to talk to each other.

On the LMS side

1. Go to your configuration menu and click on the LAMS settings

2. Enter the LAMS server URL, server_id, server_key and request_source.

When a teacher runs the LAMS authoring client (when adding an activity) and the teacher saves a sequence, the "Saved" message will have a button "Close and return to {request_source}". If this button is clicked, then the LAMS authoring client will close and the list of sequences on the add activity screen will update automatically. So the request_source should be set to a name that your users understand e.g. "Moodle", "the add LAMS activity screen". This feature will be added in LAMS 2.0.1 - you will not see the message in LAMS 2.0. Have a look at MoodleSaved.jpg to see how the message appears.


Make sure you keep your sever_key private as that is the key used for authentication

3. Click the "Validate" button to make sure it is configured correctly. LAMS should already be running - the validation test will call LAMS to ensure that the two systems can communicate.
4. If it validates okay, then click Save changes.

That's it. You are done.

Now you can go and add sequences and activities to your Moodle courses!

Latest Changes

type key summary assignee reporter priority status resolution created updated due

Data cannot be retrieved due to an unexpected error.

View these issues in Jira

Troubleshooting, Problems and Comments?

Post them in the Tech Forum in the LAMS Community

LAMS is unable to get user data from Moodle

When a user tries to create access LAMS from within Moodle for the first time, such as to create new learning design, LAMS calls back to Moodle to get the user's details. This could fail for a number of reasons and you might get an error like:

soapenv:Server.userException: java.rmi.RemoteException: Fail to fetch
user data from
external server:moodle - Unexpected return HTTP Status:404; nested
exception is:
org.lamsfoundation.lams.integration.UserInfoFetchException: Fail to
fetch user data from
external server:moodle - Unexpected return HTTP Status:404
  • Check that the configuration on both ends is done - you need to configure URLs in both Moodle and LAMS. On the LAMS side, double check that the User Information URL is correct. You may need to add or remove a "moodle/" from the path - see the User Info URLS table earlier on this page.
  • Turn on debugging in LAMS, try accessing LAMS again then then look in the lams.log in the LAMS log directory (<jboss>/server/default/log) and look for a URL like the one in the User Information URL field. It should be the same except the %blah% bits will have been replaced with real values. Then copy this URL into a browser and test it there. You should get some comma separated data back.
  • Do you have the Moodle web page protected with an .htaccess/.htpasswd scheme? If so, this will stop LAMS being able to call Moodle.

3rd party users on servers updated from 2.0

One of the changes from 2.0 relating to integrated users is that their LAMS organisations changed from groups to subgroups. This means that under their 'My Groups' workspace, they have folders for the subgroups. Whereas on a freshly installed 2.0.1+ installed server, 3rd party users should only have a folder for the main integration group. Apart from the fact that 3rd party users on a server updated from 2.0 will have more folders, this isn't a problem.

If you updated your (integrated) LAMS 2.0, then you may notice that existing 3rd party users don't have access to the main integration group folder. Users who start using LAMS after the update applied do have access. This can be easily fixed by logging into LAMS directly and giving the author role to all 3rd party users in the main integration group.

Users can create sequences but not start activities (lessons).

Check to see if the lamstwo table exists. If the strict_trans_tables option is turned on in MySQL, then the database create script will fail.

To fix, find the script in the lamstwo/db directory. If it looks like this:

CREATE TABLE prefix_lamstwo (
  id int(10) unsigned NOT NULL auto_increment,
  course int(10) unsigned NOT NULL default '0',
  name varchar(255) NOT NULL default '',
  introduction text NOT NULL default '',
  sequence_id bigint(20) default '0',
  lesson_id bigint(20) default '0',
  timemodified int(10) unsigned NOT NULL default '0',
  PRIMARY KEY  (id),
  KEY course (course)
)COMMENT='LAMS2 activity';  

then remove the NOT NULL default '' from the introduction line, change "prefix" to the prefix used in your db e.g. mdl then run the CREATE TABLE statement on your database. This will create the table. See LDEV-1435

More installation instructions

Eric Instructions from Elek Tech Solutions.

"All the LAMS module settings have not been set up!" Error and LAMS Course Format

If you try using the LAMS Course Format, you will probably see an error message "All the LAMS module settings have not been set up!". The LAMS Course format is not supported by the LAMSv2 module - it was only used in the original LAMS Moodle module.

LAMS activities (lessons) cannot be created on the main Moodle page

You can only start a new LAMS activity (known as a lesson in LAMS) within a Moodle course. We need to have an organisation on the LAMS side that matches to the Moodle course, so that we keep lessons for each course grouped together. So no Moodle course, no organisation on the LAMS side, and hence no lesson.