GETTING STARTED



One of the challenges in Moodle development is finding a good starting point for creating a Moodle plug-in. I thought it would be cool to build a step-wise tutorial on the subject as I embark on a personal whim:

Building a Moodle Module that allows the Student to post their Moodle Forum posts to FaceBook, and elicits responses from their group of friends into a totally separate forum. Perhaps too ambitious for a first project, but it hits all of the major challenges.

I will start by coming up with a cool name for the plug-in. I am thinking of calling it InYourFace ?  This particular exercise will focus on building an activity module - a module that provides an activity that can be added to any Moodle course.

WHERE DO WE START?

NOTE: This tutorial assumes that you already have a working installation of Moodle 1.9.x available, and that you have at least one course installed in your Moodle instance.  It also assumes that you have some basic knowledge of PHP and MySQL.

Before we embark on writing our first Moodle module, let's download a template provided by the folks at Moodle.org. In our case, we will be writing our module for Moodle version 1.9.x:

Download Link for The Module Template for Moodle 1.9

We end up with a file called NEWMODULE.zip which we need to save to our local drive and unzip. In my case, I download to the Public folder, unzip the file and end up with .\Public\NEWMODULE.

NEXT ARTICLE IN SERIES

Wednesday, May 12, 2010

04MOD: Moodle Module Setup - Adding our Activity


Now that we have a module that does absolutely nothing, let's add it to a course. This will give us some confidence on the plug-in architecture, and give us some visual cues on where we need to go as we beef up the module.

So. . .

Let us proceed and add our non-activity module to a course!!!! Hurrah!

Now that the module is installed, we can navigate to a course:



Click Image to Zoom

Once on the course page, ensure editing is turned on:


Click Image to Zoom

Pick one of the course weeks or topics and select our activity (inyourface) from the Activity drop down list:


Click Image to Zoom

Fill out our (currently very ugly and rather sparse) activity definition form and click on the "Save and Display" button:


Click Image to Zoom

You will now see our activity... with a disheartening message: "Your Code Goes Here"


Click Image to Zoom


Actually, that's the GOOD NEWS!

We can now get to work on our module.
It is registered, Moodle recognizes it as a valid plug-in
and we can add it to courses!!!

Next Article in Series

No comments:

Post a Comment