<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trott</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Trott"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Trott"/>
	<updated>2026-04-22T05:17:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Web_services&amp;diff=57973</id>
		<title>Web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Web_services&amp;diff=57973"/>
		<updated>2020-10-30T17:47:58Z</updated>

		<summary type="html">&lt;p&gt;Trott: /* How it works */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== How it works ===&lt;br /&gt;
This example will give you an idea of how our web services infrastructure works. &lt;br /&gt;
#The client sends a username and password to the web service login script.&lt;br /&gt;
#The script returns a token for that user account.&lt;br /&gt;
#The client calls a particular web service function on a protocol server including the token .&lt;br /&gt;
#The protocol server uses the token to check that the user can call the function.&lt;br /&gt;
#The protocol server calls the matching external function, located under the \component\external namespace (previously in a externallib.php file inside the relevant module).&lt;br /&gt;
#The external function checks that the current user has_capability to do this operation.&lt;br /&gt;
#The external function calls the matching Moodle core function (in lib.php usually).&lt;br /&gt;
#The core function can return a result to the external function. &lt;br /&gt;
#The external function will return a result to the protocol server.&lt;br /&gt;
#The protocol server returns the result to the client.&lt;br /&gt;
&lt;br /&gt;
== Developer documentation==&lt;br /&gt;
The full API can be found on any Moodle sites under &#039;&#039;&#039; Administration block &amp;gt; Plugins &amp;gt; Web services &amp;gt; API Documentation&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Additional services are available for uploading and downloading files which are not in the API Documentation - they are accessed in a different way. See [[Web services files handling]]&lt;br /&gt;
&lt;br /&gt;
* [[How to contribute a web service function to core]]&lt;br /&gt;
* [[Adding a web service to a plugin| Adding a web service to your plugin]]&lt;br /&gt;
* Code example: [https://gist.github.com/timhunt/51987ad386faca61fe013904c242e9b4 Adding a web service, using APIs] by (Tim Hunt)&lt;br /&gt;
* [[Creating a web service client | Implement a web service client]]&lt;br /&gt;
* [[Web services files handling]]&lt;br /&gt;
* [[Web_services_Roadmap | Web service Listing &amp;amp; Roadmap]]&lt;br /&gt;
&lt;br /&gt;
== Specification and brainstorming ==&lt;br /&gt;
* [[External services security | External services security]]&lt;br /&gt;
* [[External services description | External services description]]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Web_service_API_functions|Web service API functions]]&lt;br /&gt;
* [[:en:Web_services_FAQ|Web services FAQ]]&lt;br /&gt;
* [[:en:How_to_create_and_enable_a_web_service|How to create and enable a web service]]&lt;br /&gt;
* [[:en:Enable mobile web services|How to enable the mobile web service]]&lt;br /&gt;
* [[:en:Web_services|Web services user documentation]]&lt;br /&gt;
* [http://www.slideshare.net/juanleyva/mastering-moodle-web-services-development Mastering Moodle Web Services development] - Last session of the Hackfest in the MoodleMoot UK 2016&lt;br /&gt;
&lt;br /&gt;
[[Category:Web_Services]]&lt;/div&gt;</summary>
		<author><name>Trott</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_architecture&amp;diff=54651</id>
		<title>Moodle architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_architecture&amp;diff=54651"/>
		<updated>2018-08-22T18:27:07Z</updated>

		<summary type="html">&lt;p&gt;Trott: /* What is Moodle? */ fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The aim of this document is to quickly give an overview of how the Moodle works at a technical level. Hopefully this will be helpful to Administrators and Developers. However, to actually do Moodle development you will have to study the code in much more detail than is provided here. See the [[Developer_documentation|developer documentation]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==What is Moodle?==&lt;br /&gt;
&lt;br /&gt;
Moodle is a Learning Management System, Course Management System, or Virtual Learning Environment, depending on which term you prefer. Its goal is to give teachers and students the tools they need to teach and learn. Moodle comes from a background of [[:en:Pedagogy|Social Constructionist pedagogy]], however, it can be used to support any style of teaching and learning.&lt;br /&gt;
&lt;br /&gt;
There are other types of software systems that are important for educational institutions, for example ePortfolios, Student Information Systems and Content repositories. Generally, Moodle does not try to re-invent these areas of functionality. Instead, it tries to be the best LMS possible, and then interoperate gracefully with other systems that provide the other areas of functionality. It is, however, perfectly possible to use Moodle as a stand-alone system, without integrating it with anything else.&lt;br /&gt;
&lt;br /&gt;
Moodle is a web application written in PHP. Moodle is open source. Copyright is owned by individual contributors, not assigned to a single entity, although the company Moodle Pty Ltd in Perth Australia, owned by Moodle&#039;s founder Martin Dougiamas, manages the project.&lt;br /&gt;
&lt;br /&gt;
==Overview of a Moodle installation==&lt;br /&gt;
&lt;br /&gt;
A Moodle installation comprises the Moodle code executing in a PHP-capable web server; a database managed by MySQL, PostgreSQL, Microsoft SQL Server, MariaDB, or Oracle; and a file store for uploaded and generated files (the moodledata folder).&lt;br /&gt;
&lt;br /&gt;
All three parts can run on a single server; or they can be separated with many load-balanced web-servers, a database cluster, and a file-server; or anywhere between those extremes.&lt;br /&gt;
&lt;br /&gt;
Moodle is designed to be simple to install on any server that meets these basic requirements. Moodle self-installs once the code has been copied to the web server and a blank database created (see [[:en:Installing Moodle]]). Similarly, Moodle can always self-upgrade from one version to the next (see [[:en:Upgrading]]).&lt;br /&gt;
&lt;br /&gt;
==Moodle as a modular system==&lt;br /&gt;
&lt;br /&gt;
Like many successful open source systems, Moodle is structured as an application core, surrounded by numerous plugins to provide specific functionality. Moodle is designed to be highly extensible and customizable without modifying the core libraries, as doing so would create problems when upgrading Moodle to a newer version. So when customizing or extending your own Moodle install, always do so through the plugin architecture. &lt;br /&gt;
&lt;br /&gt;
Plugins in Moodle are of specific types. That is, an authentication plugin and an activity module will communicate with Moodle core using different APIs, tailored to the type of functionality the plugin provides. Functionality common to all plugins (installation, upgrade, permissions, configuration, ...) are, however, handled consistently across all plugin types.&lt;br /&gt;
&lt;br /&gt;
The standard Moodle distribution includes Moodle core and a number of plugins of each type, so that a new Moodle installation can immediately be used to start teaching and learning. After installation a Moodle site can be adapted for a particular purpose by changing the default configuration option, and by installing add-ons or removing standard plugins. Most add-ons that have been shared publicly are listed in the [http://moodle.org/plugins/index.php Moodle Plugins Directory].&lt;br /&gt;
&lt;br /&gt;
Physically, a Moodle plugin is just a folder of PHP scripts (and CSS, JavaScript, etc. if necessary). Moodle core communicates with the plugin by looking for particular entry points, often defined in the file &amp;lt;tt&amp;gt;lib.php&amp;lt;/tt&amp;gt; within the plugin.&lt;br /&gt;
&lt;br /&gt;
* See [[Communication Between Components]] on how different Moodle components and plugins communicate with each other.&lt;br /&gt;
&lt;br /&gt;
==An overview of Moodle core==&lt;br /&gt;
&lt;br /&gt;
Moodle core provides all the infrastructure necessary to build a Learning Management System. It implements the key concepts that all the different plugins will need to work with. These include:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Courses and activities:&#039;&#039;&#039;&lt;br /&gt;
A Moodle course is a sequence of activities and resources grouped into sections. Courses themselves are organized into a hierarchical set of categories within a Moodle site.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Users:&#039;&#039;&#039;&lt;br /&gt;
In moodle, users are anyone who uses the moodle system. In order to participate in course users need to be enrolled into course with a given role, such as:&lt;br /&gt;
&lt;br /&gt;
*Students&lt;br /&gt;
*Teachers&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Course enrolment&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
*Enrolment gives user the possibility to participate in course as a student or teacher.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;User functionality in moodle:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*User roles in moodle: Roles assigned to users give them a set of capabilities in given context. For example: Teacher, Student and Forum moderator are examples of roles.&lt;br /&gt;
*User&#039;s capabilities in moodle: A capability is a description of some particular Moodle feature. Capabilities are associated with roles. For example, mod/forum:replypost is a capability.&lt;br /&gt;
*Context: A context is a &amp;quot;space&amp;quot; in the Moodle, such as courses, activity modules, blocks etc.&lt;br /&gt;
*Permissions: A permission is some value that is assigned for a capability for a particular role. For example, allow or prevent.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Added facilities provided by moodle:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Creation and editing of user profiles: In moodle, the moment an user creates his account, a profile is created for that user. The user needs to fill in his initial details for completing his profile. The user generally always have the permission to edit his own profile anytime on moodle.&lt;br /&gt;
*Groups and cohorts: Cohorts, or site-wide groups, enable all members of a cohort to be enrolled in a course in one action, either manually or synchronised automatically.&lt;br /&gt;
*Enrolments and access control: Users are generally enrolled into some courses and according to their permission settings and the groups to which they belong, they have limited access on moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A bit more about moodle:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*Activity and course completion: The activity completion system allows activities such as Quizzes, SCORM modules, etc. to be marked complete when specified conditions are met.&lt;br /&gt;
*Navigation, settings and configuration: The Navigation block provide easy access to view various sections of the Moodle site and includes:&lt;br /&gt;
**My home - a personalised home page displaying links to the courses a user is associated with and activity information (such as unread forum posts and upcoming assignments)&lt;br /&gt;
**Site pages - links to site pages and resources from the front page of Moodle&lt;br /&gt;
**My profile - quick links allowing a user to view their profile, forums posts, blogs and messages as well as manage their private files&lt;br /&gt;
**My courses - lists (by course shortname) and links to courses the user is associated with. Click the course&#039;s shortname to view the front page of the course or use the arrows to navigate quickly to a specific section, resource or activity.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;JavaScript library:&#039;&#039;&#039;&lt;br /&gt;
*Moodle has adopted the Yahoo User Interface library. There is also a nice system for loading the additional JavaScript files required by each page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Upgrading moodle:&#039;&#039;&#039;&lt;br /&gt;
Moodle can be upgraded in four simple steps:&lt;br /&gt;
&lt;br /&gt;
#Make sure that your server can run the latest Moodle version&lt;br /&gt;
#You should always be prepared to &amp;quot;roll back&amp;quot; if there&#039;s an issue with your data or some custom code you&#039;ve added. So before committing, create a test install and always make backups.&lt;br /&gt;
#At this stage you can replace the Moodle code on your server with the version you downloaded and check for the plugins.&lt;br /&gt;
#Perform the upgrade by triggering the upgrade from the admin page.&lt;br /&gt;
&lt;br /&gt;
(More information about upgrading can be found here : [[:en:Upgrade overview|Upgrade overview]])&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Logs and statistics in moodle:&#039;&#039;&#039;&lt;br /&gt;
*Statistics in moodle: The statistics graphs and tables show how many hits there have been on various parts of your site during various time frames. They do not show how many distinct users there have been. They are processed daily at a time you specify. You must enable statistics before you will see anything.&lt;br /&gt;
*Log in moodle: Logs in Moodle are activity reports. Logs are available at site level and course level.&lt;br /&gt;
&lt;br /&gt;
==The most important plugin types==&lt;br /&gt;
&lt;br /&gt;
Please see the page [[Plugin types]] for the full list. A selection of the most common ones is highlighted here.&lt;br /&gt;
&lt;br /&gt;
===Activities and resources===&lt;br /&gt;
&lt;br /&gt;
Activities and resources are the most basic individual components that make up a course and are the main tools for teaching and learning. Some examples of resources are: pages, links and IMS content packages. Examples of activities include: forums, wikis, quizzes, and assignments.&lt;br /&gt;
&lt;br /&gt;
Activities are by far the largest type of plugin in terms of amount of code. A forum or wiki system could be a software project in its own right. Both activities and resources are installed in the &amp;lt;tt&amp;gt;mod&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
===Blocks===&lt;br /&gt;
&lt;br /&gt;
Blocks are small bits of interface functionality that can be added to (normally the sides of) pages. Many blocks provide additional views of data stored and modified elsewhere. Blocks live in the &amp;lt;tt&amp;gt;blocks&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
===Themes===&lt;br /&gt;
&lt;br /&gt;
The overall visual style of a Moodle site, a particular course, or all courses in a category, can be changed by selecting a different theme at these different levels. Themes are the standard way of making aesthetic changes to your Moodle application, decoupling presentation from content and functionality.&lt;br /&gt;
&lt;br /&gt;
Themes live in the &amp;lt;tt&amp;gt;theme&amp;lt;/tt&amp;gt; folder, and published themes are listed in the [http://moodle.org/mod/data/view.php?id=6552 Themes database].&lt;br /&gt;
&lt;br /&gt;
===Language packs===&lt;br /&gt;
&lt;br /&gt;
Moodle is internationalised. That is, you can get language packs for many different languages. Language packs are normally downloaded and installed via the Moodle administration screens, but they can also be downloaded manually from [http://download.moodle.org/langpack/ Moodle.org: language packs].&lt;br /&gt;
&lt;br /&gt;
Administrators can also manually change any of the standard user interface strings if the terms used in the installed language pack are not appropriate.&lt;br /&gt;
&lt;br /&gt;
===Course formats===&lt;br /&gt;
&lt;br /&gt;
control how the structure of the course, a sequence of activities grouped into sections, is presented to the users. Course formats live in the &amp;lt;tt&amp;gt;course/format&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
===Authentication plugins===&lt;br /&gt;
&lt;br /&gt;
control how users log in. Moodle can manage usernames and passwords itself, or use those stored in LDAP or another database. Alternatively, Moodle can use a number of single-sign-on schemes. Authentication plugins live in the &amp;lt;tt&amp;gt;auth&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
===Enrolment plugins===&lt;br /&gt;
&lt;br /&gt;
control which users are enrolled in which courses. Again this can be by synchronising with another system, perhaps a student information system, or it can be tracked internally by Moodle. Enrolment plugins live in the &amp;lt;tt&amp;gt;enrol&amp;lt;/tt&amp;gt; folder. (Moodle was created by an Australian, so enrol is the correct spelling ;-).)&lt;br /&gt;
&lt;br /&gt;
===Repository plugins===&lt;br /&gt;
&lt;br /&gt;
Ways for users to get content (files) into Moodle, either by uploading from their hard drive, or by getting the file from another location on the Internet, perhaps Drop Box, Google Docs, or Flickr. Repository plugins live in the &amp;lt;tt&amp;gt;repository&amp;lt;/tt&amp;gt; folder.&lt;br /&gt;
&lt;br /&gt;
==How Moodle code is organised==&lt;br /&gt;
&lt;br /&gt;
Moodle mostly follows a [http://martinfowler.com/eaaCatalog/transactionScript.html transaction script] approach. That is, suppose you are looking at a Forum. The URL will be &amp;lt;tt&amp;gt;.../mod/forum/view.php?id=1234&amp;lt;/tt&amp;gt;. and &amp;lt;tt&amp;gt;mod/forum/view.php&amp;lt;/tt&amp;gt; the PHP script that generates that page. One could argue that transaction script is not an appropriate pattern for an application as complex as Moodle. However, it is a very natural architecture for a PHP application, and Moodle is an aggregate of many different plugins, rather than a single complex application.&lt;br /&gt;
&lt;br /&gt;
Behind that basic transaction script approach, a lot of the core functionality has been refactored out into libraries (mostly in the &amp;lt;tt&amp;gt;lib&amp;lt;/tt&amp;gt; folder). This provides elements of a [http://martinfowler.com/eaaCatalog/domainModel.html domain model]. The Moodle project started before PHP could handle object-oriented code, however, so don&#039;t expect an object-oriented domain model except in some of the more recent parts of the Moodle code.&lt;br /&gt;
&lt;br /&gt;
There are two layers used to separate presentation from the business logic. The outer layer is the theme (see above) which controls the more visual aspects of the Moodle interface. Then there are renderer classes which generate the HTML to be output from the data supplied by the transaction scripts and the domain model. Unfortunately, neither PHP, nor the Moodle architecture, enforces a clear separation of the UI layer. It is possible for sloppy developers to make a mess, and this has happened in the past. The code in the standard Moodle distribution is gradually being cleaned up.&lt;br /&gt;
&lt;br /&gt;
==The Moodle database==&lt;br /&gt;
&lt;br /&gt;
The Moodle database comprises many tables (more than 250) because the whole database is an aggregate of the core tables and the tables belonging to each plugin. Fortunately, this large structure is understandable, because the tables for one particular plugin typically only link to each other and a few core tables. See [[Database_schema_introduction|Database schema introduction]] for more information.&lt;br /&gt;
&lt;br /&gt;
The Moodle database structure is defined in &amp;lt;tt&amp;gt;install.xml&amp;lt;/tt&amp;gt; files inside the &amp;lt;tt&amp;gt;db&amp;lt;/tt&amp;gt; folder in each plugin. For example &amp;lt;tt&amp;gt;mod/forum/db/install.xml&amp;lt;/tt&amp;gt; contains the database definition for the forum module. &amp;lt;tt&amp;gt;lib/db/install.xml&amp;lt;/tt&amp;gt; defines the tables used by Moodle core. The &amp;lt;tt&amp;gt;install.xml&amp;lt;/tt&amp;gt; files contain comments that should explain the purpose of each table and column. These comments can be turned into human-readable documentation by going to Site administration -&amp;gt; Development -&amp;gt; XMLDB editor in your Moodle installation, and clicking on the [Doc] link.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[:en:Administrator documentation]]&lt;br /&gt;
* [[Developer_documentation|Developer documentation]]&lt;br /&gt;
* [[Database_schema_introduction|Database schema introduction]]&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?id=6009 Modules and plugins] and [http://moodle.org/mod/data/view.php?id=6552 themes] databases&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=64465 Forum thread with a vigorous argument about whether an architecture document is a good idea, which eventually lead to this page being rewritten]&lt;br /&gt;
* [http://www.aosabook.org/en/moodle.html The chapter of The Architecture of Open Source Applications about Moodle]&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding guidelines]]&lt;/div&gt;</summary>
		<author><name>Trott</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Process&amp;diff=54652</id>
		<title>Process</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Process&amp;diff=54652"/>
		<updated>2018-08-22T18:19:20Z</updated>

		<summary type="html">&lt;p&gt;Trott: /* Scrum */ fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document summarises the various development processes used in developing Moodle.  There are four main processes that overlap.&lt;br /&gt;
&lt;br /&gt;
==Integration workflow in the tracker==&lt;br /&gt;
&lt;br /&gt;
The Moodle tracker keeps track of the status of all bug fixes and new features. &lt;br /&gt;
&lt;br /&gt;
We use a workflow that ensures that new code receives multiple reviews by different people before it is included into the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
[[Image:Workflow.jpg]]&lt;br /&gt;
&lt;br /&gt;
A number of roles make this work:&lt;br /&gt;
&lt;br /&gt;
===Users===&lt;br /&gt;
&lt;br /&gt;
Users report bugs and make feature requests directly in the tracker, by creating new issues with a summary and a description.&lt;br /&gt;
&lt;br /&gt;
===Developers===&lt;br /&gt;
&lt;br /&gt;
Developers work on the issues in the tracker to specify solutions and write code that implements these solutions.  They will often ask other developers to &amp;quot;peer review&amp;quot; their code in the early stages to avoid problems later on.&lt;br /&gt;
&lt;br /&gt;
While many of the developers work for Moodle.com, a large number are part of the global development community around Moodle. If you&#039;re interested in becoming a recognised developer, see [[Tracker_guide#Tracker_groups_and_permissions|Tracker groups and permissions]].&lt;br /&gt;
&lt;br /&gt;
===CiBoT===&lt;br /&gt;
&lt;br /&gt;
CiBoT is not a person but a bot who monitors the tracker and performs the [[Automated code review]] when issue is submitted for Peer review or when developer added &#039;&#039;cime&#039;&#039; label.&lt;br /&gt;
&lt;br /&gt;
===Component leads===&lt;br /&gt;
&lt;br /&gt;
[https://tracker.moodle.org/projects/MDL?selectedItem=com.atlassian.jira.jira-projects-plugin:components-page Component leads] are developers with some responsibility for particular components (plugins or modules) in Moodle.  They have authority to decide that a particular fix is suitable and complete enough to be considered for integration in Moodle core and should be called upon to complete peer reviews for code in their components. Note that, apart from that, every component also has some [[Component Leads|HQ Component leads]] that will specifically work on associated issues, triaging, monitoring, reviewing, fixing them.&lt;br /&gt;
&lt;br /&gt;
===Integrators===&lt;br /&gt;
&lt;br /&gt;
On Monday and Tuesday of each week, the integration team (a small team of senior developers employed by Moodle HQ) conducts a code-level review of all issues in the integration queue.  This is often called the &amp;quot;pull&amp;quot; process.  If the fix is judged appropriate they will integrate the code into our git integration repository for further testing and it gets added to the testing queue.&lt;br /&gt;
&lt;br /&gt;
If they find problems they reject the issue and send it back to the developer for further work.&lt;br /&gt;
&lt;br /&gt;
===Testers===&lt;br /&gt;
&lt;br /&gt;
On Wednesday each week, testers look at all the issues in the testing queue, trying each fix and feature to make sure that it does actually fix the problem it was supposed to, and that there are no regressions.&lt;br /&gt;
&lt;br /&gt;
If they find problems they reject the issue and integrators may remove it from the integration repository and push it back to the developer for further work.&lt;br /&gt;
&lt;br /&gt;
See [[Testing of integrated issues]] for more details.&lt;br /&gt;
&lt;br /&gt;
===Production maintainers===&lt;br /&gt;
&lt;br /&gt;
On Thursday each week, production maintainers merge all the issues that passed testing into the git production repository, and it becomes available for use on production systems via git and download packages.&lt;br /&gt;
&lt;br /&gt;
==Stable maintenance cycles==&lt;br /&gt;
&lt;br /&gt;
Moodle releases regular updates of the stable version of the software to fix bugs and other issues.  Releases like 2.2.1, 2.2.2, 2.2.3 etc only include fixes based on the latest major release (2.2) and never any significant new features or database changes.&lt;br /&gt;
&lt;br /&gt;
At Moodle HQ there are teams of developers using the [http://www.scrum.org/ Scrum framework] to work on these issues (as well as new features for [[#Major_release_cycles|major releases]]). &lt;br /&gt;
&lt;br /&gt;
===Minor release (point release) timing===&lt;br /&gt;
&lt;br /&gt;
After [[#Major_release_cycles|major releases]] there will be minor releases.&lt;br /&gt;
* x.x.1 will occur approximately two months after each major release (eg. 2.x).&lt;br /&gt;
* There will then be another point release every two months after that.&lt;br /&gt;
&lt;br /&gt;
See the [[Releases#General_release_calendar|General release calendar]] for details.&lt;br /&gt;
&lt;br /&gt;
===Issue triage===&lt;br /&gt;
&lt;br /&gt;
[[Bug_triage|Issue triage]] involves evaluating new issues, making sure that they are recorded correctly.  One of the most important jobs triagers do is to identify issues that should be fixed in the stable branch. These are set with a priority ranging from &amp;quot;Trivial&amp;quot; up to &amp;quot;Blocker&amp;quot; and other features are checked.&lt;br /&gt;
&lt;br /&gt;
At Moodle HQ there are currently teams working on stable issues (mostly bugs reported by users) and improvements and new features (Partners, Moodle Association, user suggestions and Martin Dougiamas).&lt;br /&gt;
&lt;br /&gt;
===Scrum===&lt;br /&gt;
&lt;br /&gt;
At Moodle HQ, every three weeks, the stable team takes a number of the most urgent issues from the backlog to work on during a period known as a &#039;&#039;sprint&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
At the start of a sprint there is a period of planning and estimation. All issues on the backlog are given a relative rank that is based on issue features including priority, security, Partner interest, patches and votes. Issues are given a relative size in Story Points and these points are summed to allow the teams to determine how many issues they can work on in the sprint.&lt;br /&gt;
&lt;br /&gt;
During the sprint, the team meets daily to discuss solutions and progress, as well as to organise testing and peer reviews of code.  The team has a &#039;&#039;Scrum master&#039;&#039; to help everyone stay organised, to &amp;quot;unblock&amp;quot; any barriers to progress and to protect the team from distracting influences (mostly people attempting to add to the developers&#039; workloads) during the sprint.  The teams&#039; work is documented publicly in the tracker.&lt;br /&gt;
&lt;br /&gt;
Whenever a solution for an issue is finished, it is submitted to the standard integration workflow process described above.&lt;br /&gt;
&lt;br /&gt;
==Major release cycles==&lt;br /&gt;
&lt;br /&gt;
Since Moodle 2.0, we have a policy of release major versions (eg 2.1, 2.2) every six months in May and November. See the [[Releases#General_release_calendar|General release calendar]] for more details.&lt;br /&gt;
&lt;br /&gt;
Each release can be different, but generally the cycles work as follows.&lt;br /&gt;
&lt;br /&gt;
===Define roadmap===&lt;br /&gt;
&lt;br /&gt;
The product owner (Martin Dougiamas) defines the likely roadmap based on community wishes, third-party developments and important issues within the existing code. &lt;br /&gt;
&lt;br /&gt;
Sometimes new features might be based on earlier features, sometimes they may be something developed by a third party that needs to be evaluated and sometimes it might be something completely new.&lt;br /&gt;
&lt;br /&gt;
===Planning and development===&lt;br /&gt;
&lt;br /&gt;
The UX team, employed at Moodle HQ, work on specifications of major new features throughout the cycle, specifying project ahead of development time.&lt;br /&gt;
&lt;br /&gt;
New features are worked on by the &amp;quot;Dev&amp;quot; team. The process of [[#New_feature_development|new feature development]] is described below. When specifications are in place, new code is developed during sprints and goes through the standard weekly integration workflow described above.&lt;br /&gt;
&lt;br /&gt;
===Testing===&lt;br /&gt;
&lt;br /&gt;
During development, as new code is integrated, automated testing conducted at the [[PHPUnit|code]] and [[Acceptance_testing|interface]] levels, to make sure there are no regressions caused by new features.&lt;br /&gt;
&lt;br /&gt;
In the last month before the release, a feature freeze is called (no new features can be added) and our QA team performs manual functional testing of Moodle features. The current list of functional tests is listed in the tracker in the [http://tracker.moodle.org/browse/MDLQA-1 MDLQA project]. This list of tests is extended as new features are added, but it is also being reduced as more automated [[Acceptance_testing|acceptance tests]] are developed.&lt;br /&gt;
&lt;br /&gt;
For more details, see [[Testing]].&lt;br /&gt;
&lt;br /&gt;
===Sprints===&lt;br /&gt;
&lt;br /&gt;
At Moodle HQ, development takes place in sprints. The sprints are three-week periods during which developers to focus on a fixed list of issues. Sprints are arranged within each release cycle as shown in the diagram below.&lt;br /&gt;
&lt;br /&gt;
===Events during cycle===&lt;br /&gt;
&lt;br /&gt;
During each cycle there are a periods and events that occur between and around sprints.&lt;br /&gt;
&lt;br /&gt;
[[Image:Dev sprint calendar.png|800px]]&lt;br /&gt;
&lt;br /&gt;
; &#039;&#039;&#039;Planning and bug fixing&#039;&#039;&#039;&lt;br /&gt;
: A period during which the Roadmap is explored, specs are written and prototypes are created. Regressions in the recent release are fixed as they arise.&lt;br /&gt;
; &#039;&#039;&#039;End sync period&#039;&#039;&#039;&lt;br /&gt;
: During the [[Integration Review#On-sync period|on-sync period]], the recent release and master versions are kept synchronised. No new code is added during this period, which ensures regressions are fixed rapidly. This also allows for planning and provides relief for developers after a release.&lt;br /&gt;
; &#039;&#039;&#039;Personal projects&#039;&#039;&#039;&lt;br /&gt;
: Affecting full-time HQ developers only, this period allows for individual creations to be explored and provides a break from sprints.&lt;br /&gt;
; &#039;&#039;&#039;Code freeze&#039;&#039;&#039;&lt;br /&gt;
: A point after which no new code (only fixes to existing code) is accepted until beyond the release. This stabilisation allows for QA testing.&lt;br /&gt;
; &#039;&#039;&#039;QA, bug fixing, continuous integration&#039;&#039;&#039;&lt;br /&gt;
: A period after the code freeze where quality assurance testing takes place. No new code is added, which means developers are able to respond rapidly to bugs found. Integration becomes [[Integration Review#During continuous integration/Freeze/QA period|continuous]], meaning that failed QA tests can be re-run within days rather than having to wait for the weekly release.&lt;br /&gt;
; &#039;&#039;&#039;Release candidate&#039;&#039;&#039;&lt;br /&gt;
: A point prior to the full release where a candidate is made public for wider testing.&lt;br /&gt;
&lt;br /&gt;
==New feature development==&lt;br /&gt;
&lt;br /&gt;
Major new features in Moodle usually should go through the following process.&lt;br /&gt;
&lt;br /&gt;
===Specification===&lt;br /&gt;
&lt;br /&gt;
The User Experience (UX) team should create detailed wireframes and features and goals for the new feature. It should be agreed upon and as final as possible before development starts.&lt;br /&gt;
&lt;br /&gt;
Developers should create a detailed spec (here in the developer docs) outlining their goals for the development and their design for meeting those goals.  The more detail the better.&lt;br /&gt;
&lt;br /&gt;
Developers should also create an issue in the tracker (linking to your docs) to keep track of the project status.&lt;br /&gt;
&lt;br /&gt;
===Community consultation===&lt;br /&gt;
&lt;br /&gt;
Get the community involved in looking at the spec to see if it meets their needs and to get further feedback.  Please post in the [http://moodle.org/mod/forum/view.php?id=8052 Future major features forum] on moodle.org. You could also blog/tweet about it etc.&lt;br /&gt;
&lt;br /&gt;
Community developers proposing a new feature will want to talk with HQ core developers to make sure the ideas make sense, and possibly get some review on database design, architecture and so on.&lt;br /&gt;
&lt;br /&gt;
===Develop the code using Git===&lt;br /&gt;
&lt;br /&gt;
Develop your code on an open Git repository, like github.com.  That enables people to see your code and to help you as it develops.  Testers and early adopters also have the opportunity to try it early in the process and give you more valuable feedback.&lt;br /&gt;
&lt;br /&gt;
Coverage with automated tests ([[PHPUnit]] or [[Behat|Behat_integration]]) is mandatory for new features.&lt;br /&gt;
&lt;br /&gt;
It is essential that your code follows the [[Coding|Moodle Coding Guide]].&lt;br /&gt;
&lt;br /&gt;
===Submit your code for peer review===&lt;br /&gt;
&lt;br /&gt;
Click on &amp;quot;Request peer review&amp;quot; button in the tracker.&lt;br /&gt;
&lt;br /&gt;
You need to fill in the information about your public git repository and which branches the fixes are on. Make sure you are listed as Assignee.&lt;br /&gt;
&lt;br /&gt;
This would be a good time to fill in the testing instructions (read the [[Testing instructions guide|instructions guide]]) for how to verify your fix is correct. You may also wish to add a comment in the bug.&lt;br /&gt;
&lt;br /&gt;
Component leads should put issues, which affect code in their components, up for peer review to allow interested parties to provide feedback. However, if it is not reviewed in a week, a component lead may send the issue to integration. If integrators consider that the issue has not been given proper chance for peer review (e.g. is extremely large or complex...) it can be decided to move the issue back in the process.&lt;br /&gt;
&lt;br /&gt;
All other developers, including people who are component leads but working outside their component, should have their issues peer reviewed before they are sent to integration.&lt;br /&gt;
&lt;br /&gt;
===Peer review===&lt;br /&gt;
&lt;br /&gt;
The [http://tracker.moodle.org/browse/MDL#selectedTab=com.atlassian.jira.plugin.system.project%3Acomponents-panel component lead] should peer-review the change. If there is no component lead for an affected component, any other recognised developer may complete the peer review. The peer reviewer will either give you comments on the code and if it needs more work.&lt;br /&gt;
&lt;br /&gt;
Process and the list of things to check are described in [[Peer reviewing]].&lt;br /&gt;
&lt;br /&gt;
===Submit the code for integration===&lt;br /&gt;
&lt;br /&gt;
The developer is responsible for acting on the feedback from the peer reviewer. If changes have been made and the developer is satisfied that this has accommodated the feedback from the peer reviewer, then the developer can submit the issue for integration. If there have been significant changes after the peer review, or if the peer reviewer has raised concerns about the approach taken, then the developer should offer the issue up for peer review again, most often to the same peer reviewer, but not necessarily.&lt;br /&gt;
&lt;br /&gt;
Submitting an issue to integration is much the same as for any Moodle code.  See the information about the integration workflow above.&lt;br /&gt;
&lt;br /&gt;
==Fixing a bug==&lt;br /&gt;
&lt;br /&gt;
Bug fixes, and minor features or enhancements should go through the following process. (The only exception is English language string typo fixes or suggested improvements, which may be contributed to the en_fix language pack on the [http://lang.moodle.org/ Moodle translation site].)&lt;br /&gt;
&lt;br /&gt;
===Make sure there is a tracker issue===&lt;br /&gt;
&lt;br /&gt;
Every change must have an issue in the tracker. If you are fixing a bug, there is probably one there already, but if not, create one. [[Tracker tips|Tips for searching tracker]].&lt;br /&gt;
&lt;br /&gt;
===Decide which branches the fix is required on===&lt;br /&gt;
&lt;br /&gt;
Bugs should normally be fixed on all the supported stable branches that are affected. New features should just go into master, but sometimes minor enhancements are made on the most recent stable branch.&lt;br /&gt;
&lt;br /&gt;
===Develop your change using git===&lt;br /&gt;
&lt;br /&gt;
Develop your fix and push the change to an open git repository, for example on github.com. See also [[Git for developers]]&lt;br /&gt;
&lt;br /&gt;
It is essential that your code follows the [[Coding|Moodle Coding Guide]].&lt;br /&gt;
&lt;br /&gt;
You will need to push one commit for each branch the fix needs to be applied to. Often people use branch names like MDL-12345-31_brief_name so it is clear what each branch is. [http://kernel.org/pub/software/scm/git/docs/git-cherry-pick.html git cherry-pick] can help with replicating the fix onto different branches.&lt;br /&gt;
&lt;br /&gt;
===Submit your code for peer review===&lt;br /&gt;
&lt;br /&gt;
Once your fix is done, it should be submitted for a peer review.&lt;br /&gt;
&lt;br /&gt;
The following information is necessary for this:&lt;br /&gt;
* Information about your public git repository&lt;br /&gt;
** repository URL&lt;br /&gt;
** branch name(s)&lt;br /&gt;
** diff URL&lt;br /&gt;
* [[Testing instructions guide|Testing instructions]] for how to verify your fix is correct.&lt;br /&gt;
&lt;br /&gt;
If you have never contributed to Moodle and don&#039;t see a button &amp;quot;Request peer review&amp;quot;, just comment on the issue with the above information. The component lead or another user with sufficient privileges will then send the issue up for peer review for you.&lt;br /&gt;
&lt;br /&gt;
After your first fix is integrated you will be added to developers group and will be able to send issues for peer review yourself. In this case make sure you are listed as Assignee and click on &amp;quot;Request peer review&amp;quot; button in the tracker&lt;br /&gt;
&lt;br /&gt;
===Peer review===&lt;br /&gt;
&lt;br /&gt;
The [https://tracker.moodle.org/projects/MDL?selectedItem=com.atlassian.jira.jira-projects-plugin:components-page component lead] should peer-review the change. If there is no component lead for an affected component, any other recognised developer may complete the peer review. The peer reviewer will either give you comments on the code and if it needs more work.&lt;br /&gt;
&lt;br /&gt;
Process and the list of things to check are described in [[Peer reviewing]].&lt;br /&gt;
&lt;br /&gt;
===Submit your code for integration===&lt;br /&gt;
&lt;br /&gt;
It will then be reviewed the following week by one of the integration team and either integrated or rejected. Once integrated, the fix will be tested, and then included in the next weekly release.&lt;br /&gt;
&lt;br /&gt;
==Security issues==&lt;br /&gt;
&lt;br /&gt;
Issues identified as [[Security|security issues]] are resolved in a slightly different way, in order to achieve responsible disclosure as described in [[Moodle security procedures]].&lt;br /&gt;
&lt;br /&gt;
* Security issues should be labelled as &amp;quot;Minor&amp;quot; or &amp;quot;Serious&amp;quot; in order control visibility of the issue.&lt;br /&gt;
** An issue reported with a security level of &amp;quot;Could be a security issue&amp;quot; should be evaluated as soon as possible and either set as &amp;quot;Minor&amp;quot; or &amp;quot;Serious&amp;quot; or the security level should be set to &amp;quot;None&amp;quot;.&lt;br /&gt;
* Solutions to security issues should not:&lt;br /&gt;
** be made available in public repositories.&lt;br /&gt;
*** If a developer has shared a solution as Git branches via Github, they should be asked to provide the solutions as [[How_to_create_a_patch|stand-alone patches]] attached to the issue and to [[#How to remove a branch from Github|remove the solution from Github]].&lt;br /&gt;
** contain details about the security problem in the commit message.&lt;br /&gt;
*** Instead use generic terms like, &amp;quot;improve&amp;quot;, &amp;quot;better handling of&amp;quot; ..&lt;br /&gt;
* The solution will not be integrated until the week before a [[Process#Stable_maintenance_cycles|minor release]] following the normal [[Release process|Release process]]. In short, the issue will be incorporated into the integration version, rebased, tested and made ready for release as a normal issue would, but not until as late as possible.&lt;br /&gt;
* Details of security issues will be shared with registered admins with the minor release.&lt;br /&gt;
* Details of security issues will not be publicly announced until one week after a minor release to allow admins to update.&lt;br /&gt;
&lt;br /&gt;
Note that not all the labelled (minor) security issues are always handled following the procedure above. It&#039;s possible that, after discussion, it&#039;s decided a given issue is not a real Moodle security problem (say external disclosures/potential attacks using Moodle as vector, not as target, discussions revealing some private details...). Those issues will be processed as normal issues, generating the needed user documentation if necessary and will be part of the habitual weekly releases.&lt;br /&gt;
&lt;br /&gt;
====How to remove a branch from Github====&lt;br /&gt;
&lt;br /&gt;
To remove a branch from Github, you can use the following command.&lt;br /&gt;
&lt;br /&gt;
 git push github :remote_branch&lt;br /&gt;
&lt;br /&gt;
Where &#039;&#039;remote_branch&#039;&#039; is the name of your remote branch, for example &#039;wip-mdl-1234&#039;. This effectively replaces the remote branch with nothing, removing the remote branch, but leaving the branch intact in your local Git repository. Please note that its likely that your commit will still exist on github due to the nature of git, so its best to avoid doing this in the first place.&lt;br /&gt;
&lt;br /&gt;
==Policy issues==&lt;br /&gt;
&lt;br /&gt;
Occasionally within Moodle we run into policy issues where a high-level decision needs to be made about how things are to be done.&lt;br /&gt;
&lt;br /&gt;
In these cases the process is as follows:&lt;br /&gt;
* Create an issue in the tracker with a [https://tracker.moodle.org/browse/MDL/component/12733 Policy component] and put &amp;quot;POLICY:&amp;quot; as a prefix on the summary.&lt;br /&gt;
* In the description describe the problem clearly as well as all the options.  If it&#039;s long then make a page here in Moodle Dev Docs and link to it.&lt;br /&gt;
* Do not use this issue for code.  If there are issues that depend on this policy decision, then add tracker links to them as dependencies.&lt;br /&gt;
* Feel free to encourage people to come and talk about the policy to support various points of view.  The more evidence we have (from everyone in the community) the better.&lt;br /&gt;
&lt;br /&gt;
Some time has been scheduled in the weekly Moodle HQ meeting to look at Policy issues and try to make decisions on them.  We discuss all the evidence and try to achieve a high amount of consensus.  Deadlocked issues can be resolved by a decision from Martin Dougiamas (this is rarely needed).&lt;br /&gt;
&lt;br /&gt;
Decisions will be posted on the issue and that issue will be closed, allowing any dependent issues to continue to integration (or not).   Decisions are final and bribes hardly ever work.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Release process]]&lt;br /&gt;
* [[Deprecation]]&lt;br /&gt;
* [http://tracker.moodle.org/secure/Dashboard.jspa?selectPageId=11350 Integration dashboard]&lt;br /&gt;
&lt;br /&gt;
Walks-though of the process for contributors:&lt;br /&gt;
* By Dan Poltawski, Integrator: http://www.slideshare.net/poltawski/how-to-guarantee-your-change-is-integrated-to-moodle-core, https://www.youtube.com/watch?v=836WtnM2YpM&lt;br /&gt;
* By Tim Hunt, contributor: http://tjhunt.blogspot.co.uk/2012/03/fixing-bug-in-moodle-core-mechanics.html and https://www.youtube.com/watch?v=gPPA3h7OGQU&lt;br /&gt;
&lt;br /&gt;
[[Category:Processes]]&lt;br /&gt;
[[Category:Quality Assurance]]&lt;br /&gt;
[[Category:Git]]&lt;br /&gt;
[[Category:Core development]]&lt;/div&gt;</summary>
		<author><name>Trott</name></author>
	</entry>
</feed>