Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Warning!

This is still a work in progress. We hope to have a demo for this shortly. If you have any comments and suggestion, please don't hesitate to contact me

.LRN Tool Adapters

In this page we present the possible changes we need to do in .LRN tools to get them to talk to a tool adapter so they can be use for authoring and learner (be sequenced) in LAMS.

.LRN Forum

Today I started working on a tool adapter for the .LRN Forum. The main idea is that a .LRN teacher can use the .LRN Forum in a LAMS sequence. This will include that the teacher can use the LAMS Authoring environment, drag-and-drop a .LRN Forum into the canvas and when double clicking on it, the .LRN Forum authoring environment for this forum 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.

Once the sequence is 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.

What's the advantage then? Well, that now this .LRN Forum is part of the process of learning that the teacher created in Authoring. This .LRN Forum is not just floating in a course page but part of the sequences of activities the instructor design to accomplished a particular learning outcome/competence.

One of the main issues I have encountered is that .LRN tools (and I think most tools within LMSs) they have an imperative requirement: they must live within the context of a course.

LAMS (and learning design for that matter) has a design stage, 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 is very very difficult as you need 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 in the LMS tool to overcome this limitations.

So here are the additions and changes I've done to the .LRN Forum to get this to work

Following the Tool Contract the tool adapter has to provide an authoring URL <<this is something that I still need to figure out>>

Also, once that we have an authoring URL, when LAMS Authoring invokes the authoring page for a tool, it passes it the Tool Content ID (TCI). The TCI then is used by the tool to store its content using this as the unique identifier for this instance. In the case of the .LRN Forum integration, we would have to pass this to the authoring page of the .LRN Forum, so this one knows that this is not an instance of .LRN Forum that needs to be display in a course page, but instead only displayed when LAMS invokes it.

So for this I create a copy of the

List of Added Files

Authoring files

  • /forums/www/admin/forum-lams-new.adp
  • /forums/www/admin/forum-lams-new.tcl
  • /forums/lib/forums/new-lams.adp
  • /forums/lib/forums/new-lams.tcl

SQL changes/additions

  • /forums/sql/postgresql/forums-forums-lams-create.sql

Functions and library files

  • /forums/tcl/forums-lams-procs.tcl
  • /forums/tcl/forums-lams-procs.xql

I've been trying to be really careful not to modify any existing code but rather extend the existing code with the hooks the Tool Adapter would need from .LRN. Let's have a look what are the additions on these files

Authoring Files

/packages/forums/www/admin/forum-lams-new.tcl
ad_page_contract {
    
    Create a Forum

    @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au)
    @creation-date 2008-07-23
    @cvs-id $Id$

} -query {
    {name ""}
    {lams_id 0}
}

set context [list [_ forums.Create_New_Forum]]

set returnlams_url "http://shaun.melcoe.mq.edu.au/lams"

ad_return_template


The returnlams_url will be coming from the .LRN-LAMS package parameters.

/packages/forums/www/admin/forum-lams-new.adp

<master>
<property name="title">#forums.Create_New_Forum#</property>
<property name="context">@context;noquote@</property>
<property name="focus">forum.name</property>

<include src="/packages/forums/lib/forums/new-lams" name="<at:var at:name="name" />" lams_id="<at:var at:name="lams_id" />" return_url="<at:var at:name="returnlams_url" />">

The return_url is where we will send the author after she has saved the changes in the .LRN Forum, that will be a LAMS URL that we will append the TCI and the internal .LRN Forum forum_id. These two variables then will be stored by the Tool Adapter.

/forums/lib/forums/new-lams.tcl
ad_page_contract {
    
    Create a Forum for LAMS

    @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au)
    @creation-date 2008-07-23
    @cvs-id $Id$

}

if { ![info exists name] } {
    set name {}
}

set package_id [ad_conn package_id]

form create forum

element create forum forum_id \
    -label [_ forums.Forum_ID] \
    -datatype integer \
    -widget hidden

element create forum toolContentID \
    -label toolContentID \
    -datatype integer \
    -widget hidden 

forums::form::forum forum

if {[form is_valid forum]} {
    template::form get_values forum \
        forum_id name charter presentation_type posting_policy new_threads_p

    set forum_id [forum::new -forum_id $forum_id \
        -name $name \
        -charter [template::util::richtext::get_property contents $charter] \
        -presentation_type $presentation_type \
        -posting_policy $posting_policy \
        -package_id $package_id \
    ]

    forum::posting_policy_set -posting_policy $posting_policy \
        -forum_id $forum_id
    
    # Users can create new threads?
    if {$new_threads_p} {
        forum::new_questions_allow -forum_id $forum_id
    } else {
        forum::new_questions_deny -forum_id $forum_id
    }

    forum::lams::is_lams -forum_id  $forum_id

    set return_url [export_vars -base $return_url {forum_id toolContentID}]

    ad_returnredirect $return_url
    ad_script_abort
}

if { [form is_request forum] } {
    # Pre-fetch the forum_id
    set forum_id [db_nextval acs_object_id_seq]
    element set_properties forum forum_id -value $forum_id
    element set_value forum new_threads_p 1
    element set_value forum name $name
    element set_value forum toolContentID $toolContentID
}

if {[exists_and_not_null alt_template]} {
  ad_return_template $alt_template
}




Two new things here:

  • toolContentID
  • forum::lams::is_lams function

The toolContentID is passed to this tool so afterwards we can return it to the Tool Adapter along with the .LRN forum_id (so the tool adapter can do the mapping)

The forum::lams::is_lams function is used to set this instance of forum to be a LAMS instance instead of a .LRN instance. If this is marked as LAMS, then this instance of forum won't be displayed in the .LRN course page (we'll see about this later).

/forums/lib/forums/new-lams.adp
<formtemplate id="forum"></formtemplate>

SQL Additions

/forums/sql/postgresql/forums-forums-lams-create.sql

--
-- The Forums (LAMS integration)
--
-- @author ErnieG@melcoe.mq.edu.au
-- @creation-date 2008-07-23
--
--

alter table forums_forums add column is_lams boolean;
alter table forums_forums alter column is_lams set default false;
update forums_forums set is_lams = false;

drop view forums_forums_enabled;

create view forums_forums_enabled
as
    select *
    from forums_forums
    where enabled_p = 't' and
    is_lams = 'f';


We add a the is_lams column to the forums_forums table. The default value is false.

We also recreate the forums_forums_enabled view, to include the is_lams = 'f' statement so it only will show .LRN forum instances and not LAMS instances.

Libraries and function files

/forums/tcl/forums-lams-procs.tcl
# packages/forums/tcl/forums-lams-procs.tcl

ad_library {
    
    LAMS Integration for Forum
    
    @author Ernie Ghiglione (ErnieG@melcoe.mq.edu.au)
    @creation-date 2008-07-23
    @arch-tag: F3DCDE7B-7FDF-4CD0-8CE4-AC182F82661E
    @cvs-id $Id$
}

namespace eval forum::lams {}

ad_proc -public forum::lams::is_lams {
    {-forum_id ""}
} {
    set a forum to be a LAMS forum instance only
} {

    db_dml islams {}

}


ad_proc -public forum::lams::clone_instance {
    {-forum_id ""}
} {
    Clones an instance of a forum
} {

    forum::get -forum_id $forum_id -array forum
    
    set new_forum_id [forum::new -name $forum(name) \
			  -charter $forum(charter) \
			  -presentation_type $forum(presentation_type) \
			  -posting_policy $forum(posting_policy) \
			  -package_id $forum(package_id) \
			 ]

    forum::lams::is_lams -forum_id $new_forum_id
    
    return $new_forum_id

}

The forum::lams::is_lams function only changes the is_lams column in the forums_forums table to true if this is an instance to be used in LAMS.

The forum::lams::clone_instance clones an instance of .LRN Forum.

  • No labels