Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Moodle 3.x Developer's Guide
Moodle 3.x Developer's Guide

Moodle 3.x Developer's Guide: Build custom plugins, extensions, modules and more

Arrow left icon
Profile Icon Wild Profile Icon Jaswant Tak
Arrow right icon
£16.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
Paperback Jun 2017 368 pages 1st Edition
eBook
£20.98 £29.99
Paperback
£36.99
Subscription
Free Trial
Renews at £16.99p/m
Arrow left icon
Profile Icon Wild Profile Icon Jaswant Tak
Arrow right icon
£16.99 per month
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5 (2 Ratings)
Paperback Jun 2017 368 pages 1st Edition
eBook
£20.98 £29.99
Paperback
£36.99
Subscription
Free Trial
Renews at £16.99p/m
eBook
£20.98 £29.99
Paperback
£36.99
Subscription
Free Trial
Renews at £16.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. £16.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Moodle 3.x Developer's Guide

Moodle Plugins - What Can I Plug In?

Having readied our development environment and explored the thought processes that support building a Moodle plugin, in this chapter we will be investigating the types of
plugin Moodle supports. Remember that the "M" in Moodle stands for modular; if there is a feature you need that Moodle doesn't support then we can build a plugin to implement it. Any aspect of the user experience can be enhanced and/or modified by a plugin. In this chapter, we will be mapping out the most common user journeys through the platform, from initial log on (authentication), through being assigned to courses (enrolment), and ultimately completion reporting.

As described in the previous chapter, we will be taking an Agile approach to plugin development, and that means we will be working with user stories (a description of what our work needs to achieve...

Managing users

Getting users onto courses is a two-step process. Firstly, a user needs to have a user account created in Moodle--the authentication step. Next, they need to be given access to a course through course enrolment. Both of these steps are supported--and can be enhanced--by plugins. Let's start by looking at authentication.

Authentication

Log in to your development Moodle as an administrator and, from the Site administration menu, slide down to Plugins, then Authentication, and then click on Manage authentication:

The Manage authentication page lists the available authentication plugins (together with general configuration settings further down the page):

Check out the Moodle docs for details of the authentication...

Managing courses

Moodle courses are where learning takes place, and in order to ensure Moodle is as flexible a learning tool as possible, the Moodle platform has been designed to allow developers to provide as much course design flexibility as possible through the plugin system. We start this section by investigating how plugins might be used to alter the standard Moodle course layout.

Course layout

Moodle comes supplied with four standard course layouts:

  • Weekly
  • Topics
  • Social
  • Single activity

The course format is specified from the Course format page:

For example, setting a course to a Topics format containing five sections will configure a course to display three columns: a central column where teaching interactions can...

Course content

In this section, we consider the types of interaction that an instructional designer (ID) might want the learner to engage in. Developing new learner interactions is described in much more detail in Chapter 5, Creative Teaching - Developing Custom Resources and Activities. In the meantime, let us look at the types of interaction Moodle supports out of the box and how to select the correct type of interaction based on the requirements presented to us by the ID.

Moodle supports two basic types of learner interaction: resources and activities. Let's start by looking at resources.

Resources

A Moodle resource plugin transmits information to the learner--it expects nothing in return. A resource plugin expects...

Reporting and analytics

Once students have been introduced onto the platform and have started to learn, we need to be able to report on, among other things, the activities students have been undertaking. Luckily, Moodle also takes a modular approach to report development. Both course and site administrator report scripts are to be found in the report folder:

Take a look in the documentation at https://docs.moodle.org/dev/Reports for details on the general structure of reports. Whenever you are querying the database, it is vital to remember the following:

We will be learning how to create custom reports in Chapter 9, Moodle Analytics.

Look and feel

Each plugin can be provided with its own /styles.css script to customise that plugin's look and feel. Over and above that, Moodle provides a flexible plugin-based theming framework--check out the Moodle directory at https://docs.moodle.org/dev/Themes. A new Moodle theme is possibly one of the more complicated plugin types you might need to develop. Go to Eclipse and navigate the PHP Explorer to the theme folder:

The trick to developing a new Moodle theme is to take a pre-existing theme and modify it to your requirements. Take a look in the Moodle plugins directory (https://moodle.org/plugins/browse.php?list=category&id=3) for third-party themes.

Let's take a look at the general structure of a Moodle theme plugin. In Eclipse, open the theme/canvas folder:

In the previous screenshot, you will see two folders that have been expanded: layout and style...

Managing users


Getting users onto courses is a two-step process. Firstly, a user needs to have a user account created in Moodle--the authentication step. Next, they need to be given access to a course through course enrolment. Both of these steps are supported--and can be enhanced--by plugins. Let's start by looking at authentication.

Authentication

Log in to your development Moodle as an administrator and, from the Site administration menu, slide down to Plugins, then Authentication, and then click on Manage authentication:

The Manage authentication page lists the available authentication plugins (together with general configuration settings further down the page):

Check out the Moodle docs for details of the authentication process at https://docs.moodle.org/dev/Authentication_plugins#Overview_of_Moodle_authentication_process. What is important to realize about the authentication process is that it isn't simply a question of either creating a new user account in Moodle or verifying user credentials...

Managing courses


Moodle courses are where learning takes place, and in order to ensure Moodle is as flexible a learning tool as possible, the Moodle platform has been designed to allow developers to provide as much course design flexibility as possible through the plugin system. We start this section by investigating how plugins might be used to alter the standard Moodle course layout.

Course layout

Moodle comes supplied with four standard course layouts:

  • Weekly
  • Topics
  • Social
  • Single activity

The course format is specified from the Course format page:

For example, setting a course to a Topics format containing five sections will configure a course to display three columns: a central column where teaching interactions can be added, with two columns to the left and right that contain blocks of supporting content.

The code for these four formats is to be found under \course\format, as in the following screenshot taken from Eclipse:

Any new course format we create will need to be included in this folder...

Course content


In this section, we consider the types of interaction that an instructional designer (ID) might want the learner to engage in. Developing new learner interactions is described in much more detail in Chapter 5, Creative Teaching - Developing Custom Resources and Activities. In the meantime, let us look at the types of interaction Moodle supports out of the box and how to select the correct type of interaction based on the requirements presented to us by the ID.

Moodle supports two basic types of learner interaction: resources and activities. Let's start by looking at resources.

Resources

A Moodle resource plugin transmits information to the learner--it expects nothing in return. A resource plugin expects the learner to be passive. Obvious examples of resources are text to read, videos to watch, and audio to listen to. That is not to say that the resource won't form the basis of some form of interaction outside of Moodle, but we certainly don't expect any aspect of that interaction...

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Customize your Moodle 3.x app.
  • Leverage the new features of Moodle 3.x by diving deep into the Moodle development eco-system.
  • Cater to heavy user traffic, customize learning requirements and create custom third party plugins.

Description

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.

Who is this book for?

This book is for Moodle developers who are familiar with the basic Moodle functionality 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. You should be familiar with HTML and XML protocols. You do not need to have prior knowledge of Moodle-specific terminology

What you will learn

  • • Work with the different types of custom modules that can be written for Moodle 3.x
  • • Understand how to author custom modules so they conform to the agreed Moodle 3.x development guidelines
  • • Get familiar with the Moodle 3.x architecture—its internal and external APIs
  • • Customize Moodle 3.x so it can integrate seamlessly with third-party applications of any kind
  • • Build a new course format to specify the layout of a course
  • • Implement third-party graphics libraries in your plugins
  • • Build plugins that can be themed easily
  • • Provide custom APIs that will provide the means to automate Moodle 3 in real time

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 29, 2017
Length: 368 pages
Edition : 1st
Language : English
ISBN-13 : 9781786467119
Languages :
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. £16.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : Jun 29, 2017
Length: 368 pages
Edition : 1st
Language : English
ISBN-13 : 9781786467119
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
£16.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
£169.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts
£234.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just £5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total £ 115.97
Moodle 3.x Developer's Guide
£36.99
Moodle 3 Administration, Third Edition
£41.99
Moodle Theme Development
£36.99
Total £ 115.97 Stars icon

Table of Contents

9 Chapters
Getting to Grips with the Moodle 3 Architecture Chevron down icon Chevron up icon
Moodle Plugins - What Can I Plug In? Chevron down icon Chevron up icon
Internal Interfaces Chevron down icon Chevron up icon
Course Management Chevron down icon Chevron up icon
Creative Teaching - Developing Custom Resources and Activities Chevron down icon Chevron up icon
Managing Users - Letting in the Crowds Chevron down icon Chevron up icon
Creating a Dashboard - Developing a Learner Homepage Chevron down icon Chevron up icon
Creating a New Skin Chevron down icon Chevron up icon
Moodle Analytics Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.5
(2 Ratings)
5 star 50%
4 star 50%
3 star 0%
2 star 0%
1 star 0%
Michael Ford Aug 23, 2017
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A guide to Moodle development is long overdue but the author has nailed it! I found the book well-written, thorough and very practical. The author's technical and educational expertise shine through and he's generous with insights not easily found on Moodle docs. In fact, the book has many parallels to Moodle as a learning platform, offering collaborative learning experiences while pulling together useful resources where required.The first chapter is about setting up. We're given a brief explanation of how to set up the development environment, an introduction to agile software methodology, to object orientated programming and to Moodle itself. Once prepared, we’re given our first client requirements and we’re then guided through the research, development and implementation of a working solution.Going through the book, the requirements get increasingly more complex and the explanations more detailed. In each case, we end up with a working solution as well as suggestions on how this might be further developed. I found the customised authentication plugin and the learning analytics particularly relevant. However, as the author also uses these projects to give us a thorough tour of Moodle functionality, there'll be something here for almost everybody.On the resources side, links to further reading are offered throughout the book, and the appendix is particularly worth checking - Behat, unit testing, coding standards, XML-RPC, encryption, compression, and GIT among other topics.Finally, the author's enthusiasm is infectious. I haven't coded for a while but I've been inspired. This is a book worth making space for.
Amazon Verified review Amazon
Client d'Amazon Apr 26, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Dès le premier chapitre, le livre est intéressant et vous permet de mieux comprendre l'outil et sa structure.Et d'être productif. Après une journée on est capable de réaliser des plug-ins... je dis chapeaux l'auteur.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.