Conditional activities: Activity Locking v3

Conditional activities: Activity Locking v3

by Stuart Mayor -
Number of replies: 63

Right. I've succumbed.

Here's a snapshot of the latest version of Activity Locking I've been working on.

IT IS NOT FINISHED

Please don't use this on a production server.

I've had to use a zip format called "7Zip" in order to get it small enough to post it on this forum. Do a Google search for 7Zip to find the program to unzip it. It's freeware. Sorry about that, but it's the limits set on Moodle.

There are some brief instructions in the zip, and I'm sure others on this forum would be happy to help if you run into problems.

Hopefully someone with a little more time than me will be able to do some development on it.

Average of ratings: Useful (1)
In reply to Stuart Mayor

Re: Conditional activities: Activity Locking v3

by Bernard Boucher -
Hi Stuart,
I will try the AL and the patch on 1.6 soon.

Many thanks for your succumbation wink

Bernard

In reply to Bernard Boucher

Re: Conditional activities: Activity Locking v3

by Alvin Shaffer -
Bernard,

What patch are you referencing?
In reply to Alvin Shaffer

Re: Conditional activities: Activity Locking v3

by Alvin Shaffer -
Bernard,

Nevermind I see now. If you get the files modified and working on 1.6 can you shoot me a copy to look at?

thanks
In reply to Alvin Shaffer

Re: Conditional activities: Activity Locking v3

by Bernard Boucher -
Hi Alvin,
            John Gschnaidner ( in that thread ) seem to have adapted a working version before I even have time to install it!


Bye,

Bernard

In reply to Bernard Boucher

Re: Conditional activities: Activity Locking v3

by John Gschnaidner -

Yes, but that one is based on version 2.1! wink

Regards
  John

In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Bernard Boucher -
Hi John,
thanks for the important precision.

Bye,
Bernard

In reply to Stuart Mayor

Re: Conditional activities: Activity Locking v3

by Eduardo Hernandez -

Hi Stuart,

thanks so much for your post.

I run WinRAR on my local PC, and it was able to unzip the file smile

Eduardo

In reply to Stuart Mayor

Re: Conditional activities: Activity Locking v3

by John Gschnaidner -

Hi Stuart,

I've been trying to use your new package, but it does not work at all.mixed

I would say, it is incomplete:
In V 2.1 there had been an update for /course/mod.php and an additional file named settings.html.

Can't find it in this package. Do you use that one from V 2.1?thoughtful

By now I have been hacking my way through V 2.1 to make it run on Moodle 1.6  and modify it; I did like the posibillity to hide things, which you are not allowed to see or see yet. I use this 'hide & seek' for responses or certification of attendance to say 'You got it' or 'You failed. Try again'.

If you care you can have a look at.wink
I have not smoothed it completelyblush, but so far it works for me.
That you can not use it proper with 1.6 SCORM seems to be a problem of /mod/scorm/locallib.php (see my post http://moodle.org/mod/forum/discuss.php?d=44787#210763).

But anyway, thank you for your work.smile

With best regards

  John

Average of ratings: Useful (1)
In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Brett Drinkwater -
Hi John,

Thanks for posting this. I've been trying to get 2.1 working on our 1.6 testbed, however, struggling without much progress.

I've downloaded your activitylockingwithhide package, and unfortunately, there is no readme file to explain the two different sql files.

I've tried to make the required database changes using phpMyAdmin. The  CREATE TABLE `mdl_course_locks' query runs fine, however getting the following error from the  Alter Table`mdl_course_modules` Query:

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ADD `completedbox` TINYINT( 1 ) UNSIGNED NOT NULL default '0' AFTER `groupmode`.' at line 2

Hoping you shed some light on this error?

Looking forward to getting it working. smile

Cheers
Brett




In reply to Brett Drinkwater

Re: Conditional activities: Activity Locking v3

by John Gschnaidner -

Hello Brett,

I used this SQLs just as an aid for installation. I am not sure, but I might have a syntax error there. I tried it myself and I have problems with ALTER TABLE but the CREATE TABLE works fine.

You can try this one or split it up into separate commands.

Regards
John

In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Henri Merkesdal -
If I remove the part AFTER in the sql commands it works for me.
(Can't see that this should cause trouble as they a will be in correct order, and b I wouldn't think that any code is dependent on the order of the fields)

So the working sql for me is:

# Table structure for table `course_module_locks`
# Use SQL command for update

ALTER TABLE `mdl_course_modules` ADD (
 `completedbox` TINYINT( 1 ) UNSIGNED NOT NULL default '0',
 `completedscore` VARCHAR( 255 ) NOT NULL,
 `completedstyle` VARCHAR( 255 ) NOT NULL default 'unlocked',
 `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'
);


# --------------------------------------------------------

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';
In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Henri Merkesdal -
Great WORK!!!!  big grin

Now have Locking up and running with certificates on 1.6.

The certificate won't show up before grade is high enough and all lessons have been visited.
Very cool.

BTW: When installing I had to remove the certificate module , and delete all traces of it in mod, blocks and ALSO in boxes, then reinstall it.
So first Activity Locking then Certificatesmodule  was my experience.

(With clean install this of course wouldn't be necessary.)
In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Stuart Mayor -

I've been trying to use your new package, but it does not work at all.mixed

I would say, it is incomplete:
In V 2.1 there had been an update for /course/mod.php and an additional file named settings.html.

Can't find it in this package. Do you use that one from V 2.1?thoughtful

Hi John,

Version 3 is a complete re-write from version 2.1. There is actually not a great deal in common between the two. The file settings.html is not required in v3. That functionality has been moved elsewhere.

In order to get version 3 working, you will need to put it on a clean install of Moodle 1.5.x. It is also possible to make it work on 1.6, but this requires a lot more work.

In reply to Stuart Mayor

Re: Conditional activities: Activity Locking v3

by John Gschnaidner -

Hello Stuart,

thanks for the hint, that explains everything. I thought I would at least get a hint in form of an error or so, if I install it on 1.6. And I did not count in the fact, that you went back a little step and used a separate user interface again, not the /course/mod.php.

On 1.54 it works - just needs a bit of playing to get used to the different user interface; I will try it, if I find time. For now my 'own' version for 1.6 works fine. Since I wait for the official release of 1.6 I may find some time to work out AL V3 on Moodle 1.6 - I will let you know, if I got something.

Regards
John

In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Chardelle Busch -
Picture of Core developers
Bonjour Bernard,

I wondered how you are doing testing V3 with 1.6?

I have tried it but have problems.  I added $mode as a required_param to lock.php.  But then, when I choose "Select criteria type", then hit continue, nothing happens.  So, obviously something else is missing.

Thanks
In reply to Chardelle Busch

Re: Conditional activities: Activity Locking v3

by Bernard Boucher -
Bonjour Chardelle,
                            I didn't try it yet. Maybe I will have to remove to word soon from my previous post!

I will let you know as soon  as will try it.

Bye,

Bernard
 
In reply to Bernard Boucher

Re: Conditional activities: Activity Locking v3

by Chardelle Busch -
Picture of Core developers
For anyone wanting to test AL Ver. 3 in 1.6, here are the latest lib/moodlelib.php and course/lib.php files with the AL patches included.  I can't figure out what's wrong, when I click on continue for "Select Criteria type" nothing happens (I had this working once a couple of months ago, so, somethings changed).
In reply to Chardelle Busch

Re: Conditional activities: Activity Locking v3

by Simon Gould -

Hi,

I have AL installed on moodle 1.5.3.  I have 5 modules on each course.  Its working Ok but all the timers start at the same time.  What i need is to be able to guarantee that each student takes 4 hours on each modules and then when the 4 hors is completed the student can then start the next module.  At the minute the AL seems to work on the whole course and i need it to work on each individual modules and then start the timer again on the next module.

Help would be much appreciated,

In reply to Chardelle Busch

Re: Conditional activities: Activity Locking v3

by Chris Collman -
Picture of Documentation writers
Hi Chardelle,
First time install of Activity_locking.  Got the above Zip.

I just downloaded a clean copy of 1.6 beta.  Moved the two files to Lib and Course folders in my localhost.  Got an error that it could not find locklib.php.   We up on CVS and found contri, activity_locking and under lib found locklib.php 1.1.   Did a copy and paste (how do you really download a file?) into my php editor and saved it to /lib/locklib.php .  Fatal error when I go to any course, line 821 in course/lib.   Do I need more php files?

Is activity_locking the only way to make completion of a course the requirement for allowing a student to print up a certificate in 1.6?   Our production Moodle is 1.5.3 and uses activity locking.  The local supervisor of training gives approval for the student to take the course. We have student print up a certificate and give it to their local supervisor of training, who puts it in their local HR file.  Too bad lesson dependency does not extend to certificates.

Thanks in advance, Chris
In reply to Chris Collman

Re: Conditional activities: Activity Locking v3

by Alvin Shaffer -

Chris,

Chardelle's zip files are to be used in conjuction with Stuarts original files at the begining of this forum. Her two files simply take the place of 1.5.3 files that Stuart used

In reply to Chardelle Busch

Re: Conditional activities: Activity Locking v3

by Alvin Shaffer -

Chardelle,

Have you had success getting this hacked version to run properly on 1.6?

In reply to Alvin Shaffer

Re: Conditional activities: Activity Locking v3

by Chardelle Busch -
Picture of Core developers
So, this thread was meant to be about Stuart's AL version 3--which is very much still in development.
 
As for AL version 2 for 1.6, I'm assuming that is what John posted above?  If so, that might be the way to go for now, I haven't tried it yet. I'm really not sure which is which thoughtful at this point.

No, Alvin, I haven't looked at it again.  It's strange since when Stuart sent me the files in March, I had it running on 1.6 except for the quiz questions, since they have changed radically since 1.5.  Now, with the latest 1.6 it isn't working at all, so it seem like something else has changed. 

Chris--is John's the the zip that you downloaded?  I looks like it has all the files you should need to get it to work, however, I don't know if his version works in 1.5+.    (I guess I'm going to have to try to get ver 2 working in 1.6 for now.)  Once you get it working, AL is great for "hiding" a certificate until criteria have been met.

Other posts with ver2 for Moodle 1.5+ can be found here:

http://moodle.org/mod/forum/discuss.php?d=31627&parent=152788

Also see:  http://moodle.org/mod/forum/discuss.php?d=39449

As for downloading files from cvs, first, don't get any locking code from cvs--it is very outdated, and, second, I never figured that one out about cvs either, if you really want to get files thru cvs, you should install Tortoise (see the download page).  I've got some instructions on using it posted somewhere, do a search on me as the author and cvs if you need to.
In reply to Chardelle Busch

Re: Conditional activities: Activity Locking v3

by Chris Collman -
Picture of Documentation writers
I don't really want to get files via CVS, figure I should be close to the standard Moodle that other New Users are using.  That is why I constantly download and unzip the 1.6 latest.  

Figured I needed more files and that the 1.6 zip was how AL Ver2 (or what ever), went to AL Ver3.   I will play around some more. 

Thanks for explaining the various version.  So there is not an AL version which works in 1.6 at the moment.  I will stay tuned.   I will figure out which zip is the latest ver2 and give it a shot, maybe I will get lucky.

My site administrator was hoping to move our production Moodles (internal and external) to different servers and upgrade to 1.6 this summer (July to August).   Interesting that you are running 1.6 except for quizes which is still in 1.5 and AL was working with that blend.  


In reply to Chardelle Busch

Activity Locking v3 or v2 for testing only

by Bernard Boucher -
Bonjour Chardelle,
                            I hope I will not add too much confusion to the activity locking  world thoughtful

Like you I tried two weeks ago applying Stuart patch to 1.6 beta 5 without complete success. I tried also Stuart code with a clean original 1.5.2  and it work better that with 1.6 beta 5 but not completly as  Stuart advised.

This morning with the new 1.6 out, I decided to adapt the last completly working version of activity locking ( version 2 I think )  with 1.6.  That "old" version do not include David functionnalities as version 3 try to do.

Because Moodle modules database don't seem to be accessible now I used that link. Please don't test it on a production server. If you think it is usefull and if you have time, I will be pleased to include in the zip file a readme file that explain in real english wink that post and how to copy the zipped files in the appropriate directories. Also a good naming convention for all the combinations of activity locking and Moodle versions should be usefull.

I hope it may help.

Have good testing,

Bernard






In reply to Bernard Boucher

Re: Activity Locking v3 or v2 for testing only

by Alvin Shaffer -

Bernard,

So far so good, I have been testing your new release today and everything seams to work great.

One issue is when a resource or other item is lock by a quiz which requires a certain % grade before that activity is unlocked. The locking code works fine the only issue is if a student clicks on a resource locked by the quiz all they are told is that a particular quiz has to be complete before accessing this item. Is there anyway to report to the student that not only is the quiz required but also the % grade that is required to unlock that particular resource?

Great work AGAIN!

Alvin

In reply to Alvin Shaffer

Re: Activity Locking v3 or v2 for testing only

by Chardelle Busch -
Picture of Core developers
Alvin,

That is something that I would like to look into at some point.  It's a good idea.
In reply to Bernard Boucher

Re: Activity Locking v3 or v2 for testing only

by Chardelle Busch -
Picture of Core developers
Actually Bernard,

I think I am more confused now than ever mixed.

I won't have a chance to test your version until next week.  However, I see that it is the version with the ability to lock a section--nice.  However, I don't think it has the code to be able to set a locked activity to be invisible?, or to set completion icons for activities without having to be locked (for example, once a student gets a score of >= 80 on a lesson a green checkmark appears).

Yikes. I'm not sure what we want to do now, but maybe when I get a chance I can see if the two versions can be integrated.  Here is the code for this version (which was tweaked for 1.6 by John Gschnaidner) and that I have tested on the latest 1.6.

But you are right, naming conventions are definitely necessary, as well as documentation.
In reply to Chardelle Busch

Re: Activity Locking v3 or v2 for testing only

by Alvin Shaffer -

Yes definitely getting crazy on versions
Looks to me for Moodle Ver 1.6 we have the following:

AL v2.1 - released by Stuart on Dec. 1, 2005 - Not a lot of success by forum (not sure if this version is based on pure AL or conditionals) Known to me as AL v2.1(stuart)

AL 2.1 - released by Jon on June 1, 2006 - Modified 2.1 with hides for ver 1.6. Non Block installed based AL , must hack database , etc. Not sure a list of feature differences to V2.1(stuart) Known to me as AL v2.1(jon)

AL 3.0 - Modified files to try to hack AL ver 3.0 for 1.6 released by Chardelle on June 15th, 2006 - (Stuart released Ver 3.0 AL for 1.5.X code) not a working version due to the quiz module changes and other issues (hopefully stuart is working on a 1.6 version) AL 3.0 is conditional based vs AL 2.1 being more strait forward AL based

AL 2.1 - released by Bernard on June 21st, 2006. A hack of the Block installer based AL (I think 2.1). So far in testing this version seams to work in 1.6 , just not sure what features from Jons Hack are not included (as Chardelle alluded to). Know to me as Ver 2.1(bernard)

Not sure how we corral all these versions and get a system together for there control. If I missed any releases for AL for Moodle 1.6 let me know.

Any list of features would prob be good to start documenting??

 

In reply to Alvin Shaffer

Re: Activity Locking v3 or v2 for testing only

by Bernard Boucher -
Hi Chardelle and Alvin,
                                  happy to  know that I am  not alone to be crazy about AL wide eyes

Maybe a good start is to use moodle docs instead of forum : in one page it will be possible to add a table or matrix of features vs versions ( 1.5.2 1.6 ) with appropriate links to download ( forums posts ). And it will be possible to edit and maintain it together.

After it will easier to use the "best" AL maybe working with 1.5.2 and to adapt it to 1.6!

A conditionnal activities page already exist.

Maybe a good name for the new link : version feature matrix  or something more precise in english?

Thanks for your collaboration,

Bernard

In reply to Bernard Boucher

Re: Activity Locking v3 or v2 for testing only

by Alvin Shaffer -

Bernard

I threw up a quick page to see if we can make it work better than the forum.

Activity Locking

I will have to give it some thought as to the layout but please add to it all you can.

Thanks

 

 

In reply to Alvin Shaffer

Re: Activity Locking v3 or v2 for testing only

by Simon Williams -
This is much appreciated - We have been following the forum but are not technically savvy enuf to contribute or quite understand where things areat for AL.
-S
In reply to Alvin Shaffer

Re: Activity Locking v3 or v2 for testing only

by John Gschnaidner -

Hi Alvin,

a short explanation to my version/hack:

I have been using a later version of Activity Locking (I think it was 1.5) with Moodle 1.5.3.
That version had all features enabled: Lock, with hide, delay time and checkboxes.

When I got version 2.1 it would not work proper. I've got some error but no lock. After I changed some coding I got lock and checkboxes working. What I use most 'lock and hide' as well as the delay time were still not OK.

I have not learned to program PHP, but I am pretty good in analyzing logical matters. By checking the code of 1.5 against 2.1 and using the debugger mode I finally got 'hide' running. Additional I changed a few things to make AL running with 1.6 (which I have been testing at the same time).

AL v3 has been developed parallel, which I had not been aware of. blush

The major problem of this mix-up is, that this moodle extension seems to be not really maintained by a group or a single person. thoughtful Stuart works on it from time to time, but the phrase "Somebody else may look into the problem" shows a bit to often (no offense - I am also to busy to often wink).
Open Source needs also to be maintained. It is great, that many people have such good ideas, but without coordination or sorting, things may get a bit mixed up.

Apologies to anybody, who has got headaches over my contribution.
I will try better next time. big grin

Regards to everybody
John

In reply to Bernard Boucher

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
I have just tested Bernard's 2.1 activity locking for 1.6 and can give my first report. I set an activity to be dependent on completion of two other activities. I set it to be visible, but no prerequisites and no completion to be shown. It locked it until the activities were completed, but it showed the prerequisites, which it shouldn't have done. I've added this information to the docs page.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by Bernard Boucher -
Hi Nicole,
               the version I posted is only an adaptation ( from 1.52 to 1.6 ) of Stuart 19 october 2005 version.  I choosed it because : AL v3 is not finished and it did'nt work very well on 1.5.2. And I did'nt test all the versions available around!

That old version ( 19  oct ) is the one I used last semester with 1.5.3.  I just notice that, as your post stated,  not all the combinations of  the 3 parameters work fine on the original version too.

When the table in Moodle docs will be completed  then it will be easier to choose the best working version to upgrade and/or to debug for 1.6.

Thanks for testing and reporting,

Bernard

In reply to Bernard Boucher

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
Bernard-I liked the October 19 version too but I thought that version had topic locking, or am I mistaken? Your new version doesn't seem to have topic locking. Is there any version for 1.6 that has topic locking (with hiding the topic, if possible, when locked)?
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
Things have gone bad with Bernard's version for me. It seems to work with already existing locks, but newly created locks are simply not working. I think I am going to abandon it, remove all locks, and start over with John's (Jon's?) and see how it works. Is Chardelle's June 26 version based on John's June 23?
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by Chardelle Busch -
Picture of Core developers
Yes it is Nicole,

I believe that I just tweaked a couple of things, like the mysql.txt file so it works to import.
In reply to Chardelle Busch

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
Hi Chardelle-I just installed your version. I have a couple comments. I like the way it works when I do loginas a particular student. Makes testing it faster. I have encountered two problems so far. The fact that the activity locks and settings are in separate tabs are a minor problem. When I save an activity lock, it is implemented immediately, without me first having a chance to do the settings. The other problem involves prerequisites. When a student clicks on a locked item that has a prerequisite, they are shown:

This activity is currently locked!

Exercise 1

In this case, Exercise 1 is the prerequisite, but there is nothing saying that.

Finally, there is a small problem that might confuse some people with the language files. All of the files, including the help.php file, are in a folder called help. This folder should probably not exist at all and instead put the files in the en_utf8 folder directly.



In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
Another potential problem, for those who aren't careful, is the fact that the possible dependencies listed for a module include itself.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
I'm stuck. Even if students fulfill the prerequisites, if those prerequisites were created recently the locked module will not unlock. I've tried everything. I compared everything in the database to working locks. I've got all the module settings the same. I even changed the dates of the modules because it seemed that the relative dates the modules might have been created could be behind this. Nothing works. I don't know what to do. Has anyone had any luck creating conditions using recently created prerequisites?

Edit: My problem I think stems from the following line in moodlelib.php:

$gradefunction = $module->modname."_grades";

II am trying to create a lock based on an assignment grade, and since there is no table assignment_grades, it won't work.

Anyone want to fix this?
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
I meant to say locklib.php.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
The assignment issue is an issue, but it is also that any new modules I have added cannot serve as the lock.  I created a quiz as the lock, and it still didn't unlock. I'm going to be now. Maybe someone will have solved this before I wake up again.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only

by N Hansen -
Yes I am really going to bed this time. sleepy But I just noticed something that might be significant. There is a field called visible and one called visibleold now in 1.6. I don't know why there is this new visibleold, but I wonder if this has something to do with the problem.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only (A FINAL PLEA)

by N Hansen -
I give up. This is NOT working. If the locking (not the locked) module has been created since the upgrade to 1.6, your students will never be able to unlock the module. I'm not pinning my plans on this anymore until it gets developed in a proper manner. I was planning on opening my course to the public this week and unfortunately we have unexpected personal expenses these days to cover so I just need to move forward as is and forget about this for now.

I hate to rant like this, but the development of this feature has been Moodle at its worst and perhaps at least maybe something can be learned from it about how NOT to do development. It's been one step forward, two backwards all the way, primarily because of the total lack of version control. The last time any action happened on activity locking in Moodle's CVS was nine months ago, and that isn't even the same version I was aware of 9 months ago. It's been more than a year, maybe two years in development, and it still is not working. Even if it didn't have all its features, at least I would expect some basic aspect to be working.  But it doesn't. And since everyone has their own personal version(s) one can't even safely "upgrade" to a new version without possibly breaking what was already working. There's no easy way to see what works and what doesn't. If one has a slightly different version of the files hacked for locking in their moodle than the ones that are included in the locking package, then one has to weed out what is part of locking and what isn't and then hope it will work. When one has one's own customizations to those same files it gets even worse and there is lots of room for human error to be made to break locking when there may not be the error of the code itself.  And since the table fields used and their names seem to change from version to version, one has to throw out all ones' locks and make new ones every time. The  activity locking  pages in the docs is simply a source of more confusion: links that allegedly lead to ZIP files that are actually links to discussions with no ZIP files, a mysterious table of features with cryptic abbreviations and broken layout. We wouldn't be in a predicament with a need to sort out all this confusion if there were simply one version, would we?

We don't need a wiki, we don't need 31 flavors of activity locking now. I'd be happy with ONE working version, with the barest of features. Please, put ONE version in CVS, any version will do at this point as none seem to actually work, and then everyone work TOGETHER to focus on getting that one working. Make sure that any changes to the Moodle core are also reflected in those files. Maybe we can even ask for a category for activity locking to be added to the bug tracker so problems can be identified and fixed in an organized fashion. Enough of strangely named and encoded ZIP files without any indication what version of Moodle it works with, enough of changes that aren't made explicit (as would be the case with CVS).  Enough of buggy versions being abandoned by their developer for weeks at a time leaving everyone in the lurch to start multiplying their own fixes for it exponentially.
 
I'm getting off my soapbox now, but if anyone has a solution to the problems I posted last night, I'd be happy to hear them. Otherwise, until some order is imposed through CVS, I'm not going to bother with this anymore. The effort is not worth the returns.

Think about it, wouldn't it be nice to get this working once and for all so that when Moodle 2.0 rolls around and the core Moodle team gets to developing conditional activities they could use the already existing code instead of starting from scratch?
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only (A FINAL PLEA)

by Chardelle Busch -
Picture of Core developers
WOW Nicole,

Believe me, I know the frustration that comes from tweaking Moodle core with add-ons.  It usually helps to just go to bed.  Ok, here we go.

1. There is a lang string you might want to change like this:

$string['activitycurrentlylocked'] = 'This activity is currently locked. You must complete the following prerequisites first:';

2. I moved the lang file out of the help folder--oops.

3.  I've just tested this again, I created a new online assignment.  I locked a certificate based on the assignment grade, logged in as my test user and it worked just fine. 

4.  Did you first delete any old locking tables from your db?  You might need to do that.  Or, it might not be working if you are just testing loggedinas.  Try it with a real login. 

5.  Just to be clear, the zip I posted is NOT "my" version.  It is a version that Stuart Mayor volunteered his own time to develop.  I believe he is unable to allocate any time to this right now (And it takes an unbelievable amount of time as you should know).  Until Martin decides to allocate some time to get conditional activities into the core, we will just have to do with what we have and let him know what features we would like to see in Moodle 2.0.
In reply to Chardelle Busch

Re: Activity Locking v3 or v2 for testing only (A FINAL PLEA)

by N Hansen -
Believe me, I know the frustration that comes from tweaking Moodle core with add-ons.  It usually helps to just go to bed.  Ok, here we go.

I did go to bed, as I know I am always in a more pleasant mood in the morning, but my last post was posted in the morning, so my feelings about this lasted overnight. My complaint is not about having to tweak things, as if I want something to work a certain way on my own site, it is up to me to tweak it myself even if it is frustrating. My comments were regarding the development process that this feature has gone through.
 

1. There is a lang string you might want to change like this:

$string['activitycurrentlylocked'] = 'This activity is currently locked. You must complete the following prerequisites first:';

I can do that, but that is a minor issue.

2. I moved the lang file out of the help folder--oops.

3.  I've just tested this again, I created a new online assignment.  I locked a certificate based on the assignment grade, logged in as my test user and it worked just fine. 

Doesn't work for me. And I don't see anything in the way the code is worded that would allow it to support assignment either because there is no assignment_grades table, only assignment_submissions. It seems to have worked last year when I first tried it. I even posted something about it then so it must have worked then, but I'm not sure if I just thought it worked then.

4.  Did you first delete any old locking tables from your db?  You might need to do that.  Or, it might not be working if you are just testing loggedinas.  Try it with a real login. 

I've done both. The old locking stuff wasn't really a problem though because the tables had completely different names in the version I had used previously. But in any case, based on my experiments with Bernard's version before switching to this version, I suspect Bernard's was having the same problem. Pre-existing modules can be unlocked, new ones can't. I've studied the tables in the database in detail. The only thing that distinguishes the records is that some were created after I upgraded to 1.6.

5.  Just to be clear, the zip I posted is NOT "my" version.  It is a version that Stuart Mayor volunteered his own time to develop.

But that is part of the confusion, what version is what? I don't care who developed it, but it would be more helpful to know what its "parent" is in terms of what version it builds on, because sometimes the table structure is very different even.

The only thing left that I haven't really sorted out that could be causing problems for me is group modes. I tried making some changes to see if it helped but not in a systematic manner as I wasn't sure what I should be trying. What are they set to on your site for your course as a whole and the individual modules?

The way I want to use this (to include three units in a single course and give students access to the units based on what they paid for), I can't afford to have it break in the future if I upgrade and so for the time being I have backed up unit 2 and 3 and restored them to new courses instead. I'd been using activity locking also for some unit specific accesses but I can always tell students not to look at things or start things before they should if I have to-it's just a hassle to have to remind students when they will be enrolling on a rolling basis. It's like herding cats.
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only (A FINAL ANSWER)

by Chardelle Busch -
Picture of Core developers
>>I don't care who developed it<<


And obviously therein lies the problem.  It's always much easier for people who volunteer their time to help when people come across as appreciative.

It it works, great, if not, too bad.
In reply to Chardelle Busch

Re: Activity Locking v3 or v2 for testing only (A FINAL ANSWER)

by N Hansen -
Chardelle-You misunderstand me and took my comments out of context. In terms of naming conventions yes, I don't care. I want to know what is version 1.2, 1.3, 1.4 etc. Version Chardelle, version John tell me nothing. Meaningful context is all I am asking for. I appreciate the work people do, but it would save everyone, including those who are doing the development work and those of who are testing it, a lot of time and produce more useful results, if file naming conventions were followed. Look at the discussions about this module-and you will notice that an inordinate time has been spent trying to figure out what version is what and what version does what. I don't say these things for my own benefit, but for everyone's, including the developers. 
In reply to N Hansen

Re: Activity Locking v3 or v2 for testing only (A FINAL ANSWER)

by John Gschnaidner -

Hello Nicole,

I am sorry about frustration and things, but ...

Currently things are on the way to get sorted in Moodle Docs.
Please understand, that not all of us are real software genius and are not working on Moodle fulltime, but spending their free time on this.
I, for my part, do not have the time to spent every day on this, since I work in my real job more then 40 hours every week.

I changed some of the coding of AL 2.1, because it did not work for my needs any more and at the time, there had been little activity around this add-on. Chardelle has been one of the few, I could talk to. I shared my code, because it is difficult to do debugging alone, and she had similar problems with the newer version. Then I had spare time for this; at the moment I have none.

I hope I find the time within the next two weeks, to do further debugging and to fill my gap in the Moodle Docs.

So, I would like to ask you for a bit more patience.

Regards to everybody and thank you, for your understanding

  John

In reply to John Gschnaidner

Re: Activity Locking v3 or v2 for testing only (A FINAL ANSWER)

by N Hansen -
John-I understand your perspective. But development is a two-sided process-coding and testing. I've spent a lot of time over the last two weeks filing many bug reports about 1.6 in the bug tracker while working on my site, even about features I don't plan to use myself or could implement a simple fix on my own site and not bother to report, in order to help the coders fix them. I didn't have to do that (and kept getting the complaints of my husband about why I wasn't starting my business and kept visiting Moodle when he saw the orange on my screen instead of blue). But there was a clearcut process of reporting, fixing and getting the fix back out of CVS and so there was a clearcut benefit to myself and Moodle if I did so.

I don't have to test this. I could leave it to others and just wait for the stable version to come out and use it-that's what most Moodlers do (remember there are 1000s of Moodle sites). But for those who want to spend our time testing this to help you out (while working too), our work would be made easier and more meaningful if there were some sort of clear cut version control (and I am sure yours would too). I have this vague memory (and it might not actually be about activity locking in reality) of starting to investigate activity locking about a year after it started and asking a question and being given a rather curt and useless answer that assumed I had been following the discussion all along. It was frustrating to get an answer like that, but I perservered to this point, but I'm sure there are many many others who would simply have given up at that point and their voices naturally remain silent (and research shows that something like 97% of unhappy customers simply leave without complaining and hence giving constructive criticism that could help a company or whatnot-so I am sticking my neck out to be chopped off by you guys as the 3% in order to help you). More Moodlers would be able to test this and give you helpful feedback if we didn't have to read a novel of previous posts and decipher the history of the module just to be able to install the right version and to be able to know what features to expect from that version.  It may simply be metadata, but it is really crucial metadata.
In reply to Chardelle Busch

Re: Activity Locking MoodleDoc Page

by Chris Collman -
Picture of Documentation writers
 I tried to create a list of all the AL form posts of zip and tweak files.   http://docs.moodle.org/en/Talk:Activity_Locking

Think others more familiar have a good idea of the lastest flavors for 1.5.x and 1.6.x .  I have to run to my other job so I wanted to make this quick post smile .   Chardelle, John and Alvin and others, may  have their own lists, here is my attempt at public one.  

My suggestion is that somebody more knowledgeable than me, use the article page to indicate the most current matrix with brief descriptions of the flavors.    That would include Stuart's v 2.1 for 1.5 and 1.6.  Stuart's v 3.0 for ??? and David's v ?? for ??? .  Not to leave out John's spin on Stuarts v 2.1 for 1.6.   

I am interested in AL to make a certificate based upon completion of lessons and quizzes.    Hope this grunt work helps.   Chris
In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by Alvin Shaffer -

John,

Do you have any plans to add topic locking to your version of Activity Locking?

In reply to Alvin Shaffer

Re: Conditional activities: Activity Locking v3

by John Gschnaidner -

Hi Alvin,

I plan to do it, but I can't tell for sure, if I find enough time to look into that matter. But I hope, I can finish it within the next two weeks.

Regards

  John

In reply to John Gschnaidner

Re: Conditional activities: Activity Locking v3

by N Hansen -
Can I just make a suggestion? Why don't we try and pick one version to get everything working in it? If John's is mostly OK, then we select that and everyone tries to get the other features working in that. Rather than keep it on one's personal computer, it could be stored in CVS and then all the people working on this could contribute towards getting one good functioning version. I have a feeling that a lot of the confusion and lack of progress on this feature has been due a lack of coordination, indecisiveness and a lack of centralized cooperation on a version. Don't get me wrong, this is a great feature, but every time Stuart finishes a version he seems to toss it out and start a totally different one that doesn't build on the last. I don't know if this is for good reason or simply because he is one of these kind of persons who is never happy with their work. Some control of the chaos needs to be implemented. The wiki is a first step, but that should be done with the idea in mind of concentrating efforts on getting a single version created that does everything that we would want it to do. Pick a version, stick with it, even if it means integrating features from other versions. It's better than trying to reinvent the wheel every time.
In reply to N Hansen

Re: Conditional activities: Activity Locking v3

by Munckfish _ -
IMHO this is a hugely valuable missing feature in Moodle, if development really has been going on as long as stated in posts above then I think it's time for some discipline, otherwise we're all wasting our time, developers, beta testers, everyone.

Please

1. Source control
2. Version planning
3. Work together

PS. This is Open Source so I don't see the point in making an excuse about having a day-job. To me it seems even more important to be organized otherwise we are wasting valuable free-time.
In reply to Munckfish _

Re: Conditional activities: Activity Locking v3

by Michael C -

I have to agree.  1.6 was supposedly a dead end, now there's 1.7 and 1.8 is in the works.

I understand that this is open source as well, BUT if you (developers) want Moodle to be the one source that schools are looking for you MUST join forces with the developers of add-ons in order for this to work out.

Activity or Score locking is a neccessity to any school.  How can you NOT have this ability, teachers need to control when students can advance to other lessons or there will be chaos.  I had that problem of students jumping ahead, I have an open enrollment and students were just going to the end to try to get a certificate of completion without even doing any of the work.

Activity or Score locking will prevent this from taking place.

PLEASE GET THIS TO WORK!

In reply to Michael C

Re: Conditional activities: Activity Locking v3

by Timothy Takemoto -

As you know, there is quite a long history to the activity linking debate.
Moodle is slowly moving towards activity linking in Moodle 2.0, I think.  

However, it has also been argued that activity linking is, while in demand from some teachers, not necessarily a requirement when using more learner centered, social constructionist pedagogy upon which Moodle is based.

I agree with your appraisal of the popularity of activity linking but I am not sure that Moodle puts popularity above all things. If it did then it would be convenient for some of us, but the admixture of idealism is also attractive.

Timothy

In reply to Timothy Takemoto

Re: Conditional activities: Activity Locking v3

by Rick Barnes -
Can you explain what you mean by activity linking?

I know that in our school many of the staff would welcome activity locking to prevent pupils rushing ahead in a course, (what do they do when they finish???) we don't use completion certificates we assess the work they submit so that part is not an issue if they don't do the task they don't get any credit.

Personally I don't mind them working at their own pace (it may even be good for them wink )
What I have been trying to use activity locking for is to guide pupils through specific routes, either based on quiz scores where possible or on teachers marks or even pupils voting in choices.
This woul allow me to personalise the pupils learning by offering more or less support depending on pupils abilities or allowing them to choose different levels to atempt based on self assessment ot to select the context of their tasks based on choices.

I know these things are possible in lessons but I haven't found a way to build our assessment into lessons yet. If I could build an adaptive lesson that allowed different pupilsl to access different contexts or different support materials for task then I would happily work that way but the way we currently build courses seems much easier than the few lessons that I have tried to build in the past.

Rick
In reply to Timothy Takemoto

Re: Conditional activities: Activity Locking v3

by Michael C -

Though I do have some computer knowledge, I find it quite difficult with some people terminology on how to do something like activity locking by creating links and using certain modules.

It would be a BIG help if explanations of how to do tasks within Moodle could be written in laymans terms where anyone can understand how to do these things.

I have tried using Journals and other forms for creating classes, while trying to teach my teachers how to use Moodle.  We've just decided that with activity locking, we'll just create web pages to teach students.  We put reports down, chat sessions etc. . . to get our students more interactive.  With the activity locking they have to send in reports, get graded on other areas and such.

So if we can't get activity locking soon, can someone help us non-techies with the terminology on how to use Moodle the way it's designed to be used?

Rev. Michael

In reply to Michael C

Re: Conditional activities: Activity Locking v3

by misty moodle beginner -

rumour- 1.7 has locking and certificates? if so i should wait until fantastico updates?

if not i have 1.6.3 that just updated. i have no activity locks yet but don't know what one to start with! I need them and certificates (which i got working before- so i am sure i can again) but i want to get the locks working first.

In reply to misty moodle beginner

Re: Conditional activities: Activity Locking v3

by Chris Collman -
Picture of Documentation writers
Yo Misty,
There is a version of Certificates that works in 1.7 .

I was scanning this forum to see if we have any version of activity locking that will work with 1.7 . I keep checking MoodleDocs both Activity Locking page and Score Lock but nothing so far.

The only alternative I know of (remember I am a bald headed guy) is for those who use lessons. There is a dependency setting in Lesson settings. I have posted this before. Essentially create a lesson, say with questions in it, that will be the conditional activity. The next lesson will be dependent upon the student "passing" the first lesson. In the second lesson contains a link to the certificate for course completion.

There is some interest in the how to do this another recent post. So I will revisit my notes and 1.7 local host and work it out again. Then I will figure out where to put the step by step in MoodleDocs. I will try to remember to post a new thread in this forum with some catchy title like "Using Lesson dependency and Certificate links"


In reply to Michael C

Re: Conditional activities: Activity Locking v3

by Chris Collman -
Picture of Documentation writers
Hi Rev. Michael,
Wow your post covers quite a bit of ground. I hear some of your frustration.

Are you using MoodleDocs at all? Forums can be really technical sometimes and following threads (like this one, with all due respect to others) is not easy. Of course it depends upon users like you and me to start and keep the ball rolling. For example: I don't use Journal and I discovered there is not a MoodleDoc page called Journal. Interesting. You may notice that there are lots of pages on Lesson features. I did spend a little time on Score Lock which is similar to Activity locking.

Another typical Moodle quandry is the "Show me examples" vrs "Tell me how it works" . This similar to "different learning styles", with a dash of "everyone uses Moodle differently". We all have the same car, I only go to the store, you use it to carpool, and our friend Martin has tinkered with his and races it on weekends at the local track. My blunt opinion, Activity Locking is a race car function at the moment, it is not part of a standard Moodle (unfortunately).

I have been looking for the work I did in linking (gasp I have over 12 flavors of Moodle stashed in several physical locations) and my intent is to create a page, or add a description someplace in MoodleDocs. Just to be clear, the linking here involves standard internal html kinds of links with a standard Moodle feature in Lesson that creates an effect that is similar to a "conditional activity'. Hot rod effect from the standard production model.

I hope this helps. I am still looking.

In reply to Stuart Mayor

Re: Conditional activities: Activity Locking v3

by Deon Metelski -
Hello all,

Excuse me for my ingnorance but I have been trying to follow and sort out all the postings here.

If I may ask for clarification, Stuart's V3 attached above is intended for which version of Moodle?

I see people have been trying to modify this for 1.6 so that is why I am asking.

Thanks,
Deon