OU blog

Personal Blogs

Christopher Douce

Reflections on learning object granularity

Visible to anyone in the world
Edited by Christopher Douce, Tuesday, 1 Sep 2020, 07:57

4815260870_ea30750a28.jpg

I first discovered the notion of learning object granularity when I was tasked with creating my first learning object.  I was using an authoring tool that allowed you to describe (or tag) absolutely anything.  This was a revelation!  My tool allowed me to assign descriptions to individual photographs and sets of navigable pages that could contain any type of digital media you could imagine.  You could also assign descriptions to an entire learning object.  Not only was I struggling with how to use the fields (title, description, keywords) that I had to complete, it was also difficult to know where I should stop!

Terms of reference

There are a significant number of terms here that beg further explanation.  The idea of a learning object (wikipedia) is one that is slippery: it varies depending upon who you speak to.  I see a learning object as one or more digital resources that have the potential to provide useful information to, or serve a useful function for, a consumer.  Consumers, I argue, are both the end-users (learners), and those who might use learning objects within a course of study.

An alternative definition might be: a set of learning resources that can be used together to help a learner achieve a defined set of learning objectives.  I think I prefer this second definition.  It feels a little more precise, but there are few words that allude to how large a learning object might be.

Benefits of learning objects

One of the often cited benefits of learning objects is that they have the potential to be reused.  A digital resource could be taken from one learning situation could be reused (or repurposed) to another situation.  The benefits could include an increase in the quality of the resulting material and possible savings in terms of time and money.

Learning objects are sometimes held within mysterious instruments called repositories.  If existing materials are taken and modified, they could then be later returned to a repository and placed back into circulation for other people can use and modify, thus creating a virtuous cycle.  One problem with placing material in a repository is that if your repository contains tens of thousands of individual objects, finding what you want (to solve your particular teaching need) can become difficult (as well as tedious).

Metadata (wikipedia) has the ability to 'augment’ textual searching, potentially increasing the quality of search results.  Metadata also has the ability to offer you additional information or guidance about what an object might contain and how it might have been used, allowing you to make judgements regarding its applicability in your own teaching context.

There is a paradox: the more granular (or mutable) a learning object is, the more easily it can be reused, but the less useful it is likely to be.  The larger a learning object is, the more useful it is to an individual user (since it may attempt to satisfy a set of learning objectives), and the less likely it could be transferred or 'repurposed' to different learning and teaching contexts or situations.  Furthermore, the smaller the learning object, the more moral fibre one needs to successfully create correct (and relevant) metadata.

Repurposing

'Repurposing' is a funny word. I understand it to mean that you take something that already exists and modify it so it becomes useful for your own situation. I think repurposing is intrinsically difficult.  I don't think it's hard in the sense that it's difficult to change or manipulate different types of digital resources (providing you already have skills to use the tools to effect a change).  I think it's hard because of the inherent dependencies that exist within an object.  You have to remember to take care of all those little details. 

I consider repurposing akin to writing an essay. To write a really good essay you have to first understand the material, secondly understand the question that you are writing about, and then finally, understand who you are writing it for.  If you write an essay that consists of paragraphs which have been composed in such a way that they could be used in other essays, I sense you will end up with an essay that is somewhat unsatisfactory (and rather frustrating to read).

There is something else that can make learning object repurposing difficult.  Learning objects are often built with authoring tools.  Some tools begin with a source document and then spit out a learning object at the other end.  The resulting object may (or may not) contain the source from which it was created.  This is considered to be 'destructive' (or one way) 'authoring', where the resulting material is difficult to modify.

Even if we accept that reuse is difficult, there are other reasons why it is not readily performed.  One reason is that there is no real sense of prestige in using other people materials (but you might get some credit if you find something that is particularly spectacular!).  Essentially, employers don't pay people to re-purpose learning materials; they pay people to convey useful and often difficult ideas of learners in a way that is understandable.  There is no reward structure or incentive to reuse existing material or build material that can be easily reused.  Repurposing takes ingenuity and determination, but within the end result, much of this may be hidden.

There is a final reason why people may like to create and use their own learning resources rather than reuse the work of others.  The very act of creating a resource allows one to acquire an intimate understanding of the very subject that you are intending on teaching.  Creating digital resources is a creative act.  Learning object construction can be constructivism used to prepare for teaching.

Considering metadata granularity

The terms 'aggregate' (or 'composite') and 'atomic' objects are sometimes used when talking about learning objects.  An atomic object, quite simply, are objects  that cannot be decomposed.  An atomic object might well be an image or a sound file, whereas an aggregate object might be a content package or a SCORM object.

In my opinion, many aggregate objects should be considered and treated as atomic objects since it could be far too difficult, complex and expensive to treat them in any other way.  I hold this view since learning objects are ultimately difficult to reuse and repurpose for the reasons presented earlier, but this should not detract from the creation and use of repositories.  Repositories are useful, especially if their use is supported by organisational structures and champions.

I hold the view that metadata should match the size of a resource that it describes.  There should be metadata that describes an object in terms of overall learning objectives.  Lower-level metadata can be used to add additional information to a composite object (such as an image file) that cannot be directly gained from examining its properties or structure (such as using an algorithm to determine its type).

In essence, tagging operations for aggregate and atomic object types must be simple, economic and pragmatic.  If you need to do some tagging to add additional information to a resource (a pragmatic decision), the tagging operation should be simple, and in turn, should be cost effective.

High and low-level metadata tagging

The purpose of high level tagging, the description of high level aggregate object, should be obvious.  Consider a book.  A book has metadata that describes it so it can be found within a library with relative ease (of course, things get more complicated when we consider more complex artefacts, such as journals!).

Low-level (or lower level) metadata may correspond to descriptions of individual pages or images (I should stress at this point, my experience in this area comes from the use of software tools, rather than any substantial period of formal education!).  Why would one want to 'tag' these smaller items (especially if it costs time and money)?  One reason is to provide additional functionality

Metadata helps you to do stuff, just in the same way that storing a book title and list of authors help you to find a book within a library.  Within the EU4ALL project, metadata has the potential to allow you to say that one page (which may contain an audio file) is conceptually equivalent to another page (which contains a textual equivalent).

By describing the equivalence relationships between different resources, the users experience can be optimised to their preferences.  There is also the notion of adaptability, for example, whether a resource can be dynamically changed so it can be efficiently consumed using the device from where it was accessed (this might be a mobile device, a PC, or a PC that is using assistive technology).

Moving forwards

One of the biggest challenges within EU4ALL is to ensure that the users interface to an adaptable learning technology system is coherent, consistent and understandable.  By way of addressing accessibility concerns, all users could potentially benefit.  Learners could potentially be presented with an interface or a sign that indicates that different alternatives are available at certain points during a learning activity, should they be found to exist.  Presenting alternatives in a way that does not cause disruption to learning, yet remains flexible by permitting users to change their preferences, is a difficult task.

Creating metadata is something that is difficult and tiresome (not to mention expensive).  As a result, mistakes can be easily introduced.  Some researchers (slideshare) have been attempting to explore whether it is possible to automatically generate metadata using information about the context in which they are deployed.  In fact, it appears to be a subject of a recent research tender.  But ultimately, humans will be the final consumer of metadata, although metadata languages are intended to be used by machines.

Summary

The notion of a learning object is something that is difficult to define.  Speak to ten different people and you are likely to get ten different answers.  I hold the view that the most useful learning object is an aggregate (or composite) learning object. 

Just as the idea of a learning object can be defined in different ways, the notion of granularity can also have different definitions.  The IEEE LOM standard offers four different levels of 'aggregation', ranging from 1, which refer to 'raw media data' (or media objects), through to individual lessons (level 2), a set of lessons (i.e. a course, level 3), to finally a set of courses which could lead to a formal qualification or certificate (level 4).  I hold the opinion that metadata should match the size of a 'learning object'.  Otherwise, you might end up in a situation where you have to tag everything 'in case it might be used'.  This is likely to be expensive.

High level metadata (in my opinion) is great for storing larger objects within repositories, whereas low-level metadata can be used to describe the adaptability and similarity properties of smaller resources which opens up the possibility of delivering learning resources that match individual user needs and preferences.

Acknowledgements

Posting image: from cocoi_m, from Flick.  Thanks go to an anonymous reviewer whose comments have been very instructive, and all those on the EU4ALL project.  The opinions that are presented here are my own rather than those of the project (or the Open University).

Permalink 1 comment (latest comment by Jonathan Vernon, Friday, 5 Oct 2012, 06:45)
Share post
Christopher Douce

Using OpenLearn resources with Moodle

Visible to anyone in the world
Edited by Christopher Douce, Monday, 29 Apr 2019, 13:38

OpenLearn logo

One of the things that we need to do in the EU4ALL project is to create a prototype. To show the operation of a prototype, we need to show how content can be personalised. To show content personalisation happening we need some content. Luckily, the OpenLearn project is at hand to provide some Open Educational Resources (wikipedia) that we may be able to use.

The OpenLearn project provides learning materials in a number of formats. These formats range from native OU XML files, raw HTML files, IMS content packages through to RSS feeds and Moodle backup formats. This post is all about finding the most effective way to transfer OpenLearn to Moodle (and uncovering the best approach to use for on-going development work).

Using a Moodle Course Backup

The sample content that I'm going to use is a learning package about the Forth Road bridge (openlearn). This learning package (for want of a better term) is interesting since it contains a couple of different resources, including a video, a transcript in the form of a PDF file and some HTML pages.

In terms of loading the package to Moodle, I thought the easiest route would be to import the backup file type. The course backup facility allows Moodle users to make copies of entire courses (and their setup) for safe keeping. If inadvertent changes are made, a user then has the possibility of restoring (Moodle documentation) a course to your Moodle installation.

Others at the OU have blogged about similar issues, providing a more comprehensive description about how to setup an EEE netbook to allow users to view the OpenLearn material whilst on the move. This post takes (more or less) a similar approach, but focuses more on the different OpenLearn filetypes.

After downloading an OpenLearn Moodle backup course, I logged into Moodle as an administrator then clicked around on the 'course' menu options to see what I could find. It wasn't immediately clear what to do, so I went to the documentation for help. I found quite a few things.

I discovered that you needed to use the Course administration block. But this could be only accessed from within a course. It was apparent that to import a course, I needed to also create one.

After creating an empty course (using all the default settings), the course administration block duly appeared. From faint memories of this process, having played with this part of Moodle a couple of years ago I remember that restore was a two step process: first you had to upload the backup file, then you had to click on a restore link to start the backup process.

After trying to upload my backup package I was presented with a message that read 'a required parameter (id) was missing' ('what on earth does this mean?' I wondered). I then noticed that the size of my OpenLearn zip file was bigger (because it contained a video) than maximum supported upload file size in Moodle. Obviously I need to change a setting somewhere.

The first place that I looked was the Moodle system configuration file called config.php, but this didn't tell me much. I then delved into the area of my computer that contained the PHP installation and found a file called php.ini.

After a quick search, I discovered two places which might explain the maximum file size that Moodle has told me about. I subsequently make a change to the upload_max_filesize variable, setting it to 32MB, restarted my web server and then refreshed my browser. As if by magic, the maximum file size that Moodle allows has changed.

When trying the upload again, everything seemed to work okay (but I should say that the error message that I was presented with does need some attention).

When the upload from local file store to a Moodle folder was completed, I could see an adjacent 'Restore' button which I clicked. I was then presented with a question: 'Later in this process you will have a choice of adding this backup to an existing course or creating a completely new course – do you want to continue?' In my situation I initially want to do the latter operation, but I'm forced to do the former. I click yes to continue.

I was then presented with a list of actions that have been carried out: creating temporary structure, deleting old data etc, with no button or option to click on afterwards when it appears that everything has finished. Obviously things were not working as they should be. I carried out a further web search for answers.

I discovered the following from the Moodle backup and restore FAQ: 'Attempting to restore a course to an older version of Moodle than the one the course was backed up on can result in the restore process failing to complete'.

So, what versions am I using, and what version is the OpenLearn backup software provided in? To find the version of your Moodle installation, you have to go to the site administration menu (when logged in as an administrator), and click on Environment. I soon discover that I was using version 1.9+. I extract the contents of the OpenLearn Moodle Backup file and discover that it might be version 1.9, according to the first set of lines in an XML file that I discover. It seems I might be in a spot of trouble.

Getting Moodle Restore working

All was not lost, however. After some random searches I found a forum discussion. Fred has a suggestion: change a more recent programming file to an older version (which can be downloaded from the Moodle code repository). I changed the name of my 'restorelib.php' to 'backup restorelib.php' and download the version he suggests.

After replacing the file and restarting the restore process, magic begins to happen and messages are displayed on the screen. I'm then presented with a course restore screen, where a drop down box has the options: restore to new course (what I wanted to do initially), existing course deleting it first, existing course adding data to it. I chose 'existing course deleting it first', carelessly ignore everything else (which has been automatically ticked), and faithfully click on continue. I'm then presented with a list of courses to overwrite (I was surprised by this option since I thought I was automatically going to overwrite the course from where I clicked the 'restore' option through). Ignoring the warning, 'this process can take a long time', I clicked on 'restore this course now!'

4815233102_2dd79fab23.jpg

It didn't take a long time, and a minute or so later, I could happily browse through (and edit) my newly imported OpenLearn courses. Fred saved the day!

But what of the other OpenLearn file options? I'll steer clear of the 'Unit Content XML', the 'OU XML Package' and IMS Common Cartridge for now and instead focus on some of the others.

IMS Content Package

IMS publishes specifications that aim to make learning technology systems interoperate with each other. One of the specifications that they have publishes is the content package (CP). A CP is essentially a bunch of files which are contained with a zip file. In the zip file there is something called a manifest file. This manifest file is, more or less, like a table of contents, when is read by a VLE/LMS like Moodle.

In Moodle, a CP can be a resource (interactive components are called activities). I create a new course, set a course to have a topic format, and choose to upload my CP to the first topic. When this is done, I browse to the newly added resource and Moodle tells me that it is about to deploy the CP (meaning, uncompress its contents and read the table of contents file). When complete, I can now navigate through the different pages of my material.

4815233182_9a3fe65ec5.jpg

One of the differences between this format and the Moodle format is that the content is a lot more difficult to change. You have to use special tools, such as Reload to edit the manifest file, and HTML editors (and other similar tools) to change the contents of individual pages. Also, there is no direct way to include VLE supported interactive tools such as Wikis, blogs or on-line discussion forums in the middle of the material other than using the navigation mechanisms that the VLE provides (this will hopefully become a bit clearer later on).

SCORM

SCORM is an industry standard for the sharing of e-learning materials. SCORM makes use of IMS content packaging and defines an interface between the learning material and the VLE that is used to present the material.

This interface allows the VLE to record information such as whether the user has viewed all the pages of a SCORM resource, store interaction state to the VLE (such as answers for formative questions) and retrieve information from the VLE, such as the name of the current user (to allow partial customisation of a learning experience).

IMS content packages created by OpenLearn can also be viewed using the Moodle SCORM player (but I don't know if there are any problems doing this!).

4814610459_4a2ff30fd5.jpg

SCORM originated from a US government initiative called Advanced Distributed Learning (wikipedia). As a result, it reflects its training origins. Like IMS CP, it does not directly support the inclusion of interactive activities that are provided by a VLE (other than the activities that are contained within the boundaries of a content package).

In Moodle, there are two ways to present SCORM resources. The first, as presented above, is to add it as an 'activity'. The other way is to create a course that has a SCORM format. Rather than having individual weeks or topics, a single SCORM occupies centre stage. Surrounding the centre, it is possible to create Moodle supported activities, such as forums. Here I have create a Moodle wiki, allowing consumers of the OpenLearn course to share links about bridge engineering (!), for example.

4814610507_d113253322.jpg

The way that Moodle presents IMS packages and SCORM objects (or SCOs – sharable content objects) are similar, but subtly different, making me wonder about the underlying source code. When I have time I'll explore the code development history to see whether they are related in any way.

Plain Zip

One of the simplest formats that OpenLearn supports is called plain zip.

Unzipping a 'plain zip' file reveals all the resources for a course (images, video and transcripts), along with two types of HTML file: an index file (which is similar to the Moodle course summary screen that was presented earlier), and set of content pages. The content pages themselves have their own navigation links, i.e. page 1 is connected to page 2 and so on. SCORM, on the other hand, provides its own mechanism to navigate between resource pages, generated by the information contained within a manifest file.

Two other things are provided in the plan zip package: a creative commons deed (describing licencing terms), and a formatting stylesheet. If you want, you can change the font and the colours of the content pages by changing the stylesheet. The action of double-clicking on any of the HTML files within this package displays the material directly in a browser.

So, how can a plain zip OpenLearn package be used in Moodle? Is it possible?

The answer is that it is possible, and it's quite easy, but the end result is obviously not as 'integrated' as the other approaches. First of all, I create a new course. I give my course an obvious name and set it to use the 'topics' format. Then I transfer my OpenLearn zip package to Moodle. To do this, I click on the Files menu (from administration block whilst logged in as an administrator), and upload the zip file to the course (each course has its own file area). When the file has been uploaded, I unzip the zip file. After pressing the course edit button, I can now add a link.

From the resource menu I click on 'link to a file or website'. Here I select 4ROAD_1_section0.html. This is the first content file in a sequence of four. It is the file that presents the learning objectives to a learner.

4814610291_a5b503bbb1.jpg

I turn editing off to see the effect of what I have done. Clicking on the new link takes you to the first page in the OpenLearn content, providing further navigation links that allows you to access all the other resources.

One thing that should be noted is that you have not directly uploaded the resource into a directory on the web server that anyone can access to. Only people who have legitimate access rights can gain access to these files.

These approaches rely on content being downloaded from the OpenLearn site to Moodle. Are there any other ways to tell your students about the OpenLearn content through Moodle?

RSS

The final way that I will describe is through RSS (wikipedia). RSS is most commonly associated with blog syndication. RSS can be described as an XML data structure that contains links to interesting material. OpenLean also provide RSS Feeds to individual courses. If you take a copy of a RSS feed link, you can use it within other tools. One of those tools is Moodle.

Moodle can make use of activities, resources and blocks. Blocks are the pieces of functionality that can surround courses. Blocks can be added, deleted and moved around. One of the blocks that Moodle provides is an RSS block.

Using course I created earlier, I add a new block and paste in the RSS feed link that I gathered from the OpenLearn course, then ticked a tickbox and confirmed something. As if by magic, my new block was populated by the contents of the OpenLearn course I had just told it about.

4815233350_3665e64f54.jpg

Clicking on one of these links takes you directly to the OpenLearn site, where you can access the material directly. The advantages of this approach is that you don't have to do very much, plus the material is always up to date.

There is an outstanding question that this section of the blog raises: could it be possible to create a Moodle activity (or resource?) called an 'RSS feed' that could be placed within the main body of a course? This way, educators could be able to quickly and efficiently group together different OpenLearn (or other forms of OER) resources. Furthermore, this would make it possible to group different 'blog reading or reviewing' activities together which may culminate in a forum discussion or even an on-line audio conference at a pre-arranged time. But here, I'm starting to digress...

Further information

After having completed (more or less) the first section in this post, I discovered an OpenLearn course entitled Re-using, Remixing and Creating Content. This provides further information about the different file types and how they can be manipulated.

Conclusions

There are a number of different ways to use OpenLearn content in Moodle. Each of them differ in terms of how much you have to do and how the end result appears. Taking a personal perspective, which one might be the best approach to use within my project?

What I want is flexibility: the ability to change a course and add an additional category of resource to the middle of it, should this be required. Since I'm going to be using Moodle as my main research tool, it makes sense to make use of the Moodle course format. I can then make use of the Moodle tools (should this be necessary) and move resources and sections around with relative ease.

Permalink
Share post
Christopher Douce

Understanding Moodle localisation

Visible to anyone in the world
Edited by Christopher Douce, Wednesday, 21 Jul 2010, 13:19

moodle-logo-small.gif

Another Moodle activity that I've been tasked with is: 'ensure that different users are presented with user interfaces that match their language choices'.

I understand that software localisation (or internationalisation) is an industry in its own right, replete with its own tools and practices. When you scratch the surface of the subject you're immediately presented with different character sets, fonts and issues of text direction (whether text flows from left to right or visa versa).

My question is: how is Moodle localised into different languages, and does it use any approaches that could be considered to be common between other systems?

This post will only scratch the surface of what is an interesting (and often rather challenging) subject. For example, what is the Moodle approach to dealing with plurals, for example? There's also the issue of how internet browsers send their localised settings to web servers and application engines... Before I've even started with this post, I'm heading off topic!

Let's begin by considering three different perspectives: the students perspective, maintainers perspective and the developers perspective.

Students perspective

A student shouldn't really need to concern themselves with their locale settings, since the institution in which they are enrolled are likely use a sensible default setting. But if students wish to change the LMS interface language (and providing your particular Moodle installation permits the changing of user preferences), a student user could click on their name hyperlink that they see after logging on and click on an 'Edit Profile' tab and search for the 'preferred language' drop down box.

In my test installation, I initially had only one language installed: English (en). In essence, my students are not presented with a choice. I might, at some point during my project need to offer 'student users' a choice of four different languages: German, Italian, Greek and Spanish. Obviously something needs to be done, leading us swiftly to the next perspective.

Maintainers perspective

I log out from my test student account and log back in as an administrator and discover something called a 'Language' menu, under which I discover a veritable treasure trove of options.

The first is entitled 'Language Settings'. This allows an administrator to choose the default language for a whole installation and also to do other things such as limit the choice of languages that users can choose.

The second menu option is entitled 'Language Editing'. It appears that this option allows you to edit the words and phrases (or strings) that appear on the screen of your interface. The link between a 'bit on a screen' and a language specific description is achieved by an identifier, or a 'placeholder' that indicates that 'this piece of text should go here'.

What is interesting is that individual strings are held within Moodle programming files. This makes me wonder whether the action of editing the strings causes some internal programming code to change. This process is mysterious, but interesting.

As a useful aside (which relates to an earlier project related post), I click on 'resource.php' to see what identifiers (and text translations) I can find. I see loads of resource types, including names for resource types, which are numbered. Clearly, when adding new functionality, a developer needs to understand how software localisation occurs.

Continuing my user perspective exploration (after being a little confused as to what 'new file created' means after choosing to view the 'resource.php' translation page), I click on the 'Language Packs' option. Here I am presented with a screen that tells me about what language packs I have installed. By default, I only have a single language pack: English (EN). Underneath, I see a huge list of other language packs, along with a corresponding 'download' link. Apparently, because of a problem connecting to the main Moodle site (presumably because one of my development machines is kindly shielded from world from different nasties), things won't install automatically and have to save (unzipped) language packs to a directory called 'moodledata/lang'.

Let's see what happens by downloading and unzipping the language packs I need.

After unzipping the language packs, I hit my browser 'refresh' button. As if my magic, Moodle notices the presence of the new packs and presents you with a neat summary of you have installed.

Developers perspective

So, how does this magic work, and what does a developer have to know about localisation in Moodle?

One place to start is by exploring the anatomy of a downloaded language pack by asking the questions: 'what does it contain, and how is it structured?' Out of all the four packs that I have downloaded the German pack looks by far the most interesting in terms of its file size. So, what does it contain?

The immediate answer is simply: files and directories. In the German pack I see three folders: doc, help and fonts. The doc and fonts folder do not contain very much, mostly readme files, whereas the help folder in turn contains a whole load of subfolders. These subfolders contain what appears to be files containing fragments of HTML that are read using PHP code and presented to the user. At this point I can only assume that Moodle reads different help files (and presents different content to the user) depending upon the language that a user has selected.

At the root of a resource pack I see loads of PHP files. Some of these have similar file names, i.e. some begin with quiz, and presumably correspond to the quiz functionality, and others begin with repository, enrol and so on (my programmer sense is twitching, wondering whether this is the most efficient way to do things!)

A sample of a couple of these PHP files shows that they are simply definitions of localised strings which are stored in an associative array, which is indexed by a name. Translated into 'human speak', there's a fixed 'programming world' name which is linked to a 'language world' equivalent. You might ask the question of why do 'language localisation' this way? The answer is: to avoid having to make many different versions of the same Moodle programming code, which would be more than a nightmare to maintain and keep track of.

A number of questions crawl out of the woodwork. The main one being, 'how are the contents of these resource packs used when Moodle is running?', but there is the earlier question of 'what happens when you make a change to a translation?' that needs to be answered. Both are related.

Moodle has two areas where localisation records are stored. The first can be described as a 'master' area. This is held within the 'programming code' area of Moodle within a directory unsurprisingly named 'lang'. This contains files which contains identifiers and strings for the default language, which is English. The second area is a directory, also called 'lang', which can be found within the Moodledata directory area. Moodledata is a file area that can be modified by the PHP software engine (the software that Moodle itself is written in). Moodledata can store course materials and other data that is easier to store using 'file storage' area as opposed to using the main Moodle database.

As mentioned earlier, language packs are stored to the Moodledata area. If a user chooses to edit a set of localised strings, a new version of the edited 'string set' is written as a new file to a directory that ends with '_local'. In essence, three different language resources can exist: the 'master' language held within the programming area, the installed 'language pack', and any changes made to the edited language pack.

During earlier development work, I created a new resource category called an 'adaptable resource'. After installing the German resource pack, using the 'master language pack', Moodle can tell you whether there are some translations that are missing.

4814610613_9b910ff2c8.jpg

After making the changes, the newly translated words are written to a file. This file takes the form of a set of identifier definitions which are then read by the Moodle PHP engine. Effectively, Moodle writes its own programming script.

Using this framework, developers shouldn't have to worry too much about how to 'localise' parts of their systems, but before stating that I understand how 'localisation' works, there's one ore question to ask.

How does Moodle choose which string to use?

When viewing a course you might see a the 'topic outline' headline. How does Moodle make a choice about which language pack to use? I begin my search by looking through the code that appears to present the course page, 'course/view.php'. There isn't anything in there that can directly help me, so I look further, stumbling upon a file within a 'topics' sub-directory called 'format.php'.

In the format file I discover a function called get_string, which references an identifier called 'topicoutline'. This is consistent with the documentation that I uncovered earlier. The get_string function is the magic function that makes the choice about where your labels come from.

Get_string is contained within a file called 'moodlelib.php' which is, perhaps unsurprisingly, contained within a directory called 'lib'. Moodlelib is a huge file, weighing in at about eight thousand lines. It is described as (in the comments) as a file that contains ‘miscellaneous general-purpose Moodle functions’.

Get_string is a big function. One of the first things it does is figure out what language is currently set by looking at different variables. It then creates a list of places to look where localised strings can be found. The list begins with the location of where language packs are installed to, followed by areas within the Moodle codebase that are installed by default. It then checks to see if any ‘local’ (or edited) versions of the strings that have been created (as a result of user editing the language packs). When the function knows which file the strings are held in, Moodle reads (includes) the file and caches the contents of the 'string file' into a static variable (so Moodle doesn’t have to read the file every time it needs to fetch a string) and returns the matching localised string.

In the middle of this function there is extra magic to present sensible error messages if no strings are found, and other code to help with backwards compatibility with earlier versions of Moodle. It also seems to check for something called 'parent languages', but I've steer clear of this part of the code.

Testing language installation

Has all my messing around the languages worked? Can I now assign different users different languages? (Also, can users choose their own language preferences?) There is only one way to find out. Acting as an administrator I created a new user and set the users default language to Italian. I logged out and logged in using the new user account.

Moodle in Italian

It seems to work!

The one thing that I have not really explored is whether Moodle will automatically detect the language a user has configured on their internet browser. A little poking around, indicates that Moodle can indeed be clever and change its language dynamically by using the hidden 'language' information that is sent to a web server whenever a HTTP request is made.

The 'dynamic language adaptation' functionality is turned on by default, and a switch to turn it on and off can be found within the 'language settings' menu that the administrator can use.

The fact that Moodle can dynamically change in response to browser (and potentially operating system) settings is interesting. One of the things that the EU4ALL project is exploring is whether it might be possible to tell web-based systems whether certain categories of assistive technology are being used. This may open up the possibility of user interfaces that are more directly customised to users individual needs and preferences.

Other 'languages'

I've described (rather roughly) how Moodle takes care of software localisation, but how is it handled in other programming languages. I've used Java and the .NET framework in the past, and each system provides its own way to facilitate localisation.

Java makes use of something called a resource bundle (Sun Microsystems). dotNET, on the other hand, uses something called resource files (Code Project). One question remains: is there a generally recommended approach for PHP, the language on which PHP is based? Like with so many different things in software, there is more than one way to get the same result.

The author of the PHP Cookbook describes another way to think about localisation. This approach differs in the sense that it focuses more on demonstrating localisation by using object-orientation (an approach that Moodle has historically tried to steer away from, but this seems to be changing), and doesn't really address how a user might be able to edit or change their own strings should they not like what they see.

Conclusions

Software localisation, like accessibility, is a subject that software developers and web designers need to be aware of. This rather long post has outlined how software localisation is broadly achieved in Moodle. Much, however, remains unsaid. Issues such as how plurals, right to left scripts and multi-character fonts have been carefully side stepped.

What is clear is that Moodle appears to have a solid infrastructure for localisation which seems to work, and provides site maintainers the ability to add different languages without too many headaches. Also, whilst browsing the documentation site I stumbled across a documentation page that hints at potential future localisation developments.

Although I have mentioned one other way to approach localisation within PHP it might be useful at some point to explore how comparable learning management systems tackle the same problem, perhaps also looking at how localisation is handled in other large projects.

Localisation will always be something that developers will need to address. Whenever new functionality is introduced, developers will obviously make provision to ensure that whatever is developed is understandable to others.

Permalink
Share post
Christopher Douce

User generated mobile learning designs

Visible to anyone in the world
Edited by Christopher Douce, Wednesday, 21 Jul 2010, 13:17

Photograph of different iPod devices

Would I be considered to be weird if I said that I quite like exams? I admit, I do quite like the challenge, but more specifically, I also like the feeling of opening a paper and knowing (roughly) how to answer the questions I find, and making a choice about which questions I'm going to answer, and which ones I'm going to ignore (if I have a choice, of course). I also like receiving the result and relaxing when a course finishes!

A big question to ask in relation to taking exams is, 'how do you successfully transfer all the knowledge and understanding from your course into your head in such a form that you can answer potentially challenging (and interesting!) questions?' We all have our own unique set of strategies. I'll share some of mine.

Repurposing material

When I'm taking a course, one of the things that I do is make voluminous notes. I am a sucker for writing things down. I buy a couple of dividers and split a A4 (or a lever arch) file into sections corresponding to the blocks. I usually have a couple of extra dividers free for 'other stuff'.

I admit that I sometimes go a bit far, especially when I insist on choosing a single brand of pen for the whole set of notes that I make during a course. I make headings in a consistent style and sometimes experiment with underlining colours!

Although this might seem to be a bit unusual (in terms of my studying rituals), the activity of taking notes is central to my studying strategy. Once I have my notes and the exam date is looming, I sometimes re-write my notes. I take my sides of A4 and 'summarise them down' to a single side of A4, trusting that the stuff that is not on the page is faithfully held within my head.

In the e-learning world, the term 'repurposing' crops up from time to time. It means to take existing materials that have been designed for one purpose and to change them in some way so they can be used for something else. One of the difficulties of e-learning content repositories is that it is difficult to repurpose or reuse existing learning materials, perhaps because of the granularity of the material, or perhaps because that some material is too closely connected to a particular learning situation (or context). But I digress…

When working towards an exam, I actively 'repurpose' the contents of the course that I am studying. I take the course and transfer themes and ideas from the text books or the course materials and transfer them into my A4 file.

Learning pathways

The A4 file represents my own unique adventure or path through a set of learning resources, replete with questions to self, underlining, quotations and green underlining. My repurposing activity, as an active learner, is a construction activity. In essence, I have designed my own learning resources, or have designed my own learning.

When I was a student on The Challenge of the Social Sciences, I have to confess I was not looking forward to the exam. What helped me, was not only the excellent resources that the course team provided, but also the mind maps, sets of notes and other forms of crib sheets that my fellow students had posted selflessly to our on-line discussion forum. They were a great help, not only in seeing that others were revising as hard as I was, but they were also pointing out and bringing different parts of the course together in ways that I had previously missed. Guys, I owe you one!

Dead time

I often travel on a train. When studying, I try to read when I am travelling, which I find difficult. One of the reasons, other than that I cannot easily take notes because the train is bumping around (!), is that I'm often sitting next to someone who is insisting on talking loudly on their mobile phone the moment I wish to try to settle down to learn something about the history of empiricism. Not to mention the lack of 'elbow room' needed to work through ones course notes.

I much prefer listening to podcasts. Listening is another one of my learning preferences. If only I could easily convert my notes into audio form, I might be able to make better use of the 'dead time' I spend on a train.

One thing I could try to do (but I shall never dare!) is to make a podcast of my own notes. This does sound a bit extreme since I am lead to believe that making a podcast takes up lots of time, not to mention equipment.

You need to learn how to use your sound recording software, you might even start with a script, then there is a period of editing (podediting?) to edit out the false starts, door bell ringing, the dog or telephone…

This makes me wonder: is there a way to repurpose textual notes, interesting quotations, chapter headings and thematic points in such a way that you can create an interactive audio file that contains pathways that you could navigate through whilst your travel?

iLearningNotes

Not so long ago I learnt about the Daisy talking book project and was struck by the quality of the speech synthesisers that could be used (some of the same synthesisers are also used by the current generation of screen readers).

Imagine a tool, not unlike Compendium, where you could build audio mind maps. Underneath headings you could add notes and quotations. You could establish conceptual links between different titles, chapters and ideas. The graphical structures that you create could then be converted into speech using a high quality speech synthesiser.

Another possibility could be that you might be able to use excerpts from other podcastsVideo player: Media:Titanium.ogg

(Wikipedia example). Of course, there may be nothing stopping you making your own recordings, perhaps combining your material with words from other sources (providing you adhere to licence conditions, of course).

When you have finished editing you could transfer your edited interactive 'audio map' (which may even have corresponding iconic pictures!) to a magic mobile device not unlike an iPod. You could use the magic wheel control to move through the chapters, sections and notes that you have 'built'. You may also be able to control the rate of playback, allowing you to skip over sections of which you become more familiar.

When you have created your audio notes, in true Web 2.0 fashion you could share your own personal course specific pathways with others. You might be even able to repurpose or modify pathways created by other people so they closely match your own individual learning needs. Furthermore, these resulting navigable audio equivalents may have the potential to be useful for people with disabilities.

Back to learning design

There are some resonances between these ideas and the area of learning design tools and systems.

I first came across the concept of learning design when looking through the IMS specifications. I soon learnt that IMS LD was an XML language that could be used to construct descriptions of learning activities that could be executed using a player. I later came across a system called LAMS, and most recently was told about something called the e-lesson mark-up language, ELML.

Learning design, as an idea, can take many forms. The different systems vary in terms of dynamic adaptability, ease of authoring and who the language or system is intended for. Another is presented by CloudWorks, from what I understand.

My designs

When I study, I design my own learning with help from the materials that I am provided. This may occur when I travel on a train, carry out internet searches on the internet, or read some notes whilst drinking a cup of tea at home.

My own personal pathway through a set of resources may be very different to the pathway that other learners may choose. Learning about the differences, potentially through mobile devices, may help me (and fellow learners) to see new sets of connections that were not immediately understandable.

In doing so, we have the potential to create devices and tools that make better use of our 'dead time'.

Image modified from wikipedia

Permalink
Share post
Christopher Douce

Exploring how to call SOAP webservices using PHP (and Moodle)

Visible to anyone in the world
Edited by Christopher Douce, Wednesday, 21 Jul 2010, 13:00

4815188662_bd8a3e24e0_m.jpg

This post describes my second bash at understanding PHP and SOAP webservices, work carried out off and on over the last couple of weeks. The first time I connected PHP to an externally hosted web-service was using a script that I wrote that was external to Moodle. Now my challenge is slightly different: to try to get Moodle calling external web services.

Just to make sure I understand everything, I'm going to present some background acronyms, try and remember what pages I looked at before, then step towards uncovering parts of Moodle that are in some way connected to the magic of web services.

Background information

I'm required to interface to web services that use the SOAP protocol (wikipedia). SOAP is, I am led to believe, an abbreviation for Simple Object Access Protocol. In a nutshell, SOAP allows you to send a message from one computer to another, telling it to do stuff, or asking it a question. In return, you're likely to get a response back that either tells you what you wanted or indicates why your request had failed. SOAP is one of many different techniques that you can use to pass messages to one computer to another over the internet.

Another technique, which is simpler (and faster) but has some limitations that SOAP gets round, is REST (wikipedia). More information on this 'architectural style' can be found quite easily by doing a quick internet search. My focus is, however, SOAP.

So, assuming that one computer exposes (or makes available) a web service to another computer, how do other computers know how to call a service? In other words, what parameters or data does a particular service expect? The answer is that the designers of SOAP service use a language that describes the format of the messages that the SOAP server (or service) will accept. This language is called WSDL, or Web Services Description Language (wikipedia).

Each SOAP server (or service) has a web address. If you need to find out what data a SOAP service requires, you can usually ask it by adding ?wsdl after the service name. This description, which is presented in a computer readable structure, can sometimes help you to build a SOAP call – a request from your computer to another.

Very often (in my limited experience of this area), the production and use of this intermediate language is carried out using layers of software tools and libraries. At one end, you will describe the parameters that you will process, and some magic programming will take your description (which you give in the language of your choice) and convert it into a difficult to read (for humans!) WSDL equivalent. But all this is a huge simplification, of course! And much can (and will) go wrong on the journey to get SOAP web services working.

A web service can be a building block of a Service Oriented Architecture (again, wikipedia), or SOA. In the middle, between different web services you can use the mysterious idea of middleware to connect different pieces of software together to manage the operation of a larger system, but this is a whole level of complexity which I'm very happy to avoid at this point!

Stuff I looked at earlier

The first place that I looked was in a book! Specifically, the PHP Cookbook.

Chapters 14, consuming web services, and 15, building web services looked to be of interest, specifically the sections entitled 'calling a SOAP method with/out WSDL'. Turning to this section I was presented immediately with a number of possibilities of how to make SOAP calls since there are a number of different implementations depending upon the version of PHP that you're using.

Moodle, as far as I understand, can work with version 4.3 of PHP, but moves are afoot to move entirely towards version 5. My reference suggested its perhaps best to use the bundled SOAP extension as opposed to the other (PEAR::SOAP or NuSoap) libraries since they are faster, more compatible with the standards, automatically bundled and exceptions (special case errors) that occur within SOAP are fed into corresponding PHP exception constructs to make programs (theoretically!) easier to read.

Consuming services

On my first attempt to call a web service, I ran into trouble straight after starting! All my code was failing for a mysterious reason and my debugger wasn't deciding to give me anything that was useful. After doing some searching and finding some on-line documentation I gave the PEAR library a try, but ended up just as confused. I ended up asking one of my illustrious colleagues for help who suggested that I should add an additional parameter to original attempts using the PHP extensions to take account of local network setup.

Calling seemed to be quite easy. I could create something called a SOAP client, tell it which address I want to call, give it some options and make a call my sending my client a message which has the same name of the web service which I want to call, optionally loaded up with all my parameters. To see more of what came back, I put some of the client variables in some temporary variables so I could more easily watch what was coming back in my debugger.

Producing services

Now that I (more or less) knew how to call web services using PHP, it struck me that it might be useful to see how it might be possible to present web services using PHP. This was found in the next chapter of the book.

To maintain consistency, I asked the question how might I create some WSDL that describes a service? Unfortunately, there is not an easy answer to this one. Although the integral SOAP libraries don't directly offer support to do this, there are some known techniques and utilities that can help.

One of the big differences between PHP and the WSDL language is that PHP is happy to just go ahead and do things with data without having to know exactly what form (or type) the data takes. You only get into trouble when you ask PHP to carry out operations on a data item that doesn't make sense.

WSDL, on the other hand, describes everything, giving both the name of a data item and its type. Because of this, you can't directly take a PHP data structure and use it to create WSDL. To get round this difference one approach is to provide this additional information in the form of a comment. Although comments are intended to help programmers, they can also be read by other computer programs. By presenting data type information in the form of a comment, an intermediate program can create WSDL structures without too much trouble, saving developer time and heartache. This approach is used by both the NuSoap library and code that works with PHP 5. But I digress...

Moodle web services code

There appear to be some plans to expose some of the Moodle functionality via a series of web services, enabling Moodle to be connected to and used with a range of external applications. There is also a history connecting Moodle with external assessment systems using web services.

A grep through the Moodle codebase (for 1.9) reveals a library called (perhaps unsurprisingly) soaplib. There appears to be some programming logic which makes a decision about which SOAP interface library to use, depending upon the version of PHP: use the native version if PHP 5 is used, otherwise NuSoap.

I'm guessing that the need to use the NuSoap library will gradually disappear at some point, but a guess is totally different from finding out whether this is really going to happen.

One way to find out what is going on and what lies in store for the future is to explore the on-line discussion forums and quickly find a forum that is dedicated to discussing Moodle web services. It appears there are two interesting developments, something called the Moodle NetWork (which allows you to share resources between different instances of Moodle, at a first glance), and non-core Moodle code contribution called the OKTech Web Services. After a little poking around it's possible to find some documentation that describes this development in a little more detail.

I also discovered a documentation page entitled Web services API , but is related to XML-RPC (wikipedia) rather than SOAP. My head is beginning to hurt!

Returning to the Moodle core SOAP library, I ask the question: what uses the soaplib? One way to do this is to search for calls to functions that are contained within this library. I have to confess, I didn't find anything. But, what I did find is a discussion.

It turns out it was added as a result of work carried out at the University of York in the UK for a project called Serving Maths that created something called the Remote Question Protocol (RQP). The initial post mentions concerns about not being able to make use of some of the additional parameters that the PHP 5 library provides. This is a concern that I share.

Next steps

I've more or less finished my whistlestop tour of Moodle components and code that relate to web services type stuff. I'm sure there is more lurking out there that I haven't discovered yet. But what of a conclusion?

Since I'm not planning on using Moodle to expose any web services I can thankfully sidestep some of the more difficult discussions I've uncovered.

Also, since there isn't much in the way of existing SOAP utility code that I can build upon and I roughly know more or less how to call web services using the magic functions that are provided in PHP 5, I'm going to try to more or less directly add some lines of code to Moodle. But before I do this, like every good developer, I'll test things out using a test harness to explore how my target services behave.

Image: modified from wikipedia

Permalink
Share post
Christopher Douce

Understanding Moodle accessibility

Visible to anyone in the world
Edited by Christopher Douce, Tuesday, 2 Dec 2008, 17:13

moodle-logo-small.gif

To really understand why things are the way they are today necessitates understanding what has happened in the past. This blog post is an attempt to build up an understanding of the current state of Moodle accessibility by looking into what has happened during parts of its development. My methodology is simple: begin with internet (and Moodle forum) searches, ask a few people to see what they know, and see where it takes me!

Initial results

A quick search using Cuil took me to some Moodle developer pages and the Moodle Accessibility Specification which has the headline, 'the document specifies improvements to the accessibility of the Moodle course management system for version 1.7’' This is useful. Both the page itself and the release number can point me towards some dates. Version 1.7 of Moodle dates from November 2006 onwards (until March 2007, when version 1.8 is released).

Digging a little further in the Moodle documentation, I discover the release notes for version 1.7. This provides a huge amount of information. Release notes are very often overwhealming for the casual reader. So, to help my search, I search this page for the term 'accessibility'.

Under Moodle 1.8 release notes, the words 'the Moodle interface is now compliant with XHTML Strict 1.0 and major accessibility standards' catch my eye. This is interesting, but what does this mean? Thankfully, there is a link. I’ll try to uncover what the significance of XHTML Strict later. Let's continue with the search for discussions relating to 'major accessibility standards'.

Moodle Accessibility Page

The link found on the 1.8 release notes takes me to the Moodle Accessibility page. The page provides several groups of other links: starting points, standards, legislation, tools and resources. A couple of things jump out at me: a link to the development tracker that relates to Accessibility Compliance in Moodle 1.8, a link to Italian Accessibility Legislation Compliance, and a link to an accessibility forum (guest login required).

It looks like I might be finding some very useful stuff! So much stuff, I need to focus down on what is often very important to me: source code. Code cannot lie, but on its own, it cannot always tell you its history... Thankfully, there are other ways to understand how (and why) things have changed.

Looking at the detail

To enhance the accessibility of Moodle, the developers have created tasks within a combined bug tracker and change management system. This is something that is common to loads of other software developments. Change management systems help developers to keep track of what has changed, when and by whom. If bugs are accidentally introduced as a result of changes, keeping records can help us to understand why. A side effect of a good tracker is that it can also tell you what changes are incorporated into individual releases.

Let’s have a look at a tracker entry to see what one of them says: Indicate type of resource in the name of the resource. This is an interesting one. For screen reader users, having advance warning about the file type is useful, particularly if a link is to a resource that is handled by an application outside of the browser, such as a PDF file, for example.

It’s also interesting to see that the tracker can also contain information about debates about the development of the software and, sometimes, its requirements. Clicking on the 'change history' may sometimes present you with a file that summarises the modifications that a Moodle developer has made to several files to make the accessibility enhancement.

Higher level advice

As well as the Accessibility Specification, one of the developers has created a useful page entitled Accessibility Notes (found within the developer area). This includes an executive summary of some of the guidelines, a roadmap for further accessibility developments, pointers towards future areas of development and a link to some accessibility 'patterns' which have been derived from the Web Content Accessibility Guidelines (WCAG).

Relationship to WCAG?

You often hear WCAG mentioned in relation to different levels of conformance, specifically A, AA and AAA. Whilst searching the terms Moodle and WCAG, I found myself back at the forum that I mentioned earlier which had the title, a forum to discuss 'planned conformance to standards/laws such as the Web Content Accessibility Guidelines (WCAG), Special Educational Needs and Disability Act (SENDA), Section 508 (USA)'

It should be said that there is no formal way to 'conform' to the WCAG guidelines. Whilst some of guidelines can be assessed by machine (by the use of a computer program), some sections of the guidelines require real people to determine whether or not a web page is accessible (according to the guidelines). It should be noted that even if something is accessible under one measurement, to some users, this might not be the case.

The issue of compliance is also complicated by the fact that Moodle (along with many other learning management systems) can make use of different blocks, modules or components in a range of different ways. The way that an application is use and configured can significantly influence its accessibility.

Although there is no definitive statement how Moodle adheres to the different WCAG 1.0 levels, but I have discovered a forum posting that relates to a question about the American Section 508 procurement legislation. But will there ever be a statement about WCAG? I decided to dig further by speaking to one of the contributors to the Moodle Accessibility Specification.

Whilst WCAG is great for content, it doesn’t work so well with interactive systems. The Moodle accessibility specification has been created by distilling accessibility principles and ideas from a number of different sources, WCAG as well as an organisation called IMS (see also the IMS Guidelines for Developing Accessible Learning Applications).

Future work?

It was recently announced that the latest version of the WCAG guidelines (version 2.0) will be soon released. One interesting piece of work would be to carry out an assessment of a 'vanilla' (or out of the virtual box) installation of Moodle against these new guidelines.

Strict!

Earlier on I mentioned that I might explore what is meant by the mysterious words XHTML Strict. Whilst browsing the Moodle accessibility pages, I discovered the Moodle tracker task that asked the developers to move to web pages that are 'marked up' in this way.

One part of this tracker jumps out at me, specifically: 'avoid using, within the markup language in which the page is coded, elements and attributes to define the page's presentation characteristics'. In essence, use semantic tagging on web pages as opposed to tagging that relates to the change of the visual characteristics of a display. Rather than using bold tags to indicate a heading, a developer should instead use heading tags. This way, the tags that 'add meaning' to a document can help users who have assistive technology navigate through a page more easily.

A further comment on the subject of semantic tagging is that if a developer needs to add visual formatting to a page, cascading style sheets should be used (CSS). CSS can be used to separate the structure of the content from how it appears on the users screen. A great illustration of what CSS is and what it is capable of can be found within the CSSZengarden.

There is another line within the tracker problem that was interesting: 'for all new sites, use at least version 4.01 of HTML, or preferably version 1.0 of XHTML'. What does this mean, and is there a difference between the two, and why is a difference preferred? Let’s have a look what they are in Wikipedia which contains a paragraph that explains how XHTML relates to HTML.

It seems there are little differences between the two, except that the HTML pages become well-formed XML documents. Not only can then the resulting pages be manipulated by programs that can manipulate XML (and more easily check for different types of conformance – page checking is mentioned in the tracker comments page), but by insisting that they are 'well formed' may prevent the possibility of 'ill-formed' pages confusing assistive technologies, such as screen readers.

The tracker provides more information about how XHTML relates to accessibility. WCAG states that content authors (and you could argue that a page generated by Moodle is content) should 'create documents that validate to published grammars' (checkpoint 3.2). Other useful WCAG checkpoints include guidance not to use deprecated (now obsolete or old) features, and select W3C technologies when they are available, and use the latest versions. In essence, take advantage of new technologies when they are available for use.

Summary

It seems that accessibility, as a subject, has been discussed on the Moodle forums since November 2005. Since this date, a lot of work has been carried out to improve the accessibility of Moodle, some by the Open University. Evidence of this work can be found documented within the Moodle project without too much difficulty. I hope this post has helped to show where (and how) to find information about Moodle accessibility.

Although it can be argued that no platform is totally accessible, strides have been made to make Moodle more suitable for users of assistive technology. Anyone who uses Moodle has to be aware that the accessibility of such a system does not only depend upon the programming code alone, but also how it is used, and what materials it presents to learners.

Acknowledgements are extended to those who I spoke to during preparation of this post. You know who you are!

Permalink
Share post
Christopher Douce

Discovering Moodle profile fields

Visible to anyone in the world
Edited by Christopher Douce, Wednesday, 21 Jul 2010, 12:58

EU4ALL logo

One way to improve e-learning user experience is to attempt to present material that match a learners precise needs and preferences. In terms of accessibility, it would be non-sensical to provide a screen reader user with a digital video resource, if that resource contained images or illustrations which did not have accompanying auditory explanations.

The previous post explored how it might be possible to add a new category of resource to Moodle, an 'adaptable resource'. This post will try to explore a related piece of the puzzle by examining how it might be possible to tell Moodle about your own e-learning content preferences.

Some background

A learner might use a range of different e-learning systems at different schools or universities during a learning career. One problem might be the need to continually tell different systems what your content preferences might be. Let's face it: this is trouble! Not only would this take time, but it would also no doubt introduce errors. One solution to this might be to allow a user to store their preferences on a server somewhere. This server could then share user preferences to different systems, subject to some form of magic authentication.

A learning management system could be used allow a learner (or someone acting on behalf of a learner) to edit and change their centrally managed preferences. The question is: how could we demonstrate this idea using Moodle?

Let's begin from where I left off in the previous post: user profile developer pages.

Returning to code

What this page says is that it's possible for a user of Moodle to store extra 'stuff' about a group of users to a database. This sounds great! But how does it work? In true developer fashion, ignoring all the user documentation, I delved into the source code and then browsed over the database structures. I found quite a few tables that relate to the user. There were tables relating to fields, data and categories, and a hint of previous accessibility development work as evidenced by the presence of a 'screenreader' field (but more of this later).

It soon became clear that there was quite a lot of existing functionality that might be able to be 'leveraged' (horrid word!) to facilitate (another one) the entering of user preferences. I liked what I saw: code where the functions were not too (not bigger than a screenful) and had the odd set of comments (you can read that in two different ways). Looking at the code, whilst useful, is never enough. It was time to have a look to see what the user sees.

Return to the user interface

Within a couple of minutes, I found it was possible to construct a way to enable both the user and the administrator to enter extra data against a particular user profile. Using the Moodle tools I created a really quick pull down menu to represent a learner specifying their preferences.

4815188614_d799dfb361.jpg

I should note, that a single menu represents a tip of the iceberg regarding the issue of entering user preferences! My titles are undoubtedly badly chosen. Also, there are existing metadata standards, such as AccMD (powerpoint), which can be used to describe user preferences, but I certainly won't go this thorny area here...

Along the way I stumbled across some documentation pages that describes the Moodle user profile.

Joining the dots (or nodes)

Okay, so this part of Moodle might be able to be used as a simple user interface to allow a user to specify their content preferences, but how (and where?) might I store other information like 'special-magic-numbers' or identifiers that can allow the VLE to understand that other systems are referring to the same user? (I hope this sentence makes sense!)

It seems that there are ways to store additional stuff in a Moodle profile too, fields that can be accessed and used by an administrator, but cannot be seen or edited by learners.

But... why?

As ever, one simple question has created a whole raft of others:

  1. Where did this feature come from?
  2. How is the data represented in the db? (looking at things from a developers eyes again!)
  3. What part of the code should I modify so I can connect the Moodle user interface to some kind of magic 'preferences server'?
  4. What does this mysterious 'screenreader' option do?

I'll leave some of them for another day, but I shall 'touch upon' answers to the first and the fourth.

Answers... of a sort

Apparently the capability to add profile fields (and categorize them) was added in version 1.8 of Moodle (which also incorporated a number of accessibility enhancements). I've tried to find the discussions on the forum that culminated in the addition of this feature, but I've had no joy - but what I have learnt is that there is talk about making an even more customisable version of the user interface, but I digress.

Wishing to know more, I turned my attention to the code to see what it could tell me. References to the screen reader profile tag is found scattered throughout the codebase. It appears to change how certain parts of the HTML is presented to browsers. It is found in the chat module, within the file type resource code, the question engine code (where additional feedback is presented to screen reader users), and in some of the currently mysterious theme code. I sense this question is a bit harder to answer than I had initially anticipated!

Onwards and upwards (or should it be downwards?)

Now that I know roughly how to make a custom user profile interface, my next task is to identify where in the code I should add some magic to make Moodle speak to different servers. Wish me luck!

Permalink
Share post
Christopher Douce

Working with new Moodle resource types

Visible to anyone in the world
Edited by Christopher Douce, Tuesday, 2 Dec 2008, 17:14

Moodle logo

As a part of the EU4ALL project, I have been trying to figure out how to add a new resource type. The idea is to add a resource known as an 'adaptable resource', whereby different media types are presented to the user depending on their accessibility preferences. The issue of how and where to assign or change these preferences is currently a question that has to be resolved. This post is intended as a bunch of 'notes to self' about what I have found during the last couple of days exploring and poking around the Moodle code base.

To explore the code, I've been using a couple of tools: SQLYog, which was recommended to me by an illustrious IET developer (to allow me to explore an instance of a Moodle MySQL database I have running on my home machine), and NuSphere, a PHP IDE. I did try the Zend IDE a year or so back, but abandoned it since I became rather confused!

So, how is it possible to add a new resource to Moodle? Initially, I decided to look at an existing resource, beginning with the simplest one that I could find: a simple text resource. By browsing the code base I seemed to find the rough area where the 'resource code' lives. I also browsed around the developer documentation page an unearthed a resource class template. Great!

In development, one question instantiates a tree of others. The most fundamental question is: how does this code work? I need to answer this big one to make a change. This is too big, so I split it into two other questions: (1) how can you modity a form that allows you to enter the parameters that describe an adaptable resource (currently it is to be a simple numerical value, from what I understand), and (2) how can I take the values held within a form and update them to the MySQL database? This requires an understanding of further magic code. As a note to myself, let's have a look at each of these in turn.

Entering stuff

Looking at the text resource code, there seemed to be a bit of object-oriented polymorphism going on. The name of the directory where the resource code is important too! There is a magic function called display which appears to make some further magic calls to create some data entry fields - but these calls are quite a long way away from the pure HTML that is presented in the browser window.

This is another question: how does the magic functions in display() get turned into HTML? The answer apparently lies with the application of a forms library called PERL. If I figure out how to add functions in a way that would work for this library, I can ask the user for whatever I want.

The form uses some object-oriented principles. Individual controls are added to 'the form', and then a function is executed that 'prints out' or renders each of the controls, without you having to go near to producing your own HTML.

Another interesting observation, is that the display function I have uncovered only relates to a small part of a bigger form. This is due to subclassing and polymorphism that is being used, but this is a distraction... now I have a little understanding of what is happening (thanks to the NuSphere debugger!), I'll park this question for the time being. There are other mysterious areas to explore!

Storing stuff

When a Moodle user edits a course resource, there are a couple of buttons that appear at the bottom of the screen. These are 'save and return', 'save and display' and 'cancel'. Looking at these buttons from a HCI perspective I think, 'buttons doing two different things?? surely this is a bad idea!'. But I digress.

My question is, 'what happens when the tutor (or administrator) clicks on either of the save buttons - where does the data go? Or more precisely, how does the data get saved?

Moodle seems to have a thin database layer: a set of functions that allows you to send SQL statements and receive data in response. Since the contents of the resource form is held in what can only be described as a 'big variable' (PHP has a funny approach to object-oriented programming if you've used other languages), the Moodle developers have figured out a way to transfer the contents of a form to the database, by matching on-screen fields to database fields.

This seems to work well: but on the downside is the database update code that Moodle code generates appear to be rather big, and an implicit dependency is created between the form and the database structure. Other systems that I've looked at make use of stored procedures, which has the potential to boost performance and security on one hand, but on the other restrict the database platforms that an application can be used with.

Moving forwards

Now I know (roughly) how to add extra bits to a new resource type, the next thing I have to do is figure out how to write the functions that I need. After I've done that I'll have to hook up my edits to the database, and figure out how to best display the data that I've produced. I already have some idea about how to do this since I have created a paper prototype.

But before going down that road, I think I'll continue my survey of the Moodle codebase by exploring what sections can potentially relate to adding and manipulation of user parameters and settings. I think I'll start by looking at the user profile developer pages.

Looking towards the longer term, I will also have to connect Moodle to a number of different web services. Wish me luck!

Permalink
Share post
Christopher Douce

Learning from TV

Visible to anyone in the world
Edited by Christopher Douce, Saturday, 1 Nov 2008, 09:05
I have to admit I do get more information, and dare I say it, learning from the television than I should do. I’m a bit of a sucker for factual documentaries and the odd bit of reality television, but for two episodes I have been totally entranced by can’t read, can’t write that has recently appeared on Channel 4.

The programme traces the learning journeys of a number of adults who are learning to read for the first time. My initial reaction to hearing about this programme was one of astonishment: words, to me are like air. They are something that I barely notice because they surround me. As the programme started, I wondered what would unfold before my eyes and the people who I was presented with astonished me with their determination, intelligence and their love of language.

Phil Beadle’s performance was also astonishing. I’ve done nothing more than read about learning styles and the skepticism that surround them, but he was using them in anger. Jumping out from the screen was the realization that reading (and writing) is an activity that is ultimately synesthetic. To write, you have to integrate the shape of the words with the feeling of the pen. Writing this now seems so obvious. Beadle mentioned something interesting: all his learners had different needs and requirements and no single teaching approach would work for everyone, at the same time.

I connected this need for personalization of education with a project I'm working on that is trying to figure out how to present learning materials that are suited to the needs and preferences of individual learners. A talented teacher will have the skill (and the reflective ability) to undercover what works for which student. Getting this information in to a magical software program that provides learners what they need to help learners to learn is a really tough problem to solve.

I’ve been idly wondering for a while about how much can be done to support the learning of phonics (and writing) using touch screen laptops. I remember from a keynote that learning technologists should be also thinking about what can be cost effective from a learning and teaching perspective. I simplify this terribly: teacher time is expensive but tools that can support learning have the potential to be cheap. The challenge is tuning devices and technologies in a way that is efficient for the educator and effective for the learner.
Permalink 1 comment (latest comment by Ruth Jenner, Tuesday, 17 Mar 2015, 20:55)
Share post

This blog might contain posts that are only visible to logged-in users, or where only logged-in users can comment. If you have an account on the system, please log in for full access.

Total visits to this blog: 2030820