Date post: | 24-May-2015 |
Category: |
Documents |
Upload: | cheer-wang |
View: | 1,223 times |
Download: | 1 times |
Develop a block for Moodle
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
2 of 32
Project Context• Speakers
– Michael de Raadt– Yajuvendrasinh V Mahida (Masters student)
• Moodle Trial Project• Moodle as new StudyDesk• Independent Studies ‘Mini-project’
– Develop a block for Moodle
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
3 of 32
Project Context
• Semester 1 March 2008 - CSC8480 Computing Complementary Studies
• Supervisor Mr. Michael de Raadt
• I was asked to develop block for Moodle
• I went with proposal of E-Commerce Portal
• In initial findings about Moodle I found it interesting and decided to develop block for Moodle
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
4 of 32
Moodle
• I found that Moodle is really revolutionary e-learning platform
• Moodle is modular. It is having potential for keeping up with the time and new technologies
• Development of Moodle is on going process by diffused network of commercial and non-commercial users which are streamlined by the Moodle company based in Perth, Western Australia
• The following Moodle Statistics are success story of Moodle http://moodle.org/stats/
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
5 of 32
Moodle Statistics
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
6 of 32
Intentions
• The project was divided in two phases
1.Research work on Moodle and Block
• To find out what is Moodle, how it works, what is the file structure etc
• Finding a way for creating a block, what is block, how it works and understanding what you find
2.Creating a block
• Carving the research work to develop block
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
7 of 32
Discoveries
• The first difficulty was to find exact information regarding to the development
• The http://docs.moodle.org have very useful documentation for Developer under MoodleDocs. I used this documents as secondary source for the information
• I feel that there is a need of more detailed and practical documentation work for Developer as the current documentation is inadequate
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
8 of 32
Discoveries• For my development work I downloaded the
blocks developed by developer from the Moodle website’s Modules and plugins section
• I studied them and tried the Trial and Error method and also used the MoodleDocs for block development
• Many times my Moodle Software was crashed and I learned lot of things through this
• I found that already developed blocks are the best source for developer as starting point
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
9 of 32
Discoveries• After all these findings I developed the
simple Ajax Google Search block
• It was just simple block which was showing the Google Web Search results
• I showed to supervisor Mr. Michael de Raadt and he advised me for adding more customization through the Instance Configuration and Global Configuration
• I downloaded and studied the block that have configurations. And I used that finding to add customization feature to my block
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
10 of 32
Tools1. Eclipse with PHP plugin
• It is really good IDE with powerful features
• You can connect to the CVS repository http://cvs.moodle.org
• I found that it is very complex and not easy to start with
• The setting up Eclipse for Moodle development is good guide to start with http://docs.moodle.org/en/Development:Setting_up_Eclipse
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
11 of 32
Tools2. fabFORCE DBDesigner 4
• DBDesigner 4 is a open source visual database design system that integrates database design, modeling, creation and maintenance into a single, seamless environment
• I used this tool to explore the Moodle database system
• This is really good tool for playing around the MySQL database of Moodlehttp://www.fabforce.net/dbdesigner4/downloads.php
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
12 of 32
Tools3. NuSphere PHP IDE
• It is really good IDE with powerful features like friendly user interface, debugger, code navigator etc
• I used this IDE is as a real time editor for my block http://www.nusphere.com/
• The other features can be useful but I have never needed to use it
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
13 of 32
Outcomes• Finally I developed the fully customizable
Google Search Services block
• I submitted this block on the Moodle’s Modules and Plugins section which was accepted as valid block and can be found at http://moodle.org/mod/data/view.php?d=13&rid=1608
• Till today’s date I have received some general queries regarding to the block from the Moodle community and some few users across the community have given me positive feedback about the working of the block
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
14 of 32
Outcomes• Through this course and project I had
chance for the experience with the real world development
• I learnt lot of things in terms of academic and professional skills
• My supervisor Michael de Raadt kept me on the right track during the project work. This was really important as sometime one can easily lost during the track in absence of proper guidance
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
15 of 32
Outcomes• I have learnt the theoretical aspects of the
PHP, HTML, CSS, AJAX through my academic learning
• With this project I put all these theoretical skills into the professional and real world development
• This course has proved worthwhile for me….
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
16 of 32
Moodle Google Block
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
17 of 32
Moodle Google Block File Structure
Instance Configuration HTML File
Global Configuration HTML File Main Block File
Lang directory
Cascade Style SheetDirectory
Images necessary for Block
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
18 of 32
Block’s Language File Structure
Language File
HTML Help files to use with Block’s help buttons
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
19 of 32
Main Block File block_moodle_google.php
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
20 of 32
Language File block_moodle_google.php
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
21 of 32
Global Configuration Source-Code
config_global.html
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
22 of 32
Block’s Global Configuration
Global Configuration can be accessed
by Site Administration
Block
This parameters are loaded from the config_global.html file
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
23 of 32
Instance Configuration Source-Code
config_instance.html
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
24 of 32
Block’s Instance Configuration
Press the edit buttonfor
Instance Configuration
This parameters are loaded from the config_instance.html file
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
25 of 32
Integrated Help Function• The help functionality is implemented
using the Moodle function helpbutton. This function is defined in weblib.php library.
helpbutton($page, $title, $module='moodle', $image=true, $linktext=false, $text='', $return=false,$imagetext='')
Help button using helpbutton function
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
26 of 32
Integrated Help Function• When you press this button help page
(html) is called from the directory\moodle\lang\en_utf8\help\moodle_google_help
Help Page is displayed as pop up
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
27 of 32
Integrated Help Function
• I found all these functions very late during work
• These functions are described with all arguments and required parameters. This can be said the Moodle APIs
• This is really very smart APIs and with few lines of code one can achieve big functionalities within the Moodle
• Use of these functions makes the development work very easy
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
28 of 32
Integrated Help Function
• The Moodle Community have defined all these various Moodle functions under various library on http://xref.moodle.org/nav.html?index.html
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
29 of 32
Potential for Future Students• Undergraduates
– Advanced/later-year programming undergrads• JavaScript in Block• Simple blocks modifications• Simple DB access
• Postgrads– Some groundwork but still steep learning curve– Block development– Modifications to existing Moodle code
• Project Clients– Pseudo-client– University (lower priority feature requests)– Moodle Student Projects
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
30 of 32
Useful Links
1. Moodle Docs - Developer Documents for Moodle Developer
http://docs.moodle.org/en/Developer_documentation
2. PHP Cross Reference of Moodle 1.9- Moodle Functions References and other Stuff
http://xref.moodle.org
3. The CVS archive - This archive contains all the source code for Moodle
http://cvs.moodle.org/
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
31 of 32
Useful Links4. Moodle Documentation Development:Block
Step by step guide to Creating Blocks http://docs.moodle.org/en/Development:Blocks
5. Moodle Google Block
This block’s source codes have the comments for each piece of the code.
I have tried to explain each piece of code and what it does
This makes easy for any newbie to start developing block
http://moodle.org/mod/data/view.php?d=13&rid=1608
Proj. ContextMoodleIntentionDiscoveriesToolsOutcomesMy BlockPotential
32 of 32
Thank you very much…..