This document describes some of Moodle's design and how you can contribute.
Sections in this document:
From a system administrator's perspective, Moodle has been designed according to the following criteria:
As mentioned above, Moodle has a number of features that are modular. Even if you are not a programmer there are things you can change or help with.
These are by far the most important modules, and reside in the 'mod' directory. There are six default modules: assignment, choice, forum, journal, reading, and survey. Each module is in a separate subdirectory and consists of the following mandatory elements (plus extra scripts unique to each module):
- mod.html: a form to set up or update an instance of this module
- version.php: defines some meta-info and provides upgrading code
- icon.gif: a 16x16 icon for the module
- db/: SQL dumps of all the required db tables and data (for each database type)
- index.php: a page to list all instances in a course
- view.php: a page to view a particular instance
- lib.php: any/all functions defined by the module should be in here. If the modulename if called widget, then the required functions include:
- widget_add_instance() - code to add a new instance of widget
- widget_update_instance() - code to update an existing instance
- widget_delete_instance() - code to delete an instance
- widget_user_outline() - given an instance, return a summary of a user's contribution
- widget_user_complete() - given an instance, print details of a user's contribution
- To avoid possible conflict, any module functions should be named starting with widget_ and any constants you define should start with WIDGET_
- Lastly, each module will have some language files that contain strings for that module. See below.
Themes (or skins) define the look of a site. A number of simple themes are provided in the main distribution, but you may want to copy one of these and customise it to suit your own needs (eg local logo, colours, styles, graphics etc)
Each theme is in a subdirectory of the "theme" directory. You can copy the "standard" theme as a template.
Moodle has been designed for internationalisation. Each 'string' or 'page' of text that is displayed as part of the interface is drawn from a set of language files. Each language is a subdirectory of the directory 'lang'. The structure of the lang directory is as follows:
lang/en - directory containing all files for one language (eg English)
- moodle.php - strings for main interface
- assignment.php - strings for assignment module
- choice.php - strings for choice module
- forum.php - strings for forum module
- journal.php - strings for journal module
- reading.php - strings for reading module
- survey.php - strings for reading module
- .... plus other modules if any.
A string is called from these files using the get_string() or print_string() functions. Each string supports variable substitution, to support variable ordering in different languages.
eg $strdueby = get_string("assignmentdueby", "assignment", userdate($date));
If a string doesn't exist in a particular language, then the equivalent in English will automatically be used instead.lang/en/help - contains whole help pages (for popup context-sensitive help)
Main help pages are situated here, while help pages specific to each module are located in subdirectories with the module's name.
You can insert a helpbutton in a page with the helpbutton function.
eg helpbutton("text", "Click here for help about text");
and for modules:
helpbutton("forumtypes", "Forum types", "forum");
Given a working database with defined tables, the intentionally simple SQL used in Moodle should work fine with a wide variety of database brands.
A problem exists with automatically creating new tables in a database, which is what Moodle tries to do upon initial installation. Because every database is very different, there doesn't yet exist any way to do this in a platform-independent way. To support this automation in each database, schemas can be created that list the required SQL to create Moodle tables in a particular database. These are files in lib/db and inside the db subdirectory of each module.
Currently, only MySQL is supported because that's what I know. If you are familiar with another database (especially open source databases) and are willing to help port the MySQL schema, please get in contact with me (martin@moodle.com).
Moodle 1.0 supports three different course formats: weekly, topics and social.
These are a little more connected to the rest of the code (and hence, less "pluggable") but it is still quite easy to add new ones.
If you have any ideas for different formats that you need or would like to see, get in touch with me and I'll do my absolute best to have them available in future releases.
If you feel like writing a tutorial, an article, an academic paper or anything else about Moodle, please do! Put it on the web and make sure you include links to http://moodle.com/
Participating in the bug tracker
Finally, I would like to invite you to register on the "bug tracker" at bugs.moodle.org so you can file any bugs that you find and perhaps participate in discussing and fixing them.
"Bugs" not only includes software bugs with current versions of Moodle, but also new ideas, feature requests and even constructive criticism of existing features. The beauty of open source is that anyone can participate in some way and help to create a better product for all of us to enjoy. In this project, your input is very welcome!
Thanks for using Moodle!
Cheers,
Martin Dougiamas
Version: $Id: developer.html,v 1.2 2001/12/09 10:34:19 martin Exp $