Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

by Chris Collman -
Number of replies: 7
Picture of Documentation writers
Hi,
I tried to recompile Chardelle Busch's AL v 2 with the most recent corrections.

I made a clean install of a Moodle 1.9.9+ (Build: 20100908) on an existing XAMPP localhost in htdocs. I then twiice unpacked the AL_format.zip that Chardelle Bush upload on 18 July 2009 in Conditional Activities Forum thread. I first unpacked it in my new moodle and then in an unrelated folder I called AL_v3_20100912.

In the same thread I updated both the folder and the moodle with
.course/format/locking/locklib.php (2 Aug 2009) and
.course/format/locking/display.php (3 Aug 2009)

Initially it did not install via notification after I unpacked the zip file into my moodle. However, once I copied the 2 php files to my moodle, notification told me activity locking installed.

Attached is the zip file of what I compiled. I added a brief README file to the archive. In a second thread I will ask about having a Lesson score be one of the locks.

Hope this helps.
Average of ratings: -
In reply to Chris Collman

Re: Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

by Chris Collman -
Picture of Documentation writers
First, thanks Chardelle and others for working on AL in 1.9. I had some issues trying to install it on a localhost at work but was able to focus and get it done at home. I hope to install this on a 1.9.9 production server.

It does not appear that the mysql.sql script ran. I had an existing XAMPP localhost. I added a blank moodle19al database as a UTF8_general_ci. I then told my fresh moodle install the name of the database and set "mdl_al" as the table prefix. So I took a deep breath, found the ./db/mysql.sql file and pasted it into phpMyAdmin SQL script area.

It did not seem to like "prefix_" in the script. So I changed the prefix_ in the script to mdl_al_ and it did what it needed. Not bad for someone who is scared to death of code, and even more of MySQL queries like that.

Whew. Now it seems to work. I will take the v3 zip version and run it on a localhost I have at work and check the production server's table names. smile

So the AL program works. Apparently it adds fields to the course_modules table and creates a new course_module_locks table. It does not appear to alter any existing Moodle php code. It creates new folders in the existing code structure. and puts the code there. Not altering the standard Moodle code is a big deal for me.

I share this possible issue incase somebody goes down the same path as myself.

Again, thanks to all.

Chris




In reply to Chris Collman

Re: Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

by Chris Collman -
Picture of Documentation writers
It works at work. I have a complete windows install package 1.9.9 20100825 . Previously attempted to load AL (redone by Chardelle) on this localhost. Basically unzipped my v3 file and copied everything below the AL format v3_200100912 folder to my ./moodle localhost folder. Clicked on notification, it installed itself no tweaks required. Found Activity locking format in the course settings. Icons appeared and settings also appeared.

Also loaded my customized certificate after this. Have a big grin on my face. Major mission accomplished. Now to wait for my admin/webmaster to unpack both certificate, certificate reports and AL into the soon to be production server. smile

Best to all
Chris
In reply to Chris Collman

Re: Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

by John Anderson -
Wow, if this works that will be so amazing.

Thank you for working on it, really.
In reply to John Anderson

Re: Conditional activities: AL v3 for 1.9.9, recompiled zip file & issues

by Chris Collman -
Picture of Documentation writers
Hi John,
You and I can thank every member of this forum and those who assisted Chardelle Busch in testing it. I am really excited myself.

I have revised the Readme file to add some clues as to how to install it.

Let us know if it works for you and on what version of Moodle.

Chris





In reply to Chris Collman

回應: Re: AL v3 for 1.9.9, recompiled zip file & issues

by Chiu Charlie -
Can this be applied to postgreSQL also?
I can't make it work under postgreSQL. If you can also write the pq sql and the code, it will be really appreciated.

Thanks.

In reply to Chiu Charlie

Re: 回應: Re: AL v3 for 1.9.9, recompiled zip file & issues

by Chris Collman -
Picture of Documentation writers
Hi Chiu Charlie,
I do not know anything about postgreSQL, and somebody else will need to help you.

Chris
In reply to Chiu Charlie

Re: 回應: Re: AL v3 for 1.9.9, recompiled zip file & issues

by Luca Testoni -

It also work with postgresql, but it's a dirty work.

I didn't wrote the code but i've change the db table and columns by hand.

You can check the mysql code and reproduce it on postgresql (via phppgadmin in my case).

You have to create the same table (prefix_course_module_locks) and rewrite the prefix_course_modules with new columns in the middle.

You have to rewrite a new prefix_course_modules beacuse postgresql dosn't support the AFTER 'column' condition like mysql, so:

- you have to create a new table like prefix_course_modules_new

- put in all the columns (prefix_course_modules + the new column of mysql script)

- export the data (only this!) of prefix_course_modules in prefix_course_modules_new

- rename prefix_course_modules to prefix_course_modules_old

- rename prefix_course_modules_new to prefix_course_modules

All is done!

 

Note:

postgresql have many small differences between mysql so:

- mysql column type TINYINT is translate in SMALLINT in postgresql

- NOT NULL can't be set in postgresql so leave it not set

the rest can be leaved like is set by the default installation