Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Updating to code.lamsfoundation.org

...

Info
titleImportant 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.

Modifications to Moodle

We added a new column to the \course_modules_ table so it distinguishes between LAMS course module instance (_is_lams). The is_lams is a integer value that can have only a 0 or 1 value. If 0, it means that it isn't a LAMS instance. We use this field to filter instances of course modules in the course page (as you can see below).

This file is copy of modedit.php where we add only a few lines (this is an actual diff):

...

No need for course footer, so we remove this too.

That's all!

As we have added a new column to the course_modules, when a Moodle Course page is displayed, we don't want to show instances of Moodle that we have created for LAMS (as these instances might be used at authoring stage). Therefore, we add a new constraint to the function get_course_mods($courseid) function to show only course modules that aren't used in LAMS.

...

Modifications to Moodle Forum Tool

Just as we did with the course_modules table, we add an is_lams column to the forum table. Default value is 0.

No Format
\#$forums = get_records('forum', 'course', $course->id);     $forums = get_records_select('forum', "course=$course->id and is_lams=0");

We replaced the get_records function for a get_records_select instead and add the is_lams=0 so it only shows forums that weren't created for LAMS.

This file is also a copy of the original moodle/forum/mod_form.php which we remove a lot of features that http://lamscvscode.melcoe.mq.edu.aulamsfoundation.org/fisheye/browse/lams/temp_moodle_dev/moodle/mod/forum/mod_form_lams.php?r=1.1]. The only additions/modifications are:

...

Instead of showing the standard Save options, we only show one Save button.

In order to make the Moodle Forum Tool "workflow aware", we need to introduce a "Next Activity" button so after the students have posted their messages they can continue to other activities in the sequence. However, we only show this button if this is a Moodle Forum instance used in LAMS (is_lams = 1).

As part of adding a new Moodle Tool into LAMS, we need to add a few functions to the Moodle Forum tool so they can be use from LAMS. These functions are based on existing Moodle Forum functions.

...

LAMS Integration Interface

Completed, but not documented yet. Coming soon...

...

The code is available in our CVS server. If you want to download the code, here are the CVS details. As of 22/08/2008, this code is consider in Beta. Further testing is required.

...