Book Image

Moodle 3.x Developer's Guide

By : Ian Wild, Jaswant Tak
Book Image

Moodle 3.x Developer's Guide

By: Ian Wild, Jaswant Tak

Overview of this book

The new and revamped Moodle is the top choice for developers to create cutting edge e-learning apps that cater to different user’s segments and are visually appealing as well. This book explains how the Moodle 3.x platform provides a framework that allows developers to create a customized e-learning solution. It begins with an exploration of the different types of plugin.. We then continue with an investigation of creating new courses. You will create a custom plugin that pulls in resources from a third-party repository. Then you’ll learn how users can be assigned to courses and granted the necessary permissions. Furthermore, you will develop a custom user home. At the end of the book, we’ll discuss the Web Services API to fully automate Moodle 3.x in real time.
Table of Contents (19 chapters)
Title Page
Credits
About the Author
Acknowledgments
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface
6
Managing Users - Letting in the Crowds

Preface

For any organization that's considering implementing an online learning environment, Moodle is often the number one choice. Key to its success is the free, open source ethos that underpins it. Not only is the Moodle source code fully available to developers, but Moodle itself has been developed to allow the inclusion of third-party plugins. Everything from how users access the platform and the kinds of teaching interactions that are available through to how attendance and success can be reported--in fact, all the key Moodle functionalities--can be adapted and enhanced through plugins.

Using real-world examples, this book will show you how to enhance a default Moodle installation with novel plugins to authenticate and enroll users on to courses, new and interesting teaching interactions, new custom skins, and enhanced course layouts.

Obviously, a book of this length won't be able to cover every single plugin type, but by the end of Chapter 9, Moodle Analytics, you will have a thorough grounding in Moodle plugin structure, a detailed understanding of how plugins should interact with Moodle's internal Application Programming Interfaces (APIs), and plenty of great ideas to help you enhance your Moodle installation with new, custom plugins. If you have developed a plugin you feel would be useful to the Moodle community, you should certainly consider submitting it to the Moodle Plugins Directory at https://moodle.org/plugins/.

What this book covers

Chapter 1, Getting to Grips with the Moodle 3 Architecture, introduces the ethos of the Moodle project and how it has influenced the internal architecture. We prepare ourselves for plugin development by installing the tools we need.

Chapter 2, Moodle plugins - What Can I Plug In?, investigates the main plugin types, such as those dealing with users and how they access the platform. Also, it covers plugins that provide the learning interactions that users experience when they take a course. We also looks at the less obvious plugins, such as filters.

Chapter 3, Internal Interfaces, shows the different types of application programming interfaces (APIs) Moodle provides to support plugin development.

Chapter 4, Course Management, demonstrates how courses can be enhanced through the development of novel course formats. We see how plugins can be used to modify course structure and, by so doing, enhance teaching.

Chapter 5, Creative TeachingDeveloping Custom Resources and Activities, shows that there are two types of teaching interaction: resources and activities. Both of these are types of course module plugin. In this chapter, you will learn how Moodle course plugins work, which scripts need to be present in order for your plugin to behave correctly, and how to modify course plugins to fit your needs.

Chapter 6, Managing Users - Letting in the Crowds, explores how plugins can manage users in a variety of different contexts. We develop two novel plugins, one to authenticate users against an external WordPress site using OAuth, and another to automatically enroll users onto courses when they connect to Moodle via WordPress.

Chapter 7, Creating a Dashboard - Developing a Learner Homepage, teaches us how plugins can be used to create an enhanced learner homepage. Gamification is all about using the same tricks and techniques employed by game developers to entice learners into progressing with courses. In this chapter, we learn how plugins can be developed to promote similar techniques.

Chapter 8, Creating a New Skin, focuses on aesthetics after we have concerned ourselves with functionality. We investigate how Moodle can be rebranded through theme plugins, with a particular focus on support for mobile and tablet devices.

Chapter 9, Moodle Analytics, showcases how to develop plugins to monitor and analyze learner behavior. We learn how to extract data efficiently, how to judge the effectiveness of that extraction, and the various means by which data can be reported, including via a secure external interface.

What you need for this book

You will need a computer suitable for software development, one that can run a web server and a separate development environment (Chapter 1, Getting to Grips with the Moodle 3 Architecture, guides the reader through the necessary configuration steps). This book is aimed at developers, so it is assumed that you will be able to install Moodle with minimum fuss. If you need more information on Moodle administration, check out Moodle Administration, also available from Packt (visit https://www.packtpub.com/hardware-and-creative/moodle-3-administration-third-edition for details).

Who this book is for

This book is for Moodle developers who are familiar with the basic Moodle functionalities and have an understanding of the types of scenarios in which the Moodle platform can be usefully employed. You must have medium-level PHP programming knowledge and should be familiar with the HTML and XML protocols. You do not need to have prior knowledge of Moodle-specific terminology.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "For example, an administration setting named local_duallang/primarylanguage is accessed by calling get_config('local_duallang', 'primarylanguage')."

A block of code is set as follows:

var col_complete = completion_data.colors.completed_colour; 
var col_incomplete = completion_data.colors.notCompleted_colour; 
var col_submitted = completion_data.colors.submittednotcomplete_colour; 
var col_failed = completion_data.colors.futureNotCompleted_colour; 

Any command-line input or output is written as follows:

$repeatarray[] = $mform->createElement('text', 'option', get_string('optionno', 'choice')); 
with 
$repeatarray[] = $mform->createElement('editor', 'option', get_string('option','enhancedchoice'), null, array('maxfiles'=>EDITOR_UNLIMITED_FILES, 'noclean'=>true, 'context'=>$this->context));

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "When the learner clicks on the Description button, the client wants a Course information page to be displayed."

Note

Warnings or important notes appear in a box like this.

Note

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book--what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

You can download the code files by following these steps:

  1. Log in or register to our website using your e-mail address and password.
  2. Hover the mouse pointer on the SUPPORT tab at the top.
  3. Click on Code Downloads & Errata.
  4. Enter the name of the book in the Search box.
  5. Select the book for which you're looking to download the code files.
  6. Choose from the drop-down menu where you purchased this book from.
  7. Click on Code Download.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR / 7-Zip for Windows
  • Zipeg / iZip / UnRarX for Mac
  • 7-Zip / PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Moodle-3-Developer's-Guide. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/Moodle3.xDevelopersGuide_ColorImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books-maybe a mistake in the text or the code-we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at [email protected] with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

Questions

If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.