You are browsing the archive for Moodle 2.

Block Building for Moodle 2

August 31, 2011 in Moodle 2

This year, instead of hacking the Moodle core to death we have decided to stick with core Moodle code, and this time we have put all our custom pages in their own folder.
I am in the process of converting many custom code projects into blocks and mods. An it’s surprisingly easy with Moodle 2.

Today I built a simple course header block that displays the course title with a nicely rounded CSS background image.
Previously we used to draw course headers in Photoshop but now we don’t need to.
And because we can place blocks in the centre of our theme the headers sit very neatly at the top of the course content above the resources.

At present it’s limited to 1 image but the plan is to develop it further whereby the tutor can select from a variety of images when in editing mode.
For example, there may be an image for construction courses, one for hairdressing courses etc… Plus a few generic ones.

This saves hours of time – no more Photoshop!

The next mod we need to build is similar to a label but instead creates a pre-drawn banner and associated link to a child course. At present we draw images, add them to a label and hyperlink them to a hidden child course. Painful and time consuming!

However, time is always the issue. And we are fully stretched with a new term just a few days away so finding time to code is harder than the code itself!
It will be non stop tech support for the next month and then we will see how we go!

And the senior powers that be require a Moodle reporting engine that links to our MIS system! I’d rather build the fun stuff but need to keep the bosses happy!

Bug fixing week (Moodle 2)

August 18, 2011 in Featured, Moodle 2

This week I finally found some time to sit in front of my computer and address some of the niggly little glitches that have arisen since our Moodle 2 upgrade.

One of which was the sending of emails via the cron. For some unknown reason, Moodle 2 could not initiate the send mail function. After several hours debugging and trying various things I decided to put the path to the sendmail server directly into Moodle, as opposed to using the default PHP path. And sure enough it worked! Even though the paths are exactly the same and worked prior to the upgrade, this was the only way I could get around it.

The next problem I had was with external Database enrolments via ODBC . For some reason, our Moodle 2.0 installation was refusing to run the queries even though I could communicate directly with the external database. Eventually, after searching through countless PHP pages I decided to drop ODBC in favour of FreeTDS. This worked like a charm.

Lastly, our cron was falling over when trying to run the course completion function. This was due to a mismatch in database collations. For some reason, 3 of our tables were set to utf8_general_ci, instead of utf_unicode_ci. I changed these tables to unicode and the cron completed this action.

Then I encountered another problem. Again cron related. The process kept on terminating whilst completing meta enrol enrolments. This happened everytime and just by chance I happened to time how long the process would last until it terminated. It was exactly 60 seconds. So to fix this I changed the timeout in php.ini to a much longer time limit of 300 seconds and now the cron completes perfectly.

It is now the end of the week and although the above fixes are more work arounds as opposed to actual core fixes at least things are working again. I have submitted some of my findings to the Moodle Tracker and hopefully some of these issues will be resolved in future releases.

I finished the week by installing the Drag and Drop file uplaoder block by the brilliant Davo Smith. This is by far my favourite block of all time. For those that are unfamiliar with it check out: http://moodle.org/mod/forum/discuss.php?d=181988

The only hack I had to make was to make the block sticky on all courses. As it’s a course block its not possible to make it sticky in Moodle 2.0 on all course pages by default.

To do this find the line:

function applicable_formats() {
 return array('course' => true);
 }

And change to:

function applicable_formats() {
 return array('all' => true);
 }

Now you can add the block to the frontpage and set it to appear on all pages.
Once my workload settles down I’m looking forward to coding and developing again.

My Moodle 2.0 Upgrade Journey Part 4 (Final)

July 22, 2011 in Moodle 2

Moodle 2.0 is now live at the Leeds City College!

It’s been a very busy week but we finally got there.  It’s by no means finished.  There are still lots of little tweaks needed throughout the summer but it’s working – which wasn’t an easy task.

After the upgrade I found that many of the links to resources were not working, even though the fields were correctly associated with them.  It turns out this has something to do with the description fields being empty and the priority ID order.  There’s plenty of discussion about this in the Moodle forums.

I managed to patch the early version of Moodle 2.0 with the latest release and it fixed the broken links problem.

The upgrade has however caused errors with the theme selector.  It appears as though I can only select one theme, not too much of an issue at this stage but something I will have to repair later.

The book module upgrade went well and I’ve decided to leave the Questionnaire Module out in favour of the new Feedback Module. Moodle folders doesn’t fully work yet as it’s not Moodle 2.0 ready but LDAP and Database Enrollments are fully restored and things look promising.

For the rest of the week I’ll be installing the various repositories and wait for our college tutors to come knocking at the door wondering why everything has changed.

 

 

 

My Moodle 2.0 Upgrade Journey Part 3

July 18, 2011 in Moodle 2

Well today I finally set about upgrading the Leeds City College Production Server and it has been quite an eventful day.

After making the necessary changes to Apache and PHP (namely upgrading them both) and then backing up a snapshot of the live system I began the upgrade.

Even though I have simulated this many times on a test server doing it live threw up problems I had not yet encountered.  The first error I got was an Illegal mix of collations, I don’t think was a reference to the current UK government but more a warning to me to stop mucking around with the tables.

I had to run a quick query against the tables in the database

ALTER TABLE mdl_tablename CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci;

And this fixed things.

Then I hit my second error, “Debug info: Unknown column ‘itemid’ in ‘field list’”

Having absolutely no idea how to fix this I spent the next few hours in the forums/tracker and came out none the wiser.

I then decided to just opt for a clean install before moving on just to see if the error is more to do with my current setup.  It turns out the latest snapshot of Moodle 2.1 has a slight fault in it, whereby I can’t select any themes but it installed nevertheless.

I revisited the earlier error above and still couldn’t find a fix.  The Moodle developers have done a lot more work on the install script since I downloaded it several months ago and by chance I had still had an older version.

I deleted the current failed Moodle 2.0 from the server, restored the database and tried an install and to my delight this one works.

So currently it’s migrating all the course files and this will take several hours so this blog post will end here and pick up tomorrow.  The plan is to upgrade this old Moodle 2.0 with the new version.  I realize it’s a patchy way to work but I have no choice and time is running out as this project is due completion in 4 days from now.

And although I’m on my fifth cup of tea I’m still feeling quite calm.

My Moodle 2.0 Upgrade Journey Part 2

February 17, 2011 in Moodle 2

For this next part of the process I copied my Moodle 1.9 installation to a local development server. But to save time I didn’t copy the entire MoodleData folder as it’s over 160GB. I only copied the first 20 folders.
As I wouldn’t be using LDAP on this test server (yet!) I changed my admin account to a manual account so I didn’t lock myself out.

I then flushed out the htdocs folder and copied the Moodle 2.0 installation files across so that I had a clean install with no modifications and ran the install script.

Things looked good and the new progress bar moved along nicely. I hit several errors when trying to migrate the MoodleData folders I left behind as it simply could not find them, again this was intentional on my part and expected.

Then I hit my first serious error.

The installer stopped when migrating the meta courses and I was left with an ugly looking error message.

If I skipped the error and continued with the install then Moodle 2.0 would load but I was unable to use any meta course functionality.

After several days of trying various things to fix this, including submitting it to the Moodle tracker (http://tracker.moodle.org/browse/MDL-26352) I finally figured out what was happening.

It turns out that I had courses listed in my meta table that no longer existed in my course table.

(For the more techie amongst us, I had entries in mdl_course_meta but the corresponding IDs in mdl_course were no longer there). For some reason, Moodle had not removed the meta course entry when we had deleted courses in the past.

And this was the cause of the error.

I used the following MySQL query to see which entries were causing this error:

SELECT fullname, mdl_course.id, parent_course FROM mdl_course_meta
LEFT JOIN mdl_course ON mdl_course.id = mdl_course_meta.parent_course WHERE fullname IS NULL

The query returned 30 entries which were promptly deleted.

And now the upgrade worked without any further hitches!

So now I have a fully functional Moodle 2.0 with over 25,000 live student account and over 6000 courses and approximately 3000 meta courses.

After a few initial checks to check the integrity of the data it is safe to say that the upgrade has gone as expected. Everything appears to be in the correct place, enrolments appear to have been migrated successfully and the migrated data from the MoodleData folder has worked flawlessly.

So what’s next….

In Part 3 I will further test the system and check that live database enrolments are working and test the authentication plug-ins and single sign on.

I’ll then need to do larger upgrade test with all 160GB of MoodleData- this will take an awfully long time!

Despite the slight hiccup with meta courses this upgrade has massively boosted my confidence in Moodle 2.0 and I urge all those who maybe considering an upgrade to do a test simulation as I have done.

Stay posted for the next instalment.

My Moodle 2.0 Upgrade Journey Part 1…

January 1, 1970 in Moodle 2

To upgrade or not to upgrade? That is the question.

Well my answer is…upgrade!

I am currently in the process of writing a short paper on a possible upgrade to Moodle 2.0 for Leeds City College. I am proposing an upgrade during the summer.

Unfortunately, due to the size of the organisation, our custom tweaks, third party plug-ins and staff training needs, an upgrade isn’t going to be easy.

This blog post will be part of several posts during the run up to D-Day! Or M2-Day as I’ll call it.

So the big question?…Why upgrade?

Many colleges are put off with the upgrade as they feel the support won’t be there yet if things go wrong, if bugs are found or they can’t find their way around.

Well unless we get behind Moodle 2.0 and try it we will only slow down the development proces, bug fixing and support documentation.

I must admit, I’m scared to upgrade, if it isn’t broke right?

But surely the new features in 2.0 outweigh any snags and hiccups I’ll encounter along the way. And I’m sure I’ll find bugs and some things won’t work the same as they did but that’s what it’s all about, that’s what Open Source is all about.

As long as I get the theme right and make sure things are in the right place then will my end users notice anything radical? Then when it comes to training I’ll sell the benefits of what’s new and improved rather than what has moved or changed or what’s disappeared.

So what next:

The first thing I did was have a look at what third party modules we have installed and which ones have been transferred to 2.0 and which ones are not. Loosing some desired and heavily used functionality will only irate my users. I’ve been slowly stripping out mods througout the year in preparation and deliberately not installing anything new until I know it’s (2.0) future and so I’m left with:

The Book module – which has a 2.0 version
Certificate Module – which doesn’t have a 2.0 version
Face-2-face Module – which doesn’t have a 2.0 version but do I really need it?
Log Book - which doesn’t have a 2.0 version
Lightbox Gallery - which doesn’t have a 2.0 version but I’ll be onto Paul to see if he has any plans for this or if I can lend a hand.

It may be that I can find workarounds for some of these. For example, can I use forums to replace the logbook? I have had requests from tutors for Nanagong and Reflect blocks/mods but have not installed them as I’d only be taking them away if there isn’t a 2.0 version planned.

So what’s next?

The next step is to clone the Moodle Server and try an upgrade. See what works, see what doesn’t, see what died etc..

My own modifications don’t worry me, as I can make these fit 2.0 and I have until summer to create a striking new Moodle 2.0 theme – the pressure is on to create something awesome.

My next post will inform you how the development server upgrade went, how the database coped and were all my courses intact?

I’ll let you know how i get on… let the stress…I mean “fun” begin.