<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dmonllao</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Dmonllao"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Dmonllao"/>
	<updated>2026-04-20T04:50:55Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136442</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136442"/>
		<updated>2020-01-15T03:51:03Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* AWS serverless service */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==2.3.*&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
* Set these environment variables below to setup the S3 access:&lt;br /&gt;
** MOODLE_MLBACKEND_PYTHON_S3_BUCKET_NAME to the bucket name&lt;br /&gt;
**AWS_ACCESS_KEY_ID as usual&lt;br /&gt;
** AWS_SECRET_ACCESS_KEY as usual&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136441</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136441"/>
		<updated>2020-01-15T03:49:41Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* New server in your infrastructure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==2.3.*&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
* Set MOODLE_MLBACKEND_PYTHON_DIR to the path you want to use to store the data generated by the package&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136440</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136440"/>
		<updated>2020-01-15T03:48:52Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Docker */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==2.3.*&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
* Use MOODLE_MLBACKEND_PYTHON_USERS environment var to set a list of users and password (comma-separated). The value is &#039;default:sshhhh&#039; (user: default, password: sshhhh).&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136439</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136439"/>
		<updated>2020-01-15T03:43:48Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Docker */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==2.3.*&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/r/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the python moodlemlbackend package working.&lt;br /&gt;
&lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_analytics&amp;diff=136319</id>
		<title>Using analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_analytics&amp;diff=136319"/>
		<updated>2020-01-02T04:14:36Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Evaluating models */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
== Overview ==&lt;br /&gt;
The Moodle Learning Analytics API is an open system that can become the basis for a very wide variety of models. Models can contain indicators (a.k.a. predictors), targets (the outcome we are trying to predict), insights (the predictions themselves), notifications (messages sent as a result of insights), and actions (offered to recipients of messages, which can become indicators in turn). &lt;br /&gt;
&lt;br /&gt;
[[File:learning_analytics_components.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Most learning analytics models are not enabled by default. Enabling models for use should be done after considering the institutional goals the models are meant to support.  When selecting or creating an analytics model, the following steps are important:&lt;br /&gt;
&lt;br /&gt;
* What outcome do we want to predict? Or what process do we want to detect? (Positive or negative)&lt;br /&gt;
* How will we detect that outcome/process?&lt;br /&gt;
* What clues do we think might help us predict that outcome/process?&lt;br /&gt;
* What should we do if the outcome/process is very likely? Very unlikely?&lt;br /&gt;
* Who should be notified? What kind of notification should be sent?&lt;br /&gt;
* What opportunities for action should be provided on notification?&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once, even within the same course. This can be used for A/B testing to compare the performance and accuracy of multiple models. &lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics supports two types of models. &lt;br /&gt;
* &#039;&#039;&#039;Machine-learning&#039;&#039;&#039; based models, including predictive models, make use of AI models trained using site history to detect or predict hidden aspects of the learning process. &lt;br /&gt;
* &amp;quot;&#039;&#039;&#039;Static&#039;&#039;&#039;&amp;quot; models use a simpler, rule-based system of detecting circumstances on the Moodle site and notifying selected users. &lt;br /&gt;
&lt;br /&gt;
Moodle core ships with three models, &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; and the static models &#039;&#039;Upcoming activities due&#039;&#039; and &#039;&#039;No teaching.&#039;&#039; Additional prediction models can be created by using the [[dev:Analytics API| Analytics API]] or by using the new web UI. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can view and manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:manage_models.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Existing models ==&lt;br /&gt;
Moodle core ships with three models, [[Students at risk of dropping out]] and the static models Upcoming activities due and No teaching. Other models can be added to your system by installing plugins or by using the web UI (see below). Existing models can be examined and altered from the &amp;quot;Analytics models&amp;quot; page in Site administration:&lt;br /&gt;
[[File:analytics_models.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on an existing model:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Get predictions&#039;&#039;&#039; Train machine learning algorithms with the new data available on the system and get predictions for ongoing courses. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;View Insights&#039;&#039;&#039; Once you have trained a machine learning algorithm with the data available on the system, you will see insights (predictions) here for each &amp;quot;analysable.&amp;quot; In the included model &amp;quot;[[Students at risk of dropping out]], insights may be selected per course. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Evaluate&#039;&#039;&#039; This is a resource-intensive process, and will not be visible when sites have the &amp;quot;onlycli&amp;quot; setting checked (default). See [https://docs.moodle.org/en/Using_analytics#Triggering_model_evaluation Evaluating models] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Log&#039;&#039;&#039; View previous evaluation logs, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curve graphs, the tensorboard log dir or the model&#039;s Matthews correlation coefficient. The information available will depend on the machine learning backend in use. [[File:log_info.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Edit&#039;&#039;&#039; You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Enable / Disable&#039;&#039;&#039; This allows the model to run training and prediction processes. The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Export&#039;&#039;&#039; Export your site training data to share it with your partner institutions or to use it on a new site. The Export action for models allows you to generate a csv file containing model data about indicators and weights, without exposing any of your site-specific data. We will be asking for submissions of these model files to help evaluate the value of models on different kinds of sites. Please see the [https://moodle.org/project_inspire Learning Analytics community] for more information.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Invalid site elements&#039;&#039;&#039; Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Clear predictions&#039;&#039;&#039; Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
[[Students at risk of dropping out|This model]] predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. In this model, the definition of &amp;quot;dropping out&amp;quot; is &amp;quot;no student activity in the final quarter of the course.&amp;quot; The prediction model uses the [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry] model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out#Cognitive depth|Cognitive presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Social Breadth|Social presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Potential indicator levels for selected activity modules|Teacher presence]]&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyse and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success in exact duplicates of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the [[Students at risk of dropping out#Indicators|indicator]] set (see below). Courses which do not include several core Moodle activities per “time slice” (depending on the time splitting method) will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/guess_course_start_and_end.php &lt;br /&gt;
&lt;br /&gt;
This script attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
&lt;br /&gt;
==== Upcoming activities due ====&lt;br /&gt;
&lt;br /&gt;
The static “upcoming activities due” model checks for activities with upcoming due dates and outputs to the user’s calendar page.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
This model&#039;s insights will inform site managers of which courses with an upcoming start date will not have teaching activity. This is a simple &amp;quot;static&amp;quot; model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions, e.g. there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Creating and editing models ==&lt;br /&gt;
&lt;br /&gt;
New machine learning models can be created by using the Analytics API, by importing an exported model from another site, or by using the new web UI. [[File:new_model.png|thumb]] If you delete a &amp;quot;default&amp;quot; model (shipped with Moodle core) you can restore it from the Create menu. (Note: &amp;quot;static&amp;quot; models cannot be created using the web UI at this time.)&lt;br /&gt;
&lt;br /&gt;
There are four components of a model that can be defined through the web UI:&lt;br /&gt;
&lt;br /&gt;
=== Target ===&lt;br /&gt;
[[File:create_model_2.png|thumb]]Targets represent a “known good”-- something about which we have very strong evidence of value. Targets must be designed carefully to align with the [[Curriculum theory|curriculum priorities]] of the institution.  Each model has a single target. The “Analyser” (context in which targets will be evaluated) is automatically controlled by the Target selection. See [[Learning analytics targets]] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Indicators ===&lt;br /&gt;
Indicators are data points that may help to predict targets. We are free to add many indicators to a model to find out if they predict a target-- the only limit is that the data must be available within Moodle and must have a connection to the context of the model (e.g. the user, the course, etc.). The machine learning “training” process will determine how much weight to give to each indicator in the model.&lt;br /&gt;
&lt;br /&gt;
We do want to make sure any indicators we include in a production model have a clear purpose and can be interpreted by participants, especially if they are used to make prescriptive or diagnostic decisions.&lt;br /&gt;
&lt;br /&gt;
Indicators are constructed from data, but the data points need to be processed to make consistent, reusable indicators. In many cases, events are counted or combined in some way, though other ways of defining indicators are possible and will be discussed later. How the data points are processed involves important assumptions that affect the indicators. In particular, indicators can be absolute, meaning that the value of the indicator stays the same no matter what other samples are in the context, or relative, meaning that the indicator compares the sample to others in the context.&lt;br /&gt;
&lt;br /&gt;
See [[Learning analytics indicators]] for more information.&lt;br /&gt;
&lt;br /&gt;
[[File:indicators.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
[[File:analysis_intervals.png|thumb]]Analysis intervals control how often the model will run to generate insights, and how much information will be included in each generation cycle. The two analysis intervals enabled by default for selection are “Quarters” and “Quarters accumulative.” Both options will cause models to execute four times-- after the first, second, third and fourth quarters of the course (the final execution is used to evaluate the accuracy of the predictions against the actual outcome). The difference lies in how much information will be included. “Quarters” will only include information from the most recent quarter of the course in its predictions. “Quarters accumulative” will include the most recent quarter and all previous quarters, and tends to generate more accurate predictions (though it can take more time and memory to execute). Moodle Learning Analytics also includes “Tenths” and “Tenths accumulative” options in Core, if you choose to enable them from the Analytics Settings panel. These generate predictions more frequently.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Single range&#039;&#039;&#039; indicates that predictions will be made once, but will take into account a range of time, e.g. one prediction at the end of a course. The prediction is made at the end of the range.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Upcoming...&#039;&#039;&#039; indicates that the model generates an insight based on a snapshot of data at a given moment, e.g. the &amp;quot;no teaching&amp;quot; model looks to see if there are currently any teachers or students assigned to a course one week before the start of the term, and issues one insight warning the site administrator that no teaching is likely to occur in that empty course.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;All previous...&#039;&#039;&#039; (formerly &amp;quot;accumulative&amp;quot;) and &#039;&#039;&#039;Last...&#039;&#039;&#039; methods differ in how much data is included in the prediction. Both &amp;quot;All previous quarters&amp;quot; and &amp;quot;Last quarter&amp;quot; predictions are made at the end of each quarter of a time span (e.g. a course), but in &amp;quot;Last quarter,&amp;quot; only the information from the most recent quarter is included in the prediction, whereas in &amp;quot;All previous quarters&amp;quot; all information up to the present is included in the prediction.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Single range&#039;&#039;&#039; and &#039;&#039;&#039;No time splitting&#039;&#039;&#039; methods do not have time constraints. They run during the next scheduled task execution, although models apply different restrictions (e.g. require that a course is finished to use it for training or some data in the course and students to use it to get predictions...). &#039;Single range&#039; and &#039;No splitting&#039; are not appropriate for students at risk of dropping out of courses. They are intended to be used in models like &#039;No teaching&#039; or &#039;Spammer user&#039; that are designed to make only one prediction per eligible sample. To explain this with an example: &#039;No teaching&#039; model uses &#039;Single range&#039; analysis interval; the target class (the main PHP class of a model) only accepts courses that will start during the next week. Once we provide a &#039;No teaching&#039; insight for a course we won&#039;t provide any further &#039;No teaching&#039; insights for that course. &lt;br /&gt;
&lt;br /&gt;
The difference between &#039;Single range&#039; and &#039;No splitting&#039; is that models analysed using &#039;Single range&#039; will be limited to the analysable elements (the course in students at risk model) start and end dates, while &#039;No splitting&#039; do not have any time contraints and all data available in the system is used to calculate the indicators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Although the examples above refer to courses, analysis intervals can be used on any analysable element. For example, enrolments can have start and end dates, so an analysis interval could be applied to generate predictions about aspects of an enrollment. For analysable elements with no start and end dates, different analysis intervals would be needed. For example, a &amp;quot;weekly&amp;quot; analysis interval could be applied to a model intended to predict whether a user is likely to log in to the system in the future, on the basis of activity in the previous week.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
This setting controls which machine learning backend and algorithm will be used to estimate the model. Moodle currently supports two predictions processors:&lt;br /&gt;
&lt;br /&gt;
* PHP machine learning backend - implements logistic regression using php-ml (contributed by Moodle)&lt;br /&gt;
* Python machine learning backend - implements single hidden layer feed-forward neural network using TensorFlow.&lt;br /&gt;
&lt;br /&gt;
You can only choose from the predictions processors enabled on your site.&lt;br /&gt;
&lt;br /&gt;
[[File:regression.png|thumb]]&lt;br /&gt;
[[File:ffnn.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
Each prediction processor may support multiple algorithms in the future.&lt;br /&gt;
&lt;br /&gt;
=== Changing the model name ===&lt;br /&gt;
The model name is used to identify insights generated by the model, and by default, is the same as the Target name. You can edit this by clicking the &amp;quot;pencil&amp;quot; icon next to the model name in the list of models:&lt;br /&gt;
&lt;br /&gt;
[[File:edit_model_name.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Training models ==&lt;br /&gt;
Machine-learning based models require a training process using previous data from the site. &amp;quot;Static&amp;quot; models make use of sets of pre-defined rules, and do not need to be trained.  &lt;br /&gt;
&lt;br /&gt;
There are two main categories of machine-learning based analytics models: &#039;&#039;&#039;supervised&#039;&#039;&#039; and &#039;&#039;&#039;unsupervised&#039;&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
* Supervised models must be trained by using a data set with the target values already identified. For example, if the model will predict course completion, the model must be trained on a set of courses and enrollments with known completion status.&lt;br /&gt;
* Unsupervised models look for patterns in existing data, e.g. grouping students based on similarities in their behavior in courses. &lt;br /&gt;
&lt;br /&gt;
At the present time, Moodle Learning Analytics only supports supervised models.&lt;br /&gt;
&lt;br /&gt;
While we hope to include pre-trained models with the Moodle core installation in the future, at the current time we do not have large enough data sets to train a model for external use. (If you would like to help contribute data for this effort, please see the [https://moodle.org/course/view.php?id=17233&amp;amp;section=6 Moodle Learning Analytics Working Group].)&lt;br /&gt;
&lt;br /&gt;
=== Training data ===&lt;br /&gt;
The model code includes criteria for &amp;quot;training&amp;quot; and &amp;quot;prediction&amp;quot; data sets. For example, only courses with enrolled students and an end date in the past can be used to train the [[Students at risk of dropping out]] model, because it is impossible to determine whether a student dropped out until a course has ended. On the other hand, for this model to make predictions, there must be a course with students enrolled that has started, but not yet ended.&lt;br /&gt;
&lt;br /&gt;
The training set is defined in the php code for the Target. Models can only be trained if a site contains enough data matching the training criteria. Most models will require Moodle log data for the time period covering the events being analysed. For example, the [[Students at risk of dropping out]] model can only be trained if there is log data covering student activity in the courses that meet the training criteria. It is possible to train a model on an &amp;quot;archive&amp;quot; system and then use the model on a production system.&lt;br /&gt;
&lt;br /&gt;
== Evaluating models ==&lt;br /&gt;
&lt;br /&gt;
[[File:model_menu_evaluate.png|thumb]]This is a &#039;&#039;&#039;manual&#039;&#039;&#039;, resource-intensive process, and will not be visible from the Web UI when sites have the &amp;quot;onlycli&amp;quot; setting checked (default). &lt;br /&gt;
&lt;br /&gt;
This process can be executed independently of enabling or training the model, and causes Moodle to assemble the training data available on the site, calculate all the indicators and the target and pass the resulting dataset to machine learning backends. This process will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process uses all information available on the site, even if it is very old. Because of this, the accuracy returned by the evaluation process may be lower than the real model accuracy as indicators are more reliably calculated immediately after training data is available because the site state changes over time. The metric used to describe accuracy is a weighted &#039;&#039;[https://en.wikipedia.org/wiki/F1_score F1 score]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;We recommend that all machine-learning models be evaluated before being enabled on a production site.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
To force the model evaluation process to run from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/evaluate_model.php&lt;br /&gt;
Use the --help option to see parameters.&lt;br /&gt;
&lt;br /&gt;
If you are connecting to your Moodle server remotely, you will probably want to run the process in the background and detach it, so it will continue to run if you log out of your session (or your connection times out). Here is an example on Linux using bash:&lt;br /&gt;
&lt;br /&gt;
 # php evaluate_model.php --modelid=4 --analysisinterval=&#039;\core\analytics\time_splitting\deciles_accum&#039; &amp;gt; eval.log &amp;amp;&lt;br /&gt;
 # jobs&lt;br /&gt;
 [1]+  Running                 php evaluate_model.php --modelid=4 --analysisinterval=&#039;\core\analytics\time_splitting\deciles_accum&#039; &amp;gt; eval.log &amp;amp;&lt;br /&gt;
 # disown -h %1&lt;br /&gt;
&lt;br /&gt;
This will allow the process to continue to run after the remote shell disconnects. See the documentation for your OS and shell for more details.&lt;br /&gt;
&lt;br /&gt;
On small sites, you can uncheck &amp;quot;onlycli&amp;quot; in the Analytics settings page, and you can then evaluate models from the Analytics models page. However, this is not feasible with production sites.&lt;br /&gt;
&lt;br /&gt;
=== Review evaluation results ===&lt;br /&gt;
[[File:model_menu_log.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
You can review the results of the model training process by accessing the evaluation log.[[File:model_log.png|thumb]]&lt;br /&gt;
[[File:log_info.png|thumb]]&lt;br /&gt;
Check for warnings about evaluation completion, model accuracy, and model variability.&lt;br /&gt;
&lt;br /&gt;
[[File:invalid_site_elements.png|thumb]]&lt;br /&gt;
You can also check the &#039;&#039;invalid site elements&#039;&#039; list to verify which site elements were included or excluded in the analysis. If you see a large number of unexpected elements in this report, it may mean that you need to check your data. For example, if courses don&#039;t have appropriate start and end dates set, or enrolment data has been purged, the system may not be able to include data from those courses in the model training process.&lt;br /&gt;
&lt;br /&gt;
== Exporting and Importing models ==&lt;br /&gt;
Models can also be exported from one site and imported to another. [[File:export_menu.png|thumb]] &lt;br /&gt;
=== Exporting models ===&lt;br /&gt;
You can export the data used to train the model, or the model configuration and the weights of the trained model. [[File:export_dialogue.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: the model weights are completely anonymous, containing no personally identifiable data! This means it is safe to share them with researchers without worrying about privacy regulations.&lt;br /&gt;
&lt;br /&gt;
=== Importing models ===&lt;br /&gt;
When a model is imported with weights, the site administrator has the option to evaluate the trained model using site data, or to evaluate the model configuration by re-training it using the current site data. [[File:import_model.png|thumb]][[File:evaluate_model.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Uso de analítica]]&lt;br /&gt;
[[de:Analytics nutzen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136228</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136228"/>
		<updated>2019-12-16T08:53:55Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Installed in the web server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install &amp;quot;moodlemlbackend==2.3.*&amp;quot;&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/repository/docker/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the package working. &lt;br /&gt;
  &lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136227</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=136227"/>
		<updated>2019-12-16T08:50:22Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Predictions processor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
&lt;br /&gt;
{{New features}}Analytics may be disabled from Site administration / Advanced features&lt;br /&gt;
&lt;br /&gt;
They may then be configured from Site administration / Analytics. &lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
==== PHP predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
&lt;br /&gt;
==== Python predictions processor ====&lt;br /&gt;
&lt;br /&gt;
The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The package can be installed in the web server (in all the codes if in a clustered environment) or in a separate server.&lt;br /&gt;
&lt;br /&gt;
===== Installed in the web server ===== &lt;br /&gt;
&lt;br /&gt;
The latest version of the package for &#039;&#039;&#039;Moodle 3.8&#039;&#039;&#039; is compatible with &#039;&#039;&#039;Python 3.4, 3.5, 3.6 and 3.7&#039;&#039;&#039;. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
# If necessary, install Python 3 (and pip for Python 3)&lt;br /&gt;
# Ensure that you use Python 3 to install the moodlemlbackend package:&lt;br /&gt;
&lt;br /&gt;
    sudo -H python3 -m pip install moodlemlbackend&lt;br /&gt;
# You must also enter the path to the Python 3 executable in Site administration -&amp;gt; Server -&amp;gt; System paths:&lt;br /&gt;
[[File:path_to_python_3.png|frame|center|Enter system path for Python 3]]&lt;br /&gt;
&lt;br /&gt;
===== Installed in a separate server =====&lt;br /&gt;
&lt;br /&gt;
To install the python package in a separate server instead of installing it on the web server/s have some advantages:&lt;br /&gt;
* Keeps the python ML backend as an external service&lt;br /&gt;
* To keep a separated control of the resources the web server/s dedicate to serving Moodle and the resources dedicated to the python ML backend&lt;br /&gt;
* You can reuse the same ML server for multiple Moodle sites. Easier to setup and maintain than to install/upgrade the python package in all nodes in the cluster&lt;br /&gt;
* You can install the package as a new docker container in your dockerized environment&lt;br /&gt;
* You can serve the ML backend from AWS through the API gateway and AWS lambda, storing the trained model files in S3&lt;br /&gt;
&lt;br /&gt;
On the other hand, it is expected that there can be some added latency in connecting to the python ML backend server.&lt;br /&gt;
&lt;br /&gt;
The python backend is exposed as a Flask application. The Flask application is part of the official &#039;moodlemlbackend&#039; Python package and its FLASK_APP script is &#039;webapp&#039;, in the root of the package. You are free to use the setup that better suits your existing infrastructure.&lt;br /&gt;
&lt;br /&gt;
====== New server in your infrastructure ======&lt;br /&gt;
&lt;br /&gt;
The python ML backend is exposed as a Flask application, which uses a WSGI server (https://wsgi.readthedocs.io/en/latest/what.html) to be exposed to the www. The official documentation on how to deploy a Flask app can be found in https://flask.palletsprojects.com/en/1.0.x/tutorial/deploy/.&lt;br /&gt;
&lt;br /&gt;
====== Docker ======&lt;br /&gt;
&lt;br /&gt;
https://hub.docker.com/repository/docker/moodlehq/moodle-mlbackend-python is the official moodle-mlbackend-python docker image. We use it internally at Moodle HQ for internal testing and you can use it as well. You may want more control over the image, if that is the case https://github.com/moodlehq/moodle-docker-mlbackend-python/blob/master/Dockerfile can serve as an example of what is needed to get the package working. &lt;br /&gt;
  &lt;br /&gt;
====== AWS serverless service ======&lt;br /&gt;
&lt;br /&gt;
You can serve the Flask application as a serverless application using the AWS API gateway and AWS lambda. The easiest way to do it is using Zappa https://github.com/Miserlou/Zappa to deploy the Flask application contained in the python ML package.&lt;br /&gt;
&lt;br /&gt;
Once this has been done, you can select the Python prediction processor as the default or for an individual model:&lt;br /&gt;
[[File:python_backend.png|frame|center|Predictions processor default]]&lt;br /&gt;
&lt;br /&gt;
[[File:python_backend_at_model.png|frame|center|Predictions processor selection for an individual model]]&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
Several analysis intervals are available for models in the system. In this setting, the analysis intervals that will be used [[Using_analytics#Evaluating_models|to evaluate models]] are defined, e.g. so the best analysis interval identified by the evaluation process can be selected for the model. This setting does not restrict the analysis intervals that can be used for specific models.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=135129</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=135129"/>
		<updated>2019-08-26T07:53:32Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Predictions processor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
{{New features}}&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
[[File:configure_settings.png|thumb]] The settings for the Moodle Learning Analytics system are set to reasonable defaults, but let’s review them. To configure and enable Moodle Learning Analytics settings, access the Analytics settings panel under Site Administration/Analytics.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The latest version of the package for Moodle 3.7 is compatible with python 2.7 and python 3.4. Note that the package should be available for both the Command Line Interface (CLI) user and the user who runs the web server (e.g. www-data).&lt;br /&gt;
&lt;br /&gt;
    pip install &amp;quot;moodlemlbackend&amp;gt;=1.0.0,&amp;lt;2.0.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Defining roles ==&lt;br /&gt;
&lt;br /&gt;
Moodle learning analytics makes use of a number of capabilities. These can be added or removed from roles at the site level or within certain contexts to customise who can view insights.&lt;br /&gt;
&lt;br /&gt;
To receive notifications and view insights, a user must have the [[Capabilities/moodle/analytics:listinsights|analytics:listinsights]] capability within the context used as the &amp;quot;Analysable&amp;quot; for the model. For example, the [[Students at risk of dropping out]] model operates within the context of a course. Insights will be generated for each enrolment within any course matching the criteria of the model (courses with a start date in the past and an end date in the future, with at least one teacher and student), and these insights will be sent to anyone with the listinsights capability in that course. By default, the roles of [[Teacher role|Teacher]], [[Non-editing teacher role|Non-editing teacher]], and [[Manager role|Manager]] have this capability.&lt;br /&gt;
&lt;br /&gt;
Some models (e.g. the &#039;&#039;No teaching&#039;&#039; model) generate insights at the Site level. To receive insights from these models, the user must have a role assignment at the System level which includes the listinsights capability. By default, this is included in the [[Manager role]] if assigned at the site level.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Site administrators do &#039;&#039;&#039;not&#039;&#039;&#039; automatically receive insight notifications, though they can choose to view details of any insight notifications on the system. To enable site administrators to receive notifications of insights, assign an additional role that includes the listinsights capability to the site administrator at the system level (e.g. the [[Manager role]]).&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;br /&gt;
[[de:Analytics-Einstellungen]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=134740</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=134740"/>
		<updated>2019-07-10T11:35:10Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Predictions processor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
{{New features}}&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
[[File:configure_settings.png|thumb]] The settings for the Moodle Learning Analytics system are set to reasonable defaults, but let’s review them. To configure and enable Moodle Learning Analytics settings, access the Analytics settings panel under Site Administration/Analytics.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package. The latest version of the package for Moodle 3.7 is compatible with python 2.7 and python 3.4.&lt;br /&gt;
&lt;br /&gt;
    pip install &amp;quot;moodlemlbackend&amp;gt;=1.0.0,&amp;lt;2.0.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=134739</id>
		<title>Analytics settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics_settings&amp;diff=134739"/>
		<updated>2019-07-10T11:33:19Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Predictions processor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Learning analytics}}&lt;br /&gt;
The Moodle learning analytics system requires some initial configuration before it can be used. You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Site information ==&lt;br /&gt;
{{New features}}&lt;br /&gt;
Site information will be used to help learning analytics models take characteristics of the institution into account. This information is also reported as part of site data collection when you register your site. This will allow HQ to understand which areas in learning analytics are seeing the most use and prioritize development resources appropriately.&lt;br /&gt;
&lt;br /&gt;
== Configure learning analytics settings ==&lt;br /&gt;
[[File:configure_settings.png|thumb]] The settings for the Moodle Learning Analytics system are set to reasonable defaults, but let’s review them. To configure and enable Moodle Learning Analytics settings, access the Analytics settings panel under Site Administration/Analytics.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install &amp;quot;moodlemlbackend&amp;gt;=1.0.0,&amp;lt;2.0.0&amp;quot;&lt;br /&gt;
&lt;br /&gt;
=== Log store ===&lt;br /&gt;
From Moodle version 2.7 and up, the “Standard logstore” is the default. If for some reason you also have data in the older “legacy logs,” you can enable the Moodle Learning Analytics system to access them instead.&lt;br /&gt;
&lt;br /&gt;
=== Analysis intervals ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Analysis intervals]] determine how often insights will be generated, and how much information to use for each calculation. Using proportional analysis intervals allows courses of different lengths to be used to train a single model.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Analysis intervals]]&lt;br /&gt;
&lt;br /&gt;
Each analysis interval divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the analysis intervals you are interested in using; the evaluation process will iterate through all enabled analysis intervals, so the more analysis intervals enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
=== Models output directory ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuraciones de analítica]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=133076</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=133076"/>
		<updated>2019-01-29T20:26:50Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Model management */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/MS1IqKsrXAI | desc = Analytics overview}}&lt;br /&gt;
&lt;br /&gt;
Beginning in version 3.4, Moodle core now implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
In Moodle 3.4, this system ships with two built-in models:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out]]&lt;br /&gt;
* No teaching activity&lt;br /&gt;
&lt;br /&gt;
The system can be easily extended with new custom models, based on reusable targets, indicators, and other components. For more information, see the [[dev:Analytics API| Analytics API]] developer documentation.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* Two built-in prediction models: &amp;quot;[[Students at risk of dropping out]]&amp;quot; and &amp;quot;No Teaching&amp;quot;.&lt;br /&gt;
* A set of student engagement indicators based on the  [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry].&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An [[dev:Analytics API|  API]] to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
This release of Moodle Learning Analytics has the following limitations:&lt;br /&gt;
&lt;br /&gt;
* Models included in this release must be &amp;quot;trained&amp;quot; on a site with previous completed courses, ideally using the Moodle course completion feature. The current models cannot make predictions on a site until this is done.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Moodle Learning Analytics, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the [https://moodle.org/project_inspire Moodle Learning Analytics Community]. In particular, we still need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Time splitting methods]] allow insights generated from one course to be used on another course, even if the two courses are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
Each time splitting method divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the time splitting methods you are interested in using; the evaluation process will iterate through all enabled time-spitting methods, so the more time-splitting methods enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Single range&amp;quot; indicates that predictions will be made once, but will take into account a range of time, e.g. one prediction at the end of a course. The prediction is made at the end of the range.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;No splitting&amp;quot; indicates that the model generates an insight based on a snapshot of data at a given moment, e.g. the &amp;quot;no teaching&amp;quot; model looks to see if there are currently any teachers or students assigned to a course at a defined point before the start of the term, and issues one insight warning the site administrator that no teaching is likely to occur in that empty course.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Accumulative&amp;quot; methods differ in how much data is included in the prediction. Both &amp;quot;quarterly&amp;quot; and &amp;quot;quarterly accumulative&amp;quot; predictions are made at the end of each quarter of a time span (e.g. a course), but in &amp;quot;quarterly,&amp;quot; only the information from the most recent quarter is included in the prediction, whereas in &amp;quot;quarterly accumulative&amp;quot; all information up to the present is included in the prediction.&lt;br /&gt;
&lt;br /&gt;
Single range and no splitting methods do not have time constraints. They run during the next scheduled task execution, although models apply different restrictions (e.g. require that a course is finished to use it for training or some data in the course and students to use it to get predictions...). &#039;Single range&#039; and &#039;No splitting&#039; are not appropriate for students at risk of dropping out of courses. They are intended to be used in models like &#039;No teaching&#039; or &#039;Spammer user&#039; where you just want one prediction and done. To explain this with an example: &#039;No teaching&#039; model uses &#039;Single range&#039; time splitting method; the target class (the main PHP class of a model) only accepts courses that will start during the next week. Once we provide &#039;No teaching&#039; insights for a course we don&#039;t provide them anymore. &lt;br /&gt;
&lt;br /&gt;
The difference between &#039;Single range&#039; and &#039;No splitting&#039; is that models analysed using &#039;Single range&#039; will be limited to the analysable elements (the course in students at risk model) start and end dates, while &#039;No splitting&#039; do not have any time contraints and all data available in the system is used to calculate the indicators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Although the examples above refer to courses, time splitting methods can be used on any analysable element. For example, enrolments can have start and end dates, so a time splitting method could be applied to generate predictions about aspects of an enrollment. For analysable elements with no start and end dates, different time splitting methods would be needed. For example, a &amp;quot;weekly&amp;quot; time splitting method could be applied to a model intended to predict whether a user is likely to log in to the system in the future, on the basis of activity in the previous week.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
===Scheduled tasks===&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Model management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once, even within the same course. This can be used for A/B testing to compare the performance and accuracy of multiple models. &lt;br /&gt;
&lt;br /&gt;
Moodle core ships with two prediction models, &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; and &#039;&#039;No teaching.&#039;&#039; Additional prediction models can be created by using the [[dev:Analytics API| Analytics API]]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
=== View Insights ===&lt;br /&gt;
Once you have trained a machine learning algorithm with the data available on the system, you will see insights (predictions) here for each &amp;quot;analysable.&amp;quot; In the included model &amp;quot;[[Students at risk of dropping out]], insights may be selected per course. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Evaluate ===&lt;br /&gt;
Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends. This process will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process uses all information available on the site, even if it is very old. Because of this, the accuracy returned by the evaluation process may be lower than the real model accuracy as indicators are more reliably calculated immediately after training data is available because the site state changes over time. The metric used to describe accuracy is the &#039;&#039;[https://en.wikipedia.org/wiki/Matthews_correlation_coefficient Matthews correlation coefficient]&#039;&#039; (a metric used in machine learning for evaluating binary classifications)&lt;br /&gt;
&lt;br /&gt;
You can force the model evaluation process to run from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/evaluate_model.php&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Log ===&lt;br /&gt;
View previous evaluation logs, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curve graphs, the tensorboard log dir or the model&#039;s Matthews correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
&lt;br /&gt;
=== Edit ===&lt;br /&gt;
You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
&lt;br /&gt;
=== Enable / Disable ===&lt;br /&gt;
The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
Export your site training data to share it with your partner institutions or to use it on a new site. The Export action for models allows you to generate a csv file containing model data about indicators and weights, without exposing any of your site-specific data. We will be asking for submissions of these model files to help evaluate the value of models on different kinds of sites. Please see the [https://moodle.org/project_inspire Learning Analytics community] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Invalid site elements ===&lt;br /&gt;
Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
=== Clear predictions ===&lt;br /&gt;
Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
[[Students at risk of dropping out|This model]] predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. In this model, the definition of &amp;quot;dropping out&amp;quot; is &amp;quot;no student activity in the final quarter of the course.&amp;quot; The prediction model uses the [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry] model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out#Cognitive depth|Cognitive presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Social Breadth|Social presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Potential indicator levels for selected activity modules|Teacher presence]]&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyse and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success in exact duplicates of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the [[Students at risk of dropping out#Indicators|indicator]] set (see below). Courses which do not include several core Moodle activities per “time slice” (depending on the time splitting method) will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/guess_course_start_and_end.php &lt;br /&gt;
&lt;br /&gt;
This script attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model&#039;s insights will inform site managers of which courses with an upcoming start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions, e.g. there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different points in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate [[dev:Analytics API#Insights|insights]] and which predictions will be ignored. For example, the &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; prediction model does not generate an insight if a student is predicted as &amp;quot;not at risk,&amp;quot; since the primary interest is which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Users can specify how they wish to receive insights notifications, or turn them off, via their User menu &amp;gt; Preferences &amp;gt; Notification preferences.&lt;br /&gt;
&lt;br /&gt;
=== Actions===&lt;br /&gt;
&lt;br /&gt;
Each insight can have one or more actions defined. Actions provide a way to act on the insight as it is read. These actions may include a way to send a message to another user, a link to a report providing information about the sample the prediction has been generated for (e.g. a report for an existing student), or a way to view the details of the model prediction.&lt;br /&gt;
&lt;br /&gt;
[[Image:08_insights.png|frame|center|Insights and Actions]]&lt;br /&gt;
&lt;br /&gt;
Insights can also offer two important general actions that are applicable to all insights. First, the user can acknowledge the insight. This removes that particular prediction from the view of the user, e.g. a notification about a particular student at risk is removed from the display.&lt;br /&gt;
&lt;br /&gt;
The second general action is to mark the insight as &amp;quot;Not useful.&amp;quot; This also removes the insight associated with this calculation from the display, but the model is adjusted to make this prediction less likely in the future.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Frequently Asked Questions==&lt;br /&gt;
[[Moodle Learning Analytics FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Analítica]]&lt;br /&gt;
[[de:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=133075</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=133075"/>
		<updated>2019-01-29T20:09:45Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Evaluate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/MS1IqKsrXAI | desc = Analytics overview}}&lt;br /&gt;
&lt;br /&gt;
Beginning in version 3.4, Moodle core now implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
In Moodle 3.4, this system ships with two built-in models:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out]]&lt;br /&gt;
* No teaching activity&lt;br /&gt;
&lt;br /&gt;
The system can be easily extended with new custom models, based on reusable targets, indicators, and other components. For more information, see the [[dev:Analytics API| Analytics API]] developer documentation.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* Two built-in prediction models: &amp;quot;[[Students at risk of dropping out]]&amp;quot; and &amp;quot;No Teaching&amp;quot;.&lt;br /&gt;
* A set of student engagement indicators based on the  [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry].&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An [[dev:Analytics API|  API]] to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
This release of Moodle Learning Analytics has the following limitations:&lt;br /&gt;
&lt;br /&gt;
* Models included in this release must be &amp;quot;trained&amp;quot; on a site with previous completed courses, ideally using the Moodle course completion feature. The current models cannot make predictions on a site until this is done.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Moodle Learning Analytics, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the [https://moodle.org/project_inspire Moodle Learning Analytics Community]. In particular, we still need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Time splitting methods]] allow insights generated from one course to be used on another course, even if the two courses are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
Each time splitting method divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the time splitting methods you are interested in using; the evaluation process will iterate through all enabled time-spitting methods, so the more time-splitting methods enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Single range&amp;quot; indicates that predictions will be made once, but will take into account a range of time, e.g. one prediction at the end of a course. The prediction is made at the end of the range.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;No splitting&amp;quot; indicates that the model generates an insight based on a snapshot of data at a given moment, e.g. the &amp;quot;no teaching&amp;quot; model looks to see if there are currently any teachers or students assigned to a course at a defined point before the start of the term, and issues one insight warning the site administrator that no teaching is likely to occur in that empty course.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Accumulative&amp;quot; methods differ in how much data is included in the prediction. Both &amp;quot;quarterly&amp;quot; and &amp;quot;quarterly accumulative&amp;quot; predictions are made at the end of each quarter of a time span (e.g. a course), but in &amp;quot;quarterly,&amp;quot; only the information from the most recent quarter is included in the prediction, whereas in &amp;quot;quarterly accumulative&amp;quot; all information up to the present is included in the prediction.&lt;br /&gt;
&lt;br /&gt;
Single range and no splitting methods do not have time constraints. They run during the next scheduled task execution, although models apply different restrictions (e.g. require that a course is finished to use it for training or some data in the course and students to use it to get predictions...). &#039;Single range&#039; and &#039;No splitting&#039; are not appropriate for students at risk of dropping out of courses. They are intended to be used in models like &#039;No teaching&#039; or &#039;Spammer user&#039; where you just want one prediction and done. To explain this with an example: &#039;No teaching&#039; model uses &#039;Single range&#039; time splitting method; the target class (the main PHP class of a model) only accepts courses that will start during the next week. Once we provide &#039;No teaching&#039; insights for a course we don&#039;t provide them anymore. &lt;br /&gt;
&lt;br /&gt;
The difference between &#039;Single range&#039; and &#039;No splitting&#039; is that models analysed using &#039;Single range&#039; will be limited to the analysable elements (the course in students at risk model) start and end dates, while &#039;No splitting&#039; do not have any time contraints and all data available in the system is used to calculate the indicators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Although the examples above refer to courses, time splitting methods can be used on any analysable element. For example, enrolments can have start and end dates, so a time splitting method could be applied to generate predictions about aspects of an enrollment. For analysable elements with no start and end dates, different time splitting methods would be needed. For example, a &amp;quot;weekly&amp;quot; time splitting method could be applied to a model intended to predict whether a user is likely to log in to the system in the future, on the basis of activity in the previous week.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
===Scheduled tasks===&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Model management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once, even within the same course. This can be used for A/B testing to compare the performance and accuracy of multiple models. &lt;br /&gt;
&lt;br /&gt;
Moodle core ships with two prediction models, &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; and &#039;&#039;No teaching.&#039;&#039; Additional prediction models can be created by using the [[dev:Analytics API| Analytics API]]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
=== View Insights ===&lt;br /&gt;
Once you have trained a machine learning algorithm with the data available on the system, you will see insights (predictions) here for each &amp;quot;analysable.&amp;quot; In the included model &amp;quot;[[Students at risk of dropping out]], insights may be selected per course. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Evaluate ===&lt;br /&gt;
Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends. This process will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process uses all information available on the site, even if it is very old. Because of this, the accuracy returned by the evaluation process may be lower than the real model accuracy as indicators are more reliably calculated immediately after training data is available because the site state changes over time. The metric used to describe accuracy is the &#039;&#039;[https://en.wikipedia.org/wiki/Matthews_correlation_coefficient Matthews correlation coefficient]&#039;&#039; (a metric used in machine learning for evaluating binary classifications)&lt;br /&gt;
&lt;br /&gt;
You can force the model evaluation process to run from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/evaluate_model.php&lt;br /&gt;
&lt;br /&gt;
=== Log ===&lt;br /&gt;
View previous evaluation logs, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curve graphs, the tensorboard log dir or the model&#039;s Matthews correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
&lt;br /&gt;
=== Edit ===&lt;br /&gt;
You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
&lt;br /&gt;
=== Enable / Disable ===&lt;br /&gt;
The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
Export your site training data to share it with your partner institutions or to use it on a new site. The Export action for models allows you to generate a csv file containing model data about indicators and weights, without exposing any of your site-specific data. We will be asking for submissions of these model files to help evaluate the value of models on different kinds of sites. Please see the [https://moodle.org/project_inspire Learning Analytics community] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Invalid site elements ===&lt;br /&gt;
Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
=== Clear predictions ===&lt;br /&gt;
Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
[[Students at risk of dropping out|This model]] predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. In this model, the definition of &amp;quot;dropping out&amp;quot; is &amp;quot;no student activity in the final quarter of the course.&amp;quot; The prediction model uses the [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry] model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out#Cognitive depth|Cognitive presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Social Breadth|Social presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Potential indicator levels for selected activity modules|Teacher presence]]&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyse and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success in exact duplicates of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the [[Students at risk of dropping out#Indicators|indicator]] set (see below). Courses which do not include several core Moodle activities per “time slice” (depending on the time splitting method) will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/guess_course_start_and_end.php &lt;br /&gt;
&lt;br /&gt;
This script attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model&#039;s insights will inform site managers of which courses with an upcoming start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions, e.g. there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different points in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate [[dev:Analytics API#Insights|insights]] and which predictions will be ignored. For example, the &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; prediction model does not generate an insight if a student is predicted as &amp;quot;not at risk,&amp;quot; since the primary interest is which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Users can specify how they wish to receive insights notifications, or turn them off, via their User menu &amp;gt; Preferences &amp;gt; Notification preferences.&lt;br /&gt;
&lt;br /&gt;
=== Actions===&lt;br /&gt;
&lt;br /&gt;
Each insight can have one or more actions defined. Actions provide a way to act on the insight as it is read. These actions may include a way to send a message to another user, a link to a report providing information about the sample the prediction has been generated for (e.g. a report for an existing student), or a way to view the details of the model prediction.&lt;br /&gt;
&lt;br /&gt;
[[Image:08_insights.png|frame|center|Insights and Actions]]&lt;br /&gt;
&lt;br /&gt;
Insights can also offer two important general actions that are applicable to all insights. First, the user can acknowledge the insight. This removes that particular prediction from the view of the user, e.g. a notification about a particular student at risk is removed from the display.&lt;br /&gt;
&lt;br /&gt;
The second general action is to mark the insight as &amp;quot;Not useful.&amp;quot; This also removes the insight associated with this calculation from the display, but the model is adjusted to make this prediction less likely in the future.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Frequently Asked Questions==&lt;br /&gt;
[[Moodle Learning Analytics FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Analítica]]&lt;br /&gt;
[[de:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=132959</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=132959"/>
		<updated>2019-01-14T17:41:03Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Models output directory */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/MS1IqKsrXAI | desc = Analytics overview}}&lt;br /&gt;
&lt;br /&gt;
Beginning in version 3.4, Moodle core now implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
In Moodle 3.4, this system ships with two built-in models:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out]]&lt;br /&gt;
* No teaching activity&lt;br /&gt;
&lt;br /&gt;
The system can be easily extended with new custom models, based on reusable targets, indicators, and other components. For more information, see the [[dev:Analytics API| Analytics API]] developer documentation.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* Two built-in prediction models: &amp;quot;[[Students at risk of dropping out]]&amp;quot; and &amp;quot;No Teaching&amp;quot;.&lt;br /&gt;
* A set of student engagement indicators based on the  [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry].&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An [[dev:Analytics API|  API]] to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
This release of Moodle Learning Analytics has the following limitations:&lt;br /&gt;
&lt;br /&gt;
* Models included in this release must be &amp;quot;trained&amp;quot; on a site with previous completed courses, ideally using the Moodle course completion feature. The current models cannot make predictions on a site until this is done.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Moodle Learning Analytics, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the [https://moodle.org/project_inspire Moodle Learning Analytics Community]. In particular, we still need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Time splitting methods]] allow insights generated from one course to be used on another course, even if the two courses are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
Each time splitting method divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the time splitting methods you are interested in using; the evaluation process will iterate through all enabled time-spitting methods, so the more time-splitting methods enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Single range&amp;quot; indicates that predictions will be made once, but will take into account a range of time, e.g. one prediction at the end of a course. The prediction is made at the end of the range.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;No splitting&amp;quot; indicates that the model generates an insight based on a snapshot of data at a given moment, e.g. the &amp;quot;no teaching&amp;quot; model looks to see if there are currently any teachers or students assigned to a course at a defined point before the start of the term, and issues one insight warning the site administrator that no teaching is likely to occur in that empty course.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Accumulative&amp;quot; methods differ in how much data is included in the prediction. Both &amp;quot;quarterly&amp;quot; and &amp;quot;quarterly accumulative&amp;quot; predictions are made at the end of each quarter of a time span (e.g. a course), but in &amp;quot;quarterly,&amp;quot; only the information from the most recent quarter is included in the prediction, whereas in &amp;quot;quarterly accumulative&amp;quot; all information up to the present is included in the prediction.&lt;br /&gt;
&lt;br /&gt;
Single range and no splitting methods do not have time constraints. They run during the next scheduled task execution, although models apply different restrictions (e.g. require that a course is finished to use it for training or some data in the course and students to use it to get predictions...). &#039;Single range&#039; and &#039;No splitting&#039; are not appropriate for students at risk of dropping out of courses. They are intended to be used in models like &#039;No teaching&#039; or &#039;Spammer user&#039; where you just want one prediction and done. To explain this with an example: &#039;No teaching&#039; model uses &#039;Single range&#039; time splitting method; the target class (the main PHP class of a model) only accepts courses that will start during the next week. Once we provide &#039;No teaching&#039; insights for a course we don&#039;t provide them anymore. &lt;br /&gt;
&lt;br /&gt;
The difference between &#039;Single range&#039; and &#039;No splitting&#039; is that models analysed using &#039;Single range&#039; will be limited to the analysable elements (the course in students at risk model) start and end dates, while &#039;No splitting&#039; do not have any time contraints and all data available in the system is used to calculate the indicators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Although the examples above refer to courses, time splitting methods can be used on any analysable element. For example, enrolments can have start and end dates, so a time splitting method could be applied to generate predictions about aspects of an enrollment. For analysable elements with no start and end dates, different time splitting methods would be needed. For example, a &amp;quot;weekly&amp;quot; time splitting method could be applied to a model intended to predict whether a user is likely to log in to the system in the future, on the basis of activity in the previous week.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server. This setting can be used by Moodle sites with multiple frontend nodes (a cluster) to specify a shared directory across nodes. This directory can be used by machine learning backends to store trained algorithms (its internal variables weights and stuff like that) to use them later to get predictions. Moodle cron lock will prevent multiple executions of the analytics tasks that train machine learning algorithms and get predictions from them.&lt;br /&gt;
&lt;br /&gt;
===Scheduled tasks===&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Model management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once, even within the same course. This can be used for A/B testing to compare the performance and accuracy of multiple models. &lt;br /&gt;
&lt;br /&gt;
Moodle core ships with two prediction models, &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; and &#039;&#039;No teaching.&#039;&#039; Additional prediction models can be created by using the [[dev:Analytics API| Analytics API]]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
=== View Insights ===&lt;br /&gt;
Once you have trained a machine learning algorithm with the data available on the system, you will see insights (predictions) here for each &amp;quot;analysable.&amp;quot; In the included model &amp;quot;[[Students at risk of dropping out]], insights may be selected per course. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Evaluate ===&lt;br /&gt;
(disabled by default) Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends. This process will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process uses all information available on the site, even if it is very old. Because of this, the accuracy returned by the evaluation process may be lower than the real model accuracy as indicators are more reliably calculated immediately after training data is available because the site state changes over time. The metric used to describe accuracy is the &#039;&#039;[https://en.wikipedia.org/wiki/Matthews_correlation_coefficient Matthews correlation coefficient]&#039;&#039; (a metric used in machine learning for evaluating binary classifications)&lt;br /&gt;
&lt;br /&gt;
You can force the model evaluation process to run from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/evaluate_model.php &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Log ===&lt;br /&gt;
View previous evaluation logs, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curve graphs, the tensorboard log dir or the model&#039;s Matthews correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
&lt;br /&gt;
=== Edit ===&lt;br /&gt;
You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
&lt;br /&gt;
=== Enable / Disable ===&lt;br /&gt;
The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
Export your site training data to share it with your partner institutions or to use it on a new site. The Export action for models allows you to generate a csv file containing model data about indicators and weights, without exposing any of your site-specific data. We will be asking for submissions of these model files to help evaluate the value of models on different kinds of sites. Please see the [https://moodle.org/project_inspire Learning Analytics community] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Invalid site elements ===&lt;br /&gt;
Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
=== Clear predictions ===&lt;br /&gt;
Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
[[Students at risk of dropping out|This model]] predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. In this model, the definition of &amp;quot;dropping out&amp;quot; is &amp;quot;no student activity in the final quarter of the course.&amp;quot; The prediction model uses the [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry] model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out#Cognitive depth|Cognitive presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Social Breadth|Social presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Potential indicator levels for selected activity modules|Teacher presence]]&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyse and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success in exact duplicates of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the [[Students at risk of dropping out#Indicators|indicator]] set (see below). Courses which do not include several core Moodle activities per “time slice” (depending on the time splitting method) will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/guess_course_start_and_end.php &lt;br /&gt;
&lt;br /&gt;
This script attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model&#039;s insights will inform site managers of which courses with an upcoming start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions, e.g. there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different points in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate [[dev:Analytics API#Insights|insights]] and which predictions will be ignored. For example, the &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; prediction model does not generate an insight if a student is predicted as &amp;quot;not at risk,&amp;quot; since the primary interest is which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Users can specify how they wish to receive insights notifications, or turn them off, via their User menu &amp;gt; Preferences &amp;gt; Notification preferences.&lt;br /&gt;
&lt;br /&gt;
=== Actions===&lt;br /&gt;
&lt;br /&gt;
Each insight can have one or more actions defined. Actions provide a way to act on the insight as it is read. These actions may include a way to send a message to another user, a link to a report providing information about the sample the prediction has been generated for (e.g. a report for an existing student), or a way to view the details of the model prediction.&lt;br /&gt;
&lt;br /&gt;
[[Image:08_insights.png|frame|center|Insights and Actions]]&lt;br /&gt;
&lt;br /&gt;
Insights can also offer two important general actions that are applicable to all insights. First, the user can acknowledge the insight. This removes that particular prediction from the view of the user, e.g. a notification about a particular student at risk is removed from the display.&lt;br /&gt;
&lt;br /&gt;
The second general action is to mark the insight as &amp;quot;Not useful.&amp;quot; This also removes the insight associated with this calculation from the display, but the model is adjusted to make this prediction less likely in the future.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Frequently Asked Questions==&lt;br /&gt;
[[Moodle Learning Analytics FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Analítica]]&lt;br /&gt;
[[de:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=132958</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=132958"/>
		<updated>2019-01-14T17:37:28Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Settings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/MS1IqKsrXAI | desc = Analytics overview}}&lt;br /&gt;
&lt;br /&gt;
Beginning in version 3.4, Moodle core now implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
In Moodle 3.4, this system ships with two built-in models:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out]]&lt;br /&gt;
* No teaching activity&lt;br /&gt;
&lt;br /&gt;
The system can be easily extended with new custom models, based on reusable targets, indicators, and other components. For more information, see the [[dev:Analytics API| Analytics API]] developer documentation.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* Two built-in prediction models: &amp;quot;[[Students at risk of dropping out]]&amp;quot; and &amp;quot;No Teaching&amp;quot;.&lt;br /&gt;
* A set of student engagement indicators based on the  [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry].&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An [[dev:Analytics API|  API]] to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
This release of Moodle Learning Analytics has the following limitations:&lt;br /&gt;
&lt;br /&gt;
* Models included in this release must be &amp;quot;trained&amp;quot; on a site with previous completed courses, ideally using the Moodle course completion feature. The current models cannot make predictions on a site until this is done.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Moodle Learning Analytics, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the [https://moodle.org/project_inspire Moodle Learning Analytics Community]. In particular, we still need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
 [[Image:analytics01_predictions_processor34.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra tools: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
[[dev:Analytics API#Time splitting methods|Time splitting methods]] allow insights generated from one course to be used on another course, even if the two courses are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
[[Image:06_timesplitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
Each time splitting method divides the course duration into segments. At the end of each defined segment, the predictions engine will run and generate insights. It is recommended that you only enable the time splitting methods you are interested in using; the evaluation process will iterate through all enabled time-spitting methods, so the more time-splitting methods enabled, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Single range&amp;quot; indicates that predictions will be made once, but will take into account a range of time, e.g. one prediction at the end of a course. The prediction is made at the end of the range.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;No splitting&amp;quot; indicates that the model generates an insight based on a snapshot of data at a given moment, e.g. the &amp;quot;no teaching&amp;quot; model looks to see if there are currently any teachers or students assigned to a course at a defined point before the start of the term, and issues one insight warning the site administrator that no teaching is likely to occur in that empty course.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Accumulative&amp;quot; methods differ in how much data is included in the prediction. Both &amp;quot;quarterly&amp;quot; and &amp;quot;quarterly accumulative&amp;quot; predictions are made at the end of each quarter of a time span (e.g. a course), but in &amp;quot;quarterly,&amp;quot; only the information from the most recent quarter is included in the prediction, whereas in &amp;quot;quarterly accumulative&amp;quot; all information up to the present is included in the prediction.&lt;br /&gt;
&lt;br /&gt;
Single range and no splitting methods do not have time constraints. They run during the next scheduled task execution, although models apply different restrictions (e.g. require that a course is finished to use it for training or some data in the course and students to use it to get predictions...). &#039;Single range&#039; and &#039;No splitting&#039; are not appropriate for students at risk of dropping out of courses. They are intended to be used in models like &#039;No teaching&#039; or &#039;Spammer user&#039; where you just want one prediction and done. To explain this with an example: &#039;No teaching&#039; model uses &#039;Single range&#039; time splitting method; the target class (the main PHP class of a model) only accepts courses that will start during the next week. Once we provide &#039;No teaching&#039; insights for a course we don&#039;t provide them anymore. &lt;br /&gt;
&lt;br /&gt;
The difference between &#039;Single range&#039; and &#039;No splitting&#039; is that models analysed using &#039;Single range&#039; will be limited to the analysable elements (the course in students at risk model) start and end dates, while &#039;No splitting&#039; do not have any time contraints and all data available in the system is used to calculate the indicators.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Although the examples above refer to courses, time splitting methods can be used on any analysable element. For example, enrolments can have start and end dates, so a time splitting method could be applied to generate predictions about aspects of an enrollment. For analysable elements with no start and end dates, different time splitting methods would be needed. For example, a &amp;quot;weekly&amp;quot; time splitting method could be applied to a model intended to predict whether a user is likely to log in to the system in the future, on the basis of activity in the previous week.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:03_models_output_directory.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
&lt;br /&gt;
===Scheduled tasks===&lt;br /&gt;
&lt;br /&gt;
Most analytics API processes are executed through [[Scheduled_tasks|scheduled tasks]]. These processes usually read the activity log table and can require some time to finish. You can find &#039;&#039;Train models&#039;&#039; and &#039;&#039;Predict models&#039;&#039; scheduled tasks listed in &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Server &amp;gt; Scheduled tasks.&#039;&#039; It is recommended to edit the tasks schedule so they run nightly.&lt;br /&gt;
&lt;br /&gt;
== Model management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once, even within the same course. This can be used for A/B testing to compare the performance and accuracy of multiple models. &lt;br /&gt;
&lt;br /&gt;
Moodle core ships with two prediction models, &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; and &#039;&#039;No teaching.&#039;&#039; Additional prediction models can be created by using the [[dev:Analytics API| Analytics API]]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
=== View Insights ===&lt;br /&gt;
Once you have trained a machine learning algorithm with the data available on the system, you will see insights (predictions) here for each &amp;quot;analysable.&amp;quot; In the included model &amp;quot;[[Students at risk of dropping out]], insights may be selected per course. &#039;&#039;Predictions are not limited to ongoing courses-- this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Evaluate ===&lt;br /&gt;
(disabled by default) Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends. This process will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process uses all information available on the site, even if it is very old. Because of this, the accuracy returned by the evaluation process may be lower than the real model accuracy as indicators are more reliably calculated immediately after training data is available because the site state changes over time. The metric used to describe accuracy is the &#039;&#039;[https://en.wikipedia.org/wiki/Matthews_correlation_coefficient Matthews correlation coefficient]&#039;&#039; (a metric used in machine learning for evaluating binary classifications)&lt;br /&gt;
&lt;br /&gt;
You can force the model evaluation process to run from the command line:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/evaluate_model.php &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Log ===&lt;br /&gt;
View previous evaluation logs, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curve graphs, the tensorboard log dir or the model&#039;s Matthews correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
&lt;br /&gt;
=== Edit ===&lt;br /&gt;
You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
&lt;br /&gt;
=== Enable / Disable ===&lt;br /&gt;
The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
&lt;br /&gt;
=== Export ===&lt;br /&gt;
Export your site training data to share it with your partner institutions or to use it on a new site. The Export action for models allows you to generate a csv file containing model data about indicators and weights, without exposing any of your site-specific data. We will be asking for submissions of these model files to help evaluate the value of models on different kinds of sites. Please see the [https://moodle.org/project_inspire Learning Analytics community] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Invalid site elements ===&lt;br /&gt;
Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
=== Clear predictions ===&lt;br /&gt;
Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
[[Students at risk of dropping out|This model]] predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. In this model, the definition of &amp;quot;dropping out&amp;quot; is &amp;quot;no student activity in the final quarter of the course.&amp;quot; The prediction model uses the [https://en.wikipedia.org/wiki/Community_of_inquiry Community of Inquiry] model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* [[Students at risk of dropping out#Cognitive depth|Cognitive presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Social Breadth|Social presence]]&lt;br /&gt;
* [[Students at risk of dropping out#Potential indicator levels for selected activity modules|Teacher presence]]&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyse and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success in exact duplicates of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the [[Students at risk of dropping out#Indicators|indicator]] set (see below). Courses which do not include several core Moodle activities per “time slice” (depending on the time splitting method) will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Moodle. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script:&lt;br /&gt;
&lt;br /&gt;
 $ admin/tool/analytics/cli/guess_course_start_and_end.php &lt;br /&gt;
&lt;br /&gt;
This script attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model&#039;s insights will inform site managers of which courses with an upcoming start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions, e.g. there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different points in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate [[dev:Analytics API#Insights|insights]] and which predictions will be ignored. For example, the &#039;&#039;[[Students at risk of dropping out]]&#039;&#039; prediction model does not generate an insight if a student is predicted as &amp;quot;not at risk,&amp;quot; since the primary interest is which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
Users can specify how they wish to receive insights notifications, or turn them off, via their User menu &amp;gt; Preferences &amp;gt; Notification preferences.&lt;br /&gt;
&lt;br /&gt;
=== Actions===&lt;br /&gt;
&lt;br /&gt;
Each insight can have one or more actions defined. Actions provide a way to act on the insight as it is read. These actions may include a way to send a message to another user, a link to a report providing information about the sample the prediction has been generated for (e.g. a report for an existing student), or a way to view the details of the model prediction.&lt;br /&gt;
&lt;br /&gt;
[[Image:08_insights.png|frame|center|Insights and Actions]]&lt;br /&gt;
&lt;br /&gt;
Insights can also offer two important general actions that are applicable to all insights. First, the user can acknowledge the insight. This removes that particular prediction from the view of the user, e.g. a notification about a particular student at risk is removed from the display.&lt;br /&gt;
&lt;br /&gt;
The second general action is to mark the insight as &amp;quot;Not useful.&amp;quot; This also removes the insight associated with this calculation from the display, but the model is adjusted to make this prediction less likely in the future.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
There are two analytics capabilities:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/analytics:managemodels|Manage models]] - allowed for the default role of manager only&lt;br /&gt;
* [[Capabilities/moodle/analytics:listinsights|List insights]] - allowed for the default roles of manager, teacher and non-editing teacher&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Frequently Asked Questions==&lt;br /&gt;
[[Moodle Learning Analytics FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;br /&gt;
&lt;br /&gt;
[[es:Analítica]]&lt;br /&gt;
[[de:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131587</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131587"/>
		<updated>2018-08-01T12:15:26Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* The Solr server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator sets the setting &amp;quot;Searchable courses&amp;quot; to &#039;&#039;Search within all courses the user can access&#039;&#039; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr-specific features===&lt;br /&gt;
&#039;&#039;These features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Search query features====&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
====File contents indexing====&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts.&lt;br /&gt;
&lt;br /&gt;
====Extra filters====&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
{{New features}}&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
* Solr 7 is not currently supported as the field type &#039;int&#039; has been removed.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
====How to install Solr====&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
===== Linux (Debian/Ubuntu) =====&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
===== Linux (Redhat/Centos 6 &amp;amp; 7) =====&lt;br /&gt;
&lt;br /&gt;
====== Using built in php5 packages ======&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
====== Using 3rd party php7 packages (webtactic) ======&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== OSX using macports =====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
===== OSX using homebrew =====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
===== The Solr server =====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
&lt;br /&gt;
Please note that there is a security issue that affects some Solr versions. The patched versions are 5.5.5, 6.6.2, 7.1, 7.2 and all new versions are patched. If your Solr server version is lower but you can&#039;t upgrade to one of the patched versions it is recommended to disable the XML Query Parser.&lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.5.5 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.5.5&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Solr 5/6 schema setup======&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
======Solr 4 schema setup======&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
======Memory and File indexing considerations======&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
======Too many boolean clauses error======&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
=====Commannd for installing Solr Server on Centos 7=====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A quick introduction to Moodle global search, followed by a description of the new features and fixes in Moodle 3.4 (and some of those in Moodle 3.5).&lt;br /&gt;
*[https://www.slideshare.net/sammarshall_ou/moodle-global-search-nows-the-time-to-jump-in Presentation by Sam Marshall from the Open University]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131100</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131100"/>
		<updated>2018-05-23T15:04:41Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* How does it work? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator sets the setting &amp;quot;Searchable courses&amp;quot; to &#039;&#039;Search within all courses the user can access&#039;&#039; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr-specific features===&lt;br /&gt;
&#039;&#039;These features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====Search query features====&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
====File contents indexing====&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts.&lt;br /&gt;
&lt;br /&gt;
====Extra filters====&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
{{New features}}&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
* Solr 7 is not currently supported as the field type &#039;int&#039; has been removed.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
====How to install Solr====&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
===== Linux (Debian/Ubuntu) =====&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
===== Linux (Redhat/Centos 6 &amp;amp; 7) =====&lt;br /&gt;
&lt;br /&gt;
====== Using built in php5 packages ======&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
====== Using 3rd party php7 packages (webtactic) ======&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== OSX using macports =====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
===== OSX using homebrew =====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
===== The Solr server =====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.5.5&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Solr 5/6 schema setup======&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
======Solr 4 schema setup======&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
======Memory and File indexing considerations======&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
======Too many boolean clauses error======&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
=====Commannd for installing Solr Server on Centos 7=====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131099</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131099"/>
		<updated>2018-05-23T14:57:10Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* How is it set up? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator sets the setting &amp;quot;Searchable courses&amp;quot; to &#039;&#039;Search within all courses the user can access&#039;&#039; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;These search features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
{{New features}}&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
* Solr 7 is not currently supported as the field type &#039;int&#039; has been removed.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
====How to install Solr====&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
===== Linux (Debian/Ubuntu) =====&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
===== Linux (Redhat/Centos 6 &amp;amp; 7) =====&lt;br /&gt;
&lt;br /&gt;
====== Using built in php5 packages ======&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
====== Using 3rd party php7 packages (webtactic) ======&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== OSX using macports =====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
===== OSX using homebrew =====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
===== The Solr server =====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.5.5&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
======Solr 5/6 schema setup======&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
======Solr 4 schema setup======&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
======Memory and File indexing considerations======&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
======Too many boolean clauses error======&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
=====Commannd for installing Solr Server on Centos 7=====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131098</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131098"/>
		<updated>2018-05-23T14:46:19Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* What can I search for? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator sets the setting &amp;quot;Searchable courses&amp;quot; to &#039;&#039;Search within all courses the user can access&#039;&#039; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;These search features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
{{New features}}&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
* Solr 7 is not currently supported as the field type &#039;int&#039; has been removed.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== Linux (Redhat/Centos 6 &amp;amp; 7) ====&lt;br /&gt;
&lt;br /&gt;
===== Using built in php5 packages =====&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== Using 3rd party php7 packages (webtactic) =====&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.5.5&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
=====Too many boolean clauses error=====&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
====Commannd for installing Solr Server on Centos 7====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131064</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=131064"/>
		<updated>2018-05-17T11:24:36Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator in Advanced features and then, from the Manage Global search page, the search engine must be selected.&lt;br /&gt;
&lt;br /&gt;
When Global search is enabled,  search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. &lt;br /&gt;
&lt;br /&gt;
HTML block content may be searched and, if the administrator enables the setting &amp;quot;Search all courses&amp;quot; then courses which are visible to users but which they are not enrolled in may also be searched. (These courses are courses with guest access or if the user has the capability to view all courses.)&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;These search features are only available if you use &#039;&#039;&#039;Solr&#039;&#039;&#039; as your search engine.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 3.5&#039;&#039;&#039; : New fields now facilitate filtering by user ID and searching by group.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
Note: Global search needs a search engine. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.&lt;br /&gt;
&lt;br /&gt;
Moodle core includes two search engines: Simple Global search and Solr. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.&lt;br /&gt;
&lt;br /&gt;
===Setting up Simple search===&lt;br /&gt;
&lt;br /&gt;
{{New features}}&lt;br /&gt;
Simple Global search provides global search features without the need to install an external search engine.&lt;br /&gt;
&lt;br /&gt;
{{MediaPlayer | url = https://youtu.be/4JJhOd2XAiY | desc = Simple global search}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
* The latest Solr 5 available version is the recommended one.&lt;br /&gt;
* Moodle supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released.&lt;br /&gt;
* Solr 7 is not currently supported as the field type &#039;int&#039; has been removed.&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# You now need to populate the created Solr index with your site&#039;s data. You can do it via the web interface by going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI by running the &amp;lt;tt&amp;gt;search/cli/indexer.php&amp;lt;/tt&amp;gt; script. The CLI script is the recommended option for big sites.&amp;lt;br&amp;gt;&amp;lt;code&amp;gt;# sudo -u www-run php search/cli/indexer.php --force&amp;lt;/code&amp;gt;&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;New in 34:&#039;&#039;&#039; File indexing now works retroactively -ie, if you set up Global search without file indexing enabled and a later date you enable file indexing, files associated with existing objects will be included.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr PECL: Package: solr]. The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
With PHP5.x&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
With PHP 7&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php7.0-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php/7.0/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== Linux (Redhat/Centos 6 &amp;amp; 7) ====&lt;br /&gt;
&lt;br /&gt;
===== Using built in php5 packages =====&lt;br /&gt;
  yum install php-pecl-solr2&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
===== Using 3rd party php7 packages (webtactic) =====&lt;br /&gt;
  yum install libxml2-devel pcre-devel libcurl-devel php70w-devel php70w-pear&lt;br /&gt;
  pecl install solr&lt;br /&gt;
  echo &amp;quot;extension=solr.so&amp;quot; &amp;gt; /etc/php.d/solr.ini&lt;br /&gt;
  service httpd restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it. If wget gives an error, check  http://www-us.apache.org/dist/lucene/solr and update SOLRVERSION&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
=====Too many boolean clauses error=====&lt;br /&gt;
&lt;br /&gt;
Because of the way Moodle handles permissions for searches, if you have non-admin users with access to a large number of activities (&amp;gt;1000), they may an error similar to the following:&lt;br /&gt;
&lt;br /&gt;
    The query you provided could not be parsed by the search engine: org.apache.solr.search.SyntaxError: Cannot parse &lt;br /&gt;
    ...&lt;br /&gt;
    too many boolean clauses&lt;br /&gt;
&lt;br /&gt;
To correct this, you need to increase the &#039;&#039;maxBooleanClauses&#039;&#039; setting in your Solr core. The setting is located in &#039;&#039;corename/conf/solrconfig.xml&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
This important note is included in the config file:&lt;br /&gt;
    ** WARNING **&lt;br /&gt;
    &lt;br /&gt;
    This option actually modifies a global Lucene property that&lt;br /&gt;
    will affect all SolrCores.  If multiple solrconfig.xml files&lt;br /&gt;
    disagree on this property, the value at any given moment will&lt;br /&gt;
    be based on the last SolrCore to be initialized.&lt;br /&gt;
&lt;br /&gt;
This means that for consistent behavior you should update this value for all cores in the Solr server.&lt;br /&gt;
&lt;br /&gt;
====Commannd for installing Solr Server on Centos 7====&lt;br /&gt;
First of all install java (openjdk)&lt;br /&gt;
 yum install java-1.8.0-openjdk&lt;br /&gt;
Add user for solr&lt;br /&gt;
 adduser solr&lt;br /&gt;
Download solr server, find latest here : http://lucene.apache.org/solr/mirrors-solr-latest-redir.html, from the list there download latest solr-[version].tgz&lt;br /&gt;
&lt;br /&gt;
Here is the list of needed commands (note that latest solr is suggested, change command to appropriate version) &lt;br /&gt;
 cd /opt&lt;br /&gt;
 wget http://www-eu.apache.org/dist/lucene/solr/6.6.0/solr-6.6.0.tgz&lt;br /&gt;
 tar zxvf solr-6.6.0.tgz&lt;br /&gt;
 cp solr-6.6.0/bin/install_solr_service.sh .&lt;br /&gt;
 rm -rf solr-6.6.0&lt;br /&gt;
 ./install_solr_service.sh solr-6.6.0.tgz&lt;br /&gt;
 chkconfig solr on&lt;br /&gt;
Create the index&lt;br /&gt;
 su - solr -c &amp;quot;/opt/solr/bin/solr create_core -c moodle&amp;quot;&lt;br /&gt;
Then go to your Moodle and set index name as created (moodle)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Forum discussions:&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?]&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=339819 Global Search on Moodle 3.1]&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;br /&gt;
[[de:Globale Suche]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129239</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129239"/>
		<updated>2017-11-10T08:27:26Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Predictions processor */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}{{New features}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This page describes analytics features in Moodle core. Open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP one is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates [https://www.tensorflow.org/get_started/summaries_and_tensorboard graphs that explain the model performance]. It requires setting up extra stuff: Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend python package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides the course duration in parts, the predictions engine will run at the end of these parts. It is recommended that you only enable the time splitting methods you could be interested on using; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
&lt;br /&gt;
== Models management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once. Moodle core comes with two prediction models &#039;&#039;Students at risk of dropping out&#039;&#039; and &#039;&#039;No teaching&#039;&#039;, you can add your own prediction models using [https://docs.moodle.org/dev/Analytics_API Moodle analytics API]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Get predictions:&#039;&#039;&#039; Train machine learning algorithms with the new data available on the system and get predictions for ongoing courses. &#039;&#039;Predictions are not limited to ongoing courses, this depends on the model.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Evaluate:&#039;&#039;&#039; Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends, they will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process use all information available on the site, even if it is very old, the accuracy returned by the evaluation process will generally be lower than the real model accuracy as indicators are more reliably calculated straight after training data is available because the site state changes along time. The metric used as accuracy is the &#039;&#039;Matthew’s correlation coefficient&#039;&#039; (good metric for binary classifications)&lt;br /&gt;
* &#039;&#039;&#039;Log:&#039;&#039;&#039; View previous evaluations log, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curves graphs, the tensorboard log dir or the model&#039;s Matthew’s correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
* &#039;&#039;&#039;Edit:&#039;&#039;&#039; You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
* &#039;&#039;&#039;Enable / Disable:&#039;&#039;&#039; The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
* &#039;&#039;&#039;Export&#039;&#039;&#039;: Export your site training data to share it with your partner institutions.&lt;br /&gt;
* &#039;&#039;&#039;Invalid site elements&#039;&#039;&#039;: Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
* &#039;&#039;&#039;Clear predictions&#039;&#039;&#039;: Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
This model predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. The prediction model uses the Community of Inquiry model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* Cognitive presence&lt;br /&gt;
* Social presence&lt;br /&gt;
* Teacher presence&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyze and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success only in perfect copies of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script (https://github.com/moodlehq/moodle-tool_inspire/blob/master/cli/guess_course_start_and_end.php) that attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the indicator set (see below). Courses which do not include several core Moodle activities per “time slice” will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model insights will inform site managers of which courses with a close start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions like there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different point in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate insights and which predictions will be ignored. This is an example of &#039;&#039;Students at risk of dropping out&#039;&#039; prediction model; if a student is predicted as not at risk no insight is generated as what is interesting is to know which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129233</id>
		<title>Inspire</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129233"/>
		<updated>2017-11-09T14:38:46Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note|Note that this page refers to https://moodle.org/plugins/tool_inspire plugin which has been integrated in core as [Analytics]; check that page for Moodle 3.4 information}}&lt;br /&gt;
&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Admin tool&lt;br /&gt;
|entry = https://moodle.org/plugins/tool_inspire&lt;br /&gt;
|tracker = &lt;br /&gt;
|discussion = https://moodle.org/course/view.php?id=17233&lt;br /&gt;
|maintainer = [[User:David Monllaó|David Monllaó]], [[Emdalton1|Elizabeth Dalton]]&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Inspire plugin implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* A built-in prediction model: Students at risk of dropping out of courses.&lt;br /&gt;
* A set of student engagement indicators based on the Community of Inquiry.&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An API to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
The initial 3.3-r1 version of the Inspire plugin has some limitations:&lt;br /&gt;
&lt;br /&gt;
* This version is installed as a third-party plugin. Future versions will become part of Moodle Core.&lt;br /&gt;
* This version only reads activity logs from the standard log store. A log store selector will be added in future versions of the plugin.&lt;br /&gt;
* This version requires a site with previous completed course, ideally using the Moodle course completion feature. This data is used to train the prediction engine.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Inspire, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the Project Inspire Community. In particular, we need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Installing plugins#installing a plugin]]. &lt;br /&gt;
&lt;br /&gt;
If you are manually installing, this plugin should be unpacked to admin/tool/inspire.&lt;br /&gt;
&lt;br /&gt;
==Plugin configuration==&lt;br /&gt;
&lt;br /&gt;
After installation completes, you will be prompted to configure the settings for the Inspire plugins. You can also access these options at any time within the Site Administration menu:&lt;br /&gt;
&lt;br /&gt;
:Dashboard / Site administration / Plugins / Admin tools / Inspire&lt;br /&gt;
&lt;br /&gt;
Or at:&lt;br /&gt;
&lt;br /&gt;
http://your.moodle.site/moodle/admin/settings.php?section=inspiremanagement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Predictions processor===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire01_predictions_processor.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. This version of Inspire is shipped with 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates graphs with the model performance but it requires setting up extra tools like Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodleinspire python package: &lt;br /&gt;
 $ pip install moodleinspire&lt;br /&gt;
&lt;br /&gt;
===Time splitting methods===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire15_time_splitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides each course into segments, based on the “Course start date” and “Course end date” settings per course. The predictions engine will run at the end of each segment. It is recommended that you only enable the time splitting methods you plan to use; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
The use of these time splitting methods allows insights generated from one course to be used on another course, even if the two are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire04_models_output.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where evaluation data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
===Teacher roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire05_teacher_roles.png|frame|center|Teacher roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “teachers” within a course or other context. The actions of teachers are handled differently from the actions of students in the prediction models.&lt;br /&gt;
&lt;br /&gt;
===Student roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire06_student_roles.png|frame|center|Student roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “students” within a course or other context. These roles will be recognized by prediction models. For example, the built-in model, “Identify students at risk,” generates predictions only for users identified as students within courses.&lt;br /&gt;
&lt;br /&gt;
==Model configuration==&lt;br /&gt;
Inspire can support multiple prediction models at once. Each model requires a certain amount of configuration before use. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
Examples of prediction targets:&lt;br /&gt;
* Student will not complete a course using defined course completion criteria&lt;br /&gt;
* Student will not achieve a passing grade as defined in the course gradebook &lt;br /&gt;
* Student will not attain the competencies attached to the course before the course end date&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on the course design&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on teacher actions in the course&lt;br /&gt;
&lt;br /&gt;
Models apply to specific contexts. For example, a model predicting student success in a course is operating in the context of a course. A model could be defined to apply to a cohort of students receiving a specific intervention, or to categories of courses (e.g. to compare  courses in different academic subjects or using different teaching methods).&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
This version of Inspire (3.3-r1) contains one model:&lt;br /&gt;
&lt;br /&gt;
* Students at risk of dropping out&lt;br /&gt;
&lt;br /&gt;
Additional models will be implemented in the future. An API is also provided for community model development.&lt;br /&gt;
&lt;br /&gt;
====Students at risk of dropping out====&lt;br /&gt;
&lt;br /&gt;
This model predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. The prediction model uses the Community of Inquiry model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* Cognitive presence&lt;br /&gt;
* Social presence&lt;br /&gt;
* Teacher presence&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyze and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success only in perfect copies of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script (https://github.com/moodlehq/moodle-tool_inspire/blob/master/cli/guess_course_start_and_end.php) that attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the indicator set (see below). Courses which do not include several core Moodle activities per “time slice” will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
&lt;br /&gt;
===Indicators===&lt;br /&gt;
In this model, indicators are defined for the cognitive presence and social presence of each of the Core activity plugins, along with a few other indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire07_indicators.png|frame|center|Predictive indicators]]&lt;br /&gt;
&lt;br /&gt;
Additional indicators will be incorporated in future versions of Inspire. The API also supports community development of indicators.&lt;br /&gt;
&lt;br /&gt;
===The Web and CLI interfaces===&lt;br /&gt;
Large production sites require intense, resource-heavy processing when a model is first enabled and evaluated. Inspire allows operations to be executed via a web-based interface or from the command line.&lt;br /&gt;
&lt;br /&gt;
* The web-based interface is appropriate for smaller sites, e.g. test or prototype sites.&lt;br /&gt;
:Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
* The command-line interface is appropriate for larger, production sites or copies of production sites.&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we do not recommend attempting to use the web-based interface for model configuration and evaluation on production sites.&lt;br /&gt;
&lt;br /&gt;
===Enable the model===&lt;br /&gt;
Before you can evaluate a model, you must select the time splitting method and enable it.&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the CLI====&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php enable_model.php --modelid=1 --timesplitting=\&amp;quot;\\tool_inspire\\local\\time_splitting\\quarters\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Edit menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire14_edit_menu.png|frame|center|Edit model to enable]]&lt;br /&gt;
&lt;br /&gt;
Use the “Edit” Action menu to view and configure the settings for this model, and to enable it.&lt;br /&gt;
&lt;br /&gt;
In this screen you can choose from among the time splitting methods enabled in the plugin settings, and you can also disable (or restore) some of the default indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire12_edit_model.png|frame|center|Enable model]]&lt;br /&gt;
&lt;br /&gt;
===Evaluate the model===&lt;br /&gt;
After enabling a model with a specific time-splitting method and list of indicators, evaluate the model against your existing site data (courses whose end date is in the past). This will allow you to determine which time splitting method works best with your courses. You may wish to return to the “enabling” step to alter the timesplitting method, then re-evaluate.&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the CLI====&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php evaluate_model.php --modelid=1 --non-interactive&lt;br /&gt;
&lt;br /&gt;
Analysing the site&lt;br /&gt;
The site contents are calculated and stored in batches, during evaluation you can stop the process at any moment, the next time you run it it will continue from the point you stopped it.&lt;br /&gt;
!! There is no data to evaluate the model !!&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the Web-based interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Evaluate menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire02_models_list.png|frame|center|Select model to evaluate]]&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire03_evaluate_models.png|frame|center|View model evaluations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Execute the model===&lt;br /&gt;
Once the model has been evaluated against past course data, the model can be executed to begin to make predictions about current and future courses (courses with start dates in the past or future, and end dates in the future).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the CLI====&lt;br /&gt;
These are the 2 tasks that will run through cron regularly. You can force their execution.&lt;br /&gt;
&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\train_models&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\predict_models&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The “train” process reviews data from previously completed courses. The “predict” process generates predictions using current courses (or future courses that have not yet started, if the model is designed for that purpose).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Execute menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire17_execute_model.png|frame|center|Select model to begin execution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==View predictions==&lt;br /&gt;
Predictions are viewed within the web-based interface and are automatically sent to the teacher of a course using notifications. Note that you will first need to enable and execute the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a manager/admin===&lt;br /&gt;
Go to Site administration &amp;gt; Reports &amp;gt; Inspire models&lt;br /&gt;
Select a context from the predictions list menu, e.g. a specific course. Available contexts depend on the model definition.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire09_view_predictions.png|frame|center|View predictions as manager]]&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a teacher===&lt;br /&gt;
Go to an ongoing course and Course administration &amp;gt; Reports &amp;gt; Insights&lt;br /&gt;
A user with tool/inspire:listinsights capability will also automatically receive notifications when new predictions are available for them. e.g. Course teachers will receive a notification about their students at risk of dropping out.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire13_view_notifications.png|frame|center|View Inspire notifications]]&lt;br /&gt;
&lt;br /&gt;
From this screen, the teacher can view more details or send a message directly to the student:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire10_notifications_list.png|frame|center|View notification details]]&lt;br /&gt;
&lt;br /&gt;
===View prediction details===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire11_view_prediction_details.png|frame|center|View prediction details]]&lt;br /&gt;
&lt;br /&gt;
The prediction details show which of the indicator values were used in the prediction, and what the student’s values for those indicators are.&lt;br /&gt;
&lt;br /&gt;
Again, the teacher can send a message to the student at this point, or view the Outline report.&lt;br /&gt;
&lt;br /&gt;
==Developer’s documentation==&lt;br /&gt;
Architecture overview (mostly for developers / systems administrators / researchers): https://docs.moodle.org/dev/Project_Inspire_API&lt;br /&gt;
&lt;br /&gt;
==How to request a new feature==&lt;br /&gt;
* Check in the open issues if your feature have been already requested https://github.com/moodlehq/moodle-tool_inspire/issues&lt;br /&gt;
* https://tracker.moodle.org/issues/?jql=project%20%3D%20MDL%20AND%20component%20%3D%20Analytics &lt;br /&gt;
* If not, create a New issue Project: Moodle (MDL)&lt;br /&gt;
* Select the component Analytics and your Moodle version&lt;br /&gt;
* Explain your needs in the Description field &lt;br /&gt;
* Vote and Watch the issue you have created&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
* David Monllaó - Lead Maintainer&lt;br /&gt;
* Elizabeth Dalton - Research Analyst&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [https://moodle.org/plugins/tool_inspire Inspire tool in Plugins database]&lt;br /&gt;
* [https://moodle.org/course/view.php?id=17233 Project Inspire Community]&lt;br /&gt;
* [[Learning analytics]] documentation&lt;br /&gt;
* [https://moodle.org/mod/forum/view.php?id=8044 Analytics and reporting forum]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129232</id>
		<title>Inspire</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129232"/>
		<updated>2017-11-09T14:35:57Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Note that this page refers to https://moodle.org/plugins/tool_inspire plugin which has been integrated in core as [Analytics]; check that page for Moodle 3.4 information}}&lt;br /&gt;
&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Admin tool&lt;br /&gt;
|entry = https://moodle.org/plugins/tool_inspire&lt;br /&gt;
|tracker = &lt;br /&gt;
|discussion = https://moodle.org/course/view.php?id=17233&lt;br /&gt;
|maintainer = [[User:David Monllaó|David Monllaó]], [[Emdalton1|Elizabeth Dalton]]&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Inspire plugin implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* A built-in prediction model: Students at risk of dropping out of courses.&lt;br /&gt;
* A set of student engagement indicators based on the Community of Inquiry.&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An API to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
The initial 3.3-r1 version of the Inspire plugin has some limitations:&lt;br /&gt;
&lt;br /&gt;
* This version is installed as a third-party plugin. Future versions will become part of Moodle Core.&lt;br /&gt;
* This version only reads activity logs from the standard log store. A log store selector will be added in future versions of the plugin.&lt;br /&gt;
* This version requires a site with previous completed course, ideally using the Moodle course completion feature. This data is used to train the prediction engine.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Inspire, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the Project Inspire Community. In particular, we need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Installing plugins#installing a plugin]]. &lt;br /&gt;
&lt;br /&gt;
If you are manually installing, this plugin should be unpacked to admin/tool/inspire.&lt;br /&gt;
&lt;br /&gt;
==Plugin configuration==&lt;br /&gt;
&lt;br /&gt;
After installation completes, you will be prompted to configure the settings for the Inspire plugins. You can also access these options at any time within the Site Administration menu:&lt;br /&gt;
&lt;br /&gt;
:Dashboard / Site administration / Plugins / Admin tools / Inspire&lt;br /&gt;
&lt;br /&gt;
Or at:&lt;br /&gt;
&lt;br /&gt;
http://your.moodle.site/moodle/admin/settings.php?section=inspiremanagement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Predictions processor===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire01_predictions_processor.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. This version of Inspire is shipped with 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates graphs with the model performance but it requires setting up extra tools like Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodleinspire python package: &lt;br /&gt;
 $ pip install moodleinspire&lt;br /&gt;
&lt;br /&gt;
===Time splitting methods===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire15_time_splitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides each course into segments, based on the “Course start date” and “Course end date” settings per course. The predictions engine will run at the end of each segment. It is recommended that you only enable the time splitting methods you plan to use; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
The use of these time splitting methods allows insights generated from one course to be used on another course, even if the two are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire04_models_output.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where evaluation data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
===Teacher roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire05_teacher_roles.png|frame|center|Teacher roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “teachers” within a course or other context. The actions of teachers are handled differently from the actions of students in the prediction models.&lt;br /&gt;
&lt;br /&gt;
===Student roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire06_student_roles.png|frame|center|Student roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “students” within a course or other context. These roles will be recognized by prediction models. For example, the built-in model, “Identify students at risk,” generates predictions only for users identified as students within courses.&lt;br /&gt;
&lt;br /&gt;
==Model configuration==&lt;br /&gt;
Inspire can support multiple prediction models at once. Each model requires a certain amount of configuration before use. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
Examples of prediction targets:&lt;br /&gt;
* Student will not complete a course using defined course completion criteria&lt;br /&gt;
* Student will not achieve a passing grade as defined in the course gradebook &lt;br /&gt;
* Student will not attain the competencies attached to the course before the course end date&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on the course design&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on teacher actions in the course&lt;br /&gt;
&lt;br /&gt;
Models apply to specific contexts. For example, a model predicting student success in a course is operating in the context of a course. A model could be defined to apply to a cohort of students receiving a specific intervention, or to categories of courses (e.g. to compare  courses in different academic subjects or using different teaching methods).&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
This version of Inspire (3.3-r1) contains one model:&lt;br /&gt;
&lt;br /&gt;
* Students at risk of dropping out&lt;br /&gt;
&lt;br /&gt;
Additional models will be implemented in the future. An API is also provided for community model development.&lt;br /&gt;
&lt;br /&gt;
====Students at risk of dropping out====&lt;br /&gt;
&lt;br /&gt;
This model predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. The prediction model uses the Community of Inquiry model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* Cognitive presence&lt;br /&gt;
* Social presence&lt;br /&gt;
* Teacher presence&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyze and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success only in perfect copies of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script (https://github.com/moodlehq/moodle-tool_inspire/blob/master/cli/guess_course_start_and_end.php) that attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the indicator set (see below). Courses which do not include several core Moodle activities per “time slice” will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
&lt;br /&gt;
===Indicators===&lt;br /&gt;
In this model, indicators are defined for the cognitive presence and social presence of each of the Core activity plugins, along with a few other indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire07_indicators.png|frame|center|Predictive indicators]]&lt;br /&gt;
&lt;br /&gt;
Additional indicators will be incorporated in future versions of Inspire. The API also supports community development of indicators.&lt;br /&gt;
&lt;br /&gt;
===The Web and CLI interfaces===&lt;br /&gt;
Large production sites require intense, resource-heavy processing when a model is first enabled and evaluated. Inspire allows operations to be executed via a web-based interface or from the command line.&lt;br /&gt;
&lt;br /&gt;
* The web-based interface is appropriate for smaller sites, e.g. test or prototype sites.&lt;br /&gt;
:Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
* The command-line interface is appropriate for larger, production sites or copies of production sites.&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we do not recommend attempting to use the web-based interface for model configuration and evaluation on production sites.&lt;br /&gt;
&lt;br /&gt;
===Enable the model===&lt;br /&gt;
Before you can evaluate a model, you must select the time splitting method and enable it.&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the CLI====&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php enable_model.php --modelid=1 --timesplitting=\&amp;quot;\\tool_inspire\\local\\time_splitting\\quarters\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Edit menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire14_edit_menu.png|frame|center|Edit model to enable]]&lt;br /&gt;
&lt;br /&gt;
Use the “Edit” Action menu to view and configure the settings for this model, and to enable it.&lt;br /&gt;
&lt;br /&gt;
In this screen you can choose from among the time splitting methods enabled in the plugin settings, and you can also disable (or restore) some of the default indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire12_edit_model.png|frame|center|Enable model]]&lt;br /&gt;
&lt;br /&gt;
===Evaluate the model===&lt;br /&gt;
After enabling a model with a specific time-splitting method and list of indicators, evaluate the model against your existing site data (courses whose end date is in the past). This will allow you to determine which time splitting method works best with your courses. You may wish to return to the “enabling” step to alter the timesplitting method, then re-evaluate.&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the CLI====&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php evaluate_model.php --modelid=1 --non-interactive&lt;br /&gt;
&lt;br /&gt;
Analysing the site&lt;br /&gt;
The site contents are calculated and stored in batches, during evaluation you can stop the process at any moment, the next time you run it it will continue from the point you stopped it.&lt;br /&gt;
!! There is no data to evaluate the model !!&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the Web-based interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Evaluate menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire02_models_list.png|frame|center|Select model to evaluate]]&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire03_evaluate_models.png|frame|center|View model evaluations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Execute the model===&lt;br /&gt;
Once the model has been evaluated against past course data, the model can be executed to begin to make predictions about current and future courses (courses with start dates in the past or future, and end dates in the future).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the CLI====&lt;br /&gt;
These are the 2 tasks that will run through cron regularly. You can force their execution.&lt;br /&gt;
&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\train_models&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\predict_models&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The “train” process reviews data from previously completed courses. The “predict” process generates predictions using current courses (or future courses that have not yet started, if the model is designed for that purpose).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Execute menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire17_execute_model.png|frame|center|Select model to begin execution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==View predictions==&lt;br /&gt;
Predictions are viewed within the web-based interface and are automatically sent to the teacher of a course using notifications. Note that you will first need to enable and execute the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a manager/admin===&lt;br /&gt;
Go to Site administration &amp;gt; Reports &amp;gt; Inspire models&lt;br /&gt;
Select a context from the predictions list menu, e.g. a specific course. Available contexts depend on the model definition.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire09_view_predictions.png|frame|center|View predictions as manager]]&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a teacher===&lt;br /&gt;
Go to an ongoing course and Course administration &amp;gt; Reports &amp;gt; Insights&lt;br /&gt;
A user with tool/inspire:listinsights capability will also automatically receive notifications when new predictions are available for them. e.g. Course teachers will receive a notification about their students at risk of dropping out.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire13_view_notifications.png|frame|center|View Inspire notifications]]&lt;br /&gt;
&lt;br /&gt;
From this screen, the teacher can view more details or send a message directly to the student:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire10_notifications_list.png|frame|center|View notification details]]&lt;br /&gt;
&lt;br /&gt;
===View prediction details===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire11_view_prediction_details.png|frame|center|View prediction details]]&lt;br /&gt;
&lt;br /&gt;
The prediction details show which of the indicator values were used in the prediction, and what the student’s values for those indicators are.&lt;br /&gt;
&lt;br /&gt;
Again, the teacher can send a message to the student at this point, or view the Outline report.&lt;br /&gt;
&lt;br /&gt;
==Developer’s documentation==&lt;br /&gt;
Architecture overview (mostly for developers / systems administrators / researchers): https://docs.moodle.org/dev/Project_Inspire_API&lt;br /&gt;
&lt;br /&gt;
==How to request a new feature==&lt;br /&gt;
* Check in the open issues if your feature have been already requested https://github.com/moodlehq/moodle-tool_inspire/issues&lt;br /&gt;
* https://tracker.moodle.org/issues/?jql=project%20%3D%20MDL%20AND%20component%20%3D%20Analytics &lt;br /&gt;
* If not, create a New issue Project: Moodle (MDL)&lt;br /&gt;
* Select the component Analytics and your Moodle version&lt;br /&gt;
* Explain your needs in the Description field &lt;br /&gt;
* Vote and Watch the issue you have created&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
* David Monllaó - Lead Maintainer&lt;br /&gt;
* Elizabeth Dalton - Research Analyst&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [https://moodle.org/plugins/tool_inspire Inspire tool in Plugins database]&lt;br /&gt;
* [https://moodle.org/course/view.php?id=17233 Project Inspire Community]&lt;br /&gt;
* [[Learning analytics]] documentation&lt;br /&gt;
* [https://moodle.org/mod/forum/view.php?id=8044 Analytics and reporting forum]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129230</id>
		<title>Inspire</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Inspire&amp;diff=129230"/>
		<updated>2017-11-09T14:30:16Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Notice Note that}}&lt;br /&gt;
&lt;br /&gt;
{{Infobox plugin&lt;br /&gt;
|type = Admin tool&lt;br /&gt;
|entry = https://moodle.org/plugins/tool_inspire&lt;br /&gt;
|tracker = &lt;br /&gt;
|discussion = https://moodle.org/course/view.php?id=17233&lt;br /&gt;
|maintainer = [[User:David Monllaó|David Monllaó]], [[Emdalton1|Elizabeth Dalton]]&lt;br /&gt;
|float = right&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
The Inspire plugin implements open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success, and ultimately diagnosis and prescriptions (advisements) to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
===Features===&lt;br /&gt;
* A built-in prediction model: Students at risk of dropping out of courses.&lt;br /&gt;
* A set of student engagement indicators based on the Community of Inquiry.&lt;br /&gt;
* Built-in tools to evaluate models against your site&#039;s data&lt;br /&gt;
* Proactive notifications for instructors using Events&lt;br /&gt;
* Instructors can easily send messages to students identified by the model, or jump to the Outline report for that student for more detail about student activity&lt;br /&gt;
* An API to build indicators and prediction models for third-party Moodle plugins&lt;br /&gt;
* Machine learning backend plugin type - supports PHP and Python, and can be extended to implement other ML backends&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note: PHP 7.x is required.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Limitations===&lt;br /&gt;
The initial 3.3-r1 version of the Inspire plugin has some limitations:&lt;br /&gt;
&lt;br /&gt;
* This version is installed as a third-party plugin. Future versions will become part of Moodle Core.&lt;br /&gt;
* This version only reads activity logs from the standard log store. A log store selector will be added in future versions of the plugin.&lt;br /&gt;
* This version requires a site with previous completed course, ideally using the Moodle course completion feature. This data is used to train the prediction engine.&lt;br /&gt;
* The prediction model included with this version requires that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire.&lt;br /&gt;
* Models and predictions are only visible to teachers and administrators at present.&lt;br /&gt;
&lt;br /&gt;
We are continuing to enhance Inspire, and expanded capabilities will be released going forward. To help contribute to our progress, please join the conversation at the Project Inspire Community. In particular, we need data sets from a wide variety of Moodle-using institutions in order to be able to ship a working prediction model that does not depend on local site data before it can be used.&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
See [[Installing plugins#installing a plugin]]. &lt;br /&gt;
&lt;br /&gt;
If you are manually installing, this plugin should be unpacked to admin/tool/inspire.&lt;br /&gt;
&lt;br /&gt;
==Plugin configuration==&lt;br /&gt;
&lt;br /&gt;
After installation completes, you will be prompted to configure the settings for the Inspire plugins. You can also access these options at any time within the Site Administration menu:&lt;br /&gt;
&lt;br /&gt;
:Dashboard / Site administration / Plugins / Admin tools / Inspire&lt;br /&gt;
&lt;br /&gt;
Or at:&lt;br /&gt;
&lt;br /&gt;
http://your.moodle.site/moodle/admin/settings.php?section=inspiremanagement&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Predictions processor===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire01_predictions_processor.png|frame|center|Predictions processor selection]]&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. This version of Inspire is shipped with 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP processor is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python processor is more powerful and it generates graphs with the model performance but it requires setting up extra tools like Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodleinspire python package: &lt;br /&gt;
 $ pip install moodleinspire&lt;br /&gt;
&lt;br /&gt;
===Time splitting methods===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire15_time_splitting.png|frame|center|Time splitting methods]]&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides each course into segments, based on the “Course start date” and “Course end date” settings per course. The predictions engine will run at the end of each segment. It is recommended that you only enable the time splitting methods you plan to use; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods, the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
The use of these time splitting methods allows insights generated from one course to be used on another course, even if the two are not exactly the same length.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire04_models_output.png|frame|center|Models output directory]]&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where evaluation data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
===Teacher roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire05_teacher_roles.png|frame|center|Teacher roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “teachers” within a course or other context. The actions of teachers are handled differently from the actions of students in the prediction models.&lt;br /&gt;
&lt;br /&gt;
===Student roles===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire06_student_roles.png|frame|center|Student roles]]&lt;br /&gt;
&lt;br /&gt;
Inspire needs to understand which users should be treated as “students” within a course or other context. These roles will be recognized by prediction models. For example, the built-in model, “Identify students at risk,” generates predictions only for users identified as students within courses.&lt;br /&gt;
&lt;br /&gt;
==Model configuration==&lt;br /&gt;
Inspire can support multiple prediction models at once. Each model requires a certain amount of configuration before use. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
Examples of prediction targets:&lt;br /&gt;
* Student will not complete a course using defined course completion criteria&lt;br /&gt;
* Student will not achieve a passing grade as defined in the course gradebook &lt;br /&gt;
* Student will not attain the competencies attached to the course before the course end date&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on the course design&lt;br /&gt;
* An unacceptable proportion of students in a given course will not achieve a passing grade, based on teacher actions in the course&lt;br /&gt;
&lt;br /&gt;
Models apply to specific contexts. For example, a model predicting student success in a course is operating in the context of a course. A model could be defined to apply to a cohort of students receiving a specific intervention, or to categories of courses (e.g. to compare  courses in different academic subjects or using different teaching methods).&lt;br /&gt;
&lt;br /&gt;
===Models===&lt;br /&gt;
This version of Inspire (3.3-r1) contains one model:&lt;br /&gt;
&lt;br /&gt;
* Students at risk of dropping out&lt;br /&gt;
&lt;br /&gt;
Additional models will be implemented in the future. An API is also provided for community model development.&lt;br /&gt;
&lt;br /&gt;
====Students at risk of dropping out====&lt;br /&gt;
&lt;br /&gt;
This model predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. The prediction model uses the Community of Inquiry model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* Cognitive presence&lt;br /&gt;
* Social presence&lt;br /&gt;
* Teacher presence&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyze and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success only in perfect copies of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script (https://github.com/moodlehq/moodle-tool_inspire/blob/master/cli/guess_course_start_and_end.php) that attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the indicator set (see below). Courses which do not include several core Moodle activities per “time slice” will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
&lt;br /&gt;
===Indicators===&lt;br /&gt;
In this model, indicators are defined for the cognitive presence and social presence of each of the Core activity plugins, along with a few other indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire07_indicators.png|frame|center|Predictive indicators]]&lt;br /&gt;
&lt;br /&gt;
Additional indicators will be incorporated in future versions of Inspire. The API also supports community development of indicators.&lt;br /&gt;
&lt;br /&gt;
===The Web and CLI interfaces===&lt;br /&gt;
Large production sites require intense, resource-heavy processing when a model is first enabled and evaluated. Inspire allows operations to be executed via a web-based interface or from the command line.&lt;br /&gt;
&lt;br /&gt;
* The web-based interface is appropriate for smaller sites, e.g. test or prototype sites.&lt;br /&gt;
:Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
* The command-line interface is appropriate for larger, production sites or copies of production sites.&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
&lt;br /&gt;
For performance reasons, we do not recommend attempting to use the web-based interface for model configuration and evaluation on production sites.&lt;br /&gt;
&lt;br /&gt;
===Enable the model===&lt;br /&gt;
Before you can evaluate a model, you must select the time splitting method and enable it.&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the CLI====&lt;br /&gt;
&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php enable_model.php --modelid=1 --timesplitting=\&amp;quot;\\tool_inspire\\local\\time_splitting\\quarters\&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Enable the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Edit menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire14_edit_menu.png|frame|center|Edit model to enable]]&lt;br /&gt;
&lt;br /&gt;
Use the “Edit” Action menu to view and configure the settings for this model, and to enable it.&lt;br /&gt;
&lt;br /&gt;
In this screen you can choose from among the time splitting methods enabled in the plugin settings, and you can also disable (or restore) some of the default indicators.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire12_edit_model.png|frame|center|Enable model]]&lt;br /&gt;
&lt;br /&gt;
===Evaluate the model===&lt;br /&gt;
After enabling a model with a specific time-splitting method and list of indicators, evaluate the model against your existing site data (courses whose end date is in the past). This will allow you to determine which time splitting method works best with your courses. You may wish to return to the “enabling” step to alter the timesplitting method, then re-evaluate.&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the CLI====&lt;br /&gt;
 $ cd &amp;lt;moodle install directory&amp;gt;/admin/tool/inspire/cli&lt;br /&gt;
 $ php evaluate_model.php --modelid=1 --non-interactive&lt;br /&gt;
&lt;br /&gt;
Analysing the site&lt;br /&gt;
The site contents are calculated and stored in batches, during evaluation you can stop the process at any moment, the next time you run it it will continue from the point you stopped it.&lt;br /&gt;
!! There is no data to evaluate the model !!&lt;br /&gt;
&lt;br /&gt;
====Evaluate the model using the Web-based interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Evaluate menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire02_models_list.png|frame|center|Select model to evaluate]]&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire03_evaluate_models.png|frame|center|View model evaluations]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Execute the model===&lt;br /&gt;
Once the model has been evaluated against past course data, the model can be executed to begin to make predictions about current and future courses (courses with start dates in the past or future, and end dates in the future).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the CLI====&lt;br /&gt;
These are the 2 tasks that will run through cron regularly. You can force their execution.&lt;br /&gt;
&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\train_models&lt;br /&gt;
 php admin/tool/task/cli/schedule_task.php --execute=\\tool_inspire\\task\\predict_models&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The “train” process reviews data from previously completed courses. The “predict” process generates predictions using current courses (or future courses that have not yet started, if the model is designed for that purpose).&lt;br /&gt;
&lt;br /&gt;
====Execute the model using the web interface====&lt;br /&gt;
Navigate to the Inspire Models administration page:&lt;br /&gt;
Dashboard / Site administration / Reports / Inspire models&lt;br /&gt;
&lt;br /&gt;
Select a model from the list of available models, using the Execute menu item:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire17_execute_model.png|frame|center|Select model to begin execution]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==View predictions==&lt;br /&gt;
Predictions are viewed within the web-based interface and are automatically sent to the teacher of a course using notifications. Note that you will first need to enable and execute the model.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a manager/admin===&lt;br /&gt;
Go to Site administration &amp;gt; Reports &amp;gt; Inspire models&lt;br /&gt;
Select a context from the predictions list menu, e.g. a specific course. Available contexts depend on the model definition.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire09_view_predictions.png|frame|center|View predictions as manager]]&lt;br /&gt;
&lt;br /&gt;
===Access predictions as a teacher===&lt;br /&gt;
Go to an ongoing course and Course administration &amp;gt; Reports &amp;gt; Insights&lt;br /&gt;
A user with tool/inspire:listinsights capability will also automatically receive notifications when new predictions are available for them. e.g. Course teachers will receive a notification about their students at risk of dropping out.&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire13_view_notifications.png|frame|center|View Inspire notifications]]&lt;br /&gt;
&lt;br /&gt;
From this screen, the teacher can view more details or send a message directly to the student:&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire10_notifications_list.png|frame|center|View notification details]]&lt;br /&gt;
&lt;br /&gt;
===View prediction details===&lt;br /&gt;
&lt;br /&gt;
 [[Image:inspire11_view_prediction_details.png|frame|center|View prediction details]]&lt;br /&gt;
&lt;br /&gt;
The prediction details show which of the indicator values were used in the prediction, and what the student’s values for those indicators are.&lt;br /&gt;
&lt;br /&gt;
Again, the teacher can send a message to the student at this point, or view the Outline report.&lt;br /&gt;
&lt;br /&gt;
==Developer’s documentation==&lt;br /&gt;
Architecture overview (mostly for developers / systems administrators / researchers): https://docs.moodle.org/dev/Project_Inspire_API&lt;br /&gt;
&lt;br /&gt;
==How to request a new feature==&lt;br /&gt;
* Check in the open issues if your feature have been already requested https://github.com/moodlehq/moodle-tool_inspire/issues&lt;br /&gt;
* https://tracker.moodle.org/issues/?jql=project%20%3D%20MDL%20AND%20component%20%3D%20Analytics &lt;br /&gt;
* If not, create a New issue Project: Moodle (MDL)&lt;br /&gt;
* Select the component Analytics and your Moodle version&lt;br /&gt;
* Explain your needs in the Description field &lt;br /&gt;
* Vote and Watch the issue you have created&lt;br /&gt;
&lt;br /&gt;
==Credits==&lt;br /&gt;
* David Monllaó - Lead Maintainer&lt;br /&gt;
* Elizabeth Dalton - Research Analyst&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
* [https://moodle.org/plugins/tool_inspire Inspire tool in Plugins database]&lt;br /&gt;
* [https://moodle.org/course/view.php?id=17233 Project Inspire Community]&lt;br /&gt;
* [[Learning analytics]] documentation&lt;br /&gt;
* [https://moodle.org/mod/forum/view.php?id=8044 Analytics and reporting forum]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129229</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129229"/>
		<updated>2017-11-09T14:26:01Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Tracking progress}}{{New features}}&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
This page describes analytics features in Moodle core. Open source, transparent next-generation learning analytics using machine learning backends that go beyond simple descriptive analytics to provide predictions of learner success to learners and teachers.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. Moodle core includes 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP one is the default. There are no other system requirements to use this processor.&lt;br /&gt;
* The Python one is more powerful and it generates graphs with the model performance but it requires setting up extra stuff like Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides the course duration in parts, the predictions engine will run at the end of these parts. It is recommended that you only enable the time splitting methods you could be interested on using; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
===Models output directory===&lt;br /&gt;
&lt;br /&gt;
This setting allows you to define a directory where machine learning backends data is stored. Be sure this directory exists and is writable by the web server.&lt;br /&gt;
&lt;br /&gt;
== Models management ==&lt;br /&gt;
&lt;br /&gt;
Moodle can support multiple prediction models at once. Moodle core comes with two prediction models &#039;&#039;Students at risk of dropping out&#039;&#039; and &#039;&#039;No teaching&#039;&#039;, you can add your own prediction models using [https://docs.moodle.org/dev/Analytics_API Moodle analytics API]. Each model is based on the prediction of a single, specific &amp;quot;target,&amp;quot; or outcome (whether desirable or undesirable), based on a number of selected indicators.&lt;br /&gt;
&lt;br /&gt;
You can manage your system models from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Get predictions:&#039;&#039;&#039; Train machine learning algorithms with the new data available on the system and get predictions for ongoing courses. &#039;&#039;Predictions are not limited to ongoing courses, this depends on the model.&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Evaluate:&#039;&#039;&#039; Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends, they will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process use all information available on the site, even if it is very old, the accuracy returned by the evaluation process will generally be lower than the real model accuracy as indicators are more reliably calculated straight after training data is available because the site state changes along time. The metric used as accuracy is the &#039;&#039;Matthew’s correlation coefficient&#039;&#039; (good metric for binary classifications)&lt;br /&gt;
* &#039;&#039;&#039;Log:&#039;&#039;&#039; View previous evaluations log, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curves graphs, the tensorboard log dir or the model&#039;s Matthew’s correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
* &#039;&#039;&#039;Edit:&#039;&#039;&#039; You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
* &#039;&#039;&#039;Enable / Disable:&#039;&#039;&#039; The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
* &#039;&#039;&#039;Export&#039;&#039;&#039;: Export your site training data to share it with your partner institutions.&lt;br /&gt;
* &#039;&#039;&#039;Invalid site elements&#039;&#039;&#039;: Reports on what elements in your site can not be analysed by this model&lt;br /&gt;
* &#039;&#039;&#039;Clear predictions&#039;&#039;&#039;: Clears all the model predictions and training data&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
=== Core models ===&lt;br /&gt;
&lt;br /&gt;
==== Students at risk of dropping out ====&lt;br /&gt;
&lt;br /&gt;
This model predicts students who are at risk of non-completion (dropping out) of a Moodle course, based on low student engagement. The prediction model uses the Community of Inquiry model of student engagement, consisting of three parts:&lt;br /&gt;
&lt;br /&gt;
* Cognitive presence&lt;br /&gt;
* Social presence&lt;br /&gt;
* Teacher presence&lt;br /&gt;
&lt;br /&gt;
This prediction model is able to analyze and draw conclusions from a wide variety of courses, and apply those conclusions to make predictions about new courses. The model is not limited to making predictions about student success only in perfect copies of courses offered in the past. However, there are some limitations:&lt;br /&gt;
&lt;br /&gt;
# This prediction model assumes that courses have fixed start and end dates, and is not designed to be used with rolling enrollment courses. Models that support a wider range of course types will be included in future versions of Inspire. Because of this model design assumption, it is very important to properly set course start and end dates for each course to use this model. If both past courses and ongoing courses start and end dates are not properly set predictions cannot be accurate. Because the course end date field was only introduced in Moodle 3.2 and some courses may not have set a course start date in the past, we include a command line interface script (https://github.com/moodlehq/moodle-tool_inspire/blob/master/cli/guess_course_start_and_end.php) that attempts to estimate past course start and end dates by looking at the student enrolments and students&#039; activity logs. After running this script, please check that the estimated start and end dates script results are reasonably correct.&lt;br /&gt;
# This model requires a certain amount of in-Moodle data with which to make predictions. At the present time, only core Moodle activities are included in the indicator set (see below). Courses which do not include several core Moodle activities per “time slice” will have poor predictive support in this model. This prediction model will be most effective with fully online or “hybrid” or “blended” courses with substantial online components.&lt;br /&gt;
&lt;br /&gt;
==== No teaching ====&lt;br /&gt;
&lt;br /&gt;
This model insights will inform site managers of which courses with a close start date will not have teaching activity. This is a simple model and it does not use machine learning backend to return predictions. It bases the predictions on assumptions like there is no teaching if there are no students.&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different point in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate insights and which predictions will be ignored. This is an example of &#039;&#039;Students at risk of dropping out&#039;&#039; prediction model; if a student is predicted as not at risk no insight is generated as what is interesting is to know which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Analytics]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:prediction-model-insights.jpeg&amp;diff=129215</id>
		<title>File:prediction-model-insights.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:prediction-model-insights.jpeg&amp;diff=129215"/>
		<updated>2017-11-09T09:53:31Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: Dmonllao uploaded a new version of File:prediction-model-insights.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:model-evaluation.jpeg&amp;diff=129214</id>
		<title>File:model-evaluation.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:model-evaluation.jpeg&amp;diff=129214"/>
		<updated>2017-11-09T09:53:14Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: Dmonllao uploaded a new version of File:model-evaluation.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:prediction-models-list.jpeg&amp;diff=129213</id>
		<title>File:prediction-models-list.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:prediction-models-list.jpeg&amp;diff=129213"/>
		<updated>2017-11-09T09:52:52Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: Dmonllao uploaded a new version of File:prediction-models-list.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:prediction-model-insights.jpeg&amp;diff=129212</id>
		<title>File:prediction-model-insights.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:prediction-model-insights.jpeg&amp;diff=129212"/>
		<updated>2017-11-09T09:48:08Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:model-evaluation.jpeg&amp;diff=129211</id>
		<title>File:model-evaluation.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:model-evaluation.jpeg&amp;diff=129211"/>
		<updated>2017-11-09T09:47:12Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=File:prediction-models-list.jpeg&amp;diff=129210</id>
		<title>File:prediction-models-list.jpeg</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=File:prediction-models-list.jpeg&amp;diff=129210"/>
		<updated>2017-11-09T09:47:02Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129209</id>
		<title>Analytics</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Analytics&amp;diff=129209"/>
		<updated>2017-11-09T09:45:19Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Info to be added soon...&#039;&#039;&lt;br /&gt;
This page describes the Analytics models tool used to visualise, manage and evaluate prediction models.&lt;br /&gt;
&lt;br /&gt;
== Settings ==&lt;br /&gt;
&lt;br /&gt;
You can access &#039;&#039;Analytics settings&#039;&#039; from &#039;&#039;Site administration &amp;gt; Analytics &amp;gt; Analytics settings&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Predictions processor ===&lt;br /&gt;
&lt;br /&gt;
Prediction processors are the machine learning backends that process the datasets generated from the calculated indicators and targets and return predictions. This plugin is shipped with 2 prediction processors:&lt;br /&gt;
&lt;br /&gt;
* The PHP one is the default&lt;br /&gt;
* The Python one is more powerful and it generates graphs with the model performance but it requires setting up extra stuff like Python itself (https://wiki.python.org/moin/BeginnersGuide/Download) and the moodlemlbackend package.&lt;br /&gt;
&lt;br /&gt;
    pip install moodlemlbackend&lt;br /&gt;
&lt;br /&gt;
=== Time splitting methods ===&lt;br /&gt;
&lt;br /&gt;
The time splitting method divides the course duration in parts, the predictions engine will run at the end of these parts. It is recommended that you only enable the time splitting methods you could be interested on using; the site contents analyser will calculate all indicators using each of the enabled time splitting methods. The more enabled time splitting methods the slower the evaluation process will be.&lt;br /&gt;
&lt;br /&gt;
== Models management ==&lt;br /&gt;
&lt;br /&gt;
You can access the tool from &#039;&#039;Site Administration &amp;gt; Analytics &amp;gt; Analytics models&#039;&#039; to see the list of prediction models.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-models-list.jpeg]]&lt;br /&gt;
&lt;br /&gt;
These are some of the actions you can perform on a model:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Edit:&#039;&#039; You can edit the models by modifying the list of indicators or the time-splitting method. All previous predictions will be deleted when a model is modified. Models based on assumptions (static models) can not be edited.&lt;br /&gt;
* &#039;&#039;Enable / Disable:&#039;&#039; The scheduled task that trains machine learning algorithms with the new data available on the system and gets predictions for ongoing courses skips disabled models. Previous predictions generated by disabled models are not available until the model is enabled again.&lt;br /&gt;
* &#039;&#039;Evaluate:&#039;&#039; Evaluate the prediction model by getting all the training data available on the site, calculating all the indicators and the target and passing the resulting dataset to machine learning backends, they will split the dataset into training data and testing data and calculate its accuracy. Note that the evaluation process use all information available on the site, even if it is very old, the accuracy returned by the evaluation process will generally be lower than the real model accuracy as indicators are more reliably calculated straight after training data is available because the site state changes along time. The metric used as accuracy is the &#039;&#039;Matthew’s correlation coefficient&#039;&#039; (good metric for binary classifications)&lt;br /&gt;
* &#039;&#039;Log:&#039;&#039; View previous evaluations log, including the model accuracy as well as other technical information generated by the machine learning backends like ROC curves, learning curves graphs, the tensorboard log dir or the model&#039;s Matthew’s correlation coefficient. The information available will depend on the machine learning backend in use.&lt;br /&gt;
* &#039;&#039;Get predictions:&#039;&#039; Train machine learning algorithms with the new data available on the system and get predictions for ongoing courses. &#039;&#039;Predictions are not limited to ongoing courses, this depends on the model.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:model-evaluation.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Predictions and Insights ==&lt;br /&gt;
&lt;br /&gt;
Models will start generating predictions at different point in time, depending on the site prediction models and the site courses start and end dates. &lt;br /&gt;
&lt;br /&gt;
Each model defines which predictions will generate insights and which predictions will be ignored. This is an example of &#039;&#039;Students at risk of dropping out&#039;&#039; prediction model; if a student is predicted as not at risk no insight is generated as what is interesting is to know which students are at risk of dropping out of courses, not which students are not at risk.&lt;br /&gt;
&lt;br /&gt;
[[File:prediction-model-insights.jpeg]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=124195</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=124195"/>
		<updated>2016-06-23T02:01:08Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* The Solr server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. We will add more contents in future Moodle versions. Developers interested in adding plugin&#039;s contents to global search may be interested in looking at the [https://docs.moodle.org/dev/Search_API Search API].&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
Note that for medium/large sites you may need to increase maxBooleanClauses setting. In [https://tracker.moodle.org/browse/MDL-54992 MDL-54992] we are working on an alternative way to query the server. &lt;br /&gt;
 &lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=124138</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=124138"/>
		<updated>2016-06-20T02:38:49Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* What is Global search? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==What can I search for?==&lt;br /&gt;
You can search for your courses, activities information and some activities contents like forum posts, book chapters, glossary entries or collaborative wikis pages. We will add more contents in future Moodle versions. Developers interested in adding plugin&#039;s contents to global search may be interested in looking at the [https://docs.moodle.org/dev/Search_API Search API].&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=334938 Global search doesn&#039;t index plugins?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123700</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123700"/>
		<updated>2016-05-20T02:02:51Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Linux (Debian/Ubuntu) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{More features}}&lt;br /&gt;
{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
===Solr search query features===&lt;br /&gt;
&lt;br /&gt;
You can improve your search using any of the following search query features:&lt;br /&gt;
&lt;br /&gt;
* Specifying the field to be searched by prefixing the search query with &#039;title:&#039;, &#039;content:&#039;, &#039;name:&#039;, or &#039;intro:&#039; e.g.&#039;title:news&#039; returns results with the word &#039;news&#039; in the title&lt;br /&gt;
* Boolean operators (&#039;AND&#039;, &#039;OR&#039;, &#039;NOT&#039;) to combine or exclude keywords&lt;br /&gt;
* Wildcard characters (&#039;*&#039; or &#039;?&#039; ) to represent characters in the search query&lt;br /&gt;
* Proximity searches (&#039;~&#039;) e.g. mood~2 returns &amp;quot;moodle&amp;quot; (2 letters away from &amp;quot;mood&amp;quot;), Moodle Australia~3 returns results containing &amp;quot;Moodle HQ in Perth, Australia&amp;quot; (the queried terms were within 3 words of each other)&lt;br /&gt;
* Boosting terms (&#039;^&#039;) to boost certain words or phrases e.g. &amp;quot;Perth Australia&amp;quot;^5 &amp;quot;Australia&amp;quot; will return results with the phrase &amp;quot;Perth Australia&amp;quot; as more relevant.&lt;br /&gt;
&lt;br /&gt;
Note: The above features are only available when using the Solr search engine.&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own. It&#039;s recommended you set everything up first, index the site contents &#039;&#039;and only then&#039;&#039; enable Global search.}}&lt;br /&gt;
&lt;br /&gt;
===Setting up Solr===&lt;br /&gt;
&lt;br /&gt;
====General Setup====&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
====File Indexing====&lt;br /&gt;
&lt;br /&gt;
Solr has the ability to index the contents of files, such as File resources and attachments to Forum posts. This uses the [https://tika.apache.org/ Tika] engine which comes bundled with Solr. To enable this feature:&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039; enable the checkbox &#039;&#039;&#039;Enable file indexing&#039;&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Maximum file size to index (kB)&#039;&#039;&#039; to some value - the default is &#039;&#039;&#039;2097152&#039;&#039;&#039; (2GB)&lt;br /&gt;
#* Files larger than this limit will not be sent for Solr for indexing, but the file name will still be indexed.&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=====Memory and File indexing considerations=====&lt;br /&gt;
&lt;br /&gt;
For large sites, and particularly if you are using the File indexing feature, it&#039;s a good idea to give Solr plenty of memory, eg aound 10-20GB. To start Solr with more than its default 512MB of RAM, use the &#039;&#039;-m&#039;&#039; option: &lt;br /&gt;
 solr start -m 12g&lt;br /&gt;
&lt;br /&gt;
See the documents for your version of Solr on how to increases memory when Solr is started automatically.&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123552</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123552"/>
		<updated>2016-05-17T01:55:28Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* How is it set up? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch2.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2a.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.}}&lt;br /&gt;
&lt;br /&gt;
You can start by enabling Global search feature but we recommend to set everything up first, index the site contents and once the process finishes enable Global search, so users can start using the feature straight after enabling it.&lt;br /&gt;
&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr) &lt;br /&gt;
# If you are using Solr with SSL encryption, you will need to configure Moodle as such. This is important if solr is not installed in the web server server.&lt;br /&gt;
## You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
## Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
## Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
## &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
## &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
## &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# Index your site&#039;s data going to &#039;&#039;Site administration &amp;gt; Reports &amp;gt; Global search info&#039;&#039; or from the CLI running &#039;&#039;&#039;php admin/tool/task/cli/schedule_task.php --execute=&amp;quot;\core\task\search_index_task&amp;quot;&#039;&#039;&#039; script, being the CLI script the recommended option for big sites.&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields. You will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123414</id>
		<title>Global search</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Global_search&amp;diff=123414"/>
		<updated>2016-05-13T00:14:56Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* The Solr server */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{New features}}&lt;br /&gt;
==What is Global search?==&lt;br /&gt;
*Global search lets you search everywhere on the Moodle site that you have access to. A student can search their courses for particular lecture notes, for example, or a teacher could search for subject-related activities.&lt;br /&gt;
*The feature needs to be enabled by the administrator and a search box is then available next to the user menu.&lt;br /&gt;
&lt;br /&gt;
[[File:NFGlobalsearchbox.png|thumb|center|480px|Searching the site (when global search is enabled)]]&lt;br /&gt;
&lt;br /&gt;
*A [[Global search block]] may also be added to course pages.&lt;br /&gt;
&lt;br /&gt;
==How does it work?==&lt;br /&gt;
*Click the search icon by the user menu and type a search term into the box that appears, or type into the box in the [[Global search block]] if enabled.&lt;br /&gt;
*On the next screen, you can simply click the search button to search everywhere, or expand the Filter to search in specific areas:&lt;br /&gt;
&lt;br /&gt;
[[File:NFFilteringGlobalSearch.png|thumb|center|600px|Filtering the search]]&lt;br /&gt;
&lt;br /&gt;
*You will then see results displayed from all areas of Moodle you have access to:&lt;br /&gt;
&lt;br /&gt;
[[File:31GSResults2.png|thumb|center|600px|Search results]]&lt;br /&gt;
&lt;br /&gt;
==How is it set up?==&lt;br /&gt;
&lt;br /&gt;
{{Note|Global search needs a search engine. Instructions for the installing the PHP Solr extension and a Solr server are below. See the [https://docs.moodle.org/dev/Search_engines Developer docs on Search engine plugins] if you wish to write your own.}}&lt;br /&gt;
&lt;br /&gt;
# Enable Global search in &#039;&#039;Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
# Set the feature up in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt;Search &amp;gt; Manage global search&#039;&#039; by selecting Solr as the search engine and ticking search area checkboxes as required&lt;br /&gt;
# In &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;, set &#039;&#039;&#039;Host name&#039;&#039;&#039; to localhost, &#039;&#039;&#039;Port&#039;&#039;&#039; to 8983 and &#039;&#039;&#039;Index name&#039;&#039;&#039; to &#039;moodle&#039; (the name of the index in Solr)&lt;br /&gt;
&lt;br /&gt;
If you are using Solr with SSL encryption, you will need to configure Moodle as such.&lt;br /&gt;
# You will need a separate key file and cacert file, both in pem format, located on your server Moodle, and readable by the PHP process.&lt;br /&gt;
# Go to &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Search &amp;gt; Solr&#039;&#039;&lt;br /&gt;
# Set &#039;&#039;&#039;Secure mode&#039;&#039;&#039; to Yes&lt;br /&gt;
# &#039;&#039;&#039;SSL certificate&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
# &#039;&#039;&#039;SSL key&#039;&#039;&#039; to /path/to/certs/solr-ssl.key.pem&lt;br /&gt;
# &#039;&#039;&#039;SSL key Password&#039;&#039;&#039; to The password used to lock the SSL Key&lt;br /&gt;
# &#039;&#039;&#039;SSL CA certificates name&#039;&#039;&#039; to /path/to/certs/solr-ssl.cacert.pem&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===How to install Solr===&lt;br /&gt;
&lt;br /&gt;
You need PHP Solr extension installed. You can download the official latest versions from [http://pecl.php.net/package/solr](http://pecl.php.net/package/solr) The minimum required version is PECL Solr 2.1 for PHP 5 branch and PECL Solr 2.4 for PHP 7 branch.&lt;br /&gt;
&lt;br /&gt;
Basic installation steps (using apache web server):&lt;br /&gt;
&lt;br /&gt;
==== Linux (Debian/Ubuntu) ====&lt;br /&gt;
&lt;br /&gt;
    sudo apt-get install libpcre3-dev libxml2-dev libcurl4-openssl-dev&lt;br /&gt;
    sudo apt-get install php5-dev&lt;br /&gt;
    sudo apt-get install php-pear&lt;br /&gt;
    sudo pecl install solr&lt;br /&gt;
    sudo service apache2 restart&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/apache2/conf.d/solr.ini&amp;quot;&lt;br /&gt;
    sudo sh -c &amp;quot;echo &#039;extension=solr.so&#039; &amp;gt; /etc/php5/cli/conf.d/solr.ini&amp;quot;&lt;br /&gt;
&lt;br /&gt;
==== OSX using macports ====&lt;br /&gt;
&lt;br /&gt;
    sudo port install apache-solr4&lt;br /&gt;
    sudo port install php54-solr&lt;br /&gt;
&lt;br /&gt;
==== OSX using homebrew ====&lt;br /&gt;
&lt;br /&gt;
    brew install homebrew/php/php56-solr&lt;br /&gt;
&lt;br /&gt;
==== Windows ====&lt;br /&gt;
&lt;br /&gt;
Install the pecl package as usual. (This has not yet been tested.)&lt;br /&gt;
&lt;br /&gt;
==== The Solr server ====&lt;br /&gt;
&lt;br /&gt;
Moodle 3.1 supports Solr server from 4.0 onwards, although you can only use the Solr schema setup script that we provide with Moodle from Solr 5. The latest Solr 5 available version is the recommended one; the same will apply to Solr 6 once it is released. &lt;br /&gt;
&lt;br /&gt;
The following example snippet (feel free to copy &amp;amp; paste into a .sh script with execution permissions) will download Solr 5.4.1 (replace it with latest 5.x) in the current directory, start the solr server and create an index in it named &#039;&#039;&#039;moodle&#039;&#039;&#039; to add moodle data to it.&lt;br /&gt;
&lt;br /&gt;
    #!/bin/bash&lt;br /&gt;
    set -e&lt;br /&gt;
    SOLRVERSION=5.4.1&lt;br /&gt;
    SOLRNAME=solr-$SOLRVERSION&lt;br /&gt;
    SOLRTAR=$SOLRNAME&#039;.tgz&#039;&lt;br /&gt;
    INDEXNAME=moodle&lt;br /&gt;
    if [ -d $SOLRNAME ]; then&lt;br /&gt;
        echo &amp;quot;Error: Directory $SOLRNAME already exists, remove it before starting the setup again.&amp;quot;&lt;br /&gt;
        exit 1&lt;br /&gt;
    fi&lt;br /&gt;
    if [ ! -f $SOLRTAR ]; then&lt;br /&gt;
        wget http://www-us.apache.org/dist/lucene/solr/$SOLRVERSION/$SOLRTAR&lt;br /&gt;
    fi&lt;br /&gt;
    tar -xvzf $SOLRTAR&lt;br /&gt;
    cd $SOLRNAME&lt;br /&gt;
    bin/solr start&lt;br /&gt;
    bin/solr create -c $INDEXNAME&lt;br /&gt;
    # After setting it up and creating the index use:&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr start&amp;quot; from CLI to start the server&lt;br /&gt;
    # - &amp;quot;/yourdirectory/solrdir/bin/solr stop&amp;quot; from CLI to stop the server.&lt;br /&gt;
&lt;br /&gt;
=====Solr 5/6 schema setup=====&lt;br /&gt;
&lt;br /&gt;
Moodle will use Solr&#039;s managed schema interface to install the required fields, you will be directed on what to do from the Manage global search page.&lt;br /&gt;
&lt;br /&gt;
For very large or busy sites, it is recommended that you manually remove the &#039;&#039;&#039;_text_&#039;&#039;&#039; field, and associated copy directive from, the default Solr schema. This field is not used by Moodle, and will significantly slow indexing, and increase the size of the resulting Solr core.&lt;br /&gt;
&lt;br /&gt;
=====Solr 4 schema setup=====&lt;br /&gt;
&lt;br /&gt;
You cannot  use the schema setup script when using a Solr 4 server. If you really want to use the Solr 4x branch, here are the field types descriptions:&lt;br /&gt;
&lt;br /&gt;
Extracted from search/classes/document.php&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Field name&lt;br /&gt;
! Field type&lt;br /&gt;
! Stored&lt;br /&gt;
! Indexed&lt;br /&gt;
! Query field&lt;br /&gt;
|-&lt;br /&gt;
| id&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| itemid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| title&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| content&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| contextid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| areaid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| type&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| courseid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| owneruserid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| modified&lt;br /&gt;
| org.apache.solr.schema.TrieDateField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| userid&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| description1&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| description2&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|-&lt;br /&gt;
| solr_filegroupingid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileid&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontenthash&lt;br /&gt;
| org.apache.solr.schema.StrField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_fileindexstatus&lt;br /&gt;
| org.apache.solr.schema.TrieIntField&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
| false&lt;br /&gt;
|-&lt;br /&gt;
| solr_filecontent&lt;br /&gt;
| org.apache.solr.schema.TextField&lt;br /&gt;
| false&lt;br /&gt;
| true&lt;br /&gt;
| true&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Búsqueda global]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_web_services&amp;diff=118464</id>
		<title>Using web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_web_services&amp;diff=118464"/>
		<updated>2015-05-07T02:36:20Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Web services}}&lt;br /&gt;
This document explains how an administrator can set up a web service for users to access a service. Each user will have a specific and unique security key (also known as a &amp;quot;token&amp;quot;) to access the service.&lt;br /&gt;
&lt;br /&gt;
== Enabling web services==&lt;br /&gt;
[[Image:Enable_web_service.jpg|thumb|Enabling web services]]&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
# Check &#039;Enable web services&#039; then click &#039;Save Changes&#039;&lt;br /&gt;
&lt;br /&gt;
Note: For security reasons, web services should only be enabled if you intend to make use of it.&lt;br /&gt;
&lt;br /&gt;
== Enabling protocols ==&lt;br /&gt;
[[Image:Enable_protocol.jpg|thumb|left|Enabling protocols]]&lt;br /&gt;
Usually external applications that users wish to use dictate which protocols should be enabled. &lt;br /&gt;
&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage protocols&#039;&#039;&lt;br /&gt;
# Enable the protocols (SOAP, REST, XMLRPC, AMF, ...) as required&lt;br /&gt;
&lt;br /&gt;
== Enabling web service function documentation ==&lt;br /&gt;
[[Image:Security keys and documentation.jpg|thumb|Security keys page with documentation link]]&lt;br /&gt;
Enabling web service function documentation (also on the Manage protocols page) results in user-specific web service documentation being available for each user on their [[Security keys]] page. This option is mainly useful to web service client developers. If nobody is creating a web service client, there is no need to enable this feature.&lt;br /&gt;
&lt;br /&gt;
== Creating a service ==&lt;br /&gt;
If none of the pre-build web services match your needs, you can create a custom service i.e. select which of the standard web service functions are available via that service.&lt;br /&gt;
&lt;br /&gt;
You can enable only the specific functions that you need to expose, so not compromising on security.&lt;br /&gt;
[[Image:Create a service.jpg|thumb|Creating a service|left]]&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; External services&#039;&#039;&lt;br /&gt;
# Click Add new custom service&lt;br /&gt;
#* &#039;Authorised users only&#039; - If enabled, you will need to select the authorised users manually. Otherwise all users with appropriate permissions are allowed&lt;br /&gt;
#* &#039;Required capability&#039; - If enabled, any user accessing the web service will be checked against this selected capability. (This is just an additional optional security layer.)&lt;br /&gt;
# Enter a name and check Enabled&lt;br /&gt;
# Click the button &#039;Add service&#039;&lt;br /&gt;
&lt;br /&gt;
==Adding functions to the service==&lt;br /&gt;
[[Image:Select a web service function.jpg|thumb|Adding functions to the service]]Your service is currently empty and doesn&#039;t do anything. Web service functions need to be added. Your choice will be dictated by what you allow the external application to do. For this example, select &#039;Create group&#039;.&lt;br /&gt;
&lt;br /&gt;
# Click &#039;Add functions&#039; link&lt;br /&gt;
# Select &#039;create group&#039; function and click the &#039;Add functions&#039; button&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note that deprecated functions can not be added to services although the ones that are already part of a service can remain there until they are removed from Moodle codebase.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You should be back to the service functions list. &#039;Required capabilities&#039; are indicated for each function. Users need the required capabilities to run a function. The function descriptions in the API Documentation can also give you more information about the required capabilities (&#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; API Documentation&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==Enabling capabilities==&lt;br /&gt;
&lt;br /&gt;
The final step is to grant appropriate permissions. The following capabilities should be allowed:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/webservice:createtoken|moodle/webservice:createtoken]] - for allowing users to generate a security key&lt;br /&gt;
* [[Capabilities/webservice/rest:use | webservice/rest:use]], [[Capabilities/webservice/soap:use | webservice/soap:use]], [[Capabilities/webservice/xmlrpc:use | webservice/xmlrpc:use]], [[Capabilities/webservice/amf:use | webservice/amf:use]] which match the enabled protocols.&lt;br /&gt;
* The service &#039;&#039;Required capability&#039;&#039; if set (&#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage services &amp;gt;&#039;&#039;&#039;Edit&#039;&#039;&#039; link&#039;&#039;).&lt;br /&gt;
* The required capabilities for the web service functions. These required capabilities are listed when you add a function to the service. For more information about roles and capabilities, read the [[Manage roles]] documentation.&lt;br /&gt;
&lt;br /&gt;
Once done, the web service should be set up. Users should be able to [[Security keys|obtain a personal security key]].&lt;br /&gt;
&lt;br /&gt;
= Alternative settings = &lt;br /&gt;
&lt;br /&gt;
== Authorise only specific users==&lt;br /&gt;
[[Image:Authorised users link.jpg|thumb]] [[Image:Authorised user selection page.jpg|thumb]]&lt;br /&gt;
# &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; External Services&#039;&#039;&lt;br /&gt;
# Select &#039;&#039;&#039;Authorised users&#039;&#039;&#039; link (the service must have been set as &#039;&#039;&#039;Authorised users only&#039;&#039;&#039; in the &#039;&#039;&#039;Edit&#039;&#039;&#039; link)&lt;br /&gt;
# Select some users and click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Moodle indicates if some capabilities need to be assigned to an authorised user. Moreover if you click on the authorised user fullname, you can set up some specific options: &#039;&#039;IP restriction&#039;&#039; and &#039;&#039;Valid until&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Create a token  ==&lt;br /&gt;
[[Image:Create_token.jpg|thumb]]&lt;br /&gt;
This feature allows you to create a token for specific user. It can be useful if a user doesn&#039;t have the moodle/create:token capability. This is also the only way to create a token for an administrator. For security reason, tokens are not automatically generated in the administrator security  keys page.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage tokens&#039;&#039;&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
# Select the created user and service&lt;br /&gt;
# Click on &#039;&#039;&#039;Saves changes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As you created a token for this user, you do not need to assign &amp;quot;&#039;&#039;moodle/webservice:createtoken&#039;&#039;&amp;quot; to him/her.&lt;br /&gt;
Finally, note that, as for authorised users, you can also set &#039;&#039;IP restriction&#039;&#039; and &#039;&#039;Valid until&#039;&#039; on a token.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
 		&lt;br /&gt;
*[http://www.joomdle.com/wiki/Preparing_Moodle_20#Setting_up_Moodle_Web_services Joomdle documentation about setting Moodle web services]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Using_web_services&amp;diff=118463</id>
		<title>Using web services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Using_web_services&amp;diff=118463"/>
		<updated>2015-05-07T02:34:45Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: /* Adding functions to the service */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Web services}}&lt;br /&gt;
This document explains how an administrator can set up a web service for users to access a service. Each user will have a specific and unique security key (also known as a &amp;quot;token&amp;quot;) to access the service.&lt;br /&gt;
&lt;br /&gt;
== Enabling web services==&lt;br /&gt;
[[Image:Enable_web_service.jpg|thumb|Enabling web services]]&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Advanced features&#039;&#039;&lt;br /&gt;
# Check &#039;Enable web services&#039; then click &#039;Save Changes&#039;&lt;br /&gt;
&lt;br /&gt;
Note: For security reasons, web services should only be enabled if you intend to make use of it.&lt;br /&gt;
&lt;br /&gt;
== Enabling protocols ==&lt;br /&gt;
[[Image:Enable_protocol.jpg|thumb|left|Enabling protocols]]&lt;br /&gt;
Usually external applications that users wish to use dictate which protocols should be enabled. &lt;br /&gt;
&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage protocols&#039;&#039;&lt;br /&gt;
# Enable the protocols (SOAP, REST, XMLRPC, AMF, ...) as required&lt;br /&gt;
&lt;br /&gt;
== Enabling web service function documentation ==&lt;br /&gt;
[[Image:Security keys and documentation.jpg|thumb|Security keys page with documentation link]]&lt;br /&gt;
Enabling web service function documentation (also on the Manage protocols page) results in user-specific web service documentation being available for each user on their [[Security keys]] page. This option is mainly useful to web service client developers. If nobody is creating a web service client, there is no need to enable this feature.&lt;br /&gt;
&lt;br /&gt;
== Creating a service ==&lt;br /&gt;
If none of the pre-build web services match your needs, you can create a custom service i.e. select which of the standard web service functions are available via that service.&lt;br /&gt;
&lt;br /&gt;
You can enable only the specific functions that you need to expose, so not compromising on security.&lt;br /&gt;
[[Image:Create a service.jpg|thumb|Creating a service|left]]&lt;br /&gt;
# Access &#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; External services&#039;&#039;&lt;br /&gt;
# Click Add new custom service&lt;br /&gt;
#* &#039;Authorised users only&#039; - If enabled, you will need to select the authorised users manually. Otherwise all users with appropriate permissions are allowed&lt;br /&gt;
#* &#039;Required capability&#039; - If enabled, any user accessing the web service will be checked against this selected capability. (This is just an additional optional security layer.)&lt;br /&gt;
# Enter a name and check Enabled&lt;br /&gt;
# Click the button &#039;Add service&#039;&lt;br /&gt;
&lt;br /&gt;
==Adding functions to the service==&lt;br /&gt;
[[Image:Select a web service function.jpg|thumb|Adding functions to the service]]Your service is currently empty and doesn&#039;t do anything. Web service functions need to be added. Your choice will be dictated by what you allow the external application to do. For this example, select &#039;Create group&#039;.&lt;br /&gt;
&lt;br /&gt;
# Click &#039;Add functions&#039; link&lt;br /&gt;
# Select &#039;create group&#039; function and click the &#039;Add functions&#039; button&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note that, from Moodle 2.9, deprecated functions can not be added to services although deprecated functions that are already part of a service can remain there until they are removed from Moodle codebase.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
You should be back to the service functions list. &#039;Required capabilities&#039; are indicated for each function. Users need the required capabilities to run a function. The function descriptions in the API Documentation can also give you more information about the required capabilities (&#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; API Documentation&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
==Enabling capabilities==&lt;br /&gt;
&lt;br /&gt;
The final step is to grant appropriate permissions. The following capabilities should be allowed:&lt;br /&gt;
&lt;br /&gt;
* [[Capabilities/moodle/webservice:createtoken|moodle/webservice:createtoken]] - for allowing users to generate a security key&lt;br /&gt;
* [[Capabilities/webservice/rest:use | webservice/rest:use]], [[Capabilities/webservice/soap:use | webservice/soap:use]], [[Capabilities/webservice/xmlrpc:use | webservice/xmlrpc:use]], [[Capabilities/webservice/amf:use | webservice/amf:use]] which match the enabled protocols.&lt;br /&gt;
* The service &#039;&#039;Required capability&#039;&#039; if set (&#039;&#039;Administration &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage services &amp;gt;&#039;&#039;&#039;Edit&#039;&#039;&#039; link&#039;&#039;).&lt;br /&gt;
* The required capabilities for the web service functions. These required capabilities are listed when you add a function to the service. For more information about roles and capabilities, read the [[Manage roles]] documentation.&lt;br /&gt;
&lt;br /&gt;
Once done, the web service should be set up. Users should be able to [[Security keys|obtain a personal security key]].&lt;br /&gt;
&lt;br /&gt;
= Alternative settings = &lt;br /&gt;
&lt;br /&gt;
== Authorise only specific users==&lt;br /&gt;
[[Image:Authorised users link.jpg|thumb]] [[Image:Authorised user selection page.jpg|thumb]]&lt;br /&gt;
# &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; External Services&#039;&#039;&lt;br /&gt;
# Select &#039;&#039;&#039;Authorised users&#039;&#039;&#039; link (the service must have been set as &#039;&#039;&#039;Authorised users only&#039;&#039;&#039; in the &#039;&#039;&#039;Edit&#039;&#039;&#039; link)&lt;br /&gt;
# Select some users and click &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Moodle indicates if some capabilities need to be assigned to an authorised user. Moreover if you click on the authorised user fullname, you can set up some specific options: &#039;&#039;IP restriction&#039;&#039; and &#039;&#039;Valid until&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Create a token  ==&lt;br /&gt;
[[Image:Create_token.jpg|thumb]]&lt;br /&gt;
This feature allows you to create a token for specific user. It can be useful if a user doesn&#039;t have the moodle/create:token capability. This is also the only way to create a token for an administrator. For security reason, tokens are not automatically generated in the administrator security  keys page.&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;Administration &amp;gt; Site Administration &amp;gt; Plugins &amp;gt; Web services &amp;gt; Manage tokens&#039;&#039;&lt;br /&gt;
# Click on &#039;&#039;&#039;Add&#039;&#039;&#039;&lt;br /&gt;
# Select the created user and service&lt;br /&gt;
# Click on &#039;&#039;&#039;Saves changes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As you created a token for this user, you do not need to assign &amp;quot;&#039;&#039;moodle/webservice:createtoken&#039;&#039;&amp;quot; to him/her.&lt;br /&gt;
Finally, note that, as for authorised users, you can also set &#039;&#039;IP restriction&#039;&#039; and &#039;&#039;Valid until&#039;&#039; on a token.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
 		&lt;br /&gt;
*[http://www.joomdle.com/wiki/Preparing_Moodle_20#Setting_up_Moodle_Web_services Joomdle documentation about setting Moodle web services]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Administration_via_command_line&amp;diff=118462</id>
		<title>Administration via command line</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Administration_via_command_line&amp;diff=118462"/>
		<updated>2015-05-07T01:44:16Z</updated>

		<summary type="html">&lt;p&gt;Dmonllao: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Installing Moodle}}&lt;br /&gt;
==Running CLI scripts==&lt;br /&gt;
If you have shell access to your web server, you may find various CLI (command line interface) scripts useful during Moodle administration. Core admin CLI tools are located in the &amp;lt;code&amp;gt;admin/cli/*&amp;lt;/code&amp;gt; folder. Other plugins provide their CLI functionality via scripts in their own cli folder. For example, the enrol_db sync script is located in &amp;lt;code&amp;gt;enrol/db/cli/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To avoid problems with access control, you should run them as the owner of the web server process. It is especially important for CLI installation and upgrade as they create new files in moodledata directory and the web server has to have write access to them. In Linux distributions, the user that runs the web server is usually apache or wwrun or httpd or something similar. As a root, you will probably want to execute Moodle CLI scripts like this:&lt;br /&gt;
&lt;br /&gt;
    $ cd /path/to/your/moodle/dir&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/somescript.php --params&lt;br /&gt;
&lt;br /&gt;
Most of the scripts accept common --help (or -h) parameter to display the full usage information, for example:&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --help&lt;br /&gt;
&lt;br /&gt;
== Upgrading ==&lt;br /&gt;
&lt;br /&gt;
Moodle can be upgraded from the command line. As with the installation script, there is either interactive or non-interactive mode of the upgrade. The script itself does not put the site into the maintenance mode, you have to do it on your own. Also, the script does not backup any data (if you read this page, you probably have some own scripts to backup your moodledata and the database, right?)&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
&lt;br /&gt;
Upgrading via command line is a very comfortable way of Moodle upgrade if you use Git checkout of the Moodle source code (see [[Git for Administrators]]). See the following procedure how to upgrade your site within several seconds to the most recent version while preserving your eventual local customizations tracked in git repository:&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/htdocs/&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
    $ git pull&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/upgrade.php&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --disable&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
There are two modes of installing Moodle from the command line. In interactive mode, the install script asks you for all data needed to properly set up new Moodle site. In non-interactive mode, you must provide all required data as the script parameters and then the new site is installed silently. The parameters can be passed in the interactive mode, too. The provided values are then used as the default values during the interactive session.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/install.php --lang=cs&lt;br /&gt;
&lt;br /&gt;
== Maintenance mode ==&lt;br /&gt;
&lt;br /&gt;
To switch your site into the maintenance mode via CLI, you can use&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/maintenance.php --enable&lt;br /&gt;
&lt;br /&gt;
To turn maintenance mode off, just execute the same script with --disable parameter.&lt;br /&gt;
&lt;br /&gt;
== Offline mode ==&lt;br /&gt;
&lt;br /&gt;
In some situations, you may want to switch your Moodle site into offline mode so that it is not accessible via the web but you can not stop the web server completely (typically because there are other web pages and applications running there). If a file called &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; exists in the root folder of moodledata directory, Moodle will automatically display the contents of that file instead of any other page.&lt;br /&gt;
&lt;br /&gt;
    $ cd /var/www/sites/moodle/moodledata/&lt;br /&gt;
    $ echo &#039;&amp;amp;lt;h1&amp;amp;gt;Sorry, maintenance in progress&amp;amp;lt;/h1&amp;amp;gt;&#039; &amp;amp;gt; climaintenance.html&lt;br /&gt;
&lt;br /&gt;
You can prepare a nice formatted HTML page to inform your users about the server being down and keep in the moodledata directory under a name like &amp;lt;code&amp;gt;climaintenance.off&amp;lt;/code&amp;gt; and rename it to the &amp;lt;code&amp;gt;climaintenance.html&amp;lt;/code&amp;gt; if needed.&lt;br /&gt;
&lt;br /&gt;
== Custom site defaults ==&lt;br /&gt;
&lt;br /&gt;
During the install and upgrade via CLI, Moodle sets the administration variables to the default values. You can use different defaults. See MDL-17850 for details. Shortly, all you need to do is to add a file &amp;lt;code&amp;gt;local/defaults.php&amp;lt;/code&amp;gt; into your Moodle installation. The format of the file is like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
$defaults[&#039;pluginname&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;; // for plugins&lt;br /&gt;
$defaults[&#039;moodle&#039;][&#039;settingname&#039;] = &#039;settingvalue&#039;;     // for core settings&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These defaults are used during install, upgrade and are also displayed as defaults on Site administration pages.&lt;br /&gt;
&lt;br /&gt;
== Reset user password ==&lt;br /&gt;
&lt;br /&gt;
If you happen to forget your admin password (or you want to set a password for any other user on the site), you can use reset_password.php script. The script sets the correctly salted password for the given user.&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/reset_password.php&lt;br /&gt;
&lt;br /&gt;
== MySQL storage engine conversion ==&lt;br /&gt;
&lt;br /&gt;
If you run your Moodle site with MySQL database backend and use the default MyISAM as the storage engine for your tables, you may want to convert them to use some more reliable engine like InnoDB (actually, you should want to switch to PostgreSQL ;-) anyway).&lt;br /&gt;
&lt;br /&gt;
    $ sudo -u apache /usr/bin/php admin/cli/mysql_engine.php --engine=InnoDB&lt;br /&gt;
&lt;br /&gt;
==Converting InnoDB tables to Barracuda==&lt;br /&gt;
&lt;br /&gt;
Some users are getting the following MySQL error during course restore:&lt;br /&gt;
&lt;br /&gt;
  Row size too large (&amp;gt;8126). Changing some columns to TEXT or BLOB or using ROW_FORMAT=DYNAMIC or ROW_FORMAT=COMPRESSED may help.&lt;br /&gt;
&lt;br /&gt;
The error is due to the fact that the MySQL default InnoDB file format (Antelope) cannot handle more than 10 text columns. Thus you are recommended to change the InnoDB file format to Barracuda using the following command:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/mysql_compressed_rows.php&lt;br /&gt;
&lt;br /&gt;
For further information on InnoDB file formats see:&lt;br /&gt;
&lt;br /&gt;
* http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_antelope&lt;br /&gt;
* http://dev.mysql.com/doc/innodb/1.1/en/glossary.html#glos_barracuda&lt;br /&gt;
&lt;br /&gt;
== Running cron via command line ==&lt;br /&gt;
&lt;br /&gt;
In versions 1.x, you could execute admin/cron.php either from command line or via the web. Since Moodle 2.0, only admin/cli/cron.php script can be run via command line.&lt;br /&gt;
&lt;br /&gt;
== Scheduled tasks ==&lt;br /&gt;
&lt;br /&gt;
Scheduled tasks are automatically run by the cron script, but the specific tasks which run on each cron iteration are determined by the scheduled tasks configuration. It is possible to override the scheduled tasks configuration and run a single scheduled task immediately using the admin/tool/task/cli/schedule_task.php script. &lt;br /&gt;
&lt;br /&gt;
This script accepts the following arguments:&lt;br /&gt;
&lt;br /&gt;
 --list - list all the known scheduled tasks. The tasks are listed by the class name used to run the task. This class name is required as the argument to the next option in order to run a specific task immediately.&lt;br /&gt;
&lt;br /&gt;
 --execute=&amp;lt;task&amp;gt; - Runs a single scheduled task immediately - regardless of scheduling settings. This will even run disabled tasks. Tasks will still use locking to prevent concurrent execution of the same task - even on clusters. The format of the &amp;lt;task&amp;gt; argument must be the same as returned by the --list option above.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; You must escape the &amp;quot;\&amp;quot; with an extra \ when using the --execute command. Take the following for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --list&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will return something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
== List of scheduled tasks (http://yourserver.com/moodle) ==&lt;br /&gt;
\enrol_imsenterprise\task\cron_task                10 * * * * *      ASAP&lt;br /&gt;
\logstore_legacy\task\cleanup_task                 * 5 * * * *       ASAP&lt;br /&gt;
\logstore_standard\task\cleanup_task               * 4 * * * *       Wednesday, November 12, 2014, 4:35 AM&lt;br /&gt;
\mod_forum\task\cron_task                          * * * * * *       ASAP&lt;br /&gt;
\core\task\automated_backup_task                   50 * * * * *      ASAP&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the first task in that list, you would execute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;php schedule_task.php --execute=\\enrol_imsenterprise\\task\\cron_task&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Database transfer==&lt;br /&gt;
&lt;br /&gt;
A command line script for [[Database transfer]] may be found in &#039;&#039;admin/tool/dbtransfer/cli/migrate.php&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Purge caches==&lt;br /&gt;
&lt;br /&gt;
You can purge caches using this script:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/purge_caches.php&lt;br /&gt;
&lt;br /&gt;
==Fix course / module sequences==&lt;br /&gt;
&lt;br /&gt;
In rare cases (such as after upgrading from a very old version of Moodle), the course / section / module sequence data can be out of sync. This can cause various problems for affected courses, such as sections not appearing, backups failing, pages not displaying etc. There is a specific check to check for errors caused by this problem, and to fix the data in the database if they are found. To run this script please use the command below:&lt;br /&gt;
&lt;br /&gt;
  php admin/cli/fix_course_sequence.php -c=* --fix&lt;br /&gt;
&lt;br /&gt;
This will check every course in Moodle and report which ones had errors and were fixed.&lt;br /&gt;
&lt;br /&gt;
==Search and replace text==&lt;br /&gt;
&lt;br /&gt;
This script can be used to search and replace text throughout the whole database. Use carefully and backup first always. More info in [[Search and replace tool]].&lt;br /&gt;
&lt;br /&gt;
  php admin/tool/replace/cli/replace.php --search=//oldsitehost --replace=//newsitehost&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-35736 - Manage plugins via command line&lt;br /&gt;
* MDL-36237 - Resort course list via CLI&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[fr:Administration en ligne de commande]]&lt;br /&gt;
[[de:Administration über Kommandozeile]]&lt;br /&gt;
[[ja:コマンドライン経由の管理]]&lt;br /&gt;
[[es:Administración por línea de comando]]&lt;/div&gt;</summary>
		<author><name>Dmonllao</name></author>
	</entry>
</feed>