<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-3865135917765173582</id><updated>2024-11-01T04:09:50.422-07:00</updated><category term="learning management"/><category term="lms"/><category term="moodle"/><category term="moodle development"/><category term="moodle module"/><category term="online learning"/><title type='text'>Oodles of Moodles</title><subtitle type='html'>Oodles of Moodles is dedicated to sharing findings that I have ran into as a Moodle developer.  It&#39;s my plan to share some of the frustrations as well as some of the really cool things I have learned from my exposure to what is perhaps the most elegant Learning Management System today!</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-3689246686414915528</id><published>2010-05-18T06:50:00.000-07:00</published><updated>2010-05-18T11:38:42.901-07:00</updated><title type='text'>09MOD: Moodle Module Development - Adding Our Custom Code to the Module</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;&amp;nbsp;After the Module is setup and configured correctly, it&#39;s time to add our own logic.&amp;nbsp; This is what we had been waiting for!&lt;/div&gt;&lt;br /&gt;
The bulk of our logic goes into&amp;nbsp;three scripts in our module&#39;s directory:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;view.php&lt;/li&gt;
&lt;li&gt;lib.php&lt;/li&gt;
&lt;li&gt;locallib.php&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;b&gt;THE MODULE&#39;S &lt;u&gt;VIEW.PHP&lt;/u&gt; SCRIPT&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
This script handles the display of the activity once it is added to a course section.&amp;nbsp; If we look at the code provided in the template, it already handles the following:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Determining the instance of the module for the current course&lt;/li&gt;
&lt;li&gt;Entering the view as an&amp;nbsp;the activity to the Moodle log&lt;/li&gt;
&lt;li&gt;Displaying the Moodle header and footer&lt;/li&gt;
&lt;/ul&gt;&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;In essence, all we need to find is the marker where we can enter our own code. Let&#39;s open the view.php script and look for the following snippet:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;/// Print the main part of the page&lt;br /&gt;
&lt;br /&gt;
echo &#39;YOUR CODE GOES HERE&#39;;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s test it out by modifying it a little, and looking at the values of the Moodle $COURSE global. Modify the snippet above so it now looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;/// Print the main part of the page&lt;br /&gt;
&lt;br /&gt;
echo &#39;&amp;lt;pre&amp;gt;&#39;;&lt;br /&gt;
var_dump( $COURSE );&lt;br /&gt;
echo &#39;&amp;lt;/pre&amp;gt;&#39;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
When we navigate to our course, and look at our activity, it now displays our variable dump:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5ndBHbcs7m0gDrR_HTI8GdsTSWSSyu_IPczmo4OwDN8nv-Eo-ANovnST42pD1n7ZxRHrMPeyDp_S5ETCwQNHfCYd3ZPbCdCHw6zXlsVNPTscuGc_XmLzcg8PBmN2X8e5S03HqQGv5rNg/s1600/coursedump.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5ndBHbcs7m0gDrR_HTI8GdsTSWSSyu_IPczmo4OwDN8nv-Eo-ANovnST42pD1n7ZxRHrMPeyDp_S5ETCwQNHfCYd3ZPbCdCHw6zXlsVNPTscuGc_XmLzcg8PBmN2X8e5S03HqQGv5rNg/s400/coursedump.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;THE MODULE&#39;S &lt;u&gt;LIB.PHP&lt;/u&gt; SCRIPT&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The lib.php script serves two distinct functions:&lt;br /&gt;
&lt;br /&gt;
1. It is where Moodle looks for a number of standard functions that SHOULD be implemented for every module:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Add Instance&lt;/li&gt;
&lt;li&gt;Update Instance&lt;/li&gt;
&lt;li&gt;Delete Instance&lt;/li&gt;
&lt;li&gt;User Outline&lt;/li&gt;
&lt;li&gt;User Complete&lt;/li&gt;
&lt;li&gt;Recent Activity&lt;/li&gt;
&lt;li&gt;Cron handler&lt;/li&gt;
&lt;li&gt;Get Participants&lt;/li&gt;
&lt;/ul&gt;&amp;nbsp;Each of these sections will be linked to an article dedicated to implementing its specific functionality.&amp;nbsp; This article will be updated as these articles become available.&lt;br /&gt;
&lt;br /&gt;
2. A starting place for building our own custom variables and functions.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;OUR OWN &lt;u&gt;LOCALLIB.PHP&lt;/u&gt; SCRIPT&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Although we could place our code inside the lib.php script, it is better to reserve lib.php for the Moodle handlers.&amp;nbsp; It is a better practice to create our own locallib.php file, and place our functions within it.&lt;br /&gt;
&lt;br /&gt;
Open up the editor, and create a new file called locallib.php in our module&#39;s root directory (,\mod\inyourface).&amp;nbsp; Create the locallib.php file with the following contents:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&lt;strong&gt;&amp;lt;?php&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;/**&lt;br /&gt;
&amp;nbsp;* Returns the current course id&lt;br /&gt;
&amp;nbsp;*&lt;br /&gt;
&amp;nbsp;* @return int The Course Id&lt;br /&gt;
&amp;nbsp;*/&lt;br /&gt;
function inyourface_getcourseid()&lt;br /&gt;
{&lt;br /&gt;
global $COURSE;&lt;br /&gt;
return $COURSE-&amp;gt;id;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/strong&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Notice that the function is commented in the phpDoc format.&amp;nbsp; That is a subject all to itself, and one we should dedicate to a completely separate tutorial.&lt;br /&gt;
&lt;br /&gt;
Once the locallib.php file has been created, we can now reference it within our view.php script.&amp;nbsp; Open view.php and modify its references on the very top of the script so it looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
/**&lt;br /&gt;
&lt;br /&gt;
* InYourFace Module Instance&lt;br /&gt;
*&lt;br /&gt;
* @author Leo Cunha &lt;pdminfotech@yahoo.com&gt;&lt;br /&gt;
* @version $Id: view.php,v 1.6.2.3 2009/04/17 22:06:25 skodak Exp $&lt;br /&gt;
* @package mod/inyourface&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
require_once(dirname(dirname(dirname(__FILE__))).&#39;/config.php&#39;);&lt;br /&gt;
require_once(dirname(__FILE__).&#39;/lib.php&#39;);&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #990000;&quot;&gt;require_once(dirname(__FILE__).&#39;/locallib.php&#39;);&lt;/span&gt;&lt;/strong&gt; &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Now we can call our new function from view.php.&amp;nbsp; Replace our original snippet - the one that displayed the $COURSES variable with the following code: &lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
/// Print the main part of the page &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #990000;&quot;&gt;$courseid = inyourface_getcourseid();&lt;br /&gt;
echo &#39;We are editing course number &#39;.$courseid.&#39;&amp;lt;br /&amp;gt;&#39;;&lt;/span&gt;&lt;/strong&gt; &lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
That&#39;s it - we now have added our first piece of custom code to the module.&amp;nbsp; When we execute the module from the Moodle course, it now displays the course id: &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOomnFRLApcuJUGId_auKeNN570Zk-T1DAtnc3kYOD5LDdAclVX3vKb0imqK5ReqK4op9zRTeIwGfnrRaWj-he5dWVX6lDzhTHSyhZ8pvw4dyKE6vp_yDHr-9fxyKKI8unXiqBMlVJo2c/s1600/customview.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;307&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOomnFRLApcuJUGId_auKeNN570Zk-T1DAtnc3kYOD5LDdAclVX3vKb0imqK5ReqK4op9zRTeIwGfnrRaWj-he5dWVX6lDzhTHSyhZ8pvw4dyKE6vp_yDHr-9fxyKKI8unXiqBMlVJo2c/s400/customview.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/3689246686414915528/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/09mod-moodle-module-development-adding.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/3689246686414915528'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/3689246686414915528'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/09mod-moodle-module-development-adding.html' title='09MOD: Moodle Module Development - Adding Our Custom Code to the Module'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5ndBHbcs7m0gDrR_HTI8GdsTSWSSyu_IPczmo4OwDN8nv-Eo-ANovnST42pD1n7ZxRHrMPeyDp_S5ETCwQNHfCYd3ZPbCdCHw6zXlsVNPTscuGc_XmLzcg8PBmN2X8e5S03HqQGv5rNg/s72-c/coursedump.jpg" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-926872450675329164</id><published>2010-05-13T22:50:00.000-07:00</published><updated>2010-05-18T06:17:12.083-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>08MOD: Moodle Module Development - Generate Upgrade snippet with  XMLDB Editor</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;During our initial setup of the Module we modified the install.xml file.&amp;nbsp; We are now faced with a dillema - while modifying the module&#39;s form we introduced a new database column.&amp;nbsp; This value is needed by the module&#39;s logic and needs to be saved to our inyourface table (mdl_inyourface if your installation uses the default table prefix).&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
To handle this new challenge, we have to set up our first module upgrade.&amp;nbsp; We accomplish the upgrade by following a number of simple steps:&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We generate XMLDB code that we use in our module&#39;s .\mod\inyourface\db\upgrade.php script&lt;/li&gt;
&lt;li&gt;We paste the new code into the upgrade.php script&lt;/li&gt;
&lt;li&gt;We update our .\mod\inyourface\version.php file&lt;/li&gt;
&lt;li&gt;We run notifications from the Moodle admin menu&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
When we finish these steps, we can verify that our changes took effect by changing the Post Limit value in our module&#39;s form, and making sure that the change took place.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;THE MOODLE XMLDB EDITOR&lt;br /&gt;
&lt;br /&gt;
The XMLDB Editor is a nifty little tool that generates code we can use to update our module&#39;s database structure.&amp;nbsp; The editor can read existing XMLDB files (like our install.xml file) and generate code in SQL, XML or PHP.&lt;br /&gt;
&lt;br /&gt;
For our immediate need, we need to generate PHP code for use in our module upgrade.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;We start by accessing the XMLDB Editor&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Navigate to Moodle&#39;s Site Administration Menu and select Miscellaneous&lt;/li&gt;
&lt;li&gt;Select XMLDB Editor &lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDKGIBnDUbFslBIl97LlqPAeRangdwTh_G6Wl3GJus1qjO5qBZpYP3bZhIstx6ry3WQAfmWBf8EsAj9iA6Tpgfu0c8LrVbEW9calEUbAi8XIUYSp3JSf7nro83BruE2u1nSb3-8q0VGr0/s1600/MdlXmldbEditor.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;182&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDKGIBnDUbFslBIl97LlqPAeRangdwTh_G6Wl3GJus1qjO5qBZpYP3bZhIstx6ry3WQAfmWBf8EsAj9iA6Tpgfu0c8LrVbEW9calEUbAi8XIUYSp3JSf7nro83BruE2u1nSb3-8q0VGr0/s400/MdlXmldbEditor.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
The editor opens to a Main View, listing all of the available XML files. We need to scroll down to the listing for our module, mod\inyourface/db and click on the entry&#39;s &quot;Load&quot; link. The page refreshes and enables the&amp;nbsp; &quot;Load&quot; link,&amp;nbsp; Yes - we click on it as soon as it becomes available!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXgOzpgYO-yzmIj0hm4uJY0YPJChKr0KHZhgQKH3aRmq0eJGlT5agaNaZHv_l0I52DwS5WWLSx2IDS6iNQrrORX9glSodB7_PxXWaNhgZhblNZEBqSuBaGzs5CymSgiKvb6EN5L_XESw/s1600/MdlXmldbLoad.png&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjXgOzpgYO-yzmIj0hm4uJY0YPJChKr0KHZhgQKH3aRmq0eJGlT5agaNaZHv_l0I52DwS5WWLSx2IDS6iNQrrORX9glSodB7_PxXWaNhgZhblNZEBqSuBaGzs5CymSgiKvb6EN5L_XESw/s320/MdlXmldbLoad.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
After the Edit XML File page loads, we scroll down to the Tables section and find our table&#39;s &quot;Edit&quot; link&amp;nbsp; This will open the module&#39;s XML file.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjncBMywTXSskudhaUqhp3GgYZGnPprFjqhXu9l4no9-9oVBG89SGzVR9bjaPpM_o9Ac6PEcXchUgayjHVinnDWZca-d2W04YNn0J3k6O538oNG_iqdUDaN1PQd3TSVpvxdKGRMY5C-M0E/s1600/MdlXmldbEdit.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjncBMywTXSskudhaUqhp3GgYZGnPprFjqhXu9l4no9-9oVBG89SGzVR9bjaPpM_o9Ac6PEcXchUgayjHVinnDWZca-d2W04YNn0J3k6O538oNG_iqdUDaN1PQd3TSVpvxdKGRMY5C-M0E/s320/MdlXmldbEdit.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
The Edit Table screen displays, where we can select to add a New Field:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgny3SovoLbFJEeFST2XRYVqLj-w5eHpqi76Fwn-_WWPa5GAAcubRzR09DU0iTX60uJiLd0Xi1BImVxC0KkLJi3qFXO-M2sRpCiEtQB-v1JkHmAY_UbhttwNKaR6aQGyzP029tLnRT8XWs/s1600/MdlXmldbAddCol.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgny3SovoLbFJEeFST2XRYVqLj-w5eHpqi76Fwn-_WWPa5GAAcubRzR09DU0iTX60uJiLd0Xi1BImVxC0KkLJi3qFXO-M2sRpCiEtQB-v1JkHmAY_UbhttwNKaR6aQGyzP029tLnRT8XWs/s320/MdlXmldbAddCol.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
From this screen we can enter the details of our new field, which will be of type integer:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLnRz3kXXDPoXlIeALscZF566aJJ_uoB0kf7BcGWQO5J9qpgU0KH3I2PKmZv52asAb6s58fancxNVzxcGJ0ERh1LcfBzv-FNsIJuu90irAJh7dk84aIOvcUMOiefohhR0EowzLsQAZdKY/s1600/MdbXmldbEditField.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLnRz3kXXDPoXlIeALscZF566aJJ_uoB0kf7BcGWQO5J9qpgU0KH3I2PKmZv52asAb6s58fancxNVzxcGJ0ERh1LcfBzv-FNsIJuu90irAJh7dk84aIOvcUMOiefohhR0EowzLsQAZdKY/s320/MdbXmldbEditField.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
Clicking on the &quot;change&quot; button saves our changes and returns us to the Edit Table screen, where we can select to view PHP Code.&amp;nbsp; We need this snippet so we can set up our update.php script and initiate the version update.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;i&gt;&lt;b&gt;Basically, we are using the XMLDB Editor to generate &lt;br /&gt;
the snippet of HTML code needed for the update.php file.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
Once we have the snippet, we have all we need for this module upgrade.&lt;/b&gt;&lt;/i&gt;&lt;/div&gt;&lt;br /&gt;
So let&#39;s generate and fetch our snippet:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1QKlhzfzG3MIDAoc66GH3iciCPl8N8cs-QQ8rbJPu59AdOUxGPfVybW6j0rg27Iz992U2eHOatz8YQ9KkJQiZ7kX7HrA6OCpRLxpDswVWf1eP80PHuTQ7d93ROubdz0nQrDafAcAJ-UY/s1600/MdbXmldbViewPhp.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1QKlhzfzG3MIDAoc66GH3iciCPl8N8cs-QQ8rbJPu59AdOUxGPfVybW6j0rg27Iz992U2eHOatz8YQ9KkJQiZ7kX7HrA6OCpRLxpDswVWf1eP80PHuTQ7d93ROubdz0nQrDafAcAJ-UY/s400/MdbXmldbViewPhp.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click to Zoom Image&lt;br /&gt;
&lt;br /&gt;
The PHP Code form defaults to the first field in the table, so we need to use the Select Field dropdown to pick our new field (postlimit).&amp;nbsp; We then click on the &quot;View&quot; button:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiiNvHdhrerTa_15syaS-uPVMRVsJBOOQ1pnnzGlQ1kco1tYVsXAZcoYfwc-HTdY0KSQSmgN53-Y9Ny1XCTJiDhuZc-3vdaADQgai-H-Rvy9VbXNN7BIQ0xzhPfdjB4R-gQhl-aN_utUg/s1600/MdbXmldbSelectNewField.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;226&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhiiNvHdhrerTa_15syaS-uPVMRVsJBOOQ1pnnzGlQ1kco1tYVsXAZcoYfwc-HTdY0KSQSmgN53-Y9Ny1XCTJiDhuZc-3vdaADQgai-H-Rvy9VbXNN7BIQ0xzhPfdjB4R-gQhl-aN_utUg/s400/MdbXmldbSelectNewField.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
We now have the piece of the puzzle we need to complete our first module upgrade!!!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy_M49_pPEoYesvnj1lTJ5VfVHb0jK4XbxSxm7JVO_wwmPBHyJTF0z2l6nGs4ZaeseDjHp8ejLYGywqRT8BM49SeeRU_edithAs2E-ZCzB2bavp_3UDM8RnRcTlcZqvcJ4V_8_M5kkPuc/s1600/MdbXmldbViewPhpCode.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgy_M49_pPEoYesvnj1lTJ5VfVHb0jK4XbxSxm7JVO_wwmPBHyJTF0z2l6nGs4ZaeseDjHp8ejLYGywqRT8BM49SeeRU_edithAs2E-ZCzB2bavp_3UDM8RnRcTlcZqvcJ4V_8_M5kkPuc/s400/MdbXmldbViewPhpCode.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
The snippet generated by the editor is:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
if ($result &amp;amp;&amp;amp; $oldversion &amp;lt; XXXXXXXXXX) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Define field postlimit to be added to inyourface&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $table = new XMLDBTable(&#39;inyourface&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $field = new XMLDBField(&#39;postlimit&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $field-&amp;gt;setAttributes(XMLDB_TYPE_INTEGER, &#39;2&#39;, XMLDB_UNSIGNED, null, null, null, null, &#39;1&#39;, &#39;timemodified&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Launch add field postlimit&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = $result &amp;amp;&amp;amp; add_field($table, $field);&lt;br /&gt;
}&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
Copy the code to your clipboard and open the .\mod\inyourface\db\upgrade.php file.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;&lt;i&gt;ABOUT MODULE MODULES VERSION NUMBERS: &lt;br /&gt;
Version numbers are based on the date of the change, followed &lt;br /&gt;
by a sequence number. The first update on a &lt;br /&gt;
given day is given sequence number 00. &lt;br /&gt;
&lt;br /&gt;
For example, our upgrade is being completed &lt;br /&gt;
on May 14,2010 and it is the first and only update. &lt;br /&gt;
Our new version number is 2010051400.&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;&lt;br /&gt;
&lt;br /&gt;
Notice that we did not run a search and replace on the upgrade.php file. We will erase all of its contents and replace it with the following code:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;?php &lt;br /&gt;
function xmldb_inyourface_upgrade($oldversion=0) {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; global $CFG, $THEME, $db;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = true;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; if ($result &amp;amp;&amp;amp; $oldversion &amp;lt; 2007040200) &lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Define field postlimit to be added to inyourface&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $table = new XMLDBTable(&#39;inyourface&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $field = new XMLDBField(&#39;postlimit&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $field-&amp;gt;setAttributes(XMLDB_TYPE_INTEGER, &#39;2&#39;, XMLDB_UNSIGNED, null, null, null, null, &#39;1&#39;, &#39;timemodified&#39;);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /// Launch add field postlimit&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; $result = $result &amp;amp;&amp;amp; add_field($table, $field);&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return $result;&lt;br /&gt;
}&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
The upgrade.php script should have a snippet for every upgrade that we make. It is an additive process, so we need to make sure that we safeguard our upgrade snippets.&lt;br /&gt;
&lt;br /&gt;
OK.. so now we have an upgrade script that updates our mdl_inyourface table by adding a new column called postlimit.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Looks like a lot of work to generate a &lt;br /&gt;
simple SQL statement&lt;br /&gt;
&lt;br /&gt;
BUT - the cost of managing upgrades &lt;br /&gt;
in the future will be well worth it!!!&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Before we can complete the upgrade . . .&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;We need to update our .\mod\inyouface\version.php file to force Moodle to recognize that an upgrade is required.&amp;nbsp; When we are done, the version.php file should look like this:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;code&gt;&lt;br /&gt;
&amp;lt;?php // $Id: version.php,v 1.5.2.2 2009/03/19 12:23:11 mudrd8mz Exp $&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
* Code fragment to define the version of newmodule&lt;br /&gt;
* This fragment is called by moodle_needs_upgrading() and /admin/index.php&lt;br /&gt;
*&lt;br /&gt;
* @author Your Name &amp;lt;your@email.address&amp;gt;&lt;br /&gt;
* @version $Id: version.php,v 1.5.2.2 2009/03/19 12:23:11 mudrd8mz Exp $&lt;br /&gt;
* @package mod/newmodule&lt;br /&gt;
*/&lt;br /&gt;
&lt;br /&gt;
/// $module-&amp;gt;version = 2007040200; // The current module version (Date: YYYYMMDDXX)&lt;br /&gt;
$module-&amp;gt;version = 2010051400; // The current module version (Date: YYYYMMDDXX)&lt;br /&gt;
$module-&amp;gt;cron = 0; // Period for cron to check this module (secs)&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
So far we have . . .&lt;br /&gt;
&lt;br /&gt;
Used the XMLDB Editor to generate the code snippet to add a new column to our module table&lt;br /&gt;
Modified the upgrade.php script&lt;br /&gt;
Modified the version.php script&lt;br /&gt;
&lt;br /&gt;
With these changes in place, we can navigate to the Moodle Site Administration Menu, and select the Notifications option.&amp;nbsp; And VOILA! Our upgrade executes!!!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjhIfSNaeyTt8aTzINAGI32tLr8WJwCFi0FFLoDQw5hfQPcxpookOPwQ90W6Xkph9dJxzx0lg7sfpWcpnNV_3yk1GckGbqX4QpyyWmBBqC89UThXgvUuDe7Ctv5n0Fa-MSuumBvQbN7fA/s1600/MdbXmlMoodleUpdate.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjhIfSNaeyTt8aTzINAGI32tLr8WJwCFi0FFLoDQw5hfQPcxpookOPwQ90W6Xkph9dJxzx0lg7sfpWcpnNV_3yk1GckGbqX4QpyyWmBBqC89UThXgvUuDe7Ctv5n0Fa-MSuumBvQbN7fA/s400/MdbXmlMoodleUpdate.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/926872450675329164/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/08mod-moodle-module-development.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/926872450675329164'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/926872450675329164'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/08mod-moodle-module-development.html' title='08MOD: Moodle Module Development - Generate Upgrade snippet with  XMLDB Editor'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhDKGIBnDUbFslBIl97LlqPAeRangdwTh_G6Wl3GJus1qjO5qBZpYP3bZhIstx6ry3WQAfmWBf8EsAj9iA6Tpgfu0c8LrVbEW9calEUbAi8XIUYSp3JSf7nro83BruE2u1nSb3-8q0VGr0/s72-c/MdlXmldbEditor.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-8502816913721687311</id><published>2010-05-13T12:33:00.000-07:00</published><updated>2010-05-14T09:25:53.859-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>07MOD: Moodle Module Development - Testing the module&#39;s form</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
We have just completed our changes to the module&#39;s form.&amp;nbsp; This form is called when the user adds our activity to a Moodle course.&amp;nbsp; Let&#39;s test the form, and make sure that it works correctly. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
1. Let&#39;s navigate to a Moodle course&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8raWIIwCIc2GGHYD3Op8lj2Wfz9_44M6vQT_JaVZMSrp9ILYWdTdjfo3dvndvbcKT6TuYKpOZDnfl54OGPCrjWPw7RxUbf0GCmMaMBEpEo3l-94qFEcjMTOHDT_YxUuIRs6vCh-iwwbo/s1600/NavigateToCourse.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8raWIIwCIc2GGHYD3Op8lj2Wfz9_44M6vQT_JaVZMSrp9ILYWdTdjfo3dvndvbcKT6TuYKpOZDnfl54OGPCrjWPw7RxUbf0GCmMaMBEpEo3l-94qFEcjMTOHDT_YxUuIRs6vCh-iwwbo/s400/NavigateToCourse.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;2. Add our activity to one of the course&#39;s topics or weeks. &lt;br /&gt;
&amp;nbsp; &lt;br /&gt;
In our case, I am adding it to the second week, where I also have a corresponding forum discussion that will use to feed our module. &lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW2xIqjF7m07g6sob8NfIP7eCITuhjfPCMhYqj9n69PL5le3FQDa4yiUckGFiH4HJiJMJahEsrVtDCCrjaYdZ8RPO57CA8ZC85itmBCygQjcDxvIIGTUsa3wz-rMjp1mhZK6DVSJR3hzk/s1600/FormTestAddActivity.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;245&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgW2xIqjF7m07g6sob8NfIP7eCITuhjfPCMhYqj9n69PL5le3FQDa4yiUckGFiH4HJiJMJahEsrVtDCCrjaYdZ8RPO57CA8ZC85itmBCygQjcDxvIIGTUsa3wz-rMjp1mhZK6DVSJR3hzk/s400/FormTestAddActivity.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.&amp;nbsp; Fill out our form&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;WOW &lt;/b&gt;- Notice how much cleaner the form looks since we made some slight modifications.&amp;nbsp; And look - our custom block and dropdown list are both rendered!&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjefmoXCOVskT-ZUFr6LypHZ9OM1e8Qx0wIdHuRc7oX0FY4idjjZp2dLBuVvHAvTKXpZEZibsyDjcAHUNZzGzkHTsP9qEFsABaObcn8Ed5RiAdE9w13MJo3AFqTKFCQ6FpOOQA2GgX39o/s1600/ModuleForm.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgjefmoXCOVskT-ZUFr6LypHZ9OM1e8Qx0wIdHuRc7oX0FY4idjjZp2dLBuVvHAvTKXpZEZibsyDjcAHUNZzGzkHTsP9qEFsABaObcn8Ed5RiAdE9w13MJo3AFqTKFCQ6FpOOQA2GgX39o/s400/ModuleForm.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
4. Save and Display the Form&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcrrOUGqtm1b-NshFkWmVaExzH61Y4QlcjH-5eUPTkJ03wgmWFWGoruEEXOKhYC-8I3AQdBOmJ9Hz5Kwct1Pd6h_IoB1CBM3_JgX8ojfjNInw45XJCaBmwCLtRDyLHP0vJ8hbd3nqnH-0/s1600/SavedForm.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;313&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcrrOUGqtm1b-NshFkWmVaExzH61Y4QlcjH-5eUPTkJ03wgmWFWGoruEEXOKhYC-8I3AQdBOmJ9Hz5Kwct1Pd6h_IoB1CBM3_JgX8ojfjNInw45XJCaBmwCLtRDyLHP0vJ8hbd3nqnH-0/s400/SavedForm.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
Now we have a working module form. Making a few changes to the module template and adding less than 10 lines of code has left us with a registered, functioning Moodle module.&lt;br /&gt;
&lt;br /&gt;
If we look at the database, we notice that we have populated table mdl_inyourface with a row that ties our new entry to the course:&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5w0vb3PTBcYCRZep0oEYiiSPTV1FMqwtkG11WUJWEQBRe5b7SXnCk6LLmj7V82E0nvUxDIMaaor79TH6qpV1W_ZUeXs0RKZS__EMzsJH2LSMT1ybVaaYg23Cz-7MC0IZs5hun7eXZ20U/s1600/FormMySQL.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;202&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5w0vb3PTBcYCRZep0oEYiiSPTV1FMqwtkG11WUJWEQBRe5b7SXnCk6LLmj7V82E0nvUxDIMaaor79TH6qpV1W_ZUeXs0RKZS__EMzsJH2LSMT1ybVaaYg23Cz-7MC0IZs5hun7eXZ20U/s400/FormMySQL.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;WAIT!&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;&lt;br /&gt;
We just introduced a new variable to our module - postlimit.&amp;nbsp; This is new data that was not part of our original installation.&amp;nbsp; When the user saves our activity to a course, our new data element gets lost.&lt;br /&gt;
&lt;br /&gt;
It&#39;s time to look at how Moodle module updaetes work.&amp;nbsp; We will also need to take a detour and look at the Moodle XMLDB Editor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/08mod-moodle-module-development.html&quot;&gt;Next Article in Series&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/8502816913721687311/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/07mod-moodle-module-development-testing.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/8502816913721687311'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/8502816913721687311'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/07mod-moodle-module-development-testing.html' title='07MOD: Moodle Module Development - Testing the module&#39;s form'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg8raWIIwCIc2GGHYD3Op8lj2Wfz9_44M6vQT_JaVZMSrp9ILYWdTdjfo3dvndvbcKT6TuYKpOZDnfl54OGPCrjWPw7RxUbf0GCmMaMBEpEo3l-94qFEcjMTOHDT_YxUuIRs6vCh-iwwbo/s72-c/NavigateToCourse.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-6056424411757541798</id><published>2010-05-13T08:47:00.000-07:00</published><updated>2010-05-14T09:25:53.860-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>06MOD: Moodle Module Development - The module&#39;s form</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Moodle follows a very specific pattern for activity modules: &lt;br /&gt;
&lt;ul&gt;&lt;li&gt;User selects a course&lt;/li&gt;
&lt;li&gt;User turns editing on&lt;/li&gt;
&lt;li&gt;User selects a topic or week&lt;/li&gt;
&lt;li&gt;User selects an activity to add&lt;/li&gt;
&lt;/ul&gt;Once the activity has been selected from the dropdown box, the module&#39;s form is displayed.&amp;nbsp; In our case, selection of the &quot;Facebook Integration&quot; activity calls the form described in the&amp;nbsp;.\mod\inyourface\mod_form.php script.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;In this post we will go over the purpose of the form, how to customize the form, and how to handle the pre/post processing of data in the form.&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;NOTE: During this exercise, we will also have to modify our &lt;br /&gt;
module&#39;s database structure.&amp;nbsp; We will cover these steps in detail in a separate post.&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
We will start by examining our mod_form.php file. Bascially, it generates a new form that is based on the Moodle Form module (notice at the top of the file, it &quot;extends moodleform_mod&quot;).&lt;br /&gt;
&lt;br /&gt;
The form is divided into 3 basic sections:&lt;br /&gt;
&lt;br /&gt;
1. GENERAL: Elements required for every activity type&lt;br /&gt;
2. CUSTOM: Elements required by our module&lt;br /&gt;
3. STANDARD: Elements that are common to all modules&lt;br /&gt;
&lt;br /&gt;
These sections correlate to the following areas of the activity creation form (the form that comes up after the user chooses to add an activity to a course&#39;s section or topic):&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJCqUPh9_aeORii3bybGbfTmbc1LuX2LQg9qTJ4snn1dOfY6uizeldD0gF6yTxkIgEp0A7R6QohTouU1_QbWsVb0bswLJkn4AOa-KcS9uJhr4bp33YVZcOj_oLM1HHS6_kCoqZVhptvmE/s1600/ModFormCorrelation.jpg&quot; imageanchor=&quot;1&quot; rel=&quot;lightbox&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;247&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJCqUPh9_aeORii3bybGbfTmbc1LuX2LQg9qTJ4snn1dOfY6uizeldD0gF6yTxkIgEp0A7R6QohTouU1_QbWsVb0bswLJkn4AOa-KcS9uJhr4bp33YVZcOj_oLM1HHS6_kCoqZVhptvmE/s400/ModFormCorrelation.jpg&quot; width=&quot;400&quot; wt=&quot;true&quot; /&gt;&lt;/a&gt;&lt;/div&gt;Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
For our module, we will create a single custom element. A simple drop down where the user can select the number of forum posts that the student can submit using our Module.&lt;br /&gt;
&lt;br /&gt;
We will only concentrate on the custom section o four mod_form.php script.&amp;nbsp; Open the file for editing and find the following section:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
EDITING .\mod\inyouface\mod_form.php&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;br /&gt;
/// Adding the rest of inyourface settings, spreeading all them into this fieldset&lt;br /&gt;
/// or adding more fieldsets (&#39;header&#39; elements) if needed for better logic&lt;br /&gt;
$mform-&amp;gt;addElement(&#39;static&#39;, &#39;label1&#39;, &#39;inyourfacesetting1&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
$mform-&amp;gt;addElement(&#39;header&#39;, &#39;inyourfacefieldset&#39;, get_string(&#39;inyourfacefieldset&#39;, &#39;inyourface&#39;));&lt;br /&gt;
$mform-&amp;gt;addElement(&#39;static&#39;, &#39;label2&#39;, &#39;inyourfacesetting2&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
We actually start by modifying the .\mod\inyourface\lang\en_utf8\inyourface.php file!&amp;nbsp; We need to change the &quot;inyourfacefieldset&quot; variable.&amp;nbsp; Open the file in your editor and change that variable to &quot;Feed Options&quot;.&lt;br /&gt;
&lt;br /&gt;
We will also add one more variable that we&#39;ll use as a label for our dropdown list.&lt;br /&gt;
&lt;br /&gt;
The completed inyourface.php file will look like this when you are done, with our changes in red:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
EDITING \lang\en_utf8\inyourface.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourface&#39;] = &#39;Facebook Integration&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;modulename&#39;] = &#39;Facebook Integration&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;modulenameplural&#39;] = &#39;Facebook Integration&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #990000;&quot;&gt;$string[&#39;inyourfacefieldset&#39;] = &#39;Feed Options&#39;;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;span style=&quot;color: #999999;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourfaceintro&#39;] = &#39;Post to Facebook Intro&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourfacename&#39;] = &#39;Post to Facebook&#39;;&lt;/span&gt;&lt;br /&gt;
&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #990000;&quot;&gt;$string[&#39;postlimit&#39;] = &#39;Maximum Posts&#39;;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
We can now concentrate on the form itself. We start by commenting out the annoying labels - label1 and label2 that the NEWMODULE template uses as a place holder.&amp;nbsp; Comment out these lines, so your mod_form.php custom block now looks like this:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
EDITING .\mod\inyouface\mod_form.php&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;br /&gt;
/// Adding the rest of inyourface settings, spreeading all them into this fieldset&lt;br /&gt;
/// or adding more fieldsets (&#39;header&#39; elements) if needed for better logic&lt;br /&gt;
/// $mform-&amp;gt;addElement(&#39;static&#39;, &#39;label1&#39;, &#39;inyourfacesetting1&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
$mform-&amp;gt;addElement(&#39;header&#39;, &#39;inyourfacefieldset&#39;, get_string(&#39;inyourfacefieldset&#39;, &#39;inyourface&#39;));&lt;br /&gt;
/// $mform-&amp;gt;addElement(&#39;static&#39;, &#39;label2&#39;, &#39;inyourfacesetting2&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
That leaves one active line of code in the block - the one that adds the header element to our block.&amp;nbsp; We want to add our drop down list immediately below the header.&amp;nbsp; When we are finished our custom block will look as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
EDITING .\mod\inyouface\mod_form.php&lt;br /&gt;
&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;br /&gt;
/// Adding the rest of inyourface settings, spreeading all them into this fieldset&lt;br /&gt;
/// or adding more fieldsets (&#39;header&#39; elements) if needed for better logic&lt;br /&gt;
/// $mform-&amp;gt;addElement(&#39;static&#39;, &#39;label1&#39;, &#39;inyourfacesetting1&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #990000;&quot;&gt;&lt;strong&gt;$mform-&amp;gt;addElement(&#39;header&#39;, &#39;inyourfacefieldset&#39;, get_string(&#39;inyourfacefieldset&#39;, &#39;inyourface&#39;));&lt;/strong&gt;&lt;/span&gt;/// $mform-&amp;gt;addElement(&#39;static&#39;, &#39;label2&#39;, &#39;inyourfacesetting2&#39;, &#39;Your inyourface fields go here. Replace me!&#39;);&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;span style=&quot;color: #990000;&quot;&gt;$choices = array();&lt;br /&gt;
$choices[0] = 1;&lt;br /&gt;
$choices[1] = 2;&lt;br /&gt;
$choices[2] = 3;&lt;br /&gt;
$mform-&amp;gt;addElement(&#39;select&#39;, &#39;postlimit&#39;, get_strin(&#39;postlimit&#39;,&#39;inyourface&#39;), $choices);&lt;/span&gt;&lt;/strong&gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;WE CAN NOW CHECK THE EFFECT OF OUR CHANGES &lt;br /&gt;
TO THE MODULE&#39;S FORM.&lt;/strong&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;strong&gt;&lt;br /&gt;
THAT&#39;S COMING UP NEXT!&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/07mod-moodle-module-development-testing.html&quot;&gt;Next Article in Series&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/6056424411757541798/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/06mod-moodle-module-development-modules.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/6056424411757541798'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/6056424411757541798'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/06mod-moodle-module-development-modules.html' title='06MOD: Moodle Module Development - The module&#39;s form'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJCqUPh9_aeORii3bybGbfTmbc1LuX2LQg9qTJ4snn1dOfY6uizeldD0gF6yTxkIgEp0A7R6QohTouU1_QbWsVb0bswLJkn4AOa-KcS9uJhr4bp33YVZcOj_oLM1HHS6_kCoqZVhptvmE/s72-c/ModFormCorrelation.jpg" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-417800761875329350</id><published>2010-05-13T05:32:00.001-07:00</published><updated>2010-05-14T09:25:28.328-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>05MOD: Moodle Module Development - The module&#39;s language file</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
When we first set our module up, we simply completed a series of search &amp;amp; replace for the the phrase &quot;NEWMODULE&quot; and replaced them with our Module&#39;s name. This is enough to get the Module registered, but it leaves a very ugly footprint in Moodle.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Our goal right now, is to start some cleanup of these references so the user interface of our Module starts to take shape.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1. UPDATE THE .\mod\inyourface\lang\en_utf8\inyourface.php FILE&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
Inside the Moodle interface, the text that is displayed during the addition of our activity is controlled by the language file. These string variables are contained in the module&#39;s language file. Any modifications we make will take effect immediately.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2. &lt;span style=&quot;color: #cc0000;&quot;&gt;!!! IMPORTANT !!!&lt;/span&gt; MOVE THE .\mod\lang folder to the Moodle root directory (move it to .\lang).&amp;nbsp;&lt;/strong&gt; &lt;br /&gt;
If you browse through your Moodle&#39;s .\lang directory, you will notice that each module has its own language file.&lt;br /&gt;
&lt;br /&gt;
Here is the contents of the inyourface.php file after a little clean-up.&lt;br /&gt;
&lt;br /&gt;
&lt;code&gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourface&#39;] = &#39;Facebook Integration&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;modulename&#39;] = &#39;Facebook Integration&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;modulenameplural&#39;] = &#39;Facebook Integration&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourfacefieldset&#39;] = &#39;Custom Fields&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourfaceintro&#39;] = &#39;Post to Facebook Intro&#39;;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $string[&#39;inyourfacename&#39;] = &#39;Post to Facebook&#39;;&lt;br /&gt;
?&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
After making these changes, when you navigate to a course and enter edit mode, you will notice the following changes:&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;Add Activity Drop Down When Editing a Course:&lt;/u&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWBjmdbr2pkfG3TXFZ6n6KSb92ZQUOHZDAB0IPsyfWwGS9-Jf3H6E2pg6Ri-CG2xM7Ltz1O8m_iiaydPfotiRNajcEOcqDwC_-CLkQY6ie_xS89shQpArsGudKnl2pdymIqr360zegZEk/s1600/AddActivityDropDown.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470734853806885714&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWBjmdbr2pkfG3TXFZ6n6KSb92ZQUOHZDAB0IPsyfWwGS9-Jf3H6E2pg6Ri-CG2xM7Ltz1O8m_iiaydPfotiRNajcEOcqDwC_-CLkQY6ie_xS89shQpArsGudKnl2pdymIqr360zegZEk/s320/AddActivityDropDown.jpg&quot; style=&quot;cursor: hand; height: 170px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;The Module&#39;s Add Activity Form:&lt;/u&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimhFryaXuDujXsQFgCITYitmdSI95o3ljF06rF-FVgdv_eWsSUDTaLHxaf1M5-I_ROpsIRW2Ph7voaVptePbdszxfX6N48LE4tpIrVrCHXeaXzmEz2mRROIEWiJEsyL8bNdqjYNB7MGks/s1600/AddingActivityForm.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470735701178114722&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimhFryaXuDujXsQFgCITYitmdSI95o3ljF06rF-FVgdv_eWsSUDTaLHxaf1M5-I_ROpsIRW2Ph7voaVptePbdszxfX6N48LE4tpIrVrCHXeaXzmEz2mRROIEWiJEsyL8bNdqjYNB7MGks/s320/AddingActivityForm.jpg&quot; style=&quot;cursor: hand; height: 196px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;The Activity Breadcrumb Trail:&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-6S_NPVeffKg2HvKBqgY1p53U-V4t4s38yN5V118mJwNe3IIJyiws_hXEd2aJSI5T62QRiyQQ6PnlEPZ1kUicOrtNhhpHsynn1hnbXTvAqJuKaQV4UJ1FcQ2t8mHEAOoWaN09cEaQLBg/s1600/ActivityBreadCrumb.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470736439212921058&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-6S_NPVeffKg2HvKBqgY1p53U-V4t4s38yN5V118mJwNe3IIJyiws_hXEd2aJSI5T62QRiyQQ6PnlEPZ1kUicOrtNhhpHsynn1hnbXTvAqJuKaQV4UJ1FcQ2t8mHEAOoWaN09cEaQLBg/s320/ActivityBreadCrumb.jpg&quot; style=&quot;cursor: hand; height: 196px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;SMALL CHANGES, BIG BANG!&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/06mod-moodle-module-development-modules.html&quot;&gt;Next Article in Series&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/417800761875329350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/05mod-initial-module-cleanup-modules.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/417800761875329350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/417800761875329350'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/05mod-initial-module-cleanup-modules.html' title='05MOD: Moodle Module Development - The module&#39;s language file'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWBjmdbr2pkfG3TXFZ6n6KSb92ZQUOHZDAB0IPsyfWwGS9-Jf3H6E2pg6Ri-CG2xM7Ltz1O8m_iiaydPfotiRNajcEOcqDwC_-CLkQY6ie_xS89shQpArsGudKnl2pdymIqr360zegZEk/s72-c/AddActivityDropDown.jpg" height="72" width="72"/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-3952162433451641296</id><published>2010-05-12T06:55:00.001-07:00</published><updated>2010-05-13T10:15:25.380-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>04MOD: Moodle Module Setup - Adding our Activity</title><content type='html'>&lt;div align=&quot;center&quot;&gt;&lt;div align=&quot;left&quot;&gt;&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;
&lt;strong&gt;Now that we have a module that does absolutely nothing, let&#39;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.&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
So. . .&lt;br /&gt;
&lt;br /&gt;
Let us proceed and add our non-activity module to a course!!!! Hurrah!&lt;br /&gt;
&lt;br /&gt;
Now that the module is installed, we can navigate to a course:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwr5NGjoRz9jCAKODjonP_AqWg5z5JX20wU65Gd3JxBxIknnI-7jiiDXhhUZufcF1s3T9yJ8QKi3ctcA6rAKOFp4GOGlPlVQCrxBXWTGOf1QU6JptGliaaXcfL2Lt9dTl_PToxmqjFFjo/s1600/coursenavigate.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470383076823374610&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwr5NGjoRz9jCAKODjonP_AqWg5z5JX20wU65Gd3JxBxIknnI-7jiiDXhhUZufcF1s3T9yJ8QKi3ctcA6rAKOFp4GOGlPlVQCrxBXWTGOf1QU6JptGliaaXcfL2Lt9dTl_PToxmqjFFjo/s320/coursenavigate.jpg&quot; style=&quot;cursor: hand; height: 184px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Once on the course page, ensure editing is turned on:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQrTuDCYDXyQSzwTpBNteb7kJ2861UHbbtIS6BFa7pXLPAtOdLRci_nJUYOLcQFa-O4WOetYA8Lmnywc9uySvLra3ceHurdN4dOaSLMpOWVq6ReQ0_Ad6EqZvynCvS2ih5O8aaC9HArHk/s1600/courseediting.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470383592569935842&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQrTuDCYDXyQSzwTpBNteb7kJ2861UHbbtIS6BFa7pXLPAtOdLRci_nJUYOLcQFa-O4WOetYA8Lmnywc9uySvLra3ceHurdN4dOaSLMpOWVq6ReQ0_Ad6EqZvynCvS2ih5O8aaC9HArHk/s320/courseediting.jpg&quot; style=&quot;cursor: hand; height: 184px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
Pick one of the course weeks or topics and select our activity (inyourface) from the Activity drop down list:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmOeO-qLESs61OO1Hn3oAtXDzSIh11LTSqxWcPeV9zq2mg5-ht5qHhBZZDixZN_lS-EhiZJQhsKhzJOBnpP4m_i7tcRXZFnh3YoTdQofartkNkP9I97-vT94_YFo_LiBAVuEtOr8yL0HM/s1600/addactivity.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470384141880082706&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmOeO-qLESs61OO1Hn3oAtXDzSIh11LTSqxWcPeV9zq2mg5-ht5qHhBZZDixZN_lS-EhiZJQhsKhzJOBnpP4m_i7tcRXZFnh3YoTdQofartkNkP9I97-vT94_YFo_LiBAVuEtOr8yL0HM/s320/addactivity.jpg&quot; style=&quot;cursor: hand; height: 184px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
Fill out our (currently very ugly and rather sparse) activity definition form and click on the &quot;Save and Display&quot; button:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglW7wUNZRx7kx1nH-PwDQLuvnmderSL7ZAckTrHmSU5eL4-54ltQIM5j6FLRD5KQKeMdGVW0u6RLyD-pFmEeYw572eHZYRRJxUHq51mNvYGitPztb5_nnyjg0nAfMsAamGHV6POnx6hXE/s1600/saveactivity.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470385298533568450&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglW7wUNZRx7kx1nH-PwDQLuvnmderSL7ZAckTrHmSU5eL4-54ltQIM5j6FLRD5KQKeMdGVW0u6RLyD-pFmEeYw572eHZYRRJxUHq51mNvYGitPztb5_nnyjg0nAfMsAamGHV6POnx6hXE/s320/saveactivity.jpg&quot; style=&quot;cursor: hand; height: 234px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
You will now see our activity... with a disheartening message: &quot;Your Code Goes Here&quot;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLnLRwjoWkB8HnL98lKnOZDxCWP6PnsnklHxcQR5eVNc83svhTJny7_rg7KQRMAlv_oj858sLUE4ILnRNwRaBHzFVJJmKqlZQdRUDP6JDXzZisQSd4nI3JbYGQTqT-2zEwfY69wW3Zy8Q/s1600/yourcodegoeshere.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470386177757763490&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgLnLRwjoWkB8HnL98lKnOZDxCWP6PnsnklHxcQR5eVNc83svhTJny7_rg7KQRMAlv_oj858sLUE4ILnRNwRaBHzFVJJmKqlZQdRUDP6JDXzZisQSd4nI3JbYGQTqT-2zEwfY69wW3Zy8Q/s320/yourcodegoeshere.jpg&quot; style=&quot;cursor: hand; height: 141px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image to Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;&lt;br /&gt;
Actually, that&#39;s the GOOD NEWS!&lt;br /&gt;
&lt;br /&gt;
We can now get to work on our module.&lt;br /&gt;
It is registered, Moodle recognizes it as a valid plug-in&lt;br /&gt;
and we can add it to courses!!!&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/05mod-initial-module-cleanup-modules.html&quot;&gt;Next Article in Series&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/3952162433451641296/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/04mod-inyourface-adding-our-new.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/3952162433451641296'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/3952162433451641296'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/04mod-inyourface-adding-our-new.html' title='04MOD: Moodle Module Setup - Adding our Activity'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwr5NGjoRz9jCAKODjonP_AqWg5z5JX20wU65Gd3JxBxIknnI-7jiiDXhhUZufcF1s3T9yJ8QKi3ctcA6rAKOFp4GOGlPlVQCrxBXWTGOf1QU6JptGliaaXcfL2Lt9dTl_PToxmqjFFjo/s72-c/coursenavigate.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-8140817860662544204</id><published>2010-05-12T06:10:00.000-07:00</published><updated>2010-05-13T12:26:55.155-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>03MOD: Moodle Module Setup - Test Initial Changes to Template</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
So far...&lt;br /&gt;
&lt;br /&gt;
We have modified the files in the module template, replacing any references to NEWMODULE with our module&#39;s name.&lt;br /&gt;
&lt;br /&gt;
It is now time to make sure we didn&#39;t miss any of the changes:&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;We rename the directory that has been holding our files (NEWMODULE) to our module&#39;s name (inyourface).&lt;/li&gt;
&lt;li&gt;We copy the entire contents of our module to our Moodle .\mod directory&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPmRtx36PISZtuCjYlIqg3ipJ-gvCet_3d2VyvZBKCgXCSfIpuTvB45jDoNXbcIInleApMHC1whlQg1MXbb7O9ub_jf_503r3ZEMstcsi3j6Z7C00HGAlsDWmxMW7oaGL3QAvHiViXikM/s1600/copymodule.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470371488096945938&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPmRtx36PISZtuCjYlIqg3ipJ-gvCet_3d2VyvZBKCgXCSfIpuTvB45jDoNXbcIInleApMHC1whlQg1MXbb7O9ub_jf_503r3ZEMstcsi3j6Z7C00HGAlsDWmxMW7oaGL3QAvHiViXikM/s320/copymodule.jpg&quot; style=&quot;cursor: hand; height: 267px; width: 320px;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Click Image To Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;strong&gt;MOODLE NOTIFICATIONS&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Now comes time for the dreaded Moodle Notification. After copying our module to the .\mod directory, log into the Moodle instance and navigate to the Administration menu, and . . .&lt;br /&gt;
&lt;ul&gt;&lt;li&gt;Click on &quot;Notifications&quot;&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQwQ_JjAXF9edLG9vs_ZkMBXKx1VebvSKalnTcJYS4nj5LqYqeAS9k1HMfwrCwA9RRY24-ZapsGQwxgdsTaGRfLTBGlMo6e394ADlza1q18L7F1e9QPNfp1qrL_xF6zDAvt7dZA5EAvcE/s1600/moodlenotification.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470374554275944034&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhQwQ_JjAXF9edLG9vs_ZkMBXKx1VebvSKalnTcJYS4nj5LqYqeAS9k1HMfwrCwA9RRY24-ZapsGQwxgdsTaGRfLTBGlMo6e394ADlza1q18L7F1e9QPNfp1qrL_xF6zDAvt7dZA5EAvcE/s320/moodlenotification.jpg&quot; style=&quot;cursor: hand; height: 166px; width: 320px;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Click Image To Zoom&lt;br /&gt;
&lt;br /&gt;
We can verify the installation by navigating to Modules -&amp;gt; Activitiies -&amp;gt; Manage activities in the Moodle Site Administration menu:&lt;br /&gt;
&lt;br /&gt;
If all of our changes were successful, we will see the following:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrrIgPXauiFtwr1ZReg7o7QUA6AATwxYNLKVvcrdUUDAsq0-QTSktcxdkKVXQS3udV9Wfi80j6LBtgmouS2pDYWH-dYhcV5W-0Wsq6Jnn24zDN_D4NFXih3G_0_KsERCiffLjVH9TRsqQ/s1600/notificationsrun.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470374385421132338&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrrIgPXauiFtwr1ZReg7o7QUA6AATwxYNLKVvcrdUUDAsq0-QTSktcxdkKVXQS3udV9Wfi80j6LBtgmouS2pDYWH-dYhcV5W-0Wsq6Jnn24zDN_D4NFXih3G_0_KsERCiffLjVH9TRsqQ/s320/notificationsrun.jpg&quot; style=&quot;cursor: hand; height: 183px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image To Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We can confirm that the module was installed correctly by navigating to Modules -&amp;gt; Activities -&amp;gt; Manage activities in the Moodle Site Administration menu:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMahkUDN4BdNmAhyZmRUp0jmo-EWeddvzqWTwx3yMbrXZSASTJkHF1l0mP82BsNYLae9p-ikSoW3ANg63wIIqU-DsXJIvHnGRd9X5xtDQWnaklymfMmWVkA2zYj0bkOytwVJx6-6QAmqk/s1600/checkinstall.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470376849972277010&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMahkUDN4BdNmAhyZmRUp0jmo-EWeddvzqWTwx3yMbrXZSASTJkHF1l0mP82BsNYLae9p-ikSoW3ANg63wIIqU-DsXJIvHnGRd9X5xtDQWnaklymfMmWVkA2zYj0bkOytwVJx6-6QAmqk/s320/checkinstall.jpg&quot; style=&quot;cursor: hand; height: 183px; width: 320px;&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Click Image To Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 130%;&quot;&gt;CONGRATS! &lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 130%;&quot;&gt;&lt;br /&gt;
We now have a properly registered Moodle Module&lt;br /&gt;
that does absolutely nothing!&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 130%;&quot;&gt;But we will change that soon :)&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/04mod-inyourface-adding-our-new.html&quot;&gt;Next Article In Series&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/8140817860662544204/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/03-inyourface-test-initial-changes-to.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/8140817860662544204'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/8140817860662544204'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/03-inyourface-test-initial-changes-to.html' title='03MOD: Moodle Module Setup - Test Initial Changes to Template'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPmRtx36PISZtuCjYlIqg3ipJ-gvCet_3d2VyvZBKCgXCSfIpuTvB45jDoNXbcIInleApMHC1whlQg1MXbb7O9ub_jf_503r3ZEMstcsi3j6Z7C00HGAlsDWmxMW7oaGL3QAvHiViXikM/s72-c/copymodule.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-2893104321720291647</id><published>2010-05-12T05:25:00.001-07:00</published><updated>2010-05-13T11:36:34.495-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>02MOD: Moodle Module Setup - Replacing the Module Name</title><content type='html'>&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;&lt;strong&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/strong&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
After the install.xml file has been updated, it is time to update all references to NEWMODULE in the template, and replace them with our own module&#39;s name. In this case, we will replace all references to NEWMODULE to inyourface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/u&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;strong&gt;&lt;u&gt;CHANGES TO FILES IN THE MODULE&#39;S ROOT DIRECTORY&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;In all these cases, we will be searching for &quot;newmodule&quot; and replacing it with &quot;inyourface&quot;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;
1. Edit index.php&lt;/strong&gt;: For the Moodle 1.9 template, this file contains 23 references to the module name. A simple search &amp;amp; replace takes care of it.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2. Edit lib.php&lt;/strong&gt;: Just like the index.php, a simple search &amp;amp; replace does the trick. There are 49 references to the module name in this file.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;3. Edit mod_form.php: Same as above. Lather, rinse, repeat. There&lt;/strong&gt; are 16 references to replace.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;4, Edit view.php&lt;/strong&gt;: There are 22 references to replace in this file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;u&gt;&lt;strong&gt;CHANGES TO FILES IN THE .\lang\en_utf8 DIRECTORY&lt;/strong&gt; &lt;/u&gt;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;1. Rename file newmodule.php: &lt;/strong&gt;This file should be renamed so it matches our module&#39;s name. In this case, I renamed it to inyourface.php&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;2. Edit the contents of the newly renamed file&lt;/strong&gt;: Inside of the language file, all references to newmodule must be replaced with our module&#39;s name. There are 9 references to the module, but the variable $string[&#39;[MODULE]name&#39;] should be replaced with whatever we would like Moodle to display to the end user. In our case, I have changed it to &quot;Post to Facebook&quot;&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;We are almost there. One more change . . .&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;CHANGES IN THE .\lang\en_utf8\help DIRECTORY&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;1. Rename the newmodule directory: &lt;/strong&gt;Immediately below the \help directory, there is a single directory named newmodule. It needs to be renamed to our module&#39;s name. In our case, I renamed it to inyourface.&lt;br /&gt;
&lt;br /&gt;
This directory will eventually hold all of the help files for our module. More on that later.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;center&quot;&gt;&lt;strong&gt;&lt;span style=&quot;font-size: 130%;&quot;&gt;We are now ready to see whether our Module will be recognized by Moodle. Right now it doesn&#39;t do much of anything, but we&#39;ll beef it up once we are sure that we have made all of the right edits to the template&lt;/span&gt;&lt;/strong&gt;&lt;/div&gt;&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/03-inyourface-test-initial-changes-to.html&quot;&gt;NEXT ARTICLE IN SERIES&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/2893104321720291647/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/02-inyourface-moodle-module-first-steps.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/2893104321720291647'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/2893104321720291647'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/02-inyourface-moodle-module-first-steps.html' title='02MOD: Moodle Module Setup - Replacing the Module Name'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-1258476696950779317</id><published>2010-05-11T10:18:00.000-07:00</published><updated>2010-05-13T23:01:13.192-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>01MOD: Moodle Module Setup - The install.xml file</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html&quot;&gt;TO START THE TUTORIAL FROM THE BEGINNING, CLICK HERE&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;We have just finished upacking our Moodle Module Template!&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
If we inspect the contents of our new directory, it&#39;s really not very assuming:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVznfA15chJbIhQXIx1bzlFGkqKyr1zuI2Qk9XEuFC0PmSIZcUsSB1GtOwNFVxPRCEcsIGLmiiWNBq9RYZiXCi0mECG3DmuNqdBPTRhfbOwUwFmOyBCcNxoSLABPQegB_uMXLYtx3mef0/s1600/ModuleFileList.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470093644559937714&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVznfA15chJbIhQXIx1bzlFGkqKyr1zuI2Qk9XEuFC0PmSIZcUsSB1GtOwNFVxPRCEcsIGLmiiWNBq9RYZiXCi0mECG3DmuNqdBPTRhfbOwUwFmOyBCcNxoSLABPQegB_uMXLYtx3mef0/s320/ModuleFileList.jpg&quot; style=&quot;height: 206px; width: 160px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;FIRST ORDER OF BUSINESS - MAKE THE PLUG-IN PLUGGABLE!&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;STEP 1 - the install.xml file&lt;/b&gt;&lt;br /&gt;
A plug-in is only a plug-in if we have &quot;plugged it in&quot;. In Moodle, we accomplish this by registering the Module in the Moodle database. Towards this end, we focus on a single file in the package - the &lt;b&gt;&lt;span style=&quot;color: #000099;&quot;&gt;install.xml&lt;/span&gt;&lt;/b&gt; file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It is located in the .\NEWMODULE\db\ directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So, I load it up in my trusty Notepad++ (here&#39;s a gratuitous plug for this great GPL editor: &lt;a href=&quot;http://notepad-plus.sourceforge.net/uk/site.htm&quot;&gt;Notepad++ Home Page&lt;/a&gt;) and notice that install.xml is nothing but an XMLDB file. The file should something like this when you load it into your editor:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiELete9VnCowMLWABk_OdZcEm13DfeBmBLqW5wW65gh-fR8j9cKfHKFxQcP1AHwO8SXoAO3S2ls-PgId1VX-tLFFUikl3UVEbyyHF5feOIoqfeMC9C9TGe7sjUIvF_sfBYkeUhNbumneU/s1600/install.xml.jpg&quot; rel=&quot;lightbox&quot;&gt;&lt;img alt=&quot;&quot; border=&quot;0&quot; id=&quot;BLOGGER_PHOTO_ID_5470095726259530738&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiELete9VnCowMLWABk_OdZcEm13DfeBmBLqW5wW65gh-fR8j9cKfHKFxQcP1AHwO8SXoAO3S2ls-PgId1VX-tLFFUikl3UVEbyyHF5feOIoqfeMC9C9TGe7sjUIvF_sfBYkeUhNbumneU/s320/install.xml.jpg&quot; style=&quot;height: 221px; width: 320px;&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Click Image To Zoom&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
THE MODULE&#39;S XMLDB FILE CAN BE EDITED USING MOODLE&#39;S XMLDB EDITOR&lt;br /&gt;
&lt;br /&gt;
This is the preferred method, and is covered in the post listed below.&lt;b&gt; &lt;/b&gt;The editor is available after the module has been copied to the Moodle .\mod directory, so instructions for modifying the file manually are also provided below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To learn a little about the XMLDB editor, &lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/08mod-moodle-module-development.html&quot;&gt;VISIT THE XMLDB EDITOR ARTICLE&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
TO EDIT THE XMLDB FILE MANUALLY:&lt;br /&gt;
&lt;br /&gt;
I run a search &amp;amp; replace for the word &quot;newmodule&quot; and replace it with my module&#39;s name: inyourface. For version 1.9, it should result in 12 replacements.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;We can also change the comments in the file, but we will save that for later. Before we can test our module, we still have a little more work to do!!! We will cover these steps in the next post.&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;CONTENTS OF install.xml after changes:&lt;/b&gt;&lt;br /&gt;
&lt;code&gt;&amp;lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; &amp;gt;&lt;br /&gt;
&amp;lt;XMLDB PATH=&quot;mod/inyourface/db&quot; VERSION=&quot;20070401&quot; COMMENT=&quot;XMLDB file for Moodle mod/inyourface&quot;&lt;br /&gt;
xmlns:xsi=&lt;a href=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/a&gt;&lt;br /&gt;
xsi:noNamespaceSchemaLocation=&quot;../../../lib/xmldb/xmldb.xsd&quot;&lt;br /&gt;
&amp;gt;&lt;br /&gt;
&amp;lt;TABLES&amp;gt;&lt;br /&gt;
&amp;lt;TABLE NAME=&quot;inyourface&quot; COMMENT=&quot;Default comment for inyourface, please edit me&quot;&amp;gt;&lt;br /&gt;
&amp;lt;FIELDS&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;id&quot; TYPE=&quot;int&quot; LENGTH=&quot;10&quot; NOTNULL=&quot;true&quot; UNSIGNED=&quot;true&quot; SEQUENCE=&quot;true&quot; ENUM=&quot;false&quot; NEXT=&quot;course&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;course&quot; TYPE=&quot;int&quot; LENGTH=&quot;10&quot; NOTNULL=&quot;true&quot; UNSIGNED=&quot;true&quot; DEFAULT=&quot;0&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; COMMENT=&quot;Course inyourface activity belongs to&quot; PREVIOUS=&quot;id&quot; NEXT=&quot;name&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;name&quot; TYPE=&quot;char&quot; LENGTH=&quot;255&quot; NOTNULL=&quot;true&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; COMMENT=&quot;name field for moodle instances&quot; PREVIOUS=&quot;course&quot; NEXT=&quot;intro&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;intro&quot; TYPE=&quot;text&quot; LENGTH=&quot;medium&quot; NOTNULL=&quot;false&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; COMMENT=&quot;General introduction of the inyourface activity&quot; PREVIOUS=&quot;name&quot; NEXT=&quot;introformat&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;introformat&quot; TYPE=&quot;int&quot; LENGTH=&quot;4&quot; NOTNULL=&quot;true&quot; UNSIGNED=&quot;true&quot; DEFAULT=&quot;0&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; COMMENT=&quot;Format of the intro field (MOODLE, HTML, MARKDOWN...)&quot; PREVIOUS=&quot;intro&quot; NEXT=&quot;timecreated&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;timecreated&quot; TYPE=&quot;int&quot; LENGTH=&quot;10&quot; NOTNULL=&quot;true&quot; UNSIGNED=&quot;true&quot; DEFAULT=&quot;0&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; PREVIOUS=&quot;introformat&quot; NEXT=&quot;timemodified&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;FIELD NAME=&quot;timemodified&quot; TYPE=&quot;int&quot; LENGTH=&quot;10&quot; NOTNULL=&quot;true&quot; UNSIGNED=&quot;true&quot; DEFAULT=&quot;0&quot; SEQUENCE=&quot;false&quot; ENUM=&quot;false&quot; PREVIOUS=&quot;timecreated&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/FIELDS&amp;gt;&lt;br /&gt;
&amp;lt;KEYS&amp;gt;&lt;br /&gt;
&amp;lt;KEY NAME=&quot;primary&quot; TYPE=&quot;primary&quot; FIELDS=&quot;id&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/KEYS&amp;gt;&lt;br /&gt;
&amp;lt;INDEXES&amp;gt;&lt;br /&gt;
&amp;lt;INDEX NAME=&quot;course&quot; UNIQUE=&quot;false&quot; FIELDS=&quot;course&quot;/&amp;gt;&lt;br /&gt;
&amp;lt;/INDEXES&amp;gt;&lt;br /&gt;
&amp;lt;/TABLE&amp;gt;&lt;br /&gt;
&amp;lt;/TABLES&amp;gt;&lt;br /&gt;
&amp;lt;STATEMENTS&amp;gt;&lt;br /&gt;
&amp;lt;STATEMENT NAME=&quot;insert log_display&quot; TYPE=&quot;insert&quot; TABLE=&quot;log_display&quot; COMMENT=&quot;Initial insert of records on table log_display. Each record describes how data will be showed by log reports.&quot;&amp;gt;&lt;br /&gt;
&amp;lt;SENTENCES&amp;gt;&lt;br /&gt;
&amp;lt;SENTENCE TEXT=&quot;(module, action, mtable, field) VALUES (&#39;inyourface&#39;, &#39;add&#39;, &#39;inyourface&#39;, &#39;name&#39;)&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;SENTENCE TEXT=&quot;(module, action, mtable, field) VALUES (&#39;inyourface&#39;, &#39;update&#39;, &#39;inyourface&#39;, &#39;name&#39;)&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;SENTENCE TEXT=&quot;(module, action, mtable, field) VALUES (&#39;inyourface&#39;, &#39;view&#39;, &#39;inyourface&#39;, &#39;name&#39;)&quot; /&amp;gt;&lt;br /&gt;
&amp;lt;/SENTENCES&amp;gt;&lt;br /&gt;
&amp;lt;/STATEMENT&amp;gt;&lt;br /&gt;
&amp;lt;/STATEMENTS&amp;gt;&lt;br /&gt;
&amp;lt;/XMLDB&amp;gt;&lt;/code&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/02-inyourface-moodle-module-first-steps.html&quot;&gt;NEXT ARTICLE IN SERIES&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/1258476696950779317/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/inyourface-moodle-module-first-steps.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/1258476696950779317'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/1258476696950779317'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/inyourface-moodle-module-first-steps.html' title='01MOD: Moodle Module Setup - The install.xml file'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVznfA15chJbIhQXIx1bzlFGkqKyr1zuI2Qk9XEuFC0PmSIZcUsSB1GtOwNFVxPRCEcsIGLmiiWNBq9RYZiXCi0mECG3DmuNqdBPTRhfbOwUwFmOyBCcNxoSLABPQegB_uMXLYtx3mef0/s72-c/ModuleFileList.jpg" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-3865135917765173582.post-7887833894381026623</id><published>2010-05-11T08:52:00.000-07:00</published><updated>2010-05-18T07:08:19.046-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="learning management"/><category scheme="http://www.blogger.com/atom/ns#" term="lms"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle development"/><category scheme="http://www.blogger.com/atom/ns#" term="moodle module"/><category scheme="http://www.blogger.com/atom/ns#" term="online learning"/><title type='text'>00MOD: Developing Moodle Modules</title><content type='html'>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:&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
I will start by coming up with a cool name for the plug-in. I am thinking of calling it InYourFace ?&amp;nbsp; This particular exercise will focus on building an activity module - a module that provides an activity that can be added to any Moodle course.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;WHERE DO WE START?&lt;br /&gt;
&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;color: blue;&quot;&gt;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.&amp;nbsp; It also assumes that you have some basic knowledge of PHP and MySQL.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;br /&gt;
Before we embark on writing our first Moodle module, let&#39;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:&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://download.moodle.org/plugins19/mod/NEWMODULE.zip&quot;&gt;Download Link for The Module Template for Moodle 1.9&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://moodlesensei.blogspot.com/2010/05/inyourface-moodle-module-first-steps.html&quot;&gt;NEXT ARTICLE IN SERIES&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://moodlesensei.blogspot.com/feeds/7887833894381026623/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/7887833894381026623'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/3865135917765173582/posts/default/7887833894381026623'/><link rel='alternate' type='text/html' href='http://moodlesensei.blogspot.com/2010/05/developing-moodle-modules.html' title='00MOD: Developing Moodle Modules'/><author><name>moodlesensei</name><uri>http://www.blogger.com/profile/14951271186133985670</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='27' src='//blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhP9Dwq5IOwudO245QvtCoQQSZXLQqtDyRFQq42f9CCEfzAwA53HRNQccLRRDJqLd3ty_UHimfD3U4Nl2FsQjotzoT6mweLmrZ3qsTVc98M8dLxHrH473402O6y90lkDKQ/s220/n797268748_9344.jpg'/></author><thr:total>0</thr:total></entry></feed>