Conditional activities: Error when locking the quiz.

Conditional activities: Error when locking the quiz.

by shilpa Champaneri -
Number of replies: 11

Hi

I have 1.7 version of activity locking installed. it was working fine. But then i tried to lock quiz and in the settings i set as not visible when locked. Now i get this mesage.

This SQL relies on obsolete tables! Your code must be fixed by a developer.

and the quiz has disappeared even in administrator section. I need to get the quiz back!! What to do? Please help!!

Thanks

Shilpa

Average of ratings: -
In reply to shilpa Champaneri

Re: Conditional activities: Error when locking the quiz.

by Chris Throup -
Hi, Shilpa.

Which version of activity locking did you install? And exactly which version of Moodle do you have? It is very important to have versions which match exactly.

The error you have sounds very similar to what happened when Activity Locking for Moodle 1.7+ was installed on Moodle 1.7.1.

If you are not certain which version you have, look at the admin page.

If you have Moodle 1.7+, you will need this package.

If you have Moodle 1.7.1, you will need this package.

If you have a different Moodle version, then neither will work.

I hope that helps.
In reply to Chris Throup

Re: Conditional activities: Error when locking the quiz.

by shilpa Champaneri -

Hi Chris,

I am using moodle 1.7+, i thought i could have installed the wrong version of the activity locking. So i downloaded the right version for 1.7+ and installed it on my test box and i have the same problem. I have realised the error only occurs if i use time delays. It works fine for the other things like locking and visibility. I managed to get the quiz that i lost back by making changes in the database. But i would like to use the time delay aswell.

Thanks

Shilpa

In reply to shilpa Champaneri

Re: Conditional activities: Error when locking the quiz.

by Chris Throup -
Hi, Shilpa.

Do you know exactly which version of Moodle you have? For example, the server we have activity locking on is running Moodle 1.7+ (2006101009). You can find out from the admin page.

I have not been able to replicate the problem on our server.

Could you tell me (as best you remember) the steps you took, and when the error occurred?

Also, if you find out the exact Moodle version I can try adding the activity locking hacks to your specific Moodle files and see if that resolves the problem.

Chris
In reply to Chris Throup

Re: Conditional activities: Error when locking the quiz.

by Michal Blazke -

Hi, Chris & Shilpa

I'm in the same trouble as Shilpa; Moodle 1.7.1 + AL_V20_for_171_Feb1907.zip installed

I've noticed the problem arises only on the course, where I've experimented with the AL_Delay... It breaks the Topic outline in my case, so there is no way to re-edit the attribs via GUI.

The "SQL obsolete tables" warning has dismissed after I manually reset the corresponding  prefix_course_modules.delay value to "" (empty).

Other AL funcionalities still works fine.

Michal

In reply to Michal Blazke

Re: Conditional activities: Error when locking the quiz.

by Chris Throup -
Interesting...

I am still unable to replicate Shilpa's problem on our install, but I can replicate Michal's.

If you are using Moodle 1.7.1, Michal, then that would suggest the problem lies somewhere other than the code I wrote, so I don't know immediately what is causing that.

I shall have a play around with it and see if I can work out what is going on.

Chris
In reply to Chris Throup

Re: Conditional activities: Error when locking the quiz.

by shilpa Champaneri -

Hi Chris,

The version i am using is Moodle1.7+(2006101009). The steps i went through were. I clicked on the little lock icon which took me to the activity locking setup page. I then clicked on the checkerbox that i want the user to access. then set a time delay of 5 minutes. The other settings i left as they were.

Visible when locked: yes

Show activity completion: no

Show activity prerequisites: yes

style of use: left the text box blank

Style to use when the activity is locked: locked

Then i clicked the Save Activity Locks button. Thats when it takes me back to the course section page and that activity is disappeared with any other sections beneath it. And i get that message obsolete tables.

Hope that helps.

Thanks

Shilpa

In reply to shilpa Champaneri

Re: Conditional activities: Error when locking the quiz.

by Bernard Boucher -
Hi all,
activity locking is only a hack adapted for moodle 1.7.1. The new roles functions are not used, only depreciated functions like isteacher() are used. Also to make Moodle easier to port to others databases a new library lib/dmlib.php ( data manipulation ) was added to "spot" the usage of these old functions to permit to remove them.

If you don't use advanced role features and if you comment out some lines in lib/dmlib.php then it should work without error messages.

add // before lines like in lib/dmlib.php:

// error('This SQL relies on obsolete tables! Your code must be fixed by a developer.');


Please don't try that on a production server!


Let me know if it works in many cases ( I don't use 1.7 nor delays here )!

I hope it may help,

Bernard



In reply to Bernard Boucher

Re: Conditional activities: Error when locking the quiz.

by Rafael Rivera -
Hello Bernard

First of all I like to thank you for your help with the AL Module.

I'm a newby with Moodle and I having some problems.

I have a fresh install of Moodle 1.7.2+ and I trying to use AL.
I have dowloaded the file Activity_Locking_for_Moodle_1.7_.zip
and try to install, but i get the following error

ALTER TABLE `prefix_course_modules` ADD `delay` VARCHAR( 10 ) NOT NULL AFTER `added`

MySQL ha dicho: Documentación
#1146 - Table 'moodle.prefix_course_modules' doesn't exist

It seems like if I have not the right tables structure.
Could you please explain me what I have to do in order to can use AL.
Im a litlle frustrated trying to make it work, i have tried with diferent version of AL confuso

Thanks in advance and best regards

Rafael
In reply to Rafael Rivera

Re: Conditional activities: Error when locking the quiz.

by Bernard Boucher -
Hi Rafael,

I am sorry that you got problem with activities locking.


Activity locking is only a hack and it use some of original moodle files slightly modified. That is why it is very sensitive to the moodle version implied.

It is not uninstallable and non downgradable.
If you try to install it a second time it will not be able to do things like ALTER TABLE `prefix_course_modules` ADD `delay` VARCHAR( 10 ) NOT NULL AFTER `added ` because the table was probably altered in the first attempt to install activity locking.

For your particular case you seem to have try to install Activity_Locking_for_Moodle_1.7_.zip in a 1.7.2+ version of moodle wich are incompatibles.

If you check carefully from moodle plugins you will see that recent 2 versions exist one for 1.6 only and the other for 1.7.1 only and they cannot be intermixed.

Another reference is that table wich specify that many versions exist but none for 1.7.2. The version you use is specific for 1.7 only.

I hope you did'nt installed it on a production server as stated in all versions!

Destroy database and try a fresh new install of moodle 1.7.1 with activity locking for 1.7.1 only and it will work as stated the first time!


I hope it may help,

Bernard
In reply to Bernard Boucher

Re: Conditional activities: Error when locking the quiz.

by Rafael Rivera -
Hi Bernard

I like to thank for your help, I follow your recommendation and now everything is working fine.

I have aslo the same problem exposed by Silph, but I comment the lines you suggest and the problem has solved.

Again, thanks a lot for your help.

Rafael
In reply to Rafael Rivera

Re: Conditional activities: Error when locking the quiz.

by Alex Greene -

So - there is no Activity Locking module for 1.7.2?

I need a certificate to print based on quiz results, and was about to try AL until reading this post. I don't want to screw up the database. If anyone has ideas, please reply!  

Cheers from Brooklyn,

Alex