To make it easier, I have created a new course format called Activity Locking. This requires no hacks to course files. Unfortunately, you will still have to hack your lib/moodlelib file, but it is very easy to do.
Instructions
1. In the zip you will find the AL block. If you already have it installed, you do not need it, it is the same block as before. If you have never installed it, add the folder under the blocks folder called Activity Locking to your moodle/blocks folder. Then click on Notifications to install.
2. Copy the folder called locking under course/formats to your moodle/course/format folder. (If you currently have AL installed, you can safely delete the lib/locklib.php file, the lang file, and the course/lock.php file, and any added icons--they are all included in the format--be sure to get a new clean copy of the course/lib.php file for your moodle version!!.)
3. Open your moodle/lib/moodlelib.php file (DO NOT use a moodlelib file from one of the AL files, use the clean copy for your Moodle version!). Go to about line 1975 under the function_require_login AFTER this code:
/// If the site is currently under maintenance, then print a message
if (!has_capability('moodle/site:config', $sysctx)) {
if (file_exists($CFG->dataroot.'/'.SITEID.'/maintenance.html')) {
print_maintenance_message();
exit;
}
}
paste in the following code here:
//Check to see if Activity Locking criteria have been met
require_once($CFG->dirroot.'/course/format/locking/locklib.php');
global $cm;
check_locks($cm);
4. Go to your course settings and choose the Activity Locking format (I made this using the topics format, so that is what you are stuck with for now.)
Now, go to your course, turn editing on and you will see your lock icon after each activity. Using it is the same as it always was.
If somebody is running a test site (Chris???) please test this, I put it together rather quickly.
Re: Conditional activities: Activity Locking course format
Sweet.
I will be happy to give it a go.
This format is for 1.9.x, right?
-- Art
Re: Conditional activities: Activity Locking course format
Does anyone have activity locking working (stable) with Moodle 1.9.10+ (Build: 20101206) ? If so, can you please provide instructions? I'm new to Moodle and trying to learn as much as I can.
Thanks,
Re: Conditional activities: Activity Locking course format
I would like to know how to get this to work too! Earlier versions contained files that weren't in later versions. If I need to upload those to make it work in 1.9.10 I would like to know!
Re: Conditional activities: Activity Locking course format
Hey Deb,
I found another thread that might be useful for us:
http://moodle.org/mod/forum/discuss.php?d=165504#p725446
Let me know if you get things up and runnning and I'll do the same!
Re: Conditional activities: Activity Locking course format
No, I have tried all these things and nothing worked. I got the padlocks at least once I turned off Ajax, but when I tried to lock some items, I always got "There are 0 locks in this course." I think some files were omitted from the later versions, and since I only tried to install it with the 1.9.9 and 1.9.9.1 versions, they were never loaded to the site. But I cannot verify this is the problem, and I don't want to just blindly load stuff for fear I could do some real damage.
If anybody knows the answer, we could use a bit of help here! The earlier versions of AL include:
lib folder: deprecatedlib.php and locklib.php
lock.php to go in the lang folder
images to go in the pix/t/folder
course folder/ lib.php, lock.php, and section.ock.php
I don't think any of these files are included in the later versions that I have tried to get to work.
Re: Conditional activities: Activity Locking course format
I'll give it a test run over the weekend and get back to you.
The instructions are very clear to follow - well done.
Chris
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Thanks Chris and other testers. Please report back and let us know how it goes and what version you test it on.
Re: Conditional activities: Activity Locking course format
Has anyone tried this on the latest build of 1.9.5. That is what we plan to try. Wow. This would be awesome. Keeping my fingers and all my toes crossed!!!!!
Re: Conditional activities: Activity Locking course format
I have developed a split personality due to budget cuts. Right now I am floundering around in a different pond with a bunch of alligators. In my current context, "A.L." is in my priorities but low on my next alligator to wrestle list. However in the other pond that I will be in on Monday, I will be looking forward to testing out "A.L." and reporting back.
Did I tell you that I tried to follow instructions you gave me before but they didn't work for me. I had print outs of your email, the old and the new file open at the same time, numbered the 6 different changes I thought were required, carefully tried to copy and paste and note. However, I am pleased to report that in both ponds, what ever version of AL that is there, is behaving itself just enough not to crash anything (I think).
Thank you for all your efforts.
Chris
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
-- Art
Re: Conditional activities: Activity Locking course format
Thanks for the quick reports and feedback.
a gold star for everybody !
Re: Conditional activities: Activity Locking course format
So, here is version 2 (2009070405).
Wonderful screencast Mary. Very helpful. One thing to note, when you click on the locking icon for an activity, you can set two things--1) criteria to be met before a student can access that activity and 2) criteria to be met to show that activity as being completed. At the top of the page you will see all other activities in the course. Choosing anything there will lock that activity with the criteria you set for those activities. If you choose the setting Show activity prerequisites, you will see locks BEHIND the locked activity showing the requirements, and green checks after they have been met. Right above the settings you will see the Activity Completion section with the activity you are locking. By setting something here, your students will see an open box in FRONT of the activity when incomplete and the green check once the Activity Completion requirements for the activity have been met.
Re: Conditional activities: Activity Locking course format
Chardelle -
I followed the instructions. After the databases were successfully created, I lost my template! All formatting, text, colors, etc. were lost. Any ideas on this one?
Re: Conditional activities: Activity Locking course format
More data...
When I replaced my backed up version of moodlelib.php, all was well. I was able to login (as I wasn't able to reviously), and the theme returned.
I am using 1.9.5+
Re: Conditional activities: Activity Locking course format
Never was able to log in, so I got no indication that the database had been updated.
I wonder if I pasted the moodlelib.php patch into the wrong place.
-- Art
Re: Conditional activities: Activity Locking course format
Not finding the style sheet, I guess.
When I replaced moodlelib.php with the original version, all was well again.
Hope that helps.
-- Art
Re: Conditional activities: Activity Locking course format
Seems to be working fine.
-- Art
Re: Conditional activities: Activity Locking course format
2. If your style is messed up, is it also messed up in a course that does not have the Activity Locking format?
3. Do you have debugging turned on? Any error messages?
4. If you have access to db, do you have the course_module_locks table and 4 new fields in the course_module table:
delay, checkboxesforprereqs, checkboxforcomplete, visiblewhenlocked
Re: Conditional activities: Activity Locking course format
I am attaching a screen capture of the course module locks table. Please check your messages for more.
I hope that helps!
Thanks,
Art
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
thanks for the great work. It just works fine on my 195 installation.
Just one Hint: There is a problem with the Menu Block: Although you course format is based on topics, the Navigation Links in the Menü Block points on a weekly course format.
i.e. with your course format a link looks like
http://www.ofsb.de/course/view.php?id=2&week=1
but in a themebased course format it should be
http://www.ofsb.de/course/view.php?id=2&topic=1
so sadly: the Navigation with the Menu Block does't work...
any ideas? and tahnk you very much,
Thomas (Michalak) from Berlin
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
i use 'Menu Block (menu_site_and_course)' (http://moodle.org/mod/data/view.php?d=13&rid=1216%22%3Ehttp://moodle.org/mod/data/view.php?d=13&rid=1216).
Thank you, Thomas
Re: Conditional activities: Activity Locking course format
I just looked at that block. Yikes, with debugging on it throws up a few notices. However, to fix the problem, find this line in the main block file:
if ($this->course->format == 'topics') {
and change it to
if ($this->course->format == 'topics' or 'locking') {
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
if ($this->course->format == 'topics' or $this->course->format == 'locking') {
Re: Conditional activities: Activity Locking course format
With the activity locking format you will NOT be able to add the Section Links block to the course because of this line (around line 24 in blocks/section_links/block_section_links.php):
function applicable_formats() {
return (array('course-view-weeks' => true, 'course-view-topics' => true, ,'course-edit-weeks' => true, 'course-edit-topics' => true));
}
Reason - for the section_links block to appear as an option (in the BLOCKS>>>ADD) it needs to make sure that the course format can acutally support sections (makes sense).
To fix - add the BOLD to above:
function applicable_formats() {
return (array('course-view-weeks' => true, 'course-view-topics' => true, 'course-view-locking' => true,'course-edit-weeks' => true, 'course-edit-topics' => true,'course-edit-locking' => true));
}
This hack tells section_links that this course format (activity locking) has sections.
Ken
Re: Conditional activities: Activity Locking course format
I added activity loking format in course format for my moodle 1.9.5(stable).But my problem is if i lock activities students can view them .Locked activities are showing activity complete and prereuisite complete even if student view them before .I am using activities as scorm for course content and lessons for assessments.Please can u tell me what should i do.
/// If the site is currently under maintenance, then print a message
if (!has_capability('moodle/site:config', $sysctx)) {
if (file_exists($CFG->dataroot.'/'.SITEID.'/maintenance.html')) {
print_maintenance_message();
exit;
}
}
/*i added code here*/
//Check to see if Activity Locking criteria have been met
require_once($CFG->dirroot.'/course/format/locking/locklib.php');
global $cm;
check_locks($cm);
/*till here*/
/// groupmembersonly access control
if (!empty($CFG->enablegroupings) and $cm and $cm->groupmembersonly and !has_capability('moodle/site:accessallgroups', get_context_instance(CONTEXT_MODULE, $cm->id))) {
if (isguestuser() or !groups_has_membership($cm)) {
print_error('groupmembersonlyerror', 'group', $CFG->wwwroot.'/course/view.php?id='.$cm->course);
}
}
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
As for AJAX, it requires javascript functions to show the editing icons and I don't really want to go that far.
However, this is for the editing icons ONLY. So, you cannot edit the locks if you have Disable AJAX course editing turned off. You still should be able to use forum ratings. And you could still use ajax course editing once you have the course locks all set up.
Re: Conditional activities: Activity Locking course format
Let me clarify - we can use forum ratings but was told with AJAX enabled you could rate/reply in one step as we do on this site. Otherwise it is a two step process but maybe those settings are controlled elsewhere? That would really be a time saver.
Re: Conditional activities: Activity Locking course format
I still seam to have this roles issue where the admin and teacher have to adhear to the locks
1.9.7+
AL format block version 2 - 2009070400
Re: Conditional activities: Activity Locking course format
I have a Problem with this AL course - and its really urgent.
I allready created another thread here.
The problem is that when I try to change the activity lock settings - they wont save. It probably has something to do with tables...
I allready posted the error message (from the debug mode) but I dont know what to do now.
Just wanted to point some attention on my thread
Thanks everyone for their afford.
Re: Conditional activities: Activity Locking course format
This version fixes the "teachers can't access locked activities" problem, and also fixes the locking on forum posts problem.
Re: Conditional activities: Activity Locking course format
Doing a project where Flex page is the best course format, but activity locking is required also.
Thanks everyone!
Re: Conditional activities: Activity Locking course format
You need to look for "AMFPHP" with moodle in moodle docs along with complete understanding on Activity locking mechanism (you need to do this part by reading code as no live official source code or documentation exists till now for this purpose)
http://docs.moodle.org/en/Development:AMFPHP
^ ^ sorry no gui editor in my present weird test browser.
All the best
~ ~ ~ Peace - Ravishankar Somasundaram ~ ~ ~
Re: Conditional activities: Activity Locking course format
I had no idea I could write Flash apps to work with Moodle. That could come in handy some day.
I was actually looking for some help on using Activity Locking with the FlexPage Format
from Moodlerooms. Sorry I didn't put the link in my first post. I usually use a Web-kit browser without access to the GUI editor to insert links.
Sorry for the confusion, and thanks for the response!
Andy
Re: Conditional activities: Activity Locking course format
The latest version of locking that you attached (04-23-2010) solved the issue I had with instructors not being able to view "locked" quizzes.
But.....if an instructor tries to edit (update a quiz question) in that "locked" quiz they still are not given access.
Ken
Re: Conditional activities: Activity Locking course format
I just noticed this post. I rewrote the locking code. Please try this locklib file and see if it works for you--activities are now shown as completed for teachers, so editing shouldn't be a problem.
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Hey Chardelle,
Sorry for the delay in responding. Tried the new locklib.php you posted 5/10/2010 and have the same issue. As an admin (I can edit all locked items fine), but when I "login in as" the teacher in the course, I still cannot access locked items (assignments, quizzes) and get the standard "this item is locked you need to complete pre-requisite ABC before.....opens".
Ken
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Much closer - but not quite.
Here are the steps:
- "login as" instructor
- Clicked on a "locked" quiz (they need to first open docs A,B,C)
- Quiz opens (good - I wasn't getting this far before)
- Select Edit Tab - see the 10 quiz questions (all good)
- Try edit question#1 and get the "this activity is locked...."(no good)
Switch back to admin role and can complete without issue - so admin is ok, just not teacher (or at least "logged in as" teacher).
Without the locks the teacher can edit the question fine - so there is some buried permission that isn't quite getting set right.
Really appreciate the help.
Ken
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
YOU GOT IT - fixed the issue.
Can now edit all the way through as "instructor".
Ken
Re: Conditional activities: Activity Locking course format
Got the latest other ones posted here , display.php and locklib.php in place and it now seems happy with my upgrades.
Need to test some still, but the install went good. The youtube videos were wonderful. Only thing better would be a new whole packaged zip.
Thank You Chardelle and testers here.
Re: Conditional activities: Activity Locking course format
Notice: Undefined index: time in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Trying to get property of non-object in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Undefined index: time in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Trying to get property of non-object in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Table 'meckmoodle.mdl_' doesn't exist
SELECT * FROM mdl_ WHERE id IS NULL
* line 686 of lib\dmllib.php: call to debugging()
* line 481 of lib\dmllib.php: call to get_recordset_sql()
* line 421 of lib\dmllib.php: call to get_record_sql()
* line 172 of course\format\locking\display.php: call to get_record()
* line 215 of course\format\locking\format.php: call to locking_print_section()
* line 227 of course\view.php: call to require()
My database is missing some 'time' field or a whole table? Without setting a time period, it seems to work.
Re: Activity Locking course format Email notifications
Thought I'd share this idea here, maybe someone can put it to use. I had to customize the Activity Locking course format so that it would send emails to students to notify them each time a previous activity that was locked is now unlocked.
See the changes in the attached file, locklib.php. The only alteration I made is between lines 103 and 159.
The new code I added is very basic, expensive and very awkward - I only recently begun playing with Moodle . Nonetheless, it explains the logic and it works, and there are definitely much better and cleaner ways to do this.
What an awesome plugin this is!
Re: Activity Locking course format Email notifications
Re: Conditional activities: Activity Locking course format
I am getting this exact same error that John reported in July of 2010.
Notice: Undefined index: time in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Trying to get property of non-object in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Undefined index: time in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Notice: Trying to get property of non-object in E:\Inetpub\wwwroot\meckcares_moodle\course\format\locking\display.php on line 172
Table 'meckmoodle.mdl_' doesn't exist
SELECT * FROM mdl_ WHERE id IS NULL
* line 686 of lib\dmllib.php: call to debugging()
* line 481 of lib\dmllib.php: call to get_recordset_sql()
* line 421 of lib\dmllib.php: call to get_record_sql()
* line 172 of course\format\locking\display.php: call to get_record()
* line 215 of course\format\locking\format.php: call to locking_print_section()
* line 227 of course\view.php: call to require()
Any idea how to correct this? Thanks
Eric
Re: Conditional activities: Activity Locking course format
I was having a problem with my activity lock not recognizing when the previous requirement was completed and not allowing the nest step to continue. I was modifying the moodlelib.php and replaced it. Now I get a long in screen, and then nothing, a blank screen.
I cannot get into my site, how do I correct this?
Re: Conditional activities: Activity Locking course format
I have found this information:
Debugging showed this error" Fatal error: Call to undefined method auth_plugin_manual::prevent_local_passwords() in /home/content/d/e/w/dewayne24/html/moodle/lib/moodlelib.php on line 3397"
That section of this file reads:
/**
* Update pssword hash in user object.
*
* @param object user
* @param string plain text password
* @param bool store changes also in db, default true
* @return true if hash changed
*/
function update_internal_user_password(&$user, $password) {
global $CFG;
$authplugin = get_auth_plugin($user->auth);
if ($authplugin->prevent_local_passwords()) {
$hashedpassword = 'not cached';
} else {
$hashedpassword = hash_internal_user_password($password);
}
return set_field('user', 'password', $hashedpassword, 'id', $user->id);
}
All I did was change the lines, as instructed:
3. Open your moodle/lib/moodlelib.php file (DO NOT use a moodlelib file from one of the AL files, use the clean copy for your Moodle version!). Go to about line 1975 under the function_require_login AFTER this code:
/// If the site is currently under maintenance, then print a message
if (!has_capability('moodle/site:config', $sysctx)) {
if (file_exists($CFG->dataroot.'/'.SITEID.'/maintenance.html')) {
print_maintenance_message();
exit;
}
}
paste in the following code here:
//Check to see if Activity Locking criteria have been met
require_once($CFG->dirroot.'/course/format/locking/locklib.php');
global $cm;
check_locks($cm);
Can someone help tell me what I screwed up and how to correct it?
Thanks so much.
Re: Conditional activities: Activity Locking course format
ok, sorry about the previous two post. I have been able to correct both these problems.
Now I think I have found a bug. I have both a hosted moodle and a local test moodle. I have installed the activity lock on both machines, and they are both acting the same way.
attached is a screen shot of what I have. Number 1 is the first event to be accomplished. After it is accomplished the green check mark occurs in the box. Number 2 is then done. When it is completed you see the check in the boxes for quiz 2 and 3, but it cannot be accessed for quiz 1 which is what should follow. Quiz 1is not allowed to be accessed. Each event is dependant on the one directly above it only. is there a bug here?
Re: Conditional activities: Activity Locking course format
I am having this issue with the non-editing teacher role. Is there any way they can view locked activities? I am running 1.9.7 with all updated AL code installed.
Re: Conditional activities: Activity Locking course format
-- Art
Re: Conditional activities: Activity Locking course format
Now to get the rest of the site launched.
Re: Conditional activities: Activity Locking course format
I got it installed and it looks like it works, but it keeps generating error messages on the Notifications page. (see attached file) I had this problem with my AL hack install and never got an answer on how to fix it, so if anybody can tell me what's wrong I'd really appreciate it!
(Edited by Helen Foster to cut and paste the long error messages into the attached text file - original submission Monday, 20 July 2009, 09:45 PM)
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
I have exactly the same thing – it looked like AL was going to work but didn’t so I have had to take it off.
Let me know if yours works or you get a work around.
Chris
Re: Conditional activities: Activity Locking course format
It is also possible that the conflict is caused by unclean code in some other plugin that you may have installed. Sorry about that.
Re: Conditional activities: Activity Locking course format
And it's working perfectly on my up-to-date installation of Moodle. It's only a problem for me in 1.9.4.
Thank you for all of your work on this (and everything else, of course). I know it's a very big investment of time and energy.
-- Art
Re: Conditional activities: Activity Locking course format
Thanks for testing, and sorry about the problems. The odd thing is that it works fine for me on my 1.9.4 test server(??). So it isn't the version, but must be some other conflict somewhere.
And you're welcome.
Re: Conditional activities: Activity Locking course format
Who knows what weird thing I have done, Chardelle? The possibilities are endless.
-- Art
Re: Conditional activities: Activity Locking course format
But awesome work Chardelle. Thank you so much. Upgrading had been such a nightmare the other way.
Will keep testing and look forward to others input and feedback as well.
Re: Conditional activities: Activity Locking course format
What setting should I have in concerning the AJAX settings in Moodle for this module?
Both set to Disable ?
Enable AJAX
Disable AJAX course editing
Thank you.
Re: Conditional activities: Activity Locking course format
As for ajax, yes, like mentioned above, you will not get the activity locking editing icons if you do not have Disable AJAX course editing selected, however AJAX can be used for forum ratings.
Re: Conditional activities: Activity Locking course format
---------------------------------------------------
Field 'delay' doesn't have a default value
INSERT INTO mdl_course_modules ( COURSE, MODULE, INSTANCE, SECTION, ADDED, VISIBLE, GROUPMODE, GROUPINGID, GROUPMEMBERSONLY ) VALUES ( 7, 18, 5, 3, 1249411425, 1, 0, 0, 0 )
- line 1554 of lib\dmllib.php: call to debugging()
- line 2296 of course\lib.php: call to insert_record()
- line 297 of course\modedit.php: call to add_course_module()
---------------------------------------------------
Apparently this is still an issue that people have worked around? Looking at:
http://moodle.org/mod/forum/discuss.php?d=117815
Is this how I should fix it, give the DB a default value ?
Thanks again for the responses.
---------------------------------------------------
EDIT
---------------------------------------------------
This was indeed a problem for me and the workaround in the other thread did correct the problem. The install script does not provided a default for the column:
ALTER TABLE `prefix_course_modules` ADD `delay` VARCHAR( 10 ) NOT NULL AFTER `added`;
Mine was fixed using the 0:0:0 default mentioned the mentioned thread:
ALTER TABLE `ddtimoodle`.`mdl_course_modules` MODIFY COLUMN `delay` VARCHAR(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0:0:0';
Seems to really be working now
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
I'm running 1.95+ and after struggling around a bit, I have AL installed and working. Thanks!
But, I have two small issues:
1) When I go to moodle / admin I get this error:
Version mismatch: block activity_locking can't downgrade 2009070400 -> 2007101100!
I'm sure that's because I tried several combinations / methods to get Al working. Somewhere along the line I've got a mixed bag of modules. Any suggestions?
2) AL forces me (Admin) to complete the prerequisites too! And I wrote them! Not a big deal, just rather surprising. Maybe this is related to the error message?
Anyway, thanks for the Activity Locking code! I would appreciate any help getting my two issues fixed up.
-- Dave
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
I've uploaded the the second AL zip file and the error message is gone. Thanks! You were right on the money.
But I still have to satisify the locks, even though I'm logged in as the admin.
-- Dave
Re: Conditional activities: Activity Locking course format
Some activities lock you out, some don't, if it is a problem, let me know. Otherwise, just complete the requirements--gives you a chance to test it.
Re: Conditional activities: Activity Locking course format
Thanks Chardelle!
Its not a big deal. I've been working through all of activities.
I do have a question on forums. Is the activity lock for forums satisfied by just looking at a forum or is posting in a forum required? If it's just "looking" then is then I'd like to add to your long shopping list: "Posted message in forum xx" as an activity.
-- Dave
Re: Conditional activities: Activity Locking course format
User must access this activity | |||
User must post in this forum |
Also, a tester notified me that when visible when locked: No is set, the activity is still visible. If you want to use this option, try the attached new display.php file
Re: Conditional activities: Activity Locking course format
Chardelle,
First, thank you for your support. I know how hard it is to keep track of all these conversations. I appreciate it.
I've installed the display.php script in /course/format/locking
No joy. Here's what I see.
Re: Conditional activities: Activity Locking course format
This was our last barrier to upgrading to 1.9.5 (getting activity locking to work) so I am thrilled that this new format was created I think it will aid us in doing updates in a more timely fashion in the future.
Thanks again!!!!
Re: Conditional activities: Activity Locking course format
Deb,
<gulp> I'm going to have to sit and think about why my 1.95+ with "display.php" isn't doing the job.
Thanks for posting your message!
-- Dave
Re: Conditional activities: Activity Locking course format
We are using: Moodle 1.9.5+ (Build: 20090722)
If you send me a private message I can send you the email of the person who installed the activity locking format for us.
Bummer on your challenges!
Re: Conditional activities: Activity Locking course format
Chardelle,
I'm still fussing around with a proper installation of AL + display.php.
Today, for other reasons, I decided to unlock all of the "topics" in my course. After doing that twice, I still have an indication that there are "47 locks" in the course.
Is this some initial value or is there something odd going on. Should I be able to get to zero locks?
Oh, and add to my wish list a "Release all locks" "Store all current locks" " and "Restore all locks" options
Thank you!
-- Dave
Re: Conditional activities: Activity Locking course format
Yes, if you unlock any locks, then the block should show that many locks.
This is just a stipgap solution until Moodle 2.0.
Re: Conditional activities: Activity Locking course format
have few questions about the activity lock, please have a look at this topic
thanks in advance
Re: Conditional activities: Activity Locking course format
In my case teacher also locked as well as student.
Re: Conditional activities: Activity Locking course format
Hi Chardelle and folks.
I'm a first time user of this module / format and start with a 1.95+ Moodle install. Got the correct download from here and followed the steps above. Things went smooth with the block install.
I'm only getting this error / warning in my moodle admin area, at the top of the site:
"C:\Inetpub\wwwroot\ddtimoodle/mod/AL format/version.php was not readable"
Then this seemed to go away. And I think it's working. I created a new course in the new locking format, no troubles.
I then added the 'activity locking block' to the course page. It says :
"There are 0 locks within this course."
Anything more to be wary of ? And is there anymore documentation or forum topic on how to use it?
Thank you so much for the much needed module...
Re: Conditional activities: Activity Locking course format
I see that you have built this script with base which christiano created (please correct me if am wrong).
can you please give me an idea of how to solve these issues which have with this http://moodle.org/mod/forum/discuss.php?d=124609#p570628
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Thank you for a great module. It does exactly what I was looking for, but I found that for some reason it would not work on my local test site. When I uploaded to the server it worked great.
What I do have a question on is this, I have several branches in a single lesson. If a student looks at the first page in the lesson, and then goes back to the course main page, it checks him off as completely the activity. I can work with it like that, but is it possible to show the activity completed only when they complete all the lesson activities?
I think that this will be a great addition to Moodle 2.0 when it is released for sure. Thank you again for all the hard work.
Re: Conditional activities: Activity Locking course format
First, be aware that this code is not in 2.0, the 2.0 conditional activities code will be different, so all locks will have to be reset when you upgrade.
For lessons, you might put a question on the last page that says something like if you are finished with the lesson click yes, then give them a grade for clicking yes, and set the tracking to a grade of 100% for the lesson.
Re: Conditional activities: Activity Locking course format
Any ideas on how can i implement this activity lock in all other course formats ?
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
Chardelle,
Installed on 1.96 stable in 2 minutes and is working flawlessly.
Cannot thank you enough - a much better "hack" for the AL block.
Ken
Re: Conditional activities: Activity Locking course format
Hey Chardelle,
Running the Latest Activity Locking Format + Display.php posted above in a couple of Moodle 1.95+ installs. All is good..eeerrrr.....great. Just love it.
Only issue - when I lock an activity (i.e. - say I lock an assignment - the lock is that you must access + post in a forum above it first) it works as intended. The problem is that the lock is working the same for students - teachers - admins.
So when I lock something as the admin, I then cannot access it (say to edit the due date on a locked assignment) until I satisfy the locked requirements - in this case posting in that forum above.
Any easy way to have the locks all confirmed for an admin?
Ken
Re: Conditional activities: Activity Locking course format
Has anyone installed AL for Moodle 1.9.7 ? If yes, which version of AL should i use ?
Any help on this is appreciated .
Thanks
Esh
Re: Conditional activities: Activity Locking course format
Chris
Re: Conditional activities: Activity Locking course format
would be great if you would have linked the new thread in your post above so that people can have their discussions on that in there.
Re: Conditional activities: Activity Locking course format
Excellent point. Where is a forum administrator when you really need them.
That was my intent but/and then the world almost came to an end as I knew it. I started doing too many things at once and that todo in the next 30 minutes slipped away.
However, let me see if I can do it here (assuming nothing distracts me). I will even attempt a cross link between threads! I can.
Here is a link to a thread about Activity Locking in 1.9.7 in this forum.
Best Chris
Re: Conditional activities: Activity Locking course format
You can find a solution here
read it till end, you can find a file uploaded in the replies for the second time.
- - Peace
Ravishankar Somasundaram
Re: Conditional activities: Activity Locking course format
Hey Ravi,
I tried the new locklib file that you posted here .
But I am getting the same results (locks work perfectly - but ALL users must complete pre-req before items will unlock.).
Thoughts?
Ken
Re: Conditional activities: Activity Locking course format
Did you use this file ? and replaced the existing one ?
Because it works fine for me.
Please turn debugging to developers mode and test it, and post here if you get any errors, so that we can isolate the issue and proceed further.
Re: Conditional activities: Activity Locking course format
And if you find it useful, do vote for it.
Bug reports and feedback's are always welcomed.
Re: Conditional activities: Activity Locking course format
execute_sql(" ALTER TABLE `{$CFG->prefix}course_modules` ADD `visiblewhenlocked` TINYINT( 1 ) UNSIGNED NOT NULL default '1' AFTER `visible`");
execute_sql(" ALTER TABLE `{$CFG->prefix}course_modules` ADD `checkboxesforprereqs` TINYINT( 1 ) UNSIGNED NOT NULL default '1' AFTER `visible`");
Re: Conditional activities: Activity Locking course format
I installed Activity Locking and everything seems to work (I'm still doing tests)
Thanks for your work Chardelle
I wanted to ask if any of you use this function on a Moodle platform in production.
I am concerned:
- The fact that I have found to download on Modules and Plugins
- I have to go change the code of a page in php (moodlelib.php)
- Some have reported malfunctions.
Before using it on a production I would have some reassurance from someone who uses a stable
I usually use Moodle 1.9.8 (Build: 20100526)
Thanks
Re: Conditional activities: Activity Locking course format
Firstly, a big thanks for your help in improving the Activity Locks function.
I'm a newbie and using Moodle 1.9.8 version. I need your help in troubleshooting. I followed your procedure and tested it on the website.
The problem I'm facing is:
It appears activity lock function is working, but actually it is n't? I mean I can create an activity lock, make some conditions etc. But when I login as a Student, there are no conditions/restrictions on the activities. They are simply topics/activities.
Observation:
(When I click on Notifications, after adding the Activity Lock Code initially, I could say no messages like "Tables Created". Its just a blank white page on the browser. I observed there is no Green Tick mark appearing next to an activity, when I created a Lock.).
Do you think its because of the 1.9.8 version of Moodle? If so, whats the alternative for me?
Thanks in advance.
Re: Conditional activities: Activity Locking course format
Re: Conditional activities: Activity Locking course format
I do not think it installed. I do not see why 1.9.8 would make a difference. Did this happen with the set of AL files I compiled and recently posted in this forum in another thread here? Or were you brave like me and read all 100 plus posts in this thread to determine what needed to be done?
I got frustrated in trying to follow all the very helpful changes and suggestions in this particular thread. After many attempts, I did get it to work and immediately zipped all the AL files. I tested those files on another 1.9.9 local host and again on a production server 1.9.9. Both times I got a notification and it installed and worked as I expected.
However, I had the same thing happened to me on one of my attempts to install AL from all the suggestions in this particular thread. I got the right sort of screens but I checked the MySQL moodle database and did not find any AL tables. That made sense to me because I did not see anything happen in notification. If you can, check your database and I bet you will not see any AL tables. In short you did something that did not achieve the desired result
If up to this point, your site has never used AL, then I suggest the zip file I compiled from suggestions of more knowledgeable than myself. These files should work on any 1.9 version of Moodle.
Chardelle and others, please feel free to jump in and correct my misconceptions
Best to all
Chris
Re: Conditional activities: Activity Locking course format
I found out that there were no activity locking tables installed on the database. Can you please tell me, where I made a mistake in the procedure? I'm planning to redo the process again.
Re: Conditional activities: Activity Locking course format
Like I said before, I could see no tables in the database. So, I tried the procedure again, but no luck. When I clicked on Notifications, all I could see is a blank page. I used the recent version of activity locks (Changes made by Chris AL_format_v3_20100912.zip).
Can you please tell me, if there's any alternative?
Re: Conditional activities: Activity Locking course format
Thank you for the confirmation. What is the database you are using? If it is not MySQL then that would explain what is happening.
For example, there is not a PostSQL file in the blocks/db folder to create the necessary tables and fields in a PostSQL database. If you are familiar with MySQL and PostSQL you might be able to create the necessary tables and fields in Post SQL by reading the MySQL.sql file and doing it manually.
In case your database is MySQL, I will review the install steps and give you my ideas about troubleshooting. I would also suggest turning up the debug level for your site while you install any contributed module or upgrade.
The AL_format_v3_20100912.zip contains 2 folders, blocks and course. These folders should be placed in the moodle root. There should already be folders in the root with these names.
Troubleshooting #1. After the unzip or copy, you should see a ../moodle/blocks/activity_locking/db/mysql.php file along with a mysql.sql file. If you do not see those files along that path, then check your rights to the moodle folder and look for an error on the webserver side when you are trying to copy the files. That has also happened to me .
Troubleshooting #2. Since I have a lot of moodle folders (moodle19al, moodle18, moodle20 and so forth), I like to double check I put the files in the correct moodle folder that my webbrowser is using when something does not work. When my browser is looking at MyMoodle.org/Training and I carefully put the AL files in MyMoodle.org/moodle19al, it will never work. That has also happened to me
Troubleshooting #3. The mysql.sql file is a mysql query that should create the necessary tables and records. This is probably the long way of doing things. I run a script from phpMyAdmin for MySQL databases. I have edited the contents of this file and placed it in a MySQL query window and pressed the go button. You should notice "prefix" is used 5 times in the file. Change prefix to the table prefix used in your database (found in the ./moodle/config.php file). For example in the moodle I want to change, the prefix used is mdl_moodle19a_ .
Troubleshooting #4. I have used up all my 1.9.x localhosts so I have not tested this. I suspect the short way of doing things, is to run the activity_locking/db/mysql.php file from your browser when you are logged into the moodle site as administrator.
Again, I just play around in my spare time because I learn by doing. I am sort of a blind man when ever I go behind the Moodle User Interface like this. I have the belief that eventually, I will be lucky and find the door in the wall. Since I am blind, I tend to repeat the very long path I used to get there because it worked once. Those with real knowledge have vision
Hope this helps you and others, Chris
Re: Conditional activities: Activity Locking course format
Thanks a ton for your quick reply and kind words. You are an inspiration, I like learning new things and I don't like giving up things. I will follow your Trouble shooting tips and will tell about the outcome very soon.
Re: Conditional activities: Activity Locking course format
Your troubleshooting tips worked wonders for me. I ran the mysql.sql file with 'mdl' in place of prefix in PHPMyAdmin and now the locks are working fine. Thanks a billion.
I observed one thing, after successfully creating the tables I clicked on the Notifications tab, it still returned a blank page. Anyways, my mission is accomplished with your immense help. I will post a reply in an existing thread that Activity Locks work fine for 1.9.8 version of moodle.
Thank you. God bless.
Re: Conditional activities: Activity Locking course format
I think I found my problem with 1.9.8 and AL Format.
I found that the sectionlock.php code was pointing to the root/lib/locklib.php instead of the course/format/locking/locklib.php
the code I put in is
<?PHP
require_once("../config.php");
require_once("lib.php");
require_once($CFG->dirroot.'/course/format/locking/locklib.php');
....
Seems to work just fine now. I will trouble shoot with student and staff.
cheers
everyone
Re: Conditional activities: Activity Locking course format
You are using an old version. Please this thread for the latest version