<?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=Mwithheld</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=Mwithheld"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Mwithheld"/>
	<updated>2026-04-17T14:45:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Running_acceptance_test&amp;diff=63358</id>
		<title>Running acceptance test</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Running_acceptance_test&amp;diff=63358"/>
		<updated>2022-06-22T00:13:23Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: /* Troubleshooting */ Add note about This is not a behat test site&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle uses [https://behat.org Behat], a php framework for automated functional testing, as part of a suite of testing tools.&lt;br /&gt;
&lt;br /&gt;
Behat takes a set of Features, Scenarios, and Steps, and uses these to step through actions and test results using a real web browser. This is possible thanks to a protocol implemented in most modern web browsers called Webdriver.&lt;br /&gt;
&lt;br /&gt;
This documentation covers how to run Behat tests within Moodle, including requirements, setup, useful tips and tricks, and basic troubleshooting.&lt;br /&gt;
== Requirements ==&lt;br /&gt;
# Any recent OS with [[Releases|supported version of Moodle]] installed&lt;br /&gt;
# A recent browser (We support Firefox, Chrome as standard, but other browsers are possible)&lt;br /&gt;
# The WebDriver implementation for your browser&lt;br /&gt;
# A recent version of Selenium (Optional, but recommended)&lt;br /&gt;
# A recent Java Runtime Environment (Required if using Selenium)&lt;br /&gt;
=== Recommended extras ===&lt;br /&gt;
Some extra software is also recommended for testing with Behat.&lt;br /&gt;
==== Pre-configured browser profiles: moodle-browser-config ====&lt;br /&gt;
Available for [[Releases|all supported versions of Moodle]], the [https://github.com/andrewnicols/moodle-browser-config moodle-browser-config] is a recommended inclusion for Behat. This configuration tooling provides a range of standard browser profiles for testing.&lt;br /&gt;
&lt;br /&gt;
Note: In future, the &amp;lt;tt&amp;gt;moodle-browser-config&amp;lt;/tt&amp;gt; tool may be included as composer dependency to Moodle but this is currently not the case.&lt;br /&gt;
===== Installation =====&lt;br /&gt;
# Check out the moodle-browser-config repository:&lt;br /&gt;
    // Change directory to your git root, for example:&lt;br /&gt;
    $ cd ~/git&lt;br /&gt;
    // Clone the moodle-browser-config repository&lt;br /&gt;
    git clone https://github.com/andrewnicols/moodle-browser-config&lt;br /&gt;
# Open your Moodle installation&#039;s &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt; in your preferred editor, and require the tool&#039;s init.php:&lt;br /&gt;
    require_once(&#039;/path/to/your/git/dir/moodle-browser-config/init.php&#039;);&lt;br /&gt;
===== Provided profiles =====&lt;br /&gt;
The full list of profiles which are included with &amp;lt;tt&amp;gt;moodle-browser-config&amp;lt;/tt&amp;gt; are provided in its [https://github.com/andrewnicols/moodle-browser-config own documentation].&lt;br /&gt;
&lt;br /&gt;
The following is a summary of the profiles that most users may be interested in.&lt;br /&gt;
&lt;br /&gt;
You can also provide your own custom profiles, including for remote services such as Browserstack, and Saucelabs, as&lt;br /&gt;
well as for other browsers supporting the W3C Webdriver specification.&lt;br /&gt;
&lt;br /&gt;
Please note that &amp;lt;tt&amp;gt;Safari&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;Safaridriver&amp;lt;/tt&amp;gt; are not currently supported as they do not meet the W3C WebDriver specification.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Profile name&lt;br /&gt;
! Description&lt;br /&gt;
! Uses Selenium?&lt;br /&gt;
! Displays GUI?&lt;br /&gt;
|-&lt;br /&gt;
| firefox&lt;br /&gt;
| Use Firefox via Selenium&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlessfirefox&lt;br /&gt;
| Use Firefox via Selenium, without displaying the GUI&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| geckodriver&lt;br /&gt;
| Use Firefox with Geckodriver directly&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlessgeckodriver&lt;br /&gt;
| Use Firefox with Geckodriver directly, without displaying the GUI&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| chrome&lt;br /&gt;
| Use Chrome via Selenium&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlesschrome&lt;br /&gt;
| Use Chrome via Selenium, without displaying the GUI&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| chromedriver&lt;br /&gt;
| Use Chrome with Chromedriver directly&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlesschromedriver&lt;br /&gt;
| Use Chrome with Chromedriver directly, without displaying the GUI&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| edge&lt;br /&gt;
| Use Edge via Selenium&lt;br /&gt;
| Yes&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlessedge&lt;br /&gt;
| Use Edge via Selenium, without displaying the GUI&lt;br /&gt;
| Yes&lt;br /&gt;
| No&lt;br /&gt;
|-&lt;br /&gt;
| edgedriver&lt;br /&gt;
| Use Edge with Edgedriver directly&lt;br /&gt;
| No&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
| headlessedgedriver&lt;br /&gt;
| Use Edge with Edgedriver directly, without displaying the GUI&lt;br /&gt;
| No&lt;br /&gt;
| No&lt;br /&gt;
|}&lt;br /&gt;
==== chromedriver-wrapper ====&lt;br /&gt;
When using Google Chrome, you must use the correct version of the &amp;lt;tt&amp;gt;chromedriver&amp;lt;/tt&amp;gt; browser driver for the version of Chrome that you use.&lt;br /&gt;
&lt;br /&gt;
Since Google Chrome automatically updates on a regular basis, you will need to regularly upgrade your driver to match the version of Chrome that you are using.&lt;br /&gt;
&lt;br /&gt;
To make this easier, a &amp;lt;tt&amp;gt;chromedriver-wrapper&amp;lt;/tt&amp;gt; utility has been written. This inspects the version of Chrome that is in your path, and downloads the correct version of &amp;lt;tt&amp;gt;chromedriver&amp;lt;/tt&amp;gt; for that version, before starting it.&lt;br /&gt;
&lt;br /&gt;
Installation instructinos can be found at [https://github.com/andrewnicols/chromedriver-wrapper https://github.com/andrewnicols/chromedriver-wrapper].&lt;br /&gt;
== Getting started (basic) ==&lt;br /&gt;
This is a quick walk through to get Behat running for the first time.&lt;br /&gt;
=== Setting up ===&lt;br /&gt;
There are a number of ways of configuring Behat on Moodle. This is one of the simplest.&lt;br /&gt;
&lt;br /&gt;
These notes assume that you have already installed a supported Java Runtime Environment, and the [[Running_acceptance_test#Pre-configured_browser_profiles:_moodle-browser-config]] tool.&lt;br /&gt;
==== Setting up Selenium ====&lt;br /&gt;
Generally we recommend use of Selenium, though this is not a fixed requirement. You can use the browser&#039;s driver implementation directly but this is harder to setup for the first time.&lt;br /&gt;
&lt;br /&gt;
Selenium is written in Java, and requires a recent version of the JRE to run. Please ensure that you have this installed prior to starting.&lt;br /&gt;
&lt;br /&gt;
Since Moodle 3.9.5 / 3.10.2 / 3.11.0 Moodle will work with any modern version of Selenium. At time of writing that is &amp;lt;tt&amp;gt;3.141.59&amp;lt;/tt&amp;gt;, and 4.1.0. &#039;&#039;&#039;Note:&#039;&#039;&#039; There appears to be an issue with the version 4 jars - particually in 4.1.0 that generates a &#039;&#039;&#039;&amp;quot;Could not open connection: Capability value must be set”&#039;&#039;&#039; error which appears to be an issue between Selenium and the MInkExtension for JavaScript tests - see https://githubmemory.com/repo/Behat/MinkExtension/activity for more information. The quick work around is to use the earlier version (3.141.59).&lt;br /&gt;
# Download the Selenium Server (Grid) from [https://www.selenium.dev/downloads/ https://www.selenium.dev/downloads/]. This is a single JAR file, put it anywhere handy.&lt;br /&gt;
# Start Selenium&lt;br /&gt;
    # Version 3.141.59:&lt;br /&gt;
    $ java -jar selenium-server-standalone-3.141.59.jar&lt;br /&gt;
    &lt;br /&gt;
    # Version 4.0.0 and later:&lt;br /&gt;
    $ java -jar selenium-server-4.0.0-beta-3.jar standalone&lt;br /&gt;
You can optionally specify a number of settings, depending on the version of Selenium that you are using, including the port to run on.&lt;br /&gt;
See the help for the version of Selenium that you are using.&lt;br /&gt;
==== Setting up your browsers ====&lt;br /&gt;
Selenium is just an intelligient wrapper to start, and manage your browser sessions. It doesn&#039;t actually include any web browsers itself.&lt;br /&gt;
&lt;br /&gt;
Moodle HQ run all behat tests against both Firefox and Chrome multiple times per day. Other combinations, including Microsoft Edge, are also supported.&lt;br /&gt;
&lt;br /&gt;
To use Behat, you will need a recent version of your preferred browser, as well as a &amp;lt;tt&amp;gt;driver&amp;lt;/tt&amp;gt; for that browser. The driver is responsible for communication between Selenium (or Moodle directly) and the browser.&lt;br /&gt;
&lt;br /&gt;
Both the browser, and its driver, must be placed inside your &amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt; - this may be somewhere like &amp;lt;tt&amp;gt;/usr/bin&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;/usr/local/bin&amp;lt;/tt&amp;gt;, or perhaps a user bin directory like &amp;lt;tt&amp;gt;~/bin&amp;lt;/tt&amp;gt; which is present in your &amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt;&lt;br /&gt;
===== Chrome =====&lt;br /&gt;
You can download Google Chrome from [https://www.google.com.au/chrome https://www.google.com.au/chrome].&lt;br /&gt;
&lt;br /&gt;
You will need the [https://chromedriver.chromium.org/downloads correct version of the chromedriver] as per the&lt;br /&gt;
documentation. Alternatively you can make use of the [[Running_acceptance_test#chromedriver-wrapper|chromedriver-wrapper utility]] noted in the Recommended extras sections.&lt;br /&gt;
&lt;br /&gt;
Either the &amp;lt;tt&amp;gt;chromedriver&amp;lt;/tt&amp;gt; binary must be in a directory in your &amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt;, or the &amp;lt;tt&amp;gt;chromedriver-wrapper/bin&amp;lt;/tt&amp;gt; folder must be in your &amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
===== Firefox =====&lt;br /&gt;
You can download Mozilla Firefox from [https://www.mozilla.org/en-US/firefox/new/ https://www.mozilla.org/en-US/firefox/new/].&lt;br /&gt;
&lt;br /&gt;
You will need the [https://github.com/mozilla/geckodriver/releases correct version of geckodriver] as per the [https://firefox-source-docs.mozilla.org/testing/geckodriver/Support.html documentation].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;geckodriver&amp;lt;/tt&amp;gt; binary must be in a directory in your &amp;lt;tt&amp;gt;$PATH&amp;lt;/tt&amp;gt;.&lt;br /&gt;
==== Set up Moodle ====&lt;br /&gt;
# Create a new &#039;dataroot&#039; area for files especially for behat&lt;br /&gt;
# Set the following in your Moodle &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    $CFG-&amp;gt;behat_dataroot = &#039;/path/to/the/dataroot/you/created&#039;;&lt;br /&gt;
    $CFG-&amp;gt;behat_wwwroot = &#039;http://127.0.0.1/path/to/your/site&#039;;&lt;br /&gt;
    $CFG-&amp;gt;behat_prefix = &#039;beh_&#039;;&lt;br /&gt;
# We recommend that you also include the &amp;lt;tt&amp;gt;behat-browser-config&amp;lt;/tt&amp;gt; if you have not done so already.&lt;br /&gt;
    require_once(&#039;/path/to/moodle-browser-config/init.php&#039;);&lt;br /&gt;
===== Notes about the behat_wwwroot =====&lt;br /&gt;
You will need to set the &amp;lt;tt&amp;gt;behat_wwwroot&amp;lt;/tt&amp;gt; to your Moodle site, but it &#039;&#039;must&#039;&#039; use a different value to your &amp;lt;tt&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
One common way to do this is to use &amp;lt;tt&amp;gt;127.0.0.1&amp;lt;/tt&amp;gt; for behat, but &amp;lt;tt&amp;gt;localhost&amp;lt;/tt&amp;gt; for standard use. Alternatively you can add an additional hostname in your &amp;lt;tt&amp;gt;/etc/hosts&amp;lt;/tt&amp;gt; file and use this instead.&lt;br /&gt;
&lt;br /&gt;
If you use Docker, then you may be able to use &amp;lt;tt&amp;gt;host.docker.internal&amp;lt;/tt&amp;gt; where your site is hosted on the docker host&lt;br /&gt;
==== Configure Behat for Moodle ====&lt;br /&gt;
After setting your configuration, you can simply initialise behat:&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php&lt;br /&gt;
This will install all required Composer dependencies, install a new Moodle site, and put configuration in place&lt;br /&gt;
&lt;br /&gt;
When it finishes it will give advice on how to run Behat.&lt;br /&gt;
==== Run Behat tests ====&lt;br /&gt;
Before running behat, ensure that your Selenium server is running.&lt;br /&gt;
&lt;br /&gt;
The easiest way to run behat, and test that everything works is by simply running it using the command provided when you&lt;br /&gt;
initialised Behat. If you didn&#039;t make a note of it, you can just run the initialisation again.&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php&lt;br /&gt;
This will give you a command which you can then run. This command will run every behat scenario, which will take a considerable amount of time. This command will look a bit like this:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml&lt;br /&gt;
To make this more useful you an combine it with flags, for example to only run certain &amp;lt;tt&amp;gt;tags&amp;lt;/tt&amp;gt; or for a specific Behat Feature file, or Scenario.&lt;br /&gt;
&lt;br /&gt;
To run all features/scenarios which are tagged with &amp;lt;tt&amp;gt;mod_forum&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --tags=@mod_forum&lt;br /&gt;
To run one specific feature file:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml `pwd`/mod/forum/tests/behat/private_replies.feature&lt;br /&gt;
To run one specific scenario within a feature file:&lt;br /&gt;
    # To run the Scenario on line 38 of the file:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml `pwd`/mod/forum/tests/behat/private_replies.feature:38&lt;br /&gt;
To run one specific scenario by name:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --name=&amp;quot;As a teacher I can see my own response&amp;quot;&lt;br /&gt;
See the upstream documentation on Behat, and Gherkin filters for more information.&lt;br /&gt;
===== Running using a different browser =====&lt;br /&gt;
The default browser in Behat is &amp;lt;tt&amp;gt;Firefox&amp;lt;/tt&amp;gt;. To specify a different browser profile, you can add the &amp;lt;tt&amp;gt;--profile&amp;lt;/tt&amp;gt; argument. For example, to use Chrome in Headless mode:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --profile=headlesschrome&lt;br /&gt;
If you are using the &amp;lt;tt&amp;gt;moodle-browser-config&amp;lt;/tt&amp;gt; utility, then you can use any profile listed in [[Running_acceptance_test#Pre-configured_browser_profiles:_moodle-browser-config|moodle-browser-config]]. Otherwise you can write your own browser profile configuration.&lt;br /&gt;
=== Advanced testing ===&lt;br /&gt;
==== Run tests without Selenium (chromedriver, geckodriver) ====&lt;br /&gt;
Historically, Behat required Selenium server, however browsers now make use of their own automation layer. For example, Firefox uses &amp;lt;tt&amp;gt;Geckodriver&amp;lt;/tt&amp;gt; and Chrome uses &amp;lt;tt&amp;gt;Chromedriver&amp;lt;/tt&amp;gt;. As a result the use of Selenium itself is now optional.&lt;br /&gt;
&lt;br /&gt;
The moodle-browser-config tool includes standard profiles to use these drivers directly and without the use of Selenium.&lt;br /&gt;
&lt;br /&gt;
To use the drivers directly, you must run the driver itself, for example to run &amp;lt;tt&amp;gt;chromedriver&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    $ chromedriver&lt;br /&gt;
To run &amp;lt;tt&amp;gt;geckodriver&amp;lt;/tt&amp;gt;:&lt;br /&gt;
    $ geckodriver&lt;br /&gt;
Note: geckodriver runs on port 4444 by default. You cannot geckodriver at the same time as selenium.&lt;br /&gt;
&lt;br /&gt;
After starting your preferred browser, you can then run behat and specify an alternative profile, for example:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --profile=geckodriver&lt;br /&gt;
==== Headless browsers ====&lt;br /&gt;
There are a number of reasons that you may prefer to use a headless browser. It can be particularly helpful if you are running the tests on a remote system, for example over SSH, or if you do not want to be interrupted by browsers popping up on your machine.&lt;br /&gt;
&lt;br /&gt;
The following headless profiles are some of those provided in the moodle-browser-config tool as standard:&lt;br /&gt;
# &amp;lt;tt&amp;gt;headlessfirefox&amp;lt;/tt&amp;gt; Use Firefox via Selenium, without displaying the GUI&lt;br /&gt;
# &amp;lt;tt&amp;gt;headlessgeckodriver&amp;lt;/tt&amp;gt; Use Firefox with Geckodriver directly, without displaying the GUI&lt;br /&gt;
# &amp;lt;tt&amp;gt;headlesschrome&amp;lt;/tt&amp;gt; Use Chrome via Selenium, without displaying the GUI&lt;br /&gt;
# &amp;lt;tt&amp;gt;headlesschromedriver&amp;lt;/tt&amp;gt; Use Chrome with Chromedriver directly, without displaying the GUI&lt;br /&gt;
These can be provided to the &amp;lt;tt&amp;gt;--profile&amp;lt;/tt&amp;gt; argument to behat:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --profile=headlesschrome&lt;br /&gt;
==== Parallel runs ====&lt;br /&gt;
Out-of-the-box, Moodle will configure Behat to run a single Moodle installation with all tests run in series. This is great for developer use where you are running a single test. or a small suite of tests. However this can be quite slow. A lot of time is spent waiting in Behat for things to happen. This may be for a page to load, for additional content to load, or even explicit waits because some interactions must be deliberately slowed down. As a result, a system running behat will not have a particularly high load most of the time.&lt;br /&gt;
&lt;br /&gt;
If you want to run a large suite of tests then it is possible to take advantage of the relatively low resource consumption by running several behat runners in parallel. This is commonly referred to as a &#039;&#039;&#039;Parallel run&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A parallel run of behat takes the same codebase and creates several installations rather than just a single Moodle installation. The behat Feature files are then grouped and allocated between each of the separate installations.&lt;br /&gt;
&lt;br /&gt;
To support this, each of the parallels runs needs its own:&lt;br /&gt;
* &amp;lt;tt&amp;gt;behat_wwwroot&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;behat_dataroot&amp;lt;/tt&amp;gt;&lt;br /&gt;
* database&lt;br /&gt;
Rather than using an entirely separate database, the same database is actually used, but a different &amp;lt;tt&amp;gt;behat_prefix&amp;lt;/tt&amp;gt; is used to prefix the table names in the database differently.&lt;br /&gt;
===== Installation =====&lt;br /&gt;
The Behat initialisation command is responsible for preparing Moodle to run a standard run. You&#039;ll have used this before when installing for a standard run:&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php&lt;br /&gt;
The same command can be used to prepare Moodle for a parallel run by specifying the &amp;lt;tt&amp;gt;--parallel&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-j&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
    // Below command will initialise moodle to run 3 parallel tests.&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php --parallel=3&lt;br /&gt;
This can be combined with the &amp;lt;tt&amp;gt;--add-core-features-to-theme&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; flag to prepare Behat to run with all installed themes.&lt;br /&gt;
&lt;br /&gt;
A number of advanced options are also available but you are unlikely to need these:&lt;br /&gt;
# &amp;lt;tt&amp;gt;-m=&amp;lt;number&amp;gt;&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;--maxruns=&amp;lt;number&amp;gt;&amp;lt;/tt&amp;gt; Max parallel site which should be initialised at one time. If your system is slow, then you can initialise sites in chucks.&lt;br /&gt;
# &amp;lt;tt&amp;gt;--fromrun=&amp;lt;number&amp;gt;&amp;lt;/tt&amp;gt; Initialise site to run specified run from. Used for running acceptance tests on different vms&lt;br /&gt;
# &amp;lt;tt&amp;gt;--torun=&amp;lt;number&amp;gt;&amp;lt;/tt&amp;gt; Initialise site to run specified run till. Used for running acceptance tests on different vms&lt;br /&gt;
# &amp;lt;tt&amp;gt;-o&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;--optimize-runs&amp;lt;/tt&amp;gt; This option will split features with specified tags in all parallel runs, so they are executed first when parallel run gets executed.&lt;br /&gt;
You can view details of all of these using the &amp;lt;tt&amp;gt;--help&amp;lt;/tt&amp;gt; flag to &amp;lt;tt&amp;gt;admin/tool/behat/cli/init.php&amp;lt;/tt&amp;gt;&lt;br /&gt;
===== Running Parallel tests =====&lt;br /&gt;
You can use the Moodle behat runner to run all tests, including Standard runs. It is an intelligient wrapper around the standard &amp;lt;tt&amp;gt;./vendor/bin/behat&amp;lt;/tt&amp;gt; command which specifies the configuration file, and other required features.&lt;br /&gt;
    $ php admin/tool/behat/cli/run.php&lt;br /&gt;
Many of the standard options and parameters that can be passed to &amp;lt;tt&amp;gt;./vendor/bin/behat&amp;lt;/tt&amp;gt; can also be passed to the Moodle runner, for example:&lt;br /&gt;
# &amp;lt;tt&amp;gt;--tags&amp;lt;/tt&amp;gt; Run tests which match the specified tags&lt;br /&gt;
# &amp;lt;tt&amp;gt;--name=&amp;quot;Scenario name&amp;quot;&amp;lt;/tt&amp;gt; Run a test matching the supplied scenario name&lt;br /&gt;
# &amp;lt;tt&amp;gt;--feature=&amp;quot;/path/to/test.feature&amp;quot;&amp;lt;/tt&amp;gt; Run a specific feature file.&lt;br /&gt;
# &amp;lt;tt&amp;gt;--suite&amp;lt;/tt&amp;gt; Features for specified theme will be executed.&lt;br /&gt;
The runner also includes a number of custom parameters relating to parallel runs:&lt;br /&gt;
# &amp;lt;tt&amp;gt;--replace&amp;lt;/tt&amp;gt; Replace args string with run process number, useful for output and reruns.&lt;br /&gt;
# &amp;lt;tt&amp;gt;--fromrun&amp;lt;/tt&amp;gt; Execute run starting from (Used for parallel runs on different vms)&lt;br /&gt;
# &amp;lt;tt&amp;gt;--torun&amp;lt;/tt&amp;gt; Execute run till (Used for parallel runs on different vms)&lt;br /&gt;
The &amp;lt;tt&amp;gt;--replace&amp;lt;/tt&amp;gt; feature is particularly useful and can be used to replace a string in the command with the run number. This is useful when specifying output formats, and rerun files as noted below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The following example demonstrates how Behat might be initialised with three parallel runs, to run on all themes:&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php --parallel=3 --add-core-features-to-theme&lt;br /&gt;
And then to run all tests matching the &amp;lt;tt&amp;gt;@tool_myplugin&amp;lt;/tt&amp;gt; tag, against the &amp;lt;tt&amp;gt;classic&amp;lt;/tt&amp;gt; theme:&lt;br /&gt;
    $ php admin/tool/behat/cli/run.php --tags=&amp;quot;@tool_myplugin&amp;quot; --suite=&amp;quot;classic&amp;quot;&lt;br /&gt;
===== Custom parameters for parallel runs =====&lt;br /&gt;
You can set following custom config options for parallel runs via $CFG-&amp;gt;behat_parallel_run. It&#039;s an array of options where 1st array is for 1st run and so on.&lt;br /&gt;
    $CFG-&amp;gt;behat_parallel_run = [&lt;br /&gt;
        [&lt;br /&gt;
           &#039;dbtype&#039; =&amp;gt; &#039;mysqli&#039;,&lt;br /&gt;
           &#039;dblibrary&#039; =&amp;gt; &#039;native&#039;,&lt;br /&gt;
           &#039;dbhost&#039; =&amp;gt; &#039;localhost&#039;,&lt;br /&gt;
           &#039;dbname&#039; =&amp;gt; &#039;moodletest&#039;,&lt;br /&gt;
           &#039;dbuser&#039; =&amp;gt; &#039;moodle&#039;,&lt;br /&gt;
           &#039;dbpass&#039; =&amp;gt; &#039;moodle&#039;,&lt;br /&gt;
           &#039;behat_prefix&#039; =&amp;gt; &#039;mdl_&#039;,&lt;br /&gt;
           &#039;wd_host&#039; =&amp;gt; &#039;http://127.0.0.1:4444/wd/hub&#039;,&lt;br /&gt;
           &#039;behat_wwwroot&#039; =&amp;gt; &#039;http://127.0.0.1/moodle&#039;,&lt;br /&gt;
           &#039;behat_dataroot&#039; =&amp;gt; &#039;/home/example/bht_moodledata&#039;&lt;br /&gt;
       ],&lt;br /&gt;
       // ...&lt;br /&gt;
    ],&lt;br /&gt;
To set different selenium servers for parallel runs, you can use following. NOTE: Running parallel (headless) runs on different selenium servers avoid random focus failures.&lt;br /&gt;
    $CFG-&amp;gt;behat_parallel_run = [&lt;br /&gt;
        [&#039;wd_host&#039; =&amp;gt; &#039;http://127.0.0.1:4444/wd/hub&#039;],&lt;br /&gt;
        [&#039;wd_host&#039; =&amp;gt; &#039;http://127.0.0.1:4445/wd/hub&#039;],&lt;br /&gt;
        [&#039;wd_host&#039; =&amp;gt; &#039;http://127.0.0.1:4446/wd/hub&#039;],&lt;br /&gt;
    ];&lt;br /&gt;
==== Tests filters ====&lt;br /&gt;
With the &amp;lt;tt&amp;gt;--tags&amp;lt;/tt&amp;gt; or the &amp;lt;tt&amp;gt;-name&amp;lt;/tt&amp;gt; Behat options you can filter which tests are going to run or which ones are going to be skipped. There are a few tags that you might be interested in:&lt;br /&gt;
* &amp;lt;tt&amp;gt;@javascript&amp;lt;/tt&amp;gt;: All the tests that runs in a browser using Javascript; they require Selenium or the browser&#039;s own automation layer, as per [[Running acceptance test#Run%20tests%20without%20Selenium%20.28chromedriver.2C%20geckodriver.29|Running acceptance test#Run tests without Selenium .28chromedriver.2C geckodriver.29,]] to be running, otherwise an exception will be thrown.&lt;br /&gt;
* &amp;lt;tt&amp;gt;@_file_upload&amp;lt;/tt&amp;gt;: All the tests that involves file uploading or any OS feature that is not 100% part of the browser. They should only be executed when Selenium is running in the same machine where the tests are running.&lt;br /&gt;
* &amp;lt;tt&amp;gt;@_alert&amp;lt;/tt&amp;gt;: All the tests that involves Javascript dialogs (alerts, confirms...) are using a feature that is OS-dependant and out of the browser scope, so they should be tag appropriately as not all browsers manage them properly.&lt;br /&gt;
* &amp;lt;tt&amp;gt;@_switch_window&amp;lt;/tt&amp;gt;: All the tests that are using the &amp;lt;tt&amp;gt;I switch to &amp;quot;NAME&amp;quot; window&amp;lt;/tt&amp;gt; step should be tagged as not all browsers manage them properly.&lt;br /&gt;
* &amp;lt;tt&amp;gt;@_switch_iframe&amp;lt;/tt&amp;gt;: All the tests that are using the &amp;lt;tt&amp;gt;I switch to &amp;quot;NAME&amp;quot; iframe&amp;lt;/tt&amp;gt; steps should be tagged as it is an advanced feature and some browsers may have problems dealing with them&lt;br /&gt;
* &amp;lt;tt&amp;gt;@_cross_browser&amp;lt;/tt&amp;gt;: All the tests that should run against multiple combinations of browsers + OS in a regular basis. The features that are sensitive to different combinations of OS and browsers should be tagges as @_cross_browser.&lt;br /&gt;
* &amp;lt;tt&amp;gt;@componentname&amp;lt;/tt&amp;gt;: Moodle features uses the [https://docs.moodle.org/dev/Frankenstyle Frankenstyle] component name to tag the features according to the Moodle subsystem they belong to.&lt;br /&gt;
==== Output formats ====&lt;br /&gt;
Behat is able to output in a number of different formats, and to different locations as required.&lt;br /&gt;
&lt;br /&gt;
This can be achieved by specifying the &amp;lt;tt&amp;gt;--format&amp;lt;/tt&amp;gt;, and &amp;lt;tt&amp;gt;--out&amp;lt;/tt&amp;gt; parameters when running behat, for example:&lt;br /&gt;
    // Run behat, using the &#039;pretty&#039; format and outputting the value to /tmp/pretty.txt&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty.txt&lt;br /&gt;
It is also possible to output to multiple formats simultaneously by repeating the arguments, for example:&lt;br /&gt;
&lt;br /&gt;
Since Moodle 3.1 option for output is:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty.txt \&lt;br /&gt;
        --format=moodle_progress --out=std&lt;br /&gt;
The following output formats are supported:&lt;br /&gt;
# &amp;lt;tt&amp;gt;progress&amp;lt;/tt&amp;gt;: Prints one character per step.&lt;br /&gt;
# &amp;lt;tt&amp;gt;pretty&amp;lt;/tt&amp;gt;: Prints the feature as is.&lt;br /&gt;
# &amp;lt;tt&amp;gt;junit&amp;lt;/tt&amp;gt;: Outputs the failures in JUnit compatible files.&lt;br /&gt;
# &amp;lt;tt&amp;gt;moodle_progress&amp;lt;/tt&amp;gt;: Prints Moodle branch information and dots for each step.&lt;br /&gt;
# &amp;lt;tt&amp;gt;moodle_list&amp;lt;/tt&amp;gt;: List all scenarios.&lt;br /&gt;
# &amp;lt;tt&amp;gt;moodle_stepcount&amp;lt;/tt&amp;gt;: List all features with total steps in each feature file. Used for parallel run.&lt;br /&gt;
# &amp;lt;tt&amp;gt;moodle_screenshot&amp;lt;/tt&amp;gt;: Take screenshot and core dump of each step. With following options you can dump either or both.&lt;br /&gt;
## &amp;lt;tt&amp;gt;--format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;image&amp;quot;}&#039;&amp;lt;/tt&amp;gt;: will dump image only&lt;br /&gt;
## &amp;lt;tt&amp;gt;--format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html&amp;quot;}&#039;&amp;lt;/tt&amp;gt;: will dump html only.&lt;br /&gt;
## &amp;lt;tt&amp;gt;--format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html,image&amp;quot;}&#039;&amp;lt;/tt&amp;gt;: will dump both.&lt;br /&gt;
## &amp;lt;tt&amp;gt;--format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html&amp;quot;, &amp;quot;dir_permissions&amp;quot;: &amp;quot;0777&amp;quot;}&#039;&amp;lt;/tt&amp;gt;&lt;br /&gt;
Note: If you want to see the failures immediately (rather than waiting ~3 hours for all the tests to finish) then either use the -v option to output a bit more information, or change the output format using --format. Format &#039;pretty&#039; (&#039;&#039;&#039;-f pretty&#039;&#039;&#039;) is sufficient for most cases, as it outputs each step outcomes in the command line making easier to see the progress.&lt;br /&gt;
&lt;br /&gt;
When working with parallel runs, you may wish to have an output for each run. If you were to specify a standard path for this then each of the parallel runs would overwrite the others file. The &amp;lt;tt&amp;gt;--replace&amp;lt;/tt&amp;gt; option allows this to be handled:&lt;br /&gt;
    $ admin/tool/behat/cli/run.php \&lt;br /&gt;
        --replace=&amp;quot;{runprocess}&amp;quot; \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty_{runprocess}.txt \&lt;br /&gt;
        --format=moodle_progress --out=std&lt;br /&gt;
In this example, the &amp;lt;tt&amp;gt;--replace&amp;lt;/tt&amp;gt; argument is provided with a value of &amp;lt;tt&amp;gt;{runprocess}&amp;lt;/tt&amp;gt;. Anywhere that &amp;lt;tt&amp;gt;{runprocess}&amp;lt;/tt&amp;gt; appears in the command it will be replaced with the run number. The above command will generate a set of commands like:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun1/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty_1.txt \&lt;br /&gt;
        --format=moodle_progress --out=std&lt;br /&gt;
&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun2/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty_2.txt \&lt;br /&gt;
        --format=moodle_progress --out=std&lt;br /&gt;
&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun3/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty_3.txt \&lt;br /&gt;
        --format=moodle_progress --out=std&lt;br /&gt;
==== Rerun failed scenarios ====&lt;br /&gt;
With slow systems or parallel run you may experience see some random failures. These may happen when your system is too slow, when it is too fast, or where a page depends on external dependencies.&lt;br /&gt;
&lt;br /&gt;
To help with this it is possible to rerun any failed scenarios using the &amp;lt;tt&amp;gt;--rerun&amp;lt;/tt&amp;gt; option to Behat.&lt;br /&gt;
&lt;br /&gt;
The following example runs Behat with the rerun option:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty.txt \&lt;br /&gt;
        --format=moodle_progress --out=std \&lt;br /&gt;
        --rerun&lt;br /&gt;
If any single test fails then the command will return a non-zero exit code. Running the same command again will mean that only failed scenarios are run.&lt;br /&gt;
&lt;br /&gt;
For a parallel run it can be called as follows:&lt;br /&gt;
    $ admin/tool/behat/cli/run.php \&lt;br /&gt;
        --replace=&amp;quot;{runprocess}&amp;quot; \&lt;br /&gt;
        --format=pretty --out=/tmp/pretty_{runprocess}.txt \&lt;br /&gt;
        --format=moodle_progress --out=std \&lt;br /&gt;
        --rerun&lt;br /&gt;
The Moodle behat runner also includes an &amp;lt;tt&amp;gt;--auto-rerun&amp;lt;/tt&amp;gt; option which will automatically rerun failed scenarios exactly once.&lt;br /&gt;
==== Running behat with specified theme ====&lt;br /&gt;
Behat can be run with any installed theme, but it must be initialised with the &amp;lt;tt&amp;gt;-a&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;--add-core-features-to-theme&amp;lt;/tt&amp;gt; option first.&lt;br /&gt;
&lt;br /&gt;
After configuring the theme can be specified using the &amp;lt;tt&amp;gt;--suite&amp;lt;/tt&amp;gt; parameter.&lt;br /&gt;
&lt;br /&gt;
Note: The default theme in Moodle (boost) has the suite name &amp;lt;tt&amp;gt;default&amp;lt;/tt&amp;gt;.&lt;br /&gt;
    // Initialise Behat for all themes:&lt;br /&gt;
    $ php admin/tool/behat/cli/init.php --add-core-features-to-theme&lt;br /&gt;
    &lt;br /&gt;
    // Run Behat against all initalised themes:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml&lt;br /&gt;
    &lt;br /&gt;
    // Run Behat against just the default theme when all themes were initialised:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --suite=default&lt;br /&gt;
    &lt;br /&gt;
    // Run Behat against just the &#039;classic&#039; theme when all themes were initialised:&lt;br /&gt;
    $ vendor/bin/behat --config /Users/nicols/Sites/moodles/sm/moodledata_behat/behatrun/behat/behat.yml --suite=classic&lt;br /&gt;
==== Using Docker to start selenium server ====&lt;br /&gt;
There are a wide range of docker images available which contain a browser with Selenium. You will probably be using the official SeleniumHQ images unless you have a specific reason not to.&lt;br /&gt;
&lt;br /&gt;
The complete list of available SeleniumHQ images is available at [https://hub.docker.com/u/selenium/ https://hub.docker.com/u/selenium/].&lt;br /&gt;
&lt;br /&gt;
Moodle uses the &#039;&#039;standalone&#039;&#039; version and any recent version with version 3.141.59 or higher is supported.&lt;br /&gt;
&lt;br /&gt;
For any test which uploads files, for example when interacting with the filepicker, you must also ensure that the Moodle directory is mounted as on your local filesystem.&lt;br /&gt;
&lt;br /&gt;
An example usage is:&lt;br /&gt;
    $ docker run -d -p 4444:4444 -v `pwd`:`pwd` selenium/standalone-firefox:latest&lt;br /&gt;
==== Change config.php file ====&lt;br /&gt;
In the Moodle &amp;lt;tt&amp;gt;config.php&amp;lt;/tt&amp;gt; file you must change the &amp;lt;tt&amp;gt;$CFG-&amp;gt;behat_wwwroot&amp;lt;/tt&amp;gt; to an address that can be reached from within the docker image.&lt;br /&gt;
&lt;br /&gt;
You cannot use &amp;lt;tt&amp;gt;localhost&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;127.0.0.1&amp;lt;/tt&amp;gt; as this will be the IP address of the docker container itself.&lt;br /&gt;
&lt;br /&gt;
On some more recent versions of Docker you can use &amp;lt;tt&amp;gt;http://host.docker.internal/&amp;lt;/tt&amp;gt;, for example if my site is located at &amp;lt;tt&amp;gt;/sm&amp;lt;/tt&amp;gt; on my development machine, I can set the following:&lt;br /&gt;
    $CFG-&amp;gt;behat_wwwroot = &#039;http://host.docker.internal/sm&#039;;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Manually configuring other browsers =====&lt;br /&gt;
If you would prefer not to use the &amp;lt;tt&amp;gt;moodle-browser-config&amp;lt;/tt&amp;gt; tool but still wish to specify different browsers then you can do so using the &amp;lt;tt&amp;gt;$CFG-&amp;gt;behat_profiles&amp;lt;/tt&amp;gt; array. Each key/value pair contains a profile name, and the configuration for that profile. For example:&lt;br /&gt;
    $CFG-&amp;gt;behat_profiles = [&lt;br /&gt;
        &#039;chrome&#039; =&amp;gt; [&lt;br /&gt;
            &#039;browser&#039; =&amp;gt; &#039;chrome&#039;,&lt;br /&gt;
            &#039;tags&#039; =&amp;gt; &#039;@javascript&#039;,&lt;br /&gt;
        ],&lt;br /&gt;
    ];&lt;br /&gt;
[[Acceptance_testing/Browsers|More info about alternative browsers]]&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
=== Increasing timeouts ===&lt;br /&gt;
You may see errors such as:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Javascript code and/or AJAX requests are not ready after 10 seconds.&lt;br /&gt;
There is a Javascript error or the code is extremely slow.&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Sometimes this indicates a genuine problem with the code, but if you are using a slow computer, it may just mean that your browser did not finish generating parts of the UI before behat tried was finished.&lt;br /&gt;
&lt;br /&gt;
If you find that this happens regularly on different scenarios then you may want to increase the timeout:&lt;br /&gt;
    $CFG-&amp;gt;behat_increasetimeout = 2;&lt;br /&gt;
This will increase all the timeouts by a factor of 2; if that isn&#039;t sufficient, you could use 3.&lt;br /&gt;
&lt;br /&gt;
Increasing timeouts will make tests run a bit slower (because there are points where Behat waits up to a timeout to make sure something doesn&#039;t happen) so don&#039;t do this unless you need to.&lt;br /&gt;
&lt;br /&gt;
Note: This is usually an indicator that your development machine is not well tuned. A better option would be to find out where the bottleneck is. This is usually the database configuration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New step definitions or features are not executed ===&lt;br /&gt;
If you are adding new tests or steps definitions update the tests list&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
php admin/tool/behat/cli/util.php --enable&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&#039;&#039;&#039; For parallel runs, all options for initialising parallel runs are valid &#039;&#039;&#039;&lt;br /&gt;
=== Tests are failing ===&lt;br /&gt;
If you followed all the steps and you receive an unknown weird error probably your browser version is not compatible with the Selenium version you are running. Please refer Working combinations to ensure you have correct [[Acceptance_testing/Browsers#Working_combinations_of_OS.2BBrowser.2Bselenium]] of them to run acceptance test.&lt;br /&gt;
=== The tests are failing, and the error message is completely useless ===&lt;br /&gt;
For example, it just says &amp;quot;Error writing to database&amp;quot; with no stack trace.&lt;br /&gt;
&lt;br /&gt;
Add -vv command-line option to get very verbose output.&lt;br /&gt;
=== Errors during setup (before test are launched) ===&lt;br /&gt;
Typical errors are:&lt;br /&gt;
* Behat requirement not satisfied: http://127.0.0.1/m/stable_master is not available, ensure you specified correct url and that the server is set up and started.&lt;br /&gt;
* init.php or util.php complain that &amp;quot;Unknown error 1 This is not a behat test site!&amp;quot;.  Delete the behat wwwroot (look in config.php for $CFG-&amp;gt;behat_dataroot) and drop the behat DB tables (look in config.php for $CFG-&amp;gt;behat_prefix).  Then try again.&lt;br /&gt;
* Behat is configured but not enabled on this test site.&lt;br /&gt;
In order to fix those errors please check that: the behat_dataroot has correct write permissions and that the $CFG-&amp;gt;behat* variables are placed before the lib/setup.php include:&lt;br /&gt;
 require_once(__DIR__ . &#039;/lib/setup.php&#039;);&lt;br /&gt;
=== Selenium server is not running ===&lt;br /&gt;
==== Chrome specific ====&lt;br /&gt;
If you are using chrome, you need to ensure that the driver matches the version of the installed chrome browser – which may change on OS updates/upgrades. Moodle or Selenium will not give the appropriate message – see [https://tracker.moodle.org/browse/MDL-67659/ MDL-67659]. One solution is the one suggested in the issue and use Andrew Nicols’ [https://github.com/andrewnicols/chromedriver-wrapper/  Chromedriver Wrapper] which will ensure you have the appropriate driver before running the tests.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* Vagrant profile with Moodle and Behat preconfigured: https://github.com/mackensen/moodle-hat&lt;br /&gt;
* Docker containers for Moodle Developers and Behat: https://github.com/moodlehq/moodle-docker&lt;br /&gt;
* Docker environment with Behat preconfigured : https://github.com/tobiga/docker_moodle_environment&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Examples ==&lt;br /&gt;
=== Quick setup and testing using moodle-docker ===&lt;br /&gt;
This is a quick guide to help locally pass tests for your developments, before submitting them:&lt;br /&gt;
# Set up a default Moodle install using [https://github.com/moodlehq/moodle-docker moodle-docker], with the database and Moodle version of your choice. See its README for more details. This will start some docker containers.&lt;br /&gt;
# Initialize behat to start testing with this command, from the webserver container: &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;php admin/tool/behat/cli/init.php&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# Run the behat test of your choice, from the webserver container. For instance: &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;vendor/bin/behat --config /var/www/behatdata/behatrun/behat/behat.yml --tags tool_task&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
And you&#039;ll see something like:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
Moodle 4.0dev (Build: 20210507), 0b47ea0a44a092f9000729ca7b15fff23111538b&lt;br /&gt;
Php: 7.3.26, mysqli: 5.7.21, OS: Linux 5.4.0-66-generic x86_64&lt;br /&gt;
Run optional tests:&lt;br /&gt;
&lt;br /&gt;
Accessibility: No&lt;br /&gt;
Server OS &amp;quot;Linux&amp;quot;, Browser: &amp;quot;firefox&amp;quot;&lt;br /&gt;
Started at 09-05-2021, 06:00&lt;br /&gt;
...................................................................... 70&lt;br /&gt;
...............................&lt;br /&gt;
12 scenarios (12 passed)&lt;br /&gt;
101 steps (101 passed)&lt;br /&gt;
2m53.27s (47.61Mb)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Acceptance testing for the mobile app]]&lt;br /&gt;
[[Category:Quality Assurance]][[Category:Behat]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Information to re-home ==&lt;br /&gt;
==== Override behat core context for theme suite ====&lt;br /&gt;
Note: This documentation needs to be rehomed to a location related to writing Behat tests.&lt;br /&gt;
&lt;br /&gt;
To override behat step definitions so as to run behat with specified theme, you should create a contexts within &#039;&#039;&#039;/theme/{MYTHEME}/tests/behat/&#039;&#039;&#039; with prefix behat_theme_{MYTHEME}_ and suffixed with the context being overridden. For example, if you want to override behat_mod_forum context, then you should create a class /theme/{MYTHEME}/tests/behat/mod_forum/behat_theme_{MYTHEME}_behat_mod_forum.php&lt;br /&gt;
==== Disable behat context or features to run in theme suite ====&lt;br /&gt;
Note: This documentation needs to be rehomed to a location related to writing Behat tests.&lt;br /&gt;
&lt;br /&gt;
To disable specific contexts and features from being executed by a specific theme/suite you can create a &amp;lt;tt&amp;gt;/theme/{MYTHEME}/tests/behat/blacklist.json&amp;lt;/tt&amp;gt; file with following format.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;contexts&amp;quot;: [&lt;br /&gt;
    &amp;quot;behat_grade&amp;quot;,&lt;br /&gt;
    &amp;quot;behat_navigation&amp;quot;,&lt;br /&gt;
  ],&lt;br /&gt;
  &amp;quot;features&amp;quot;: [&lt;br /&gt;
    &amp;quot;auth/tests/behat/login.feature&amp;quot;,&lt;br /&gt;
    &amp;quot;grade/tests/behat/grade_hidden_items.feature&amp;quot;,&lt;br /&gt;
   ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The above will:&lt;br /&gt;
# disable the use of step_definitions from &amp;lt;tt&amp;gt;behat_grade&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;behat_navigation&amp;lt;/tt&amp;gt; while running theme suite; and&lt;br /&gt;
# disable running of scenarios in &amp;lt;tt&amp;gt;auth/tests/behat/login.feature&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;grade/tests/behat/grade_hidden_items.feature&amp;lt;/tt&amp;gt;.&lt;br /&gt;
==== Override core behat selectors ====&lt;br /&gt;
Note: This documentation needs to be rehomed to a location related to writing Behat tests.&lt;br /&gt;
&lt;br /&gt;
To override behat selectors in specific theme, you should create a class behat_theme_{MYTHEME}_behat_selectors in /theme/{MYTHEME}/tests/behat/behat_theme_{MYTHEME}_behat_selectors.php extending behat_selectors.&lt;br /&gt;
==== Write new tests and behat methods ====&lt;br /&gt;
Note: This documentation needs to be rehomed to a location related to writing Behat tests.&lt;br /&gt;
&lt;br /&gt;
If you want to write tests for your own integration, you can do so by creating new tests with format .feature. Follow instructions in [[Writing_acceptance_tests|this page]] to write new tests.&lt;br /&gt;
&lt;br /&gt;
It is also possible to add new steps the moodle behat integration. In order to do so, you will have to create a new .php class with the prefix &#039;&#039;&#039;behat_&#039;&#039;&#039;. Copy the format from &#039;&#039;&#039;lib\behat\behat_base.php&#039;&#039;&#039;, but set your class to extend the behat_base class instead of the MinkExtension. You can define new behat steps by declaring functions with the appropriate heading.&lt;br /&gt;
&lt;br /&gt;
You will not be able to use these steps and features right away. Check [[Running_acceptance_test#New_step_definitions_or_features_are_not_executed|this section]] for instructions on how to update the behat integration.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For further information on how to create new steps definitions, check [[Acceptance testing/Custom acceptance steps]].&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Grunt&amp;diff=57281</id>
		<title>Grunt</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Grunt&amp;diff=57281"/>
		<updated>2020-04-09T23:06:24Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: Add link to bitbucket pipeline for YUI&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.9}}&lt;br /&gt;
&lt;br /&gt;
Grunt is a command line tool used to prepare our javascript and less-generated css for production usage. After making any change to javascript or less files in Moodle, you must run grunt to lint, minify and package the javascript/css properly so that it can be served by Moodle.&lt;br /&gt;
&lt;br /&gt;
== Install grunt ==&lt;br /&gt;
The Javascript modules (AMD and YUI) and less css in Moodle must be processed by some build tools before they will be visible to your web browser. We use &amp;quot;[http://gruntjs.com/ grunt]&amp;quot; as a build tool to wrap our different processes. Grunt is a build tool written in Javascript that runs in the &amp;quot;[http://nodejs.org/ nodejs]&amp;quot; environment. This means you first have to install nodejs - and it&#039;s package manager &amp;quot;[https://www.npmjs.com/ npm]&amp;quot;. The details of how to install those packages will vary by operating system, but on Linux it&#039;s likely to be: &lt;br /&gt;
 apt-get install nodejs npm&lt;br /&gt;
See also: [http://askubuntu.com/questions/594656/how-to-install-the-latest-versions-of-nodejs-and-npm-for-ubuntu-14-04-lts/711976 how to install the latest version of nodejs and npm for ubuntu 14.04]&lt;br /&gt;
&lt;br /&gt;
There are downloadable packages for other operating systems here: http://nodejs.org/download/. &lt;br /&gt;
&lt;br /&gt;
Once this is done, cd into your Moodle directory and run the command: &lt;br /&gt;
 npm install&lt;br /&gt;
to install all of the required tools.&lt;br /&gt;
&lt;br /&gt;
You also need to install the grunt-cli package globally in order to have a &amp;quot;grunt&amp;quot; command in your path. To do this run:&lt;br /&gt;
 npm install -g grunt-cli&lt;br /&gt;
&lt;br /&gt;
== Running grunt ==&lt;br /&gt;
Typical commands:&lt;br /&gt;
&lt;br /&gt;
 grunt amd               # Short-cut for grunt jshint uglify, rebuild all AMD modules.&lt;br /&gt;
 grunt shifter           # Run shifter&lt;br /&gt;
 grunt js                # Short-cut for grunt amd shifter&lt;br /&gt;
 &lt;br /&gt;
 grunt css               # Run less&lt;br /&gt;
 grunt                   # Try to do the right thing:&lt;br /&gt;
                         # * If you are in a folder called amd, do grunt amd&lt;br /&gt;
                         # * If you are in a folder called yui/src/something, do grunt shifter&lt;br /&gt;
                         # * Otherwise build everything (grunt css js).&lt;br /&gt;
 &lt;br /&gt;
 grunt watch             # Watch for changes and re-run grunt tasks depending on what file changes&lt;br /&gt;
 grunt eslint --show-lint-warnings # Show pedantic lint warnings for JS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
On Linux/Mac it will build everything in the current folder and below. You need to cd into the amd folder of your module root, i.e. &amp;lt;tt&amp;gt;dirroot/blocks/foo/amd&amp;lt;/tt&amp;gt; before running &amp;lt;tt&amp;gt;grunt amd&amp;lt;/tt&amp;gt; - this will compile only your plugins AMD source files. You can make output more verbose by adding &amp;lt;tt&amp;gt;-v&amp;lt;/tt&amp;gt; parameter, if used with &amp;lt;tt&amp;gt;grunt shifter&amp;lt;/tt&amp;gt; this will actually show what your lint errors are. On Windows, you need to specify the path on the command line like &amp;lt;tt&amp;gt;--root=admin/tool/templatelibrary&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Using Grunt in additional plugins ==&lt;br /&gt;
&lt;br /&gt;
You may want to use Grunt for performing tasks in your custom Moodle plugins. For building AMD and YUI modules in your plugin, the standard configuration Gruntfile.js located in the Moodle root should work well. For building CSS files from LESS templates, you will have to set up a separate Grunt installation in the root of your plugin.&lt;br /&gt;
&lt;br /&gt;
If you do not have it yet, create the package.json file in the root of your plugin:&lt;br /&gt;
&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;name&amp;quot;: &amp;quot;moodle-plugintype_pluginname&amp;quot;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
Install grunt, grunt less and grunt watch modules. Note that you should put the folder node_modules into your plugin&#039;s .gitignore file, too.&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/your/plugin/root&lt;br /&gt;
    $ npm install --save-dev grunt grunt-contrib-less grunt-contrib-watch grunt-load-gruntfile&lt;br /&gt;
&lt;br /&gt;
Create a Gruntfile.js in the root of your plugin and configure the task for building CSS files from LESS:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
&amp;quot;use strict&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
module.exports = function (grunt) {&lt;br /&gt;
&lt;br /&gt;
    // We need to include the core Moodle grunt file too, otherwise we can&#039;t run tasks like &amp;quot;amd&amp;quot;.&lt;br /&gt;
    require(&amp;quot;grunt-load-gruntfile&amp;quot;)(grunt);&lt;br /&gt;
    grunt.loadGruntfile(&amp;quot;../../Gruntfile.js&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
    // Load all grunt tasks.&lt;br /&gt;
    grunt.loadNpmTasks(&amp;quot;grunt-contrib-less&amp;quot;);&lt;br /&gt;
    grunt.loadNpmTasks(&amp;quot;grunt-contrib-watch&amp;quot;);&lt;br /&gt;
    grunt.loadNpmTasks(&amp;quot;grunt-contrib-clean&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
    grunt.initConfig({&lt;br /&gt;
        watch: {&lt;br /&gt;
            // If any .less file changes in directory &amp;quot;less&amp;quot; then run the &amp;quot;less&amp;quot; task.&lt;br /&gt;
            files: &amp;quot;less/*.less&amp;quot;,&lt;br /&gt;
            tasks: [&amp;quot;less&amp;quot;]&lt;br /&gt;
        },&lt;br /&gt;
        less: {&lt;br /&gt;
            // Production config is also available.&lt;br /&gt;
            development: {&lt;br /&gt;
                options: {&lt;br /&gt;
                    // Specifies directories to scan for @import directives when parsing.&lt;br /&gt;
                    // Default value is the directory of the source, which is probably what you want.&lt;br /&gt;
                    paths: [&amp;quot;less/&amp;quot;],&lt;br /&gt;
                    compress: true&lt;br /&gt;
                },&lt;br /&gt;
                files: {&lt;br /&gt;
                    &amp;quot;styles.css&amp;quot;: &amp;quot;less/styles.less&amp;quot;&lt;br /&gt;
                }&lt;br /&gt;
            },&lt;br /&gt;
        }&lt;br /&gt;
    });&lt;br /&gt;
    // The default task (running &amp;quot;grunt&amp;quot; in console).&lt;br /&gt;
    grunt.registerTask(&amp;quot;default&amp;quot;, [&amp;quot;less&amp;quot;]);&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now running &amp;quot;grunt&amp;quot; or &amp;quot;grunt less&amp;quot; in your plugin root folder will compile the file less/styles.less and saves it as styles.css. Running &amp;quot;grunt watch&amp;quot; will watch the less/*.less files and if some is changed, it will immediately rebuild the CSS file.&lt;br /&gt;
&lt;br /&gt;
If you are working on a custom theme, you may have multiple less/*.less files that you want to compile to their style/*.css counterparts. You can either define an explicit list all such file pairs, or let that list be created for you by making use of [http://gruntjs.com/configuring-tasks#building-the-files-object-dynamically expand:true feature] of gruntfile.js:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code javascript&amp;gt;&lt;br /&gt;
// This dynamically creates the list of files to be processed.&lt;br /&gt;
files: [&lt;br /&gt;
    {   &lt;br /&gt;
        expand: true,&lt;br /&gt;
        cwd: &amp;quot;less/&amp;quot;,&lt;br /&gt;
        src: &amp;quot;*.less&amp;quot;,&lt;br /&gt;
        dest: &amp;quot;style/&amp;quot;,&lt;br /&gt;
        ext: &amp;quot;.css&amp;quot;&lt;br /&gt;
    }   &lt;br /&gt;
]   &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[YUI/Shifter]]&lt;br /&gt;
* [[Javascript Modules]]&lt;br /&gt;
* [[LESS]]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=400229#p1614743 Bitbucket pipeline to build YUI JS]&lt;br /&gt;
&lt;br /&gt;
[[Category:AJAX]]&lt;br /&gt;
[[Category:Javascript]]&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Git_for_developers&amp;diff=46271</id>
		<title>Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Git_for_developers&amp;diff=46271"/>
		<updated>2014-09-18T00:04:36Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: Add external link to Tim&amp;#039;s docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A reasonable knowledge of the Git basics is a good idea before you start to use it for development. If you are new to Git, you are encouraged to go to &#039;See also&#039; for some more general reading.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and publish links to your changes in the Moodle Tracker&lt;br /&gt;
* You may ask for a peer review of your code from another developer (preferred but optional)&lt;br /&gt;
* When you are confident of your code you should submit it for integration (Integration request, also sometimes known as a pull request)&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
If you&#039;d like to be added to the developers group in the tracker (which allows you to assign issues to yourself), please send an email to michaeld@moodle.com with your tracker username and a link to an issue where you have contributed a patch.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in a few clicks.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git://github.com/YOUR_GITHUB_USERNAME/moodle.git LOCALDIR&lt;br /&gt;
&lt;br /&gt;
    (or:  git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git LOCALDIR)&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
Note that the format of the URL here is important. In the first example, the URL starts &amp;quot;git://github.com&amp;quot; and this will give read-only access to the repository at github.com. If you use this URL, the &amp;quot;git push origin&amp;quot; command that appears later in this document will not work. Therefore, if you want to be able to update the &amp;quot;origin&amp;quot; repository, you should use the URL that starts &amp;quot;git@github.com&amp;quot;, i.e. the second of the two &amp;quot;git clone&amp;quot; commands given above. This will give you read and write access to the repository on github.com.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    cd moodle&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/sh&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_{19..27}_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
=== New branches ===&lt;br /&gt;
&lt;br /&gt;
Occasionally, moodle.org will create a new branch that does not exist in your public (e.g. Github.com) repository. If you try to push this new branch, you will see an error such as the following:&lt;br /&gt;
&lt;br /&gt;
    error: unable to push to unqualified destination: MOODLE_99_STABLE&lt;br /&gt;
    The destination refspec neither matches an existing ref on the remote&lt;br /&gt;
    nor begins with refs/, and we are unable to guess a prefix based on the source ref.&lt;br /&gt;
    error: failed to push some refs to &#039;git@github.com:YOUR_GITHUB_USERNAME/moodle.git&#039;&lt;br /&gt;
&lt;br /&gt;
In the above example, &amp;quot;MOODLE_99_STABLE&amp;quot;, is the name of the new branch that does not exist in your public repository. To fix the error, you need to create the new branch on your public repository, using the following commands, replacing &amp;quot;MOODLE_99_STABLE&amp;quot; with the name of the new branch you wish to create:&lt;br /&gt;
&lt;br /&gt;
    git checkout MOODLE_99_STABLE&lt;br /&gt;
    git push origin MOODLE_99_STABLE:MOODLE_99_STABLE&lt;br /&gt;
&lt;br /&gt;
The above code will create a new copy of the &amp;quot;MOODLE_99_STABLE&amp;quot; branch in your local repository. If you do not need to keep a local copy of the new branch - and probably you do not need it, you then can remove it from your local repository as follows:&lt;br /&gt;
&lt;br /&gt;
    git checkout master&lt;br /&gt;
    git branch -D MOODLE_99_STABLE&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you think it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push MDL-xxxxx-nasty-bug&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
After some time contributing to Moodle you would have a lot of branches both in your local repository and in your public repository. To prune their list and delete those that were accepted by upstream, use the following&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream                                      (1)&lt;br /&gt;
    git branch --merged upstream/master                     (2)&lt;br /&gt;
    git branch --merged upstream/MOODLE_20_STABLE           (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) fetches the changes from your upstream repository at git.moodle.org (remember that git-fetch does not modify your working dir so it is safe to run it whenever). Command (2) and (3) print all branches that are merged into the upstream master branch and MOODLE_20_STABLE branch, respectively. To delete these local branches, use&lt;br /&gt;
&lt;br /&gt;
    git branch -d MDL-xxxxx-accepted-branch&lt;br /&gt;
&lt;br /&gt;
The similar approach can be used to check the branches published at your origin repository at github.com&lt;br /&gt;
&lt;br /&gt;
    git fetch origin                                        (1)&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    git branch -r --merged upstream/master                  (2)&lt;br /&gt;
    git branch -r --merged upstream/MOODLE_20_STABLE        (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) makes sure that you have all your branches from github.com recorded as the remote tracking branch locally. Commands (2) and (3) work the same as in the previous example but they list remote tracking branches only ([http://www.kernel.org/pub/software/scm/git/docs/git-branch.html see -r param]). To delete a branch at github.com, use&lt;br /&gt;
&lt;br /&gt;
    git push origin :MDL-xxxx-branch-to-delete&lt;br /&gt;
&lt;br /&gt;
This syntax may look weird to you. However it is pretty logical. The general syntax of the git-push command is&lt;br /&gt;
&lt;br /&gt;
    git push &amp;lt;repository&amp;gt; &amp;lt;source ref&amp;gt;:&amp;lt;target ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so deleting a remote branch can be understood as pushing an &amp;quot;empty (null) reference&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see how a particular file looks at Alice&#039;s branch&lt;br /&gt;
&lt;br /&gt;
    git show FETCH_HEAD:admin/blocks.php&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
Once you are all set and reviewing code, this [[Peer_reviewing_checklist|checklist]] should prove to be useful.&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Applying changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
Most bugs are fixed at a stable branch (like MOODLE_20_STABLE) and the fix must be prepared for other branches, too (like MOODLE_21_STABLE and the main development branch - master). In Moodle, we do not merge stable branches into the master one. So usually the contributor prepares at least two branches - with the fix for the stable branch(es) and with the fix for the master branch.&lt;br /&gt;
&lt;br /&gt;
If you have a patch prepared on a local branch (let us say MDL-xxxx-topic_20_STABLE), it is possible to re-apply it to another branch.&lt;br /&gt;
&lt;br /&gt;
=== Cherry-picking a single commit ===&lt;br /&gt;
&lt;br /&gt;
Let us have two local Git repositories ~/public_html/moodle21 containing local installation of Moodle 2.1 and ~/public_html/moodledev with the local installation of most recent development version of Moodle. They both use your public repository at github.com as the origin. You have a branch in moodle21 called MDL-xxxx-topic_21_STABLE that was forked off MOODLE_21_STABLE. It contains one commit. Now you want to re-apply this commit to a branch MDL-xxxx-topic in moodledev.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodledev&lt;br /&gt;
    git checkout -b MDL-xxxx-topic origin/master            (1)&lt;br /&gt;
    git fetch ../moodle21 MDL-xxxx-topic_21_STABLE          (2)&lt;br /&gt;
    git cherry-pick FETCH_HEAD                              (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) creates new local branch forked off the CONTHERE The command (1) fetches all data needed to re-apply the topic branch and stores the pointer to the tip of that branch to FETCH_HEAD symbolic reference. The command (2) picks the tip of the branch (the top-most commit on it) and tries to apply it on the current branch.&lt;br /&gt;
There is also a variant of the cherry-pick command that supports multiple commits, shortly (see its man page for details): &amp;lt;code bash&amp;gt;$ git cherry-pick A^..B&amp;lt;/code&amp;gt; if you want to include from A - see &#039;&#039;&#039;^&#039;&#039;&#039; - to B, A should be older than B. We will use another approach for cherry-picking multiple commits.&lt;br /&gt;
&lt;br /&gt;
=== Applying a set of patches ===&lt;br /&gt;
&lt;br /&gt;
If the branch MDL-xxxx-topic_21_STABLE from the previous example consists of several commits, it may be easier to use git-format-patch and git-am combo to re-apply the whole set of patches (aka patchset). Firstly you will export all commits from the topic branch to files.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodle21&lt;br /&gt;
    mkdir .patches&lt;br /&gt;
    git format-patch -o .patches MOODLE_21_STABLE..MDL-xxxx-topic_21_STABLE         (1)&lt;br /&gt;
&lt;br /&gt;
The command (1) takes all commits from the topic branch that are not in MOODLE_21_STABLE and exports them one by one to the output directory .patches. Look at the generated files. They contain the patch itself (in diff format) and additional information about the commit. You could eg send these files by email to a friend of yours for peer-review. We will use them in another repository.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodledev&lt;br /&gt;
    git checkout -b MDL-xxxx-topic origin/master&lt;br /&gt;
    git am -3 ../moodle21/.patches/*                        (1)&lt;br /&gt;
&lt;br /&gt;
The command (1) applies all the files from the .patches directory. When a patch does not apply cleanly, the command tries fall back on 3-way merge (see the -3 parameter). If conflicts occur during the procedure, you can either deal with them and then use `git am --continue` or abort the whole procedure with `git am --abort`.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
; Moodle forum discussions&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=168094 GIT help needed]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=165236 Best way to manage CONTRIB code with GIT]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167063 Handy Git tip for tracking 3rd-party modules and plugins]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=167730 Moodle Git repositories]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=183409 Git help!! I don&#039;t understand rebase enough...]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=217617 add MOODLE_24_STABLE to github.com repository]&lt;br /&gt;
&lt;br /&gt;
; External resources &lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
* [http://vimeo.com/14629850 Getting git by Scott Chacon] - an recording of an excellent 1-hour presentation that introducing git, including a simple introduction to what is going on under the hood.&lt;br /&gt;
* [http://tjhunt.blogspot.co.uk/2012/03/fixing-bug-in-moodle-core-mechanics.html Tim Hunt&#039;s blog: Fixing a bug in Moodle core: the mechanics]&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;br /&gt;
&lt;br /&gt;
[[ja:開発者用Git]]&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_2.7_release_notes&amp;diff=44309</id>
		<title>Moodle 2.7 release notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_2.7_release_notes&amp;diff=44309"/>
		<updated>2014-04-04T04:54:48Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: Add tracker ticket for Logging&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Releases]] &amp;gt; {{FULLPAGENAME}}&lt;br /&gt;
&lt;br /&gt;
Release date: Expected in May 2014&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==Server Requirements==&lt;br /&gt;
&lt;br /&gt;
These are just minimums.  We recommend keeping all your software updated. &lt;br /&gt;
&lt;br /&gt;
* Moodle upgrade:  Moodle 2.2 or later (if upgrading from earlier versions, you must upgrade to 2.2.11 as a first step)&lt;br /&gt;
* Minimum Database versions: &lt;br /&gt;
** PostgreSQL 9.1&lt;br /&gt;
** MySQL 5.5.31&lt;br /&gt;
** MariaDB 5.5.31&lt;br /&gt;
** MSSQL 2008, or &lt;br /&gt;
** Oracle 10.2&lt;br /&gt;
* Minimum PHP version: PHP 5.4.4 (always use latest PHP 5.4.x or 5.5.x on Windows - http://windows.php.net/download/)&lt;br /&gt;
*Ghostscript should be installed for pdf annotation.&lt;br /&gt;
&lt;br /&gt;
==Browser requirements==&lt;br /&gt;
&lt;br /&gt;
* Recent Google Chrome, recent Mozilla Firefox, Safari 6, Internet Explorer 9 (IE 10 required for drag and drop of files from outside the browser into Moodle)&lt;br /&gt;
&lt;br /&gt;
==Before you upgrade==&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.1 there was a major upgrade to questions. As explained in [https://docs.moodle.org/21/en/Upgrading_to_Moodle_2.1#Planning_the_question_engine_upgrade the upgrade documentation for that version], it was possible to delay parts of the database upgrade to be run later. Before you upgrade to Moodle 2.7, this upgrade must be completed.&lt;br /&gt;
&lt;br /&gt;
You can check for this by going to the [[:en:Environment]] check page. This check is at the bottom of the page.&lt;br /&gt;
&lt;br /&gt;
Several core themes have been removed prior to the release of Moodle 2.7.&lt;br /&gt;
If you use and wish to continue using one of the following themes you will be required to reinstall it *BEFORE* running the upgrade.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;After burner&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_afterburner plugins db] [https://github.com/moodlehq/moodle-theme_afterburner github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Anomaly&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_anomaly plugins db] [https://github.com/moodlehq/moodle-theme_anomaly github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Arialist&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_arialist plugins db] [https://github.com/moodlehq/moodle-theme_arialist github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Binarius&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_binarius plugins db] [https://github.com/moodlehq/moodle-theme_binarius github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Boxxie&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_boxxie plugins db] [https://github.com/moodlehq/moodle-theme_boxxie github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Brick&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_brick plugins db] [https://github.com/moodlehq/moodle-theme_brick github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Formal_white&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_formal_white plugins db] [https://github.com/andreabix/moodle-theme_formal_white github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Form factor&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_formfactor plugins db] [https://github.com/moodlehq/moodle-theme_formfactor github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Fusion&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_fusion plugins db] [https://github.com/moodlehq/moodle-theme_fusion github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Leatherbound&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_leatherbound plugins db] [https://github.com/moodlehq/moodle-theme_leatherbound github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Magazine&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_magazine plugins db] [https://github.com/moodlehq/moodle-theme_magazine github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Nimble&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_nimble plugins db] [https://github.com/moodlehq/moodle-theme_nimble github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Nonzero&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_nonzero plugins db] [https://github.com/moodlehq/moodle-theme_nonzero github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Overlay&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_overlay plugins db] [https://github.com/moodlehq/moodle-theme_overlay github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Serenity&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_serenity plugins db] [https://github.com/moodlehq/moodle-theme_serenity github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Sky high&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_sky_high plugins db] [https://github.com/moodlehq/moodle-theme_sky_high github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Splash&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_splash plugins db] [https://github.com/moodlehq/moodle-theme_splash github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Standard&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_standard plugins db] [https://github.com/moodlehq/moodle-theme_standard github]&lt;br /&gt;
* &amp;lt;b style=&amp;quot;display:inline-block; min-width: 200px;&amp;quot;&amp;gt;Standard old&amp;lt;/b&amp;gt; [https://moodle.org/plugins/view.php?plugin=theme_standardold plugins db] [https://github.com/moodlehq/moodle-theme_standardold github]&lt;br /&gt;
&lt;br /&gt;
For more information about the removal of these themes see MDL-43784.&lt;br /&gt;
&lt;br /&gt;
==Headline core features==&lt;br /&gt;
&lt;br /&gt;
===Interface===&lt;br /&gt;
* Atto - our new Moodle editor, tightly integrated in Moodle and focussing on usability and accessibility (TinyMCE still available as an option)&lt;br /&gt;
* Themes clean-up - Moodle now uses Bootstrap by default.  Clean is now the default theme and most other old themes have been removed from core (still available from Plugins database).&lt;br /&gt;
* More - a completely new theme called More that provides easy configuration though the UI while retaining the power of LESS and Bootstrap.&lt;br /&gt;
&lt;br /&gt;
===Platform===&lt;br /&gt;
* Logging - a new logging subsystem with plugins allowing Moodle logs to be very detailed and external.  Many new events have been added which developers can take advantage of. MDL-37658&lt;br /&gt;
* Performance - many improvements that improve overall performance in most cases&lt;br /&gt;
* Tasks - an improved scheduling system (like Unix cron) that allows precise scheduling of tasks even on complex clustered servers&lt;br /&gt;
&lt;br /&gt;
===Long-term support (LTS) until June 2017===&lt;br /&gt;
&lt;br /&gt;
Most of our releases receive 1 year of backported general bug fixes and 1.5 years of security and dataloss fixes from Moodle HQ.&lt;br /&gt;
&lt;br /&gt;
Due to popular demand, we are committing to giving Moodle 2.7 extended support of &#039;&#039;&#039;&#039;3 years security and dataloss fixes&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you are stuck on an old version then this might be the perfect time to upgrade!&lt;br /&gt;
&lt;br /&gt;
==Details==&lt;br /&gt;
&lt;br /&gt;
===Quiz &amp;amp; Question bank===&lt;br /&gt;
&lt;br /&gt;
* Quiz reports improved. MDL-41727&lt;br /&gt;
** Responses from all tries are avaiable for analysis when using or &amp;quot;Adaptive&amp;quot;, &amp;quot;Interactive with multiple tries&amp;quot; or similar behaviours.&lt;br /&gt;
** Break-down by question variant, for question types like Calculated, STACK and Variable-numeric, which one question can have different random variants.&lt;br /&gt;
** Progress bar during long calculations to prevent time-outs.&lt;br /&gt;
** Low-level calculation code moved into the question component, where it could potentially be reused by other activities.&lt;br /&gt;
** Much more automated testing of this complex area of code.&lt;br /&gt;
* Some minor improvements to the usability of the question bank - Some of MDL-40987&lt;br /&gt;
** To duplicate a question, you now start by clicking the x2 icon, like for activities. MDL-33653&lt;br /&gt;
** The various different ways to move questions in the question bank have been rationalised. MDL-33839&lt;br /&gt;
** There is now a &#039;Save changes and continue editing&#039; button when editing questions. Useful when you are working on a complex question with the preview open in another window. MDL-33653&lt;br /&gt;
* New plugin point, so that plugins can add columns to the question bank, or new search conditions. MDL-40313 &amp;amp; MDL-40457&lt;br /&gt;
* Essay questions can now require an attachment, with the text optional, rather than the other way around. MDL-39756&lt;br /&gt;
* Random short-answer matching question type brought back from the dead. (This was in stable branches, but worht mentioning again.) MDL-27414&lt;br /&gt;
&lt;br /&gt;
===Assignment===&lt;br /&gt;
&lt;br /&gt;
The old Assignment (2.2) module has been removed from core (MDL-33952). It has been replaced by a stub to support transparently remapping urls and restoring course backups from the old module to the new one. &lt;br /&gt;
&lt;br /&gt;
If you are still using the old assignment module - all instances of the old assignment module will be hidden after upgrading to Moodle 2.7. Once the upgrade tool is run on those assignments they will become visible again. &lt;br /&gt;
&lt;br /&gt;
It is recommended to upgrade, and then convert any remaining assignments because logic has been added to the assignment upgrade code for Moodle 2.7 to transparently map urls from the old assignment module to the new one.&lt;br /&gt;
&lt;br /&gt;
If you really, really need to keep using the old module, you should update the code to Moodle 2.7, and then replace the &amp;quot;mod/assignment&amp;quot; folder with the one from the plugins database before completing the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Cron===&lt;br /&gt;
&lt;br /&gt;
Cron has received a major update and now has support for both scheduled and adhoc tasks - MDL-25499.&lt;br /&gt;
The benefits of these changes are:&lt;br /&gt;
* The schedule for every task can be configured by the admin&lt;br /&gt;
* Tasks can run in parallel&lt;br /&gt;
* Cron processes use locking to prevent the same task running at the same time by different processes&lt;br /&gt;
&lt;br /&gt;
A result of this is that cron can be run much more often, which means (for example) forum posts can be sent out sooner. Admins can keep cron running at the same schedule as before, but it is strongly recommended that they increase the frequency of running cron to at least once per minute.&lt;br /&gt;
&lt;br /&gt;
[[fr:Notes de mise à jour de Moodle 2.7]]&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_2.4_release_notes&amp;diff=36484</id>
		<title>Moodle 2.4 release notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_2.4_release_notes&amp;diff=36484"/>
		<updated>2012-11-19T18:45:45Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: /* Performance improvements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Releases]] &amp;gt; {{FULLPAGENAME}}&lt;br /&gt;
 &lt;br /&gt;
Release date: December 2012&lt;br /&gt;
 &lt;br /&gt;
Here is [http://tracker.moodle.org/secure/IssueNavigator!executeAdvanced.jspa?jqlQuery=project+%3D+mdl+AND+resolution+%3D+fixed+AND+fixVersion+in+%28%222.4%22%29+ORDER+BY+priority+DESC&amp;amp;runQuery=true&amp;amp;clear=true the full list of fixed issues in 2.4].&lt;br /&gt;
 &lt;br /&gt;
Many thanks to [http://moodle.org/dev/contributions.php?version=2.4.x everyone that worked on the new features in this release]&lt;br /&gt;
&lt;br /&gt;
A special thanks to our incredible &#039;&#039;&#039;&#039;Integration Team&#039;&#039;&#039;&#039; from Moodle HQ who worked tirelessly with all developers to review, test and help finish code for inclusion in Moodle core:&lt;br /&gt;
&lt;br /&gt;
* Eloy Lafuente&lt;br /&gt;
* Sam Hemelryk&lt;br /&gt;
* Dan Poltawski&lt;br /&gt;
* Aparup Bannerjee &lt;br /&gt;
&lt;br /&gt;
Finally, thanks to all our testers both within Moodle HQ and from the whole community, who have contributed to producing our most exciting and stable release yet!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Requirements===&lt;br /&gt;
&lt;br /&gt;
* Recommended minimum browser: Firefox 4, Internet Explorer 8  (IE 10 required for drag and drop of files from outside the browser into Moodle), Safari 5, Google Chrome 11, Opera 9&lt;br /&gt;
* Moodle upgrade:  Moodle 2.2 or later (if upgrading from earlier versions, you must upgrade to 2.2 as a first step)&lt;br /&gt;
* Minimum DB versions: Postgres 8.3, MySQL 5.1.33 (MDL-33984), MSSQL 2005 or Oracle 10.2&lt;br /&gt;
* Minimum PHP version: PHP 5.3.2&lt;br /&gt;
&lt;br /&gt;
NOTE: We will probably drop support for IE8 in Moodle 2.5 (June 2013)&lt;br /&gt;
&lt;br /&gt;
===Major new features===&lt;br /&gt;
&lt;br /&gt;
====Performance improvements====&lt;br /&gt;
&lt;br /&gt;
A variety of improvements have been made under the hood to improve performance in a number of ways.  Some of require configuration by the admin to take advantage of them but used properly they can allow you to make better use of your hardware for faster speed and more students.&lt;br /&gt;
&lt;br /&gt;
* MDL-33018 - New context index to substantially improve system performance on large PostgreSQL installations.&lt;br /&gt;
* MDL-30643 - Improved daily statistics performance.&lt;br /&gt;
* MDL-33017 - Significant size reduction of navigation widget.&lt;br /&gt;
* MDL-25290 - MUC Stage 1: Implement some core caching architecture (MUC).&lt;br /&gt;
* MDL-34343 - Database meta information caching.&lt;br /&gt;
* MDL-34399 - Question related caching.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;((NOTE: We need performance graphs here comparing 2.4 to 2.3))&#039;&#039;&#039;&#039;&lt;br /&gt;
* [http://www.iteachwithmoodle.com/2012/11/17/moodle-2-4-beta-performance-test-comparison-with-moodle-2-3/ Moodle 2.4 Beta performance test – comparison with Moodle 2.3]&lt;br /&gt;
&lt;br /&gt;
====Plugin updating from within Moodle====&lt;br /&gt;
&lt;br /&gt;
* MDL-35238 - Not only will Moodle tell you when one of your plugins is out-of-date, but you can also now update it via the web interface.&lt;br /&gt;
&lt;br /&gt;
====Course format plugins====&lt;br /&gt;
&lt;br /&gt;
Moodle has always supported pluggable course formats, but now we&#039;ve given developers even more flexibility than before.  Course formats can now provide their own settings for courses and sections, and they can also have a lot more control of all the pages in a course.&lt;br /&gt;
&lt;br /&gt;
* MDL-35218 - Course formats re-factoring&lt;br /&gt;
&lt;br /&gt;
We&#039;re looking forward to seeing some exciting course formats from the community in future.    (Note that in 2.4 the standard course formats have not been changed).&lt;br /&gt;
&lt;br /&gt;
====Themes====&lt;br /&gt;
&lt;br /&gt;
* MDL-22955 - Support for SVG icons.&lt;br /&gt;
* MDL-34299 - All pages are now served HTML5 doctype by default. This allows us to improve usability, add new features, developers can use reliable iframe tag instead of broken object embedding, data attributes may simplify JavaScript code, etc.&lt;br /&gt;
* MDL-36487, MDL-36481 - Improved compatibility with Internet Explorer 8-10.&lt;br /&gt;
* MDL-34915 - SimpleYUI enables similar coding style to JQuery, it is intended especially for theme designers.&lt;br /&gt;
* Multiple RTL fixes and improvements.&lt;br /&gt;
* MDL-34080 - Complete overhaul of all icons. The default icons used for activities and editing actions have been updated for the first time since Moodle 1.0.  Not only are they a little bigger and more colourful but they are SVG format and support full scaling on all devices, so they always look good.  (Developers, see [[Moodle icons 2.4]])&lt;br /&gt;
&lt;br /&gt;
====Improved TinyMCE editor integration====&lt;br /&gt;
&lt;br /&gt;
The integration of TinyMCE  editor was significantly improved:&lt;br /&gt;
&lt;br /&gt;
* MDL-33041 - Support for fully configurable add-on plugins extending standard TinyMCE.&lt;br /&gt;
* MDL-35172 - New TinyMCE editor settings allowing an admin to customise the toolbar, enable/disable icons such as insert equation and insert emoticon.&lt;br /&gt;
* MDL-35955 - Support for built-in browser spell checking.&lt;br /&gt;
* MDL-34875 - Other minor fixes and improvements.&lt;br /&gt;
&lt;br /&gt;
(Developers, see [[TinyMCE plugins]])&lt;br /&gt;
&lt;br /&gt;
====Enrolment related improvements====&lt;br /&gt;
&lt;br /&gt;
* MDL-35071 - Completely reworked support for enrolment restore, fully implemented in manual, self, cohort and database plugins.&lt;br /&gt;
* MDL-35064 - Option to move users to manual enrolment method when uninstalling other enrolment plugins.&lt;br /&gt;
* MDL-35062, MDL-35063 - New configurable expiration action in self and manual enrolment plugins.&lt;br /&gt;
* MDL-28980, MDL-35843 - Pending unenrolment notification in self and manual enrolment plugins.&lt;br /&gt;
* MDL-23875 - Self enrolment can be restricted to cohort members.&lt;br /&gt;
* MDL-31437 - Consistent synchronisation between cohorts, enrolments and groups.&lt;br /&gt;
* MDLSITE-1912 - New add-on plugin for cohort-group sync.&lt;br /&gt;
* MDL-35061 - More custom fields into enrol table.&lt;br /&gt;
* MDL-34696 - Other minor enrolment fixes and improvements.&lt;br /&gt;
&lt;br /&gt;
====Integration of external calendars====&lt;br /&gt;
&lt;br /&gt;
The most-voted feature request in the tracker has been fixed!&lt;br /&gt;
&lt;br /&gt;
* MDL-16660 - You can now stream your external calendars (such as Google Calendar, or a calendar from another Moodle site) into Moodle&#039;s calendar via the iCal standard.&lt;br /&gt;
&lt;br /&gt;
====Full support for Unicode file names in Zip archives====&lt;br /&gt;
&lt;br /&gt;
* MDL-33710 - Moodle creates valid Zip archives with Unicode file names.&lt;br /&gt;
* MDL-33753 - Moodle now extracts most Zip archives with Unicode file names.&lt;br /&gt;
&lt;br /&gt;
Please note that the built-in Windows zip/unzip is not Unicode compatible. It is possible to extra the windows zips if you set the same language in Moodle and in Windows, but Windows can not extract any valid Zip archives with Unicode file names. Please use other tools such as 7-Zip, WinZip or WinRar.&lt;br /&gt;
&lt;br /&gt;
====Assignment enhancements====&lt;br /&gt;
&lt;br /&gt;
A number of significant - and very welcome - enhancements to the assignment module have been made:&lt;br /&gt;
&lt;br /&gt;
* MDL-31284 - Group assignments - It will now be possible to set an assignment which a group can work on collaboratively -and receive a common (or individual) grade.&lt;br /&gt;
* MDL-31291 - Blind marking i.e. not knowing the identity of students when grading. Students&#039; names will be replaced by randomly generated Participant numbers. &lt;br /&gt;
* MDL-31295 - Submission date extensions - Teachers can set a cut-off date (and time) beyond which submissions will no longer be accepted. They can also grant extensions for those who miss the deadline.&lt;br /&gt;
* MDL-31288 - Submission statement - It will be possible to set a submission statement so students have to check a box promising their work is original before submitting it.&lt;br /&gt;
&lt;br /&gt;
===Other highlights===&lt;br /&gt;
&lt;br /&gt;
==== Workshop module enhancements ====&lt;br /&gt;
&lt;br /&gt;
* MDL-36135 Full support for alternative grading evaluation methods.&lt;br /&gt;
* MDL-26349 Final grades are displayed to workshop participants when the activity is closed.&lt;br /&gt;
* MDL-35421 Ability to define a conclusion text to be displayed to workshop participants when the activity is closed.&lt;br /&gt;
* MDL-36209 Teachers can assess submissions in the grading evaluation phase without the need to switch to the assessment phase.&lt;br /&gt;
&lt;br /&gt;
====Miscellaneous====&lt;br /&gt;
&lt;br /&gt;
* MDL-8249 - Localised standard role names and descriptions.&lt;br /&gt;
* MDL-19430 - Users can set the order and number of courses displayed on their My home page.&lt;br /&gt;
* MDL-34088 - Students can now see the content of advanced grading forms on their assignment page before they submit.&lt;br /&gt;
* MDL-29538 - Activities and topics can be restricted according to user profile fields.&lt;br /&gt;
&lt;br /&gt;
===Security issues===&lt;br /&gt;
 &lt;br /&gt;
All security issues that were fixed in 2.3.x and 2.2.x were also fixed in 2.4. &lt;br /&gt;
 &lt;br /&gt;
===For developers: API changes===&lt;br /&gt;
&lt;br /&gt;
Abbreviated descriptions of API changes are always kept up to date in the &amp;quot;upgrade.txt&amp;quot; within each plugin area.  We do this so that the information is always exactly right for the version of Moodle you are using. Changes in this release:&lt;br /&gt;
&lt;br /&gt;
;Core: http://git.moodle.org/gw?p=moodle.git;a=blob;f=lib/upgrade.txt;hb=master&lt;br /&gt;
;Blocks: http://git.moodle.org/gw?p=moodle.git;a=blob;f=blocks/upgrade.txt;hb=master&lt;br /&gt;
;Course formats: http://git.moodle.org/gw?p=moodle.git;a=blob;f=course/format/upgrade.txt;hb=master&lt;br /&gt;
;Enrolment plugins: http://git.moodle.org/gw?p=moodle.git;a=blob;f=enrol/upgrade.txt;hb=master&lt;br /&gt;
;Filters: http://git.moodle.org/gw?p=moodle.git;a=blob;f=filter/upgrade.txt;hb=master&lt;br /&gt;
;Activity modules: http://git.moodle.org/gw?p=moodle.git;a=blob;f=mod/upgrade.txt;hb=master  See also [[Moodle_icons_2.4]] for information on the new icons.&lt;br /&gt;
;Quiz access rules: http://git.moodle.org/gw?p=moodle.git;a=blob;f=mod/quiz/accessrule/upgrade.txt;hb=master&lt;br /&gt;
;Quiz reports: http://git.moodle.org/gw?p=moodle.git;a=blob;f=mod/quiz/report/upgrade.txt;hb=master&lt;br /&gt;
;Portfolio plugins: http://git.moodle.org/gw?p=moodle.git;a=blob;f=portfolio/upgrade.txt;hb=master&lt;br /&gt;
;Question behaviour plugins: http://git.moodle.org/gw?p=moodle.git;a=blob;f=question/behaviour/upgrade.txt;hb=master&lt;br /&gt;
;Question behaviour plugins: http://git.moodle.org/gw?p=moodle.git;a=blob;f=question/format/upgrade.txt;hb=master&lt;br /&gt;
;Question types: http://git.moodle.org/gw?p=moodle.git;a=blob;f=question/type/upgrade.txt;hb=master&lt;br /&gt;
;Repository plugins: http://git.moodle.org/gw?p=moodle.git;a=blob;f=repository/upgrade.txt;hb=master&lt;br /&gt;
;Themes: http://git.moodle.org/gw?p=moodle.git;a=blob;f=theme/upgrade.txt;hb=master&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Core API changes====&lt;br /&gt;
&lt;br /&gt;
* MDL-36145 - Latest YUI 3.7.3 imported, includes full IE 10 compatibility.&lt;br /&gt;
* MDL-34741 - Custom integration of YUI2 was replaced by 2in3. All legacy code needs to be updated to use new YUI3 modules, 2in3 dependency or SimpleYUI.&lt;br /&gt;
* MDL-31973 - Component field in group_members table. Group membership can be linked to other plugins.&lt;br /&gt;
* MDL-8249 - Improved API for customised role names.&lt;br /&gt;
* MDL-34960 - Dropped support for Google Maps V2 API, use V3 instead.&lt;br /&gt;
* MDL-35218 - Improved course-related functions.&lt;br /&gt;
* Latest versions of 3rd party libraries - ADOdb 5.17, Flowplayer 3.2.14, phpMailer 5.2.1, TCPDF 5.9.181.&lt;br /&gt;
&lt;br /&gt;
====Plugin API changes====&lt;br /&gt;
* MDL-34270 - The ability to add blocks to My Moodle and to courses is now controlled by capabilities.&lt;br /&gt;
&lt;br /&gt;
====Unit tests====&lt;br /&gt;
Unit tests are now required in most pull requests.&lt;br /&gt;
&lt;br /&gt;
* MDL-33180 - SimpleTest support was removed, use PHPUnit instead.&lt;br /&gt;
* MDL-35479 - New debugging support in PHPUnit tests - simplified testing of code that uses debugging().&lt;br /&gt;
* MDL-36031 - Message redirection in PHPUnit tests - simplified testing of code that sends messages.&lt;br /&gt;
* More unit tests for cohorts, enrolments and other areas.&lt;br /&gt;
&lt;br /&gt;
====Authentication plugins====&lt;br /&gt;
* MDL-34685 Auth plugins may provide custom user signup forms.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;noinclude&amp;gt;==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/24/en/Category:New_features User documentation of new features in Moodle 2.4]&lt;br /&gt;
* [https://docs.moodle.org/24/en/Upgrading_to_Moodle_2.4 Upgrading to Moodle 2.4] - information for admins who are upgrading from earlier versions&lt;br /&gt;
*[[Moodle 2.3 release notes]]&lt;br /&gt;
* [[2.4_Test_Plan]] - Moodle 2.4 test plan.&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
[[Category:Release notes]]&lt;br /&gt;
[[Category:Moodle 2.4]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Notes de mise à jour de Moodle 2.4]]&lt;br /&gt;
&amp;lt;/noinclude&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Logging_stage2&amp;diff=35675</id>
		<title>Talk:Logging stage2</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Logging_stage2&amp;diff=35675"/>
		<updated>2012-09-25T22:21:09Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please dump your thoughts here about additional things Moodle could be logging In a future new log system.&lt;br /&gt;
&lt;br /&gt;
See also: [http://moodle.org/mod/forum/view.php?id=8044 Forum on analytics and reporting]&lt;br /&gt;
&lt;br /&gt;
From Clive Holtham City University following Moodle Research Conference Session 5 on Learning Analytics&lt;br /&gt;
&lt;br /&gt;
We need to capture every link clicked in Moodle. A click from a URL simply embedded in a page does not create an entry in Moodle Logs (for us anyway). So we have to create a hidden section with the URL&#039;s in their own right, which is captured by the logs, then point to that URL from the place where the original embedding was situated. It would be useful to have a table which reconciles the differing number of hits shown through different Moodle log reports.&lt;br /&gt;
&lt;br /&gt;
Again for us anyway, activity in OUwiki is not showing up in the Moodle logs; OU told us today that the activity should show up.&lt;br /&gt;
&lt;br /&gt;
It was interesting to hear about the privacy legislation in Germany and Switzerland which limit what personal detail can be shown out of Moodle. Even as in the UK where we can legally use the detail, I have reservations about displaying (for example) the time of day a click was made. So there needs to be a series of filters which will deliberately limit data which can be retrieved by an average user, whether for legal or other reasons.&lt;br /&gt;
&lt;br /&gt;
When I create the most detailed actvity spreadsheet, there is very little filtering possible. I would, for example,, like to include only students in the main spreadsheet (exclude faculty and administrators).&lt;br /&gt;
&lt;br /&gt;
On a separate issue, I have been concerned about the grown of use of Google Analytics, not least for data protection reasons, which in part derives from the very limited features and unattractive interface of Moodle logs/reports. GA cannot replace Moodle logs/reports; it can of course provide additional data than currently available. I would like an upgraded Moodle logs/reports to replace the need to use GA. Certainly the emphasis needs to shift to presenting the Moodle reports with a look and feel much more like Google Analytics.&lt;br /&gt;
&lt;br /&gt;
One key point that came through at the conference is that the needs of individual teachers, management broadly defined, and students are all quite different. I would be anxious to see that whatever happens, the priority order for improvement should be&lt;br /&gt;
Teachers&lt;br /&gt;
Students&lt;br /&gt;
Management&lt;br /&gt;
The need for teachers and students does not relate to Big Data. It actually relates to Small Data- how can we gain insights from the fewest pieces of data. The very term Learning Analytics is associated with the Big Data movement, which is primarily related to managerial rather than teacher concerns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Alice Kaerast at Webanywhere:&lt;br /&gt;
&lt;br /&gt;
I would very much like a nice control panel controlling what is logged.  This is particularly important for sites with heavy traffic where I probably don&#039;t care about most activity, and systems like Google Analytics or Kissmetrics are better for this amount of traffic.  I&#039;d also like the ability to control where logs are saved, for very heavy traffic sites I might prefer to have logs streamed to somewhere other than my main database.  Syslog would be great, a second external database would be nice, a message queueing system might be useful, a third-party cloud based logging system could be good - why not create an api to control where logs are sent?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Mark van Hoek at University of Victoria:&lt;br /&gt;
&lt;br /&gt;
The current logs are at once way too much info, yet not enough useful info.  What I&#039;d like: Log every click, every pageview, every submission, every delete, every redirect, for every user (including admins).  Context info should include: course, module, url, request type, Moodle&#039;s response, response level (error, info, warning, fatal).  Add powerful filtering on top: by user, by group, by course, by time period, by action (add, update, delete, click, submit, etc).  Enhance ability to filter and follow a single users actions.  Add an analytics UI layer for higher-level queries, with a UI to build new reports.  Something like PiWik may be leveraged here.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t rely on module authors to write logging code -- centralize the logging (e.g. via a central controller class + output handler).  Add better ability to delete log records and archive them out of the DB and into a file.  The export be optionally excel or should comply to some standard that sysadmins can parse (e.g. log4java, syslog, ...), and that there are standard log readers/handlers for.  &lt;br /&gt;
&lt;br /&gt;
Relational integrity + ACID (consistency) is not so important for logging, and reading is less time-sensitive than writing -- this opens options to prevent logging from being a performance issue (e.g. NoSQL, write to a file, async logging, logging queues, whatever).&lt;br /&gt;
&lt;br /&gt;
+1 for Alice&#039;s request for controlling what is logged.&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Talk:Logging_stage2&amp;diff=35674</id>
		<title>Talk:Logging stage2</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Talk:Logging_stage2&amp;diff=35674"/>
		<updated>2012-09-25T22:04:48Z</updated>

		<summary type="html">&lt;p&gt;Mwithheld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please dump your thoughts here about additional things Moodle could be logging In a future new log system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Clive Holtham City University following Moodle Research Conference Session 5 on Learning Analytics&lt;br /&gt;
&lt;br /&gt;
We need to capture every link clicked in Moodle. A click from a URL simply embedded in a page does not create an entry in Moodle Logs (for us anyway). So we have to create a hidden section with the URL&#039;s in their own right, which is captured by the logs, then point to that URL from the place where the original embedding was situated. It would be useful to have a table which reconciles the differing number of hits shown through different Moodle log reports.&lt;br /&gt;
&lt;br /&gt;
Again for us anyway, activity in OUwiki is not showing up in the Moodle logs; OU told us today that the activity should show up.&lt;br /&gt;
&lt;br /&gt;
It was interesting to hear about the privacy legislation in Germany and Switzerland which limit what personal detail can be shown out of Moodle. Even as in the UK where we can legally use the detail, I have reservations about displaying (for example) the time of day a click was made. So there needs to be a series of filters which will deliberately limit data which can be retrieved by an average user, whether for legal or other reasons.&lt;br /&gt;
&lt;br /&gt;
When I create the most detailed actvity spreadsheet, there is very little filtering possible. I would, for example,, like to include only students in the main spreadsheet (exclude faculty and administrators).&lt;br /&gt;
&lt;br /&gt;
On a separate issue, I have been concerned about the grown of use of Google Analytics, not least for data protection reasons, which in part derives from the very limited features and unattractive interface of Moodle logs/reports. GA cannot replace Moodle logs/reports; it can of course provide additional data than currently available. I would like an upgraded Moodle logs/reports to replace the need to use GA. Certainly the emphasis needs to shift to presenting the Moodle reports with a look and feel much more like Google Analytics.&lt;br /&gt;
&lt;br /&gt;
One key point that came through at the conference is that the needs of individual teachers, management broadly defined, and students are all quite different. I would be anxious to see that whatever happens, the priority order for improvement should be&lt;br /&gt;
Teachers&lt;br /&gt;
Students&lt;br /&gt;
Management&lt;br /&gt;
The need for teachers and students does not relate to Big Data. It actually relates to Small Data- how can we gain insights from the fewest pieces of data. The very term Learning Analytics is associated with the Big Data movement, which is primarily related to managerial rather than teacher concerns.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Alice Kaerast at Webanywhere:&lt;br /&gt;
&lt;br /&gt;
I would very much like a nice control panel controlling what is logged.  This is particularly important for sites with heavy traffic where I probably don&#039;t care about most activity, and systems like Google Analytics or Kissmetrics are better for this amount of traffic.  I&#039;d also like the ability to control where logs are saved, for very heavy traffic sites I might prefer to have logs streamed to somewhere other than my main database.  Syslog would be great, a second external database would be nice, a message queueing system might be useful, a third-party cloud based logging system could be good - why not create an api to control where logs are sent?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From Mark van Hoek at University of Victoria:&lt;br /&gt;
&lt;br /&gt;
The current logs are at once way too much info, yet not enough useful info.  What I&#039;d like: Log every click, every pageview, every submission, every delete, every redirect, for every user (including admins).  Context info should include: course, module, url, request type, Moodle&#039;s response, response level (error, info, warning, fatal).  Add powerful filtering on top: by user, by group, by course, by time period, by action (add, update, delete, click, submit, etc).  Enhance ability to filter and follow a single users actions.  Add an analytics UI layer for higher-level queries, with a UI to build new reports.  Something like PiWik may be leveraged here.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t rely on module authors to write logging code -- centralize the logging (e.g. via a central controller class + output handler).  Add better ability to delete log records and archive them out of the DB and into a file.  The export be optionally excel or should comply to some standard that sysadmins can parse (e.g. log4java, syslog, ...), and that there are standard log readers/handlers for.  &lt;br /&gt;
&lt;br /&gt;
Relational integrity + ACID (consistency) is not so important for logging, and reading is less time-sensitive than writing -- this opens options to prevent logging from being a performance issue (e.g. NoSQL, write to a file, async logging, logging queues, whatever).&lt;br /&gt;
&lt;br /&gt;
+1 for Alice&#039;s request for controlling what is logged.&lt;/div&gt;</summary>
		<author><name>Mwithheld</name></author>
	</entry>
</feed>