Adding modules to Moodle

Once you've found a module you would like to test, you need to know how to add and install that module.

Getting ready

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.

How to do it...

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.

How to do it...

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 progress.zip.

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.

Note

A 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 moodle/.

Activity module

moodle/mod/

Assignment type

moodle/mod/assignment/type/

Block

moodle/blocks/

Course format

moodle/course/format/

Filter

moodle/filter/

Integration

(varies by module, look for additional instructions)

Question type

moodle/question/type/

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.

Within the 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.

Tip

Be careful that the folder structure from the zip file is maintained when it is extracted.

Unzip the progress.zip file inside the moodle/blocks directory. The path to the root of the module code should be moodle/blocks/progress.

How to do it...

Tip

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.

Once the files are in place, the next step is to install the module. For most modules the process is the same.

  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.
    How to do it...
  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.
    How to do it...
  6. Once the module is installed, you can begin using it. To try the Progress Bar block, go to your course and click on Turn editing on. On the right-most column at the bottom, there is a block containing a list for adding blocks. Select the block name, for example, Progress Bar, to add it.
    How to do it...
  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:
    How to do it...

If you are not sure what the icons on a block do, hover over them for a description. Some blocks will not function properly until you have changed their settings.

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.

How to do it...

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.

How to do it...

Note

Knowing how to install a module is useful. Getting the best results from the module when it is used for teaching is more critical. Instructions describing how to set up common modules for practical teaching can be found in the later chapters of this book.

How it works...

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
  • A readme.txt file in the zip package

There's more...

Filters and course formats are installed in a slightly different way compared to blocks, activity modules, and question types.

Filters

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.

Filters

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.

Filters

Course formats

Course formats allow the layout of a course page to take on a different structure.

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.

Course formats

See also

  • Changing site-wide settings
  • Getting rid of modules
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset