I have been working on a version to run on the latest 1.6 development version of Moodle. This has been virtually a complete rewrite and as such there are areas of functionality the were available in older versions of AL that are not in this. I believe this version is far more efficient and stable, though.
Things that are in this release:
- Conditional locking: Lock based on a user's performance in previous activities. You can also choose to unlock and activity if a user scores less than a certain grade.
- Show activity completion: The checkbox that appears before each activity to show it have been done.
- Automatic Installation: More trouble than it's worth so far.
- Locking of topics.
- Time locking: A user has to be enrolled for a certain amount of time before the activity is available.
- Hiding locked activities.
- Group locking: Activities only available to certain groups.
- Decent documentation: There's lots of help files still need writing.
Read this carefully
Firstly, you need the latest, nightly build of Moodle 1.6. This version of AL might work on earlier releases but I didn't write it with them in mind and I certainly can't support them.
Next, you need to modify one table in the database and add a new one (I use phpmyadmin for this). The table you need to modify is mdl_course_modules. You need to add the following fields:
completedbox TINYINT(1) UNSIGNED NOT NULL DEFAULT '0'
completedscore VARCHAR(255) NOT NULL
completedstyle VARCHAR(255) NOT NULL
lockedbox TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'
lockedstyle VARCHAR(255) NOT NULL DEFAULT 'locked'
lockedvisible TINYINT(1) UNSIGNED NOT NULL DEFAULT '1'
delay INT(10) UNSIGNED NOT NULL DEFAULT '0'
The table you need to create is as follows:
CREATE TABLE `mdl_course_locks` (
`id` int(10) unsigned NOT NULL auto_increment,
`courseid` int(10) unsigned NOT NULL default '0',
`locktype` varchar(10) NOT NULL default '',
`targetid` int(10) unsigned NOT NULL default '0',
`locks` longtext NOT NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM COMMENT='Contains locks for sections and modules';
Lastly, you need to copy the following files from the zip file:
lib/moodlelib.php to moodle/lib/moodlelib.php
lib/locklib.php to moodle/lib/locklib.php
course/lib.php to moodle/course/lib.php
course/lock.php to moodle/course/lock.php
course/mod.php to moodle/course/mod.php
course/settings.html to moodle/course/settings.html
pix/t/open.gif to moodle/pix/t/open.gif
pix/t/closed.gif to moodle/pix/t/closed.gif
lang/en/lock.php to moodle/lang/en/lock.php
Things have changed slightly in this version. Now, in order to switch locks on or off, you need to click on the pencil icon next to the activity name (the one you click on to update an activity). Now, on the update page there is 3 tabs at the top. Click on the Activity Locks tab to set activity locks. The Settings tab allows you to set whether checkboxes are shown for the locks etc.
It's worthwhile mentioning that teachers and administrators (should) never see ticks in the activity complete boxes, regardless of whether they have completed it. You need to log in as a student to see the ticks in boxes.