Image source: http://moodle.org/.
Add modules to your Moodle instance
Selectively use the modules you need
The acronym Moodle stands for Modular Object-Oriented Dynamic Learning Environment. It is modular because you can add and remove modules. The programming paradigm used to create Moodle code is Object-Oriented. It is dynamic because it can be used for information delivery and interactivity, in a changeable and flexible way. It is a learning environment designed for teaching at many levels.
Because Moodle is modular and open source, many people have created modules for Moodle, and many of those modules are available freely for you to use. At time of writing, there are over 600 modules that you can download from the Moodle Modules and plugins database. Some of these are popular, well designed, and well maintained modules. Others are ideas that didn't seem to get off the ground. Some are contributed and maintained by large institutions, but most are contributed by individuals, often teachers themselves, who want to share what they have created.
If you have an idea for something you would like to do with Moodle, it's possible that someone has had that idea before and has created and shared a module you can use. This chapter will show you how to download and test contributed Moodle modules, to see if they suit your needs. Later chapters will help you find modules that will be useful to you and your students, and to show examples of how these modules can be set up and used in teaching.
Origins of Moodle
Moodle began in 1999 as postgraduate work of Martin Dougiamas, "out of frustration with the existing commercial software at the time". Considering the widespread use of Moodle around the world (over 40,000 registered sites in over 200 countries), Martin is a very humble man. If you ever make it to a MoodleMoot and Martin is in attendance, be sure to introduce yourself.
If you only want to test modules, consider setting up your own basic web server, such as XAMPP (http://www.apachefriends.org/en/xampp.html) and installing Moodle from the Moodle Downloads page (http://download.moodle.org/). If you are a Windows or Mac user, you can even download and install Moodle packages where these two ingredients are already combined and ready to go.
Once installed, add a course or two. Create some dummy students to see how modules work within a course. Have a play around with the modules available—Moodle is quite hard to break—don't be afraid to experiment.
The Moodle Modules and plugins database is filled with modules great and small. This book will review a range of useful modules and show you how to use them, but first you may want to know how you can find modules yourself.
It is helpful to know where the modules discussed in this book come from, and how they were judged as worthy candidates for review.
You may have an idea in mind, or you may just want to see what's out there. You'll need a web browser and an active Internet connection.
Point your browser to the Moodle Modules and plugins database. Refer http://moodle.org/mod/data/view.php?id=6009:
Image source: http://moodle.org/mod/data/view.php?id=6009.
As you scroll down you will see list of modules that can be downloaded. At the bottom of the page is a Search facility:
Image source: http://moodle.org/mod/data/view.php?id=6009.
What type of module you want
What version of Moodle you have
A number of other features
The following is a search result for the term 'progress':
Image source: http://moodle.org/mod/data/view.php?id=6009.
Each entry has a type, the version of Moodle that it is compatible with, and a brief description. Clicking on the name of the module will take you to a page with details about the module. This is the module's 'entry':
Image source: http://moodle.org/mod/data/view.php?d=13&rid=2524&filter=1.
Will it work with your version of Moodle?
Is documentation provided?
When was the module released and has there been activity (postings on the page below) since then?
Is the module author active in the discussion about the module?
Is the discussion positive (don't be too discouraged by bug reports if the author is involved and reporting that bugs have been fixed)?
From discussion, can you tell if the module is widely used with a community of users behind it?
What is the rating of the module?
If you are happy with your answers to these questions, then you may have found a useful module.
Here is some additional information that may help you on a module hunt.
In order to get a sense of how modules will work, you need to have an understanding of the distinction between different module types. The following table describes common module types. Amid the array of modules available, the majority are blocks and activity modules.
Activity modules deliver information or facilitate interactivity within a course. Links to activity modules are added on a course main page and the activity module itself appears on a new page when clicked. Examples in the core installation are 'Forums' and 'Quizzes'.
Assignment types are a specific type of activity module that focus on assessable work. They are all based on a common assignment framework and appear under 'Assignments' in the activities list. Examples in the core installation are 'Advanced upload of files' and 'Online text' assignments.
Blocks usually appear down each side of a course main page. They are usually passive, presenting specific information, and links to more information and activities. A block is a simpler type of module. Because they are easy to create, there are a large number of these in the Modules and plugins database. Examples in the core installation are the 'Calendar' and 'Online Users' blocks.
A course format allows the structure of a course main page to be changed to reflect the nature of the delivery of the course, for example, by schedule or by topic.
Filters allow targeted text appearing around a Moodle site to be replaced with other content, for example, equations, videos, or audio clips.
An integration module allows Moodle to make use of systems outside the Moodle instance itself.
Within a quiz, question types can be added to enable different forms of questions to be asked.
If you have access to the Site Administration interface (the Moodle site root page when logged in as an administrator), clicking on Notifications will show you the version number near the bottom, for example Moodle 1.9.8 (Build: 20100325). The first part of this is the Moodle version; this is what you need when searching through modules on the Modules and plugins database. The second part, labeled "Build" shows the date when the installed version was released in YYYYMMDD format. This version information reflects what is stored in the
If you are not the administrator of your system, consult the person who is. They should usually be able to tell you the version without looking it up.
The next version of Moodle to follow version 1.9 has been "on the cards" for some time. At time of writing, only preview versions of Moodle 2.0 have been released. The process of installing modules will not change in the new version, so most of the information in this book will still be valid. You will need to look for versions of modules ready for Moodle 2.0 as earlier versions will not work without adjustment. As modules are usually contributed by volunteers, there may be some waiting before this happens; the best way to encourage this re-development is to suggest an improvement for the module on the Moodle bug tracker system at http://tracker.moodle.org/.
You will need to have your web server running with Moodle installed. If you are not an administrator of the site, you will need assistance from someone who is.
To install a module, you will need to access your file browser to copy files and a web browser to see the results. You will need to be able to unzip files as this is how files in a module are packaged together.
On the entry page for the module, look for the links at the bottom-right of the description. If you have an older version of Moodle, look for the version of the module that is suitable for your version.
Image source: http://moodle.org/mod/data/view.php?d=13&rid=2524&filter=1.
Clicking on the link will take you to a new page, then a download dialog should appear. Most modules are packaged as
zip files. Save the
zip file to an easily accessible location on your computer.
As a specific example, search for the Progress Bar block in the Moodle Modules and plugins database. Find the download link and download the file. The filename should be
Once you have the file downloaded on your machine, you need to unzip the code and copy it to a location within the Moodle file structure. The location for the files will depend on the type of module you are installing.
zip file is a collection of files that have been combined together into a single file and compressed. How you "unzip" a file will depend on your operating system. Most operating systems will provide support to unzip. Try double clicking on a
zip file and you may be presented with a view of its contents; dragging the files from such a view will uncompress and copy the files from the
zip into the location you drop them. If this doesn't work for you, try right-clicking on the
zip file and see what options are available for extracting the files inside.
The following table shows where common module types need to be placed within the Moodle file structure. You will need to know where the Moodle code exists within the file structure of your server when viewed using your file browser (not your web browser). For simplicity we shall refer to this directory as
(varies by module, look for additional instructions)
Most modules are self contained within a single subdirectory. This is especially true for modules created for more recent versions of Moodle. So, generally, you should be able to unzip the contents of the module package to one place.
zip file, there will normally be a structure that should become the directory structure when unzipped. This will usually be a single directory at the root of the
zip file and subfolders within this. Depending on the complexity of the module, there may be a few PHP files or there may be hundreds of files for images, scripts, language translations, and more.
progress.zip file inside the
moodle/blocks directory. The path to the root of the module code should be
When you unzip the files, be sure that you do not add additional directories, for example
moodle/blocks/progress/progress/. Doing so will prevent the block code from being detected and installed. Also take care not to accidentally rename the directory or the files within it as this will affect the functioning of the module.
1. Log in as the system administrator.
2. Go to the root of the site page.
3. Look for the block labeled Site Administration.
4. Click on the Notifications link.
5. When you click on the Notifications link, a scan will be conducted for new modules and updates of existing modules. Database tables will be set up during this process.
7. After you have added a block you will want to change its settings. With editing turned on, look for the Update settings icon on the block. It may vary in appearance when different themes are used, but often it is depicted as a hand holding a pen, or a pen over a notepad:
When you add an activity module, an assignment type, or an integration, you can add an instance by selecting it from the list of resources or activities, depending on what kind of module it is. When you add a module of this kind you will immediately be taken to a page to set it up.
Question types allow a greater variety of questions to be added to quizzes. Once you have copied the directory of files for a question type to
moodle/question/type/, visit the Notifications page as normal. You should then be able to select that question type when creating a new question.
Moodle is designed to be modular, and also to make the process of adding modules as easy as possible. Allowing the code for a module to be in a self contained directory allows module authors to create and share modules without requiring a complicated installation or detailed instructions. Once you've installed one module, installing more is relatively easy.
Not all modules can be contained in a single directory. If this is not the case, you will be provided with additional instructions for installation. A common change needed for some module types is to add a string to a language file. For extra information check the following:
The Modules and plugins database entry for the module
Moodle documentation pages for the module
readme.txtfile in the
Filters and course formats are installed in a slightly different way compared to blocks, activity modules, and question types.
Once you have copied the module code to the
moodle/filter/ directory, log in as the administrator and go to the root page of your site. At this stage if you were to visit the Notifications page, nothing will be shown as no databases are needed for filters. On the Site Administration menu, expand Modules and you will see a link to Filters. Expanding this will show a link to Manage Filters. Clicking this will take you to the filters settings page.
The newly added filter should appear in the list of filters. Clicking the closed-eye icon will enable the filter. Text appearing in labels, web pages, and forums will be filtered and text matching the code specific to the filter will be replaced accordingly. The following is an example of a filter that replaces code, such as
(smile) with icons.
To add a course format, copy the format directory and files into the
moodle/course/format/ directory, log into the course, choose Settings from the course Administration block, then choose your new format from the list of formats.
Activity modules and blocks can have site-wide settings that you can adjust. These settings allow consistent changes in the use of the module across an entire site, but even during testing you might want to change such settings. It may be that you just want to see what settings can be changed globally for a module.
To achieve this you must have your web server running with Moodle installed. You need to be able to log in as the administrator, or get the help of someone who can. You should have installed the modules that you want to change settings for.
The following steps assume you have installed the Progress Bar block, which has global settings that can be changed.
Log in as the site administrator and visit the root page of the site. To get to the global settings of a module, on the Site Administration menu, select Modules, then Activities or Blocks, whichever is appropriate. The Progress Bar block is a block, so select Blocks to reach its global settings.
The next step is to select the name of the module. For our test, the module name is Progress Bar. The settings for the module should appear in a form.
Not all activity modules or blocks have global settings. For many modules, this is not necessary. Changes to the global settings affect the configuration of the module, including any instances that may already exist, and any that are added in future, across the site.
Be a little careful when changing global settings on a live site. If the module is currently in use, changing global settings can affect the experience of students and teachers. Accidentally using invalid global settings can detrimentally affect the running of the module on the site.
Another feature of Moodle is its capacity for internationalization. This means that the same software can be used by people speaking different languages. While translations for over 80 languages are available for the core functionality of Moodle, most modules only offer translations for a smaller number of languages, and the language you are teaching in may not be one of them.
Adding a translation for a module is simple to do. If you give your translation to the author of the module, your efforts could also benefit others who speak your language.
It is assumed that you have set the default language for your site. If not, there is more information about adding a language pack and setting the language for your site later.
In order to create a translation for a module, you don't need any real programming experience; it's actually quite simple. Some understanding of HTML tags can be an advantage.
You will need a text editor that can create and edit Unicode files. Word processors are not appropriate for this task, and a simple editor, such as Windows Notepad, is not up to the job. There are many free editors available that will allow you to create and edit Unicode files. One example available for Windows is Notepad++, which is a free editor and is also available as a portable application.
The steps that follow provide an example that assumes the Progress Bar block has been installed.
Where the module was installed, there will usually be a
/lang folder. For the Progress Bar block this is located at
moodle/blocks/progress/lang. Within this folder, there are folders for different languages, most of them contributed by users around the world.
If you are reading this, it is assumed you have an understanding of English, so have a look inside the
en_utf8/ folder. You will see a file called
block_progress.php and another directory called
block_progress.php file contains strings of text used in the module, each with a code and the string displayed on screen. Open this file in your editor to see the contents.
lang/help/progress/ directory there are a number of HTML files, each relating to a help topic. These appear when a help icon (usually appearing as a question mark) is clicked. Opening these files in your web browser will show you the rendered version of these files and opening them in your editor will show you the HTML source of the documents.
To add a new language, you first need to find out the two letter code for your language. To see the list of supported languages visit the following site. You will also see the code letters for each language, and you need to follow the same code. Refer to http://download.moodle.org/lang16/.
Return to the
lang/ folder. For the Progress Bar block this is at
moodle/blocks/progress/lang/. Assuming that you know English as a second language, copy the
en_utf8/ folder and all of its content. Rename the folder with the two letter code for your language, for example, the folder for Afrikaans would be
af_utf8/. Be sure to preserve the filenames and folder names within (they do not need translation, only the contents).
block_progress.php file in your Unicode editor. You need to translate the string on the right of the
= symbol, within the quotes. Do not translate the code value for the string on the left. You may need to see the string in use to get a sense of what the string is intended for, in order to make an accurate translation. If you include any apostrophes within the string, escape the quote with a slash, as shown in the following example, otherwise the string will be seen as coming to an end earlier than it should.
$string['owners'] = 'Owner\'s';
If there is code within the strings, or HTML tags, that you are unsure about, leave these and just translate any text around them.
You can also translate the HTML files in
moodle/blocks/progress/lang/help/progress/ to produce help files in your language. Open these in your editor and translate the text within the files. Again, avoid changing any HTML or code you don't understand. Some help files also include PHP code segments within
?> tags, avoid changing this content.
Be sure to test your translated files. If, after changing a translation file, nothing appears on the course page, it may be that you have inadvertently created an error. Typically this comes from mismatched quotes around strings. Be sure each starting quote is matched with a closing quote, and any enclosed quotes are escaped. Test that your translated text items are appearing correctly and have an appropriate meaning in your language. Once created, you can use this translation throughout your site.
The final step is to send your translation to the author of the module. You should be able to find their contact details on the Moodle Modules and plugins database entry page for the module. If you have translated the language strings but not translated the help files, this is still a helpful contribution that can be shared.
Zip up the files you have translated and e-mail them to the author who will usually be more than happy to include your contribution within the module for future downloaders.
Each time the module is loaded, its code is interpreted by the web server and HTML is produced to form the part of the page where the module will appear. Within the code, instead of writing text strings in the author's language, there are calls to functions that check the language and draw the appropriate strings from the language files. This way, all that is needed to change from one language to another is a different language file.
If you want to use another language throughout your Moodle site, the following sections are a basic guide for installing and selecting the language.
Visit the following site to find if a language pack is available for your language: http://download.moodle.org/lang16/.
If your language is available, download the appropriate
zip file and extract its contents to the directory
moodle/lang/. If your language is Afrikaans, for example, the language files should be contained in
moodle/lang/af_utf8/. Ensure you do not introduce additional unnecessary directory levels.
To set the default language, log in as administrator and go to the site root page. On the Site Administration menu, select Language, then Language Settings. The default language can be set on the page that appears.
For individual courses a language can be set. This will "force" students to use that particular language rather than their preferred language.
You may have found a module that is helpful, but not exactly what you want. There are a number of ways that you can contribute to changes in modules.
Thank the author and let them know you are interested in their module
Request a new feature
Report a bug
The best place to thank the author is on the Modules and plugins database entry for the module. That way others will see that the module is worth testing. You can also give a rating for the module there.
To request a new feature, the best way is to e-mail the author of the module. Authors are not notified of postings on their Modules and plugins entry page, they only see these postings if they check manually. If there is a forum thread for the module, that can also be a good place to contribute ideas for changes. The authors will usually be subscribed to such forums, particularly if they have posted to the forum themselves.
If you find a bug in a module, try to find a method to reproduce the bug. Consider if the bug is something that might only happen on your server for some reason. If you're confident that you have found a bug that needs fixing, create a "new issue" on the Moodle Tracker at this URL: http://tracker.moodle.org/secure/Dashboard.jspa. You will need to create an account. The tracker supports bug resolution and communication between you and the author.
Moodle is all about learning and sharing. The people who create contributed modules are often teachers themselves, or people interested in open source software. Please allow time for bugs to be fixed and don't be surprised if the author rejects your feature suggestion. It's really 'their baby'.
Module authors have 'opened up' their source. Within reason, you are free to make changes to the modules so that they suit your needs and possibly the needs of others at your institution. If this is what you want to do, read on.
Because the source of modules is made available, you are able to make changes yourself, or to ask other, possibly more technically minded people, to do so for you.
If you do make changes, you need to be willing to share the source code you write with others, and stick to the GNU license conditions. More information is available on the following two pages:
If you can't find a module to suit your needs in the Modules and plugins database, you can always create your own. Writing and sharing Moodle modules is a rich and rewarding experience. The best part about sharing modules you have written is knowing that your code will be used around the world. The idea you have may also help many others.
There are conventions, libraries, interfaces, and processes that need to be learned. To get started, visit this URL: http://docs.moodle.org/en/Development.
Sometimes, the best way to see how it's done is to look at other authors' code.
It is assumed you have your web server running, you have installed a module and now you want to say goodbye to it.
Activity modules (and usually integrations) and blocks can be deleted in two steps.
For activity modules, visit the Activities management page (Site Administration | Modules | Activities | Manage Activities). Click on Delete to remove all instances of the module in courses and any tables set up for the module.
After deleting activity modules and blocks using the Site Administration interface, you still need to delete the code for these modules. If you don't remove the code, the module will be re-installed the next time you visit the Notifications page.
As Moodle is modular and relies on many contributed modules to allow flexibility, the means of removing modules needs to be just as simple as adding them. With activity modules and blocks, that is the case. This covers most modules you will want to add. For other types of modules, removal is not so simple. To find out more, read on.
Filters, course formats, assignment types, and question types need to be removed in special ways.
To remove a filter, first visit the Filters page (Site Administration | Modules | Filters | Manage Filters) and disable the filter (click on the eye icon). You are then free to remove the files for the filter from
To remove a course format, simply remove its directory from
moodle/course/format/. If the format was in use and is no longer available, the format will revert back to a default. It might be wise to check which courses are using the format and set the format for those courses to an acceptable alternative before removing the course format.
Unfortunately there is no clean way to remove an assignment type. It's an activity, but it's not an activity module that appears in the list of activities in the Site Administration section. Question types are also somewhat problematic to remove.
If the assignment type or question type is no longer needed, follow these steps.
1. If you have a live site that services teachers and students, put the site in Maintenance mode (Site Administration | Server | Maintenance mode).
2. Remove all instances of the assignment type or question type from courses.
3. Manually remove the tables related to the module from the database. Take care not to remove other tables such as the 'assignment submissions table' which is used generally. If you are not sure about which tables to remove, don't remove any.
4. Remove the source code.
5. Take the site out of Maintenance mode.
Some modules require access to information outside your server. To achieve this, some modules use the cURL PHP library. If PHP is installed, the cURL library is likely to be available with your web server, but it may be disabled. The XAMPP server has cURL disabled by default.
To enable cURL in PHP 5 on XAMPP, you need to edit the
php.ini file. This file is located in the
php\ directory under your web server's root directory.
Within the file, locate the following line:
Remove the semi-colon to uncomment this line. This will enable the cURL library. Save the file after making this change. Restart the Apache server for this to take effect.
Even with cURL enabled, you may still have problems if your site is hosted behind a firewall. If this is the case, contact your network administrator.