View Source

{info:title=Implementation Completed!}
See the [Animations|.LRN Tool Adapters#Animations] on this implementation and after you can play with the [Demo server|].

h1. .LRN Tool Adapters

h2. Introduction


[.LRN|] is an open source [Learning Management System|] that is robust and solid. In [Abelardo Pardo|]'s words: _".LRN is the other open source Learning Management System that is neither Moodle or Sakai"_. It is [widely used|] and has a large [set of tools|]. LAMS has an [integration with .LRN|lamsdocs:dotLRN] for a few years as well.

Since .LRN and LAMS are integrated (and that solves issues like authentication and authorization), the step further in the integration would be to incorporate the .LRN tools to the suit of available tools in LAMS. The main idea is to use a [Tool Adapter|Tool Adapters] for .LRN so we can use .LRN Tools in LAMS as if they would be *native LAMS Tools*.

By doing this Tool Adapter, we are not only adding a kit if [key benefits|Tool Adapters#benefits] to .LRN tools, but also provide an interface to enable services for learning design, but also add true interoperability.

For this first .LRN Tool Adapter, we have have used the .LRN Forum tool. Why? well, no particular reason, really. As long as we follow the principles of the LAMS [Tool Contract] and its requirements we could have used any of the tool in the .LRN Tool suite.

To follow the implementation, we suggest you have a look at the LAMS [Tool Contract] so you are familiar with the concepts we will be using in the .LRN Forum Tool Adapter implementation.

h2. Animations

As we have now completed this implementation, we have created animations on how this works (we will soon have this available for you to play with):

# [Authoring and Preview|Authoring and Preview - LRN Tool]
# [Enactment/Runtime and Monitoring|Runtime and Monitoring - LRN Tool]
# [Using .LRN Tool outputs for Branching|LRN Outputs - LRN Tool]
# [Achieving interoperability using Export and Import|Import and Export - LRN Tool]

h2. Demo

You can use the [demo server|] to try this implementation of the .LRN Forum in LAMS. If you are interested in help us out with other .LRN Forum, please let us know in the LAMS Community [Tech Forums|]. Everyone's help is welcome!

h2. Implementation

h3. LAMS Tool Adapter

See the [LAMS Tool Adapter|Tool Adapters - Developers Page] page for further information on its implementation.

h2. Modifications to .LRN Forum to work in LAMS

h3. .LRN Forum

Let's define the simplest use case:

The main principle is that a .LRN teacher can use the .LRN Forum in a LAMS sequence. This means that the teacher can use the [LAMS Authoring environment|lamsdocs:Authoring Environment], drag-and-drop a .LRN Forum into the canvas and when double clicking on it, the .LRN Forum authoring environment for it will show.

After the teacher completes the content of the .LRN forum, the it saves and returns to LAMS without really noticing that the tool is an external tool.

The teacher then can select other activities (LAMS or .LRN) to create a sequence. Once the sequence or design is completed and saved, the teacher can start a new LAMS lesson in .LRN and when the students start this lesson and get to the .LRN Forum, then they use this forum as they normally used in .LRN, but now in the context of a learning design.


One of the main issues one encounters is that .LRN tools (and I think most tools within any other LMSs) have an imperative requirement: instances of a tool must live within the context of a course.

LAMS (and learning design for that matter) has a design stage (authoring), where the teacher sets up the sequence of activities, and a runtime or enactment stage, which is when given the design that the teacher has created, the students go thru this design completing and doing the activities.

LMSs and their tools don't really have this concept. If they would, a teacher should be able to create a Forum outside the course and then instantiate one or more instances of this forum in one (or more) of her courses.

Currently, LMS' tools allow teacher to create activities in a course. So teacher goes into the course page, selects a tool to add, completes its content and bang! Now this tool is in the course page.

Trying to do a work around this can be difficult as it requires to "hack" the LMS tool, meaning that not only you need a tool adapter to "bring" this tool into LAMS, but also modify the code (though slightly) in the LMS tool to overcome this limitation.

The good news is, that with .LRN Forum, this was probably the only 'bump in the road' and it only took a very simple change in the an SQL view to fix this issue.

*Changes in the .LRN Forum Code*

{info:title=Important Integration Principle}
The *main principle* we follow is to *avoid any modification to existing code* whenever possible and *extend the current method or functions instead*.

I committed the .LRN Forum from .LRN 2.4 in our [CVS server|] so we could track down the modification we do to the .LRN Forum Code. Also, a Module in the our [Bug Tracker|]:


h4. Changes to .LRN Forum Authoring

As mentioned before, the LAMS has a design or authoring phase where the teacher creates configure and set the content of tool to create activities. These tool instances (for instance the content of a .LRN Forum) are independent of the course in which the teacher(s) might run this sequence. As a matter of fact, a LAMS learning design can be run in one or many courses. To do this we had to change the way we create an instance of a .LRN Forum ([LDEV-1866|]). For this we added a few files to the _forums/lib_ and _forums/www/admin_ directories

Adding an instance of a .LRN Forum:

* [forums/www/admin/forum-lams-new.adp|] (+6 lines) new
* [forums/www/admin/forum-lams-new.tcl|] (+18 lines) new
* [forums/lib/forums/new-lams.adp|] (+1 line) new
* [forums/lib/forums/new-lams.tcl|] (+84 lines) new

Editing .LRN Forum Content:

* [forums/www/admin/forum-lams-edit.adp|] (+14 lines) new
* [forums/www/admin/forum-lams-edit.tcl|] (+29 lines) new
* [forums/lib/forums/edit-lams.adp|] (+1 line) new
* [forums/lib/forums/edit-lams.tcl|] (+65 lines) new

Although this might look like a lot of new lines of code, if you look a bit closer they are almost a carbon copy of their original files: for instance the [forums/lib/forums/new-lams.tcl|] file is 95% the same as the original [forums/lib/forums/new.tcl|] file. But the reason we opt not to change the _new.tcl_ file, it's because we want to extend rather than modify existing code.

We also created and alternative Zen Theme template ([LDEV-1878|]) for these Editing and Adding forums. Again, these are almost carbon copy of the Zen _lrn-master_ files.

* [forums/lib/lams/lrn-lams-master.adp|] (+133 lines) mew
* [forums/lib/lams/lrn-lams-master.tcl|] (+277 lines) new

h4. Changes to .LRN Forum procedures

The [LAMS Tool Contract|Tool Contract] requires a few methods to instantiate, export, import, clone instances of a tool. To comply with those, we added these methods to forum. Again, extending the forums-forums procedures:

* [forums/tcl/forums-lams-procs.tcl|]
** [Cloning|]
** [Import and Export Forum Content|]
** [Export Portfolio|]
** [.LRN Forum outputs for LAMS Branching|]

h4. Runtime (enactment) changes to .LRN Forum

This is the *only* part where we modified existing Forum files. The reason: so when students use the .LRN Forum the forum behaves in a Workflow-aware manner ([LDEV-1872|]).

* [forums/www/forum-view.tcl|] (+9 lines)

We did this because it only introduces 9 lines of code that in no way will conflict with the existing functionality of the .LRN Forum.

And so the instances created in LAMS are not displayed in the .LRN course page where the lesson is run ([LDEV-1864|]):

* [forums-forums-lams-create.sql|]

h4. CVS, Code and Status

The code is available in our [CVS server|]. If you want to download the code, here are the [CVS details|Building LAMS#GettingitfromCVS]. As of 15/08/2008, this code is consider in Beta. Further testing is required.