Friday, May 18, 2012

Installing the Questionnaire module

Moodle has lots of plugins developed by people around the world. One of the plugins that a customer of mine uses is the Questionnaire module. I was reminded that this is a very useful and popular plugin that has been targeted for consumption by moodle core, sort of.  In a soon to be released version of moodle, there is supposed to be a new native activity that combines the Questionnaire, Feedback and Survey modules.  For now, we will go with the Questionnaire module.

I downloaded and extracted the file and copied the resulting questionnaire folder into the moodle\mod folder on my server.  Ensured I was still logged in, refreshed my browser and was greeted by my good friend who I hang out with often these days, the Plugins Check page.  I clicked the Upgrade button and after a few seconds saw the message mod_questionnaire successfully installed.

I remoted into the DB instance to see what new tables the installation created and saw 14 new mdl_questionnaire related tables, all nice and empty, at this point. The # of tables installed provides a clue to the capability of this module.

I entered one of our courses, activated edit mode and clicked on the add an activity link and there it was, the questionnaire option.

Rather straight forward and simple, once you have done it a couple times and know how to do things

High level steps for installing plugin

  1. Do your homework and ensure there is a need and a mature plugin available
  2. Find the plugin in the moodle plugin space
  3. Read its release notes
  4. Download the plugin zip
  5. Extract the content of the plugin zip
  6. Copy the extracted folder into the appropriate place // read the documentation in the plugin, Could be /mod, /report, /block etc.
  7. Click on the notification link
  8. Response to the Plugin Check page
  9. Check the DB to see new tables
  10. Check the appropriate menu in moodle for new option, Could be Admin|Reports, Blocks Add, add an activity etc.
The size of the installed folder was about 2.3 MB.

I am reminded of a couple other hallmarks of moodle plugin design:

Hallmarks of moodle plugin design

In the root of the plugin folder, you will find:
index.php // driver file.
version.php // for kicking the Plugin check for updates
settings.php // setting plugin variables
\db folder
\lang folder
\images and \css and \pix folders
db\install.php //populates db tables where needed
db\log.php
db\install.xml // responsible for creating tables for the plugin
db\access.php //setting capability definitions





1 comment: