Time for a bit of coding. The following has gone on over a few weeks.
BIM has been added into the Moodle plugin database. A part of this is providing versions of the plugin that work with each of the versions of Moodle. Currently BIM is available for Moodle versions 2.0 through 2.3. I need to provide a version that works with Moodle 2.4 and perhaps explore what, if anything different, is required for the imminent (since released) Moodle 2.5 release. This is a record of that work.
First, it’s time to update the various BIM related pages
- The BIM page on this blog needed updating to show that BIM is now available via the Moodle plugin database.
- The Moodle docs BIM page also needs updating due to this progress.
One of the less than perfect Moodle development practices I had adopted was not having the debug messages appear on the page. Hence I was unaware of the following two problems
Notice: Undefined variable: strbims in mod/bim/lib/locallib.php on line 244
Notice: Undefined variable: base_url in mod/bim/lib/locallib.php on line 249
Thanks to Anthony for picking these up. Fix these first. Which will mean committing these to github and creating new zip files.
Having turned the full debugging options on reveals a range of similar messages to address
- undefined variable screen in student/view.php – line 42 – DONE
- A little surprising, was on-going use of “print_heading” which should have changed as part of migration to 2.0
- error() is a deprecated function, – DONE
- Issues with the use of redirect. – DONE
This is slightly larger than the above. A couple of the workflows in BIM involve a message being given in one complete page, a delay and then a redirect to another BIM page. This breaks how a Moodle script should work. I was going to leave this alone, but testing some of the above minor changes requires this to be fixed.
Simple solution for now will be to replace the timed redirect with a simple link for the user to click.
- Undefined property: stdClass::$cmidnumber – from manage questions – DONE
happens in bim_grade_item_update, which is called from bim_update_gradebook…similar problem to this which also provides the basics of a solution.
Using GIT more appropriately
This does raise the question about to another point mentioned by Anthony – the Github file repository on Moodle.org. Apparently this would make zip files easier.
Part of what I’m trying to do with BIM is to explore how tools like BIM can be made more flexible and responsive. This will, in part, need a solid foundation that links properly with the broader Moodle development practices.
After a bit of exploration this seems to mean creating branches in the BIM github repository with names such as
MOODLE_23_STABLE, MOODLE_24_STABLE which then enables easier integration with the type of processes described here.
Let’s start with setting up Moodle via git
git clone git://git.moodle.org/moodle.git cd moodle git branch -a git branch --track MOODLE_24_STABLE origin/MOODLE_24_STABLE git checkout MOODLE_24_STABLE
What work I’ve done on BIM so far is suitable for a MOODLE_23_STABLE branch. There is also an older MOODLE_19_STABLE version of BIM. I need to fix the BIM github repo to have these branches. Then I can start work on the MOODLE_24_STABLE version below.
This means I need to refresh (again) my understanding of github and branches. One of the drawbacks of only dipping into development irregularly and quickly is that I don’t really ever grok it. May be easier than I thought.
git branch MOODLE_23_STABLE git push origin MOODLE_23_STABLE
And there’s such a branch added. Add the one for 24 and start thinking about making the changes. Also done the one for MOODLE_19
What’s needed – 2.4
Lastly, there’s a need to make some changes for 2.4
- create an addinstance capability in db/access.php- DONE
- update version.php for Moodle 2.4 release – DONE/li>
Create the zip file that I’ll upload to CONTRIB
git archive -o ~/Desktop/BIM_24.zip --prefix=bim/ MOODLE_24_STABLE
That sort of worked, but I believe there may be a bit more to do.
Version 1.9 into CONTRIB
Another task is to get the old version of BIM for Moodle 1.9 into CONTRIB
That seems to be done.