<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/502/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chuang</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/502/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Chuang"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/Special:Contributions/Chuang"/>
	<updated>2026-05-12T07:26:29Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=128113</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=128113"/>
		<updated>2017-06-02T20:21:50Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the long time Moodlers since year 2004. Currently I&#039;m working as an Business Operations Lead at Marketo.&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my linkedin page at http://www.linkedin.com/in/wchuang&lt;br /&gt;
&lt;br /&gt;
For my brief bio please read my profile on moodle.org at https://moodle.org/user/profile.php?id=18123&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=LTI_Provider&amp;diff=111724</id>
		<title>LTI Provider</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=LTI_Provider&amp;diff=111724"/>
		<updated>2014-04-10T20:02:23Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* About IMS LTI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== About IMS LTI ===&lt;br /&gt;
&lt;br /&gt;
According to IMS ([http://www.imsglobal.org]):&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;IMS is developing &#039;&#039;&#039;Learning Tools Interoperability (LTI)&#039;&#039;&#039; to allow remote tools and content to be integrated into a Learning Management System (LMS).&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== About this plugin ===&lt;br /&gt;
&lt;br /&gt;
This is a local plugin for making Moodle a LTI provider tool.&lt;br /&gt;
&lt;br /&gt;
It can be use to provide access to full courses or activities from remote systems (other Moodle installations, Sakai, any LMS LTI consumer compliant)&lt;br /&gt;
&lt;br /&gt;
Please note that since Moodle 2.2 there is a core activity plugin called &amp;quot;External tool&amp;quot; that is a LTI consumer.&lt;br /&gt;
&lt;br /&gt;
=== Why this plugin  ===&lt;br /&gt;
&lt;br /&gt;
This plugin allow remote systems users (LTI consumers) access to Moodle courses or Moodle activities inside a course.&lt;br /&gt;
&lt;br /&gt;
Moodle (version 2.2 and onwards) is a LTI consumer tool also.&lt;br /&gt;
&lt;br /&gt;
You can use this plugin to share activities and courses between Moodle installations without configuring a Moodle network.&lt;br /&gt;
&lt;br /&gt;
You can also share activities and courses with other LTI consumer tools like Sakai&lt;br /&gt;
&lt;br /&gt;
You have a detailed view of this plugin possibilities in [http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ this post by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
== Main feautres ==&lt;br /&gt;
&lt;br /&gt;
Provide access to full courses or single activities.&lt;br /&gt;
&lt;br /&gt;
Change the navigation block of a course or activity for displaying information and links only regarding to your current course.&lt;br /&gt;
&lt;br /&gt;
Send backs course or activity final grades to the LTI consumer tool&lt;br /&gt;
&lt;br /&gt;
Modify the course or activity page for hiding the header, footer and left or right blocks&lt;br /&gt;
&lt;br /&gt;
== Plugin version 2.3 and above features ==&lt;br /&gt;
&lt;br /&gt;
=== The plugin settings link is displayed in the settings block, instead the course one ===&lt;br /&gt;
&lt;br /&gt;
=== Several new settings for control different features of the plugin: ===&lt;br /&gt;
- How the user profile is updated&lt;br /&gt;
- Default authentication method&lt;br /&gt;
- Format of the course shortname, fullname and idnumber (using LTI variables)&lt;br /&gt;
- Roles allowed to create new contexts&lt;br /&gt;
- Roles allowed to create new resources&lt;br /&gt;
&lt;br /&gt;
=== The remote tool can be opened using the context_id ===&lt;br /&gt;
&lt;br /&gt;
The tool can be opened using also the context_id instead the current internal Moodle id&lt;br /&gt;
&lt;br /&gt;
=== Support for context memberships service ===&lt;br /&gt;
&lt;br /&gt;
See http://developers.imsglobal.org/ext_membership.html&lt;br /&gt;
&lt;br /&gt;
=== LTI custom parameters to force settings on SSO ===&lt;br /&gt;
&lt;br /&gt;
See https://tracker.moodle.org/browse/CONTRIB-4502&lt;br /&gt;
&lt;br /&gt;
=== Service for context (course) creation, using other courses as template ===&lt;br /&gt;
&lt;br /&gt;
Service URL local/ltiprovider/services.php&lt;br /&gt;
&lt;br /&gt;
Custom parameters:&lt;br /&gt;
&lt;br /&gt;
custom_service = create_context&lt;br /&gt;
&lt;br /&gt;
custom_context_template = Moodle idnumber for a course to be used as a template (the course will be duplicate)&lt;br /&gt;
&lt;br /&gt;
The course will be created populating the fullname, shortname and idnumber configured in the plugin settings&lt;br /&gt;
&lt;br /&gt;
=== Service for resources duplication ===&lt;br /&gt;
&lt;br /&gt;
Service URL local/ltiprovider/services.php&lt;br /&gt;
&lt;br /&gt;
Custom parameters:&lt;br /&gt;
&lt;br /&gt;
custom_service = duplicate_resource&lt;br /&gt;
&lt;br /&gt;
custom_resource_link_copy_id = Moodle idnumber of the activity to be duplicated in the current context&lt;br /&gt;
&lt;br /&gt;
=== SSO to resources ===&lt;br /&gt;
&lt;br /&gt;
If the context resource_link_id matches to an activity idnumber, the user will be redirect to that activity in Moodle&lt;br /&gt;
&lt;br /&gt;
=== Automatic creation of resources (moodle activities) ===&lt;br /&gt;
&lt;br /&gt;
If this additional parameter is present in the request custom_resource_link_type (mod_forum, etc...)  and also resource_link_title and resource_link_description a new moodle activity will be created&lt;br /&gt;
&lt;br /&gt;
See: https://tracker.moodle.org/browse/CONTRIB-4409&lt;br /&gt;
&lt;br /&gt;
=== Automatic creation of contexts on SSO ===&lt;br /&gt;
&lt;br /&gt;
Two additional request parameters are required:&lt;br /&gt;
&lt;br /&gt;
custom_create_context (0 or 1)&lt;br /&gt;
&lt;br /&gt;
custom_context_template (Moodle course idnumber)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Resources duplication on SSO ===&lt;br /&gt;
&lt;br /&gt;
Additional parameter required:&lt;br /&gt;
&lt;br /&gt;
custom_resource_link_copy_id = Moodle idnumber of the activity to be duplicated in the current context&lt;br /&gt;
&lt;br /&gt;
== Installing and configuring ==&lt;br /&gt;
&lt;br /&gt;
Follow instructions here: http://moodle.org/plugins/pluginversions.php?plugin=local_ltiprovider&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039; If you are using Moodle 2.2 or above, please, be sure that this option:&lt;br /&gt;
&lt;br /&gt;
 Home / &amp;gt; Site administration / &amp;gt; Security / &amp;gt; HTTP security Allow frame embedding&lt;br /&gt;
&lt;br /&gt;
Is checked, if you leave this option unchecked your provider site will not be &amp;quot;embedable&amp;quot; via an iframe in other sites.&lt;br /&gt;
&lt;br /&gt;
Once installed, a new link called &amp;quot;LTI Provider&amp;quot; will be displayed in the course navigation block .&lt;br /&gt;
&lt;br /&gt;
In this page, you can add, modify and disable the tools provided in your course.&lt;br /&gt;
&lt;br /&gt;
Please note that you can provide a tool n times with different configurations&lt;br /&gt;
&lt;br /&gt;
There are options for hiding the page header, footer, and left and right blocks and also options for force the Moodle navigation inside a course or activity.&lt;br /&gt;
&lt;br /&gt;
There are also options for assign different roles in the course or activity to the remote users.&lt;br /&gt;
&lt;br /&gt;
Once added a tool, you will need to use two settings in your consumer tool:&lt;br /&gt;
&lt;br /&gt;
* Shared secret&lt;br /&gt;
&lt;br /&gt;
* Launch URL&lt;br /&gt;
&lt;br /&gt;
Your consumer tool will ask you for a consumer private key, you can use a random string (please, do not use the shared secret as the private key)&lt;br /&gt;
&lt;br /&gt;
Configure your consumer tool with these two settings. That&#039;s all&lt;br /&gt;
&lt;br /&gt;
For a more detailed view of the plugin options see [http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ this detailed review of the plugin by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
=== User authentication ===&lt;br /&gt;
&lt;br /&gt;
* Users are created automatically in their first access to the system.&lt;br /&gt;
* Users are created with a hashed username and also with an auth method that disable direct login to Moodle.&lt;br /&gt;
* Users are allways enrolled in the course where the activities are.&lt;br /&gt;
&lt;br /&gt;
You can choose which role has the Learner and the Teacher from the remote system.&lt;br /&gt;
&lt;br /&gt;
There is also settings for setting Users profile default values (email visible, etc...)&lt;br /&gt;
&lt;br /&gt;
If you are going to have courses with local and remote users enrolled, I recommend you to create these new roles:&lt;br /&gt;
&lt;br /&gt;
* External teacher&lt;br /&gt;
* External student&lt;br /&gt;
&lt;br /&gt;
=== Grading ===&lt;br /&gt;
&lt;br /&gt;
A cron job checks periodically activities for sending back grades (overall course grade or activity grade).&lt;br /&gt;
&lt;br /&gt;
In order to work correctly, your php.ini settings file needs to have the following setting enabled:&lt;br /&gt;
&lt;br /&gt;
allow_url_fopen = On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
Juan Leyva &amp;lt;http://twitter.com/#!/jleyvadelgado&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/profile.php?id=49568&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ Review: LTI Provider by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/plugins/pluginversions.php?plugin=local_ltiprovider Plugin entry]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jleyva/moodle-local_ltiprovider Github page]&lt;br /&gt;
&lt;br /&gt;
[[Category: Contributed code]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=LTI_Provider&amp;diff=111723</id>
		<title>LTI Provider</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=LTI_Provider&amp;diff=111723"/>
		<updated>2014-04-10T20:00:46Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* About IMS LTI */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Description ==&lt;br /&gt;
&lt;br /&gt;
=== About IMS LTI ===&lt;br /&gt;
&lt;br /&gt;
According IMS:&lt;br /&gt;
&lt;br /&gt;
IMS ([http://www.imsglobal.org]) is developing &#039;&#039;Learning Tools Interoperability (LTI)&#039;&#039; to allow remote tools and content to be integrated into a Learning Management System (LMS).&lt;br /&gt;
&lt;br /&gt;
=== About this plugin ===&lt;br /&gt;
&lt;br /&gt;
This is a local plugin for making Moodle a LTI provider tool.&lt;br /&gt;
&lt;br /&gt;
It can be use to provide access to full courses or activities from remote systems (other Moodle installations, Sakai, any LMS LTI consumer compliant)&lt;br /&gt;
&lt;br /&gt;
Please note that since Moodle 2.2 there is a core activity plugin called &amp;quot;External tool&amp;quot; that is a LTI consumer.&lt;br /&gt;
&lt;br /&gt;
=== Why this plugin  ===&lt;br /&gt;
&lt;br /&gt;
This plugin allow remote systems users (LTI consumers) access to Moodle courses or Moodle activities inside a course.&lt;br /&gt;
&lt;br /&gt;
Moodle (version 2.2 and onwards) is a LTI consumer tool also.&lt;br /&gt;
&lt;br /&gt;
You can use this plugin to share activities and courses between Moodle installations without configuring a Moodle network.&lt;br /&gt;
&lt;br /&gt;
You can also share activities and courses with other LTI consumer tools like Sakai&lt;br /&gt;
&lt;br /&gt;
You have a detailed view of this plugin possibilities in [http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ this post by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
== Main feautres ==&lt;br /&gt;
&lt;br /&gt;
Provide access to full courses or single activities.&lt;br /&gt;
&lt;br /&gt;
Change the navigation block of a course or activity for displaying information and links only regarding to your current course.&lt;br /&gt;
&lt;br /&gt;
Send backs course or activity final grades to the LTI consumer tool&lt;br /&gt;
&lt;br /&gt;
Modify the course or activity page for hiding the header, footer and left or right blocks&lt;br /&gt;
&lt;br /&gt;
== Plugin version 2.3 and above features ==&lt;br /&gt;
&lt;br /&gt;
=== The plugin settings link is displayed in the settings block, instead the course one ===&lt;br /&gt;
&lt;br /&gt;
=== Several new settings for control different features of the plugin: ===&lt;br /&gt;
- How the user profile is updated&lt;br /&gt;
- Default authentication method&lt;br /&gt;
- Format of the course shortname, fullname and idnumber (using LTI variables)&lt;br /&gt;
- Roles allowed to create new contexts&lt;br /&gt;
- Roles allowed to create new resources&lt;br /&gt;
&lt;br /&gt;
=== The remote tool can be opened using the context_id ===&lt;br /&gt;
&lt;br /&gt;
The tool can be opened using also the context_id instead the current internal Moodle id&lt;br /&gt;
&lt;br /&gt;
=== Support for context memberships service ===&lt;br /&gt;
&lt;br /&gt;
See http://developers.imsglobal.org/ext_membership.html&lt;br /&gt;
&lt;br /&gt;
=== LTI custom parameters to force settings on SSO ===&lt;br /&gt;
&lt;br /&gt;
See https://tracker.moodle.org/browse/CONTRIB-4502&lt;br /&gt;
&lt;br /&gt;
=== Service for context (course) creation, using other courses as template ===&lt;br /&gt;
&lt;br /&gt;
Service URL local/ltiprovider/services.php&lt;br /&gt;
&lt;br /&gt;
Custom parameters:&lt;br /&gt;
&lt;br /&gt;
custom_service = create_context&lt;br /&gt;
&lt;br /&gt;
custom_context_template = Moodle idnumber for a course to be used as a template (the course will be duplicate)&lt;br /&gt;
&lt;br /&gt;
The course will be created populating the fullname, shortname and idnumber configured in the plugin settings&lt;br /&gt;
&lt;br /&gt;
=== Service for resources duplication ===&lt;br /&gt;
&lt;br /&gt;
Service URL local/ltiprovider/services.php&lt;br /&gt;
&lt;br /&gt;
Custom parameters:&lt;br /&gt;
&lt;br /&gt;
custom_service = duplicate_resource&lt;br /&gt;
&lt;br /&gt;
custom_resource_link_copy_id = Moodle idnumber of the activity to be duplicated in the current context&lt;br /&gt;
&lt;br /&gt;
=== SSO to resources ===&lt;br /&gt;
&lt;br /&gt;
If the context resource_link_id matches to an activity idnumber, the user will be redirect to that activity in Moodle&lt;br /&gt;
&lt;br /&gt;
=== Automatic creation of resources (moodle activities) ===&lt;br /&gt;
&lt;br /&gt;
If this additional parameter is present in the request custom_resource_link_type (mod_forum, etc...)  and also resource_link_title and resource_link_description a new moodle activity will be created&lt;br /&gt;
&lt;br /&gt;
See: https://tracker.moodle.org/browse/CONTRIB-4409&lt;br /&gt;
&lt;br /&gt;
=== Automatic creation of contexts on SSO ===&lt;br /&gt;
&lt;br /&gt;
Two additional request parameters are required:&lt;br /&gt;
&lt;br /&gt;
custom_create_context (0 or 1)&lt;br /&gt;
&lt;br /&gt;
custom_context_template (Moodle course idnumber)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Resources duplication on SSO ===&lt;br /&gt;
&lt;br /&gt;
Additional parameter required:&lt;br /&gt;
&lt;br /&gt;
custom_resource_link_copy_id = Moodle idnumber of the activity to be duplicated in the current context&lt;br /&gt;
&lt;br /&gt;
== Installing and configuring ==&lt;br /&gt;
&lt;br /&gt;
Follow instructions here: http://moodle.org/plugins/pluginversions.php?plugin=local_ltiprovider&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039; If you are using Moodle 2.2 or above, please, be sure that this option:&lt;br /&gt;
&lt;br /&gt;
 Home / &amp;gt; Site administration / &amp;gt; Security / &amp;gt; HTTP security Allow frame embedding&lt;br /&gt;
&lt;br /&gt;
Is checked, if you leave this option unchecked your provider site will not be &amp;quot;embedable&amp;quot; via an iframe in other sites.&lt;br /&gt;
&lt;br /&gt;
Once installed, a new link called &amp;quot;LTI Provider&amp;quot; will be displayed in the course navigation block .&lt;br /&gt;
&lt;br /&gt;
In this page, you can add, modify and disable the tools provided in your course.&lt;br /&gt;
&lt;br /&gt;
Please note that you can provide a tool n times with different configurations&lt;br /&gt;
&lt;br /&gt;
There are options for hiding the page header, footer, and left and right blocks and also options for force the Moodle navigation inside a course or activity.&lt;br /&gt;
&lt;br /&gt;
There are also options for assign different roles in the course or activity to the remote users.&lt;br /&gt;
&lt;br /&gt;
Once added a tool, you will need to use two settings in your consumer tool:&lt;br /&gt;
&lt;br /&gt;
* Shared secret&lt;br /&gt;
&lt;br /&gt;
* Launch URL&lt;br /&gt;
&lt;br /&gt;
Your consumer tool will ask you for a consumer private key, you can use a random string (please, do not use the shared secret as the private key)&lt;br /&gt;
&lt;br /&gt;
Configure your consumer tool with these two settings. That&#039;s all&lt;br /&gt;
&lt;br /&gt;
For a more detailed view of the plugin options see [http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ this detailed review of the plugin by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
== How it works ==&lt;br /&gt;
&lt;br /&gt;
=== User authentication ===&lt;br /&gt;
&lt;br /&gt;
* Users are created automatically in their first access to the system.&lt;br /&gt;
* Users are created with a hashed username and also with an auth method that disable direct login to Moodle.&lt;br /&gt;
* Users are allways enrolled in the course where the activities are.&lt;br /&gt;
&lt;br /&gt;
You can choose which role has the Learner and the Teacher from the remote system.&lt;br /&gt;
&lt;br /&gt;
There is also settings for setting Users profile default values (email visible, etc...)&lt;br /&gt;
&lt;br /&gt;
If you are going to have courses with local and remote users enrolled, I recommend you to create these new roles:&lt;br /&gt;
&lt;br /&gt;
* External teacher&lt;br /&gt;
* External student&lt;br /&gt;
&lt;br /&gt;
=== Grading ===&lt;br /&gt;
&lt;br /&gt;
A cron job checks periodically activities for sending back grades (overall course grade or activity grade).&lt;br /&gt;
&lt;br /&gt;
In order to work correctly, your php.ini settings file needs to have the following setting enabled:&lt;br /&gt;
&lt;br /&gt;
allow_url_fopen = On&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
Juan Leyva &amp;lt;http://twitter.com/#!/jleyvadelgado&amp;gt;&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/profile.php?id=49568&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
[http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ Review: LTI Provider by Gavin Henrik]&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/plugins/pluginversions.php?plugin=local_ltiprovider Plugin entry]&lt;br /&gt;
&lt;br /&gt;
[https://github.com/jleyva/moodle-local_ltiprovider Github page]&lt;br /&gt;
&lt;br /&gt;
[[Category: Contributed code]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Google_OAuth_2.0_setup&amp;diff=110448</id>
		<title>Google OAuth 2.0 setup</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Google_OAuth_2.0_setup&amp;diff=110448"/>
		<updated>2014-02-27T03:12:15Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Registering with Google */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Repositories}}&lt;br /&gt;
&#039;&#039;Note: This page contains information for site administrators only.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
&lt;br /&gt;
Prior to Moodle 2.3, the [[Google Drive repository]] and [[Picasa web album repository]] and the [[Google Docs portfolio]] and [[Picasa portfolio]] could be used without any configuration or registration with Google. In April 2012, [http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html Google announced] to web application developers that they would be deprecating the service which Moodle was using to communicate with Google and strongly advised developers to move away from it. As a response to this change with Google&#039;s service, Moodle switched to use a new system for communicating with Google called &#039;OAuth 2.0&#039;. The OAuth 2.0 system provides a better security system and more friendly experience to Moodle users, though it requires some additional configuration in Moodle.&lt;br /&gt;
&lt;br /&gt;
==Registering with Google==&lt;br /&gt;
&lt;br /&gt;
Each Moodle site now needs to be registered with Google in order to use the Google Drive, Docs or Picasa plugins. As part of the registration process, you will need to enter a URL (something like &amp;lt;nowiki&amp;gt;http://yourmoodlesite.org/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;) which is provided on all Google Drive, Docs and Picasa plugins configuration pages in Moodle e.g. &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Google Drive&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
# Visit the [https://code.google.com/apis/console#access Google APIs Console] (or the new URL [https://cloud.google.com/console/project#access Google Cloud APIs Console]) and sign into your google account. You will be asked to create a project if this is your first time using this form.&lt;br /&gt;
# Click the link on the left &amp;quot;API Access&amp;quot;&lt;br /&gt;
# Click the button &#039;Create an OAuth 2.0 client ID&#039;&lt;br /&gt;
# Enter the branding information &#039;Product name&#039; (i.e. the name of your Moodle site) and &#039;Product logo&#039; (i.e. the URL of your site logo). By providing a descriptive name and link to distinct image then your users will know they are signing into the correct place. &lt;br /&gt;
# Click the Next button&lt;br /&gt;
# In &#039;Client ID Settings&#039; select &#039;Web application&#039; as application type.&lt;br /&gt;
# Click the &#039;(more options)&#039; link next to &#039;Your site or hostname&#039; then in &#039;Authorized Redirect URIs&#039; enter the URL (something like &amp;lt;nowiki&amp;gt;http://yourmoodlesite.org/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;) from the plugin configuration page in Moodle, and leave the &#039;Authorized JavaScript Origins&#039; field blank&lt;br /&gt;
# Click the button &#039;Create client ID&#039;&lt;br /&gt;
&lt;br /&gt;
The Google Drive repository plugin also requires the Drive API to be enabled as follows:&lt;br /&gt;
&lt;br /&gt;
# In the [https://code.google.com/apis/console#access Google APIs Console] click the link on the left &amp;quot;Services&amp;quot;&lt;br /&gt;
# Click the button opposite Drive API to turn it on&lt;br /&gt;
&lt;br /&gt;
Your site will then be registered with Google and you will be provided with a client ID and secret to configure all Google Drive, Docs and Picasa plugins.&lt;br /&gt;
&lt;br /&gt;
Tip: If you have more than one Moodle site to register with Google, you can add an authorized redirect URI for each site in step 7. The same name and logo would then be displayed on the authorisation screen for each Moodle site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery perrow=3 caption=&amp;quot;Registering with Google - click on each to enlarge&amp;quot;&amp;gt;&lt;br /&gt;
Image:google_oauth1.png|1. Create project&lt;br /&gt;
File:google_oauth2.png|2. Creating an OAuth 2.0 Client ID&lt;br /&gt;
File:google_oauth3.png|3. Branding information&lt;br /&gt;
File:google_oauth4.png|6. Client ID settings&lt;br /&gt;
File:DriveAPI.png|7. Enabling the Drive API&lt;br /&gt;
File:google_oauth5.png|Registered details&lt;br /&gt;
File:google_oauth6.png|Authorisation screen&lt;br /&gt;
&amp;lt;/gallery &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring the Google Docs and Picasa repositories==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Manage Repositories&#039;&#039;&lt;br /&gt;
# Activate the Google Docs and/or Picasa repositories by selecting &#039;Enable and visible&#039; in the dropdown menu&lt;br /&gt;
# Configure each repository by entering the client ID and secret. Make sure you don&#039;t include any white space in the text boxes!&lt;br /&gt;
# Save changes&lt;br /&gt;
&lt;br /&gt;
==Configuring the Google Docs and Picasa portfolios==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Portfolios &amp;gt; Manage Portfolios&#039;&#039;&lt;br /&gt;
# Activate the Google Docs and/or Picasa portfolios by selecting &#039;Enable and visible&#039; in the dropdown menu&lt;br /&gt;
# Configure each portfolio by entering the client ID and secret&lt;br /&gt;
# Save changes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once configured, Google will present Moodle users with a nice authorisation screen with your Moodle site name and logo for your users to authorise.&lt;br /&gt;
&lt;br /&gt;
[[Category:Portfolios]]&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuración de Google OAuth 2.0]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Google_OAuth_2.0_setup&amp;diff=110447</id>
		<title>Google OAuth 2.0 setup</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Google_OAuth_2.0_setup&amp;diff=110447"/>
		<updated>2014-02-27T03:11:45Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Registering with Google */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Repositories}}&lt;br /&gt;
&#039;&#039;Note: This page contains information for site administrators only.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==OAuth 2.0==&lt;br /&gt;
&lt;br /&gt;
Prior to Moodle 2.3, the [[Google Drive repository]] and [[Picasa web album repository]] and the [[Google Docs portfolio]] and [[Picasa portfolio]] could be used without any configuration or registration with Google. In April 2012, [http://googledevelopers.blogspot.com/2012/04/changes-to-deprecation-policies-and-api.html Google announced] to web application developers that they would be deprecating the service which Moodle was using to communicate with Google and strongly advised developers to move away from it. As a response to this change with Google&#039;s service, Moodle switched to use a new system for communicating with Google called &#039;OAuth 2.0&#039;. The OAuth 2.0 system provides a better security system and more friendly experience to Moodle users, though it requires some additional configuration in Moodle.&lt;br /&gt;
&lt;br /&gt;
==Registering with Google==&lt;br /&gt;
&lt;br /&gt;
Each Moodle site now needs to be registered with Google in order to use the Google Drive, Docs or Picasa plugins. As part of the registration process, you will need to enter a URL (something like &amp;lt;nowiki&amp;gt;http://yourmoodlesite.org/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;) which is provided on all Google Drive, Docs and Picasa plugins configuration pages in Moodle e.g. &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Google Drive&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
# Visit the [https://code.google.com/apis/console#access Google APIs Console] (or the new URL [https://cloud.google.com/console/project#access Google Cloud APIs Console] and sign into your google account. You will be asked to create a project if this is your first time using this form.&lt;br /&gt;
# Click the link on the left &amp;quot;API Access&amp;quot;&lt;br /&gt;
# Click the button &#039;Create an OAuth 2.0 client ID&#039;&lt;br /&gt;
# Enter the branding information &#039;Product name&#039; (i.e. the name of your Moodle site) and &#039;Product logo&#039; (i.e. the URL of your site logo). By providing a descriptive name and link to distinct image then your users will know they are signing into the correct place. &lt;br /&gt;
# Click the Next button&lt;br /&gt;
# In &#039;Client ID Settings&#039; select &#039;Web application&#039; as application type.&lt;br /&gt;
# Click the &#039;(more options)&#039; link next to &#039;Your site or hostname&#039; then in &#039;Authorized Redirect URIs&#039; enter the URL (something like &amp;lt;nowiki&amp;gt;http://yourmoodlesite.org/admin/oauth2callback.php&amp;lt;/nowiki&amp;gt;) from the plugin configuration page in Moodle, and leave the &#039;Authorized JavaScript Origins&#039; field blank&lt;br /&gt;
# Click the button &#039;Create client ID&#039;&lt;br /&gt;
&lt;br /&gt;
The Google Drive repository plugin also requires the Drive API to be enabled as follows:&lt;br /&gt;
&lt;br /&gt;
# In the [https://code.google.com/apis/console#access Google APIs Console] click the link on the left &amp;quot;Services&amp;quot;&lt;br /&gt;
# Click the button opposite Drive API to turn it on&lt;br /&gt;
&lt;br /&gt;
Your site will then be registered with Google and you will be provided with a client ID and secret to configure all Google Drive, Docs and Picasa plugins.&lt;br /&gt;
&lt;br /&gt;
Tip: If you have more than one Moodle site to register with Google, you can add an authorized redirect URI for each site in step 7. The same name and logo would then be displayed on the authorisation screen for each Moodle site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery perrow=3 caption=&amp;quot;Registering with Google - click on each to enlarge&amp;quot;&amp;gt;&lt;br /&gt;
Image:google_oauth1.png|1. Create project&lt;br /&gt;
File:google_oauth2.png|2. Creating an OAuth 2.0 Client ID&lt;br /&gt;
File:google_oauth3.png|3. Branding information&lt;br /&gt;
File:google_oauth4.png|6. Client ID settings&lt;br /&gt;
File:DriveAPI.png|7. Enabling the Drive API&lt;br /&gt;
File:google_oauth5.png|Registered details&lt;br /&gt;
File:google_oauth6.png|Authorisation screen&lt;br /&gt;
&amp;lt;/gallery &amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Configuring the Google Docs and Picasa repositories==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Repositories &amp;gt; Manage Repositories&#039;&#039;&lt;br /&gt;
# Activate the Google Docs and/or Picasa repositories by selecting &#039;Enable and visible&#039; in the dropdown menu&lt;br /&gt;
# Configure each repository by entering the client ID and secret. Make sure you don&#039;t include any white space in the text boxes!&lt;br /&gt;
# Save changes&lt;br /&gt;
&lt;br /&gt;
==Configuring the Google Docs and Picasa portfolios==&lt;br /&gt;
&lt;br /&gt;
# Go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Plugins &amp;gt; Portfolios &amp;gt; Manage Portfolios&#039;&#039;&lt;br /&gt;
# Activate the Google Docs and/or Picasa portfolios by selecting &#039;Enable and visible&#039; in the dropdown menu&lt;br /&gt;
# Configure each portfolio by entering the client ID and secret&lt;br /&gt;
# Save changes&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once configured, Google will present Moodle users with a nice authorisation screen with your Moodle site name and logo for your users to authorise.&lt;br /&gt;
&lt;br /&gt;
[[Category:Portfolios]]&lt;br /&gt;
[[Category:Site administration]]&lt;br /&gt;
&lt;br /&gt;
[[es:Configuración de Google OAuth 2.0]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108462</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108462"/>
		<updated>2013-12-19T05:44:57Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the long time Moodlers since year 2004. Currently I&#039;m working as an Instructional Designer / Curriculum Developer at University of California, San Francisco.&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my linkedin page at http://www.linkedin.com/in/wchuang&lt;br /&gt;
&lt;br /&gt;
For my brief bio please read my profile on moodle.org at https://moodle.org/user/profile.php?id=18123&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108243</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108243"/>
		<updated>2013-12-06T21:49:55Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by [https://docs.moodle.org/en/User:Wen_Hao_Chuang Wen Hao Chuang]. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://awstats.sourceforge.net/ awstats]&lt;br /&gt;
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://gismo.sourceforge.net/ GISMO]&lt;br /&gt;
GISMO is a graphical interactive monitoring tool that provides useful visualization of students&#039; activities in online courses to instructors. With GISMO instructors can examine various aspects of distance students, such as the attendance to courses, reading of materials, submission of assignments. Users of the popular learning management system Moodle may benefit from GISMO for their teaching activities. With respect to the standard reports provided by Moodle (which basically allow teachers to see if an individual student has viewed a specific resource or participated on a specific activity on a specific day), GISMO provides comprehensive visualizations that gives an overview of the whole class, not only a specific student or a particular resource. With GISMO, instructors can perform analysis of the whole class, and may have a &amp;quot;clear picture&amp;quot; of what the class is doing, or has done in a period in the past.&lt;br /&gt;
GISMO is available for Moodle 1.9.x. and Moodle 2.x. (Cited from GISMO web site).&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108242</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108242"/>
		<updated>2013-12-06T21:45:43Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by [https://docs.moodle.org/en/User:Wen_Hao_Chuang Wen Hao Chuang]. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://awstats.sourceforge.net/ awstats]&lt;br /&gt;
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://gismo.sourceforge.net]&lt;br /&gt;
GISMO is a graphical interactive monitoring tool that provides useful visualization of students&#039; activities in online courses to instructors. With GISMO instructors can examine various aspects of distance students, such as the attendance to courses, reading of materials, submission of assignments. Users of the popular learning management system Moodle may benefit from GISMO for their teaching activities. With respect to the standard reports provided by Moodle (which basically allow teachers to see if an individual student has viewed a specific resource or participated on a specific activity on a specific day), GISMO provides comprehensive visualizations that gives an overview of the whole class, not only a specific student or a particular resource. With GISMO, instructors can perform analysis of the whole class, and may have a &amp;quot;clear picture&amp;quot; of what the class is doing, or has done in a period in the past.&lt;br /&gt;
GISMO is available for Moodle 1.9.x. and Moodle 2.x. (Cited from GISMO web site).&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108241</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108241"/>
		<updated>2013-12-06T21:44:36Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by [https://docs.moodle.org/en/User:Wen_Hao_Chuang Wen Hao Chuang]. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://awstats.sourceforge.net/ awstats]&lt;br /&gt;
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://gismo.sourceforge.net]&lt;br /&gt;
GISMO is a graphical interactive monitoring tool that provides useful visualization of students&#039; activities in online courses to instructors. With GISMO instructors can examine various aspects of distance students, such as the attendance to courses, reading of materials, submission of assignments. Users of the popular learning management system Moodle may benefit from GISMO for their teaching activities. With respect to the standard reports provided by Moodle (which basically allow teachers to see if an individual student has viewed a specific resource or participated on a specific activity on a specific day), GISMO provides comprehensive visualizations that gives an overview of the whole class, not only a specific student or a particular resource. With GISMO, instructors can perform analysis of the whole class, and may have a &amp;quot;clear picture&amp;quot; of what the class is doing, or has done in a period in the past.&lt;br /&gt;
GISMO is available for Moodle 1.9.x. and Moodle 2.x.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108240</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=108240"/>
		<updated>2013-12-06T21:43:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang: added GISMO&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by [https://docs.moodle.org/en/User:Wen_Hao_Chuang Wen Hao Chuang]. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[http://awstats.sourceforge.net/ awstats]&lt;br /&gt;
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.&lt;br /&gt;
&lt;br /&gt;
[http://gismo.sourceforge.net/]&lt;br /&gt;
GISMO is a graphical interactive monitoring tool that provides useful visualization of students&#039; activities in online courses to instructors. With GISMO instructors can examine various aspects of distance students, such as the attendance to courses, reading of materials, submission of assignments. Users of the popular learning management system Moodle may benefit from GISMO for their teaching activities. With respect to the standard reports provided by Moodle (which basically allow teachers to see if an individual student has viewed a specific resource or participated on a specific activity on a specific day), GISMO provides comprehensive visualizations that gives an overview of the whole class, not only a specific student or a particular resource. With GISMO, instructors can perform analysis of the whole class, and may have a &amp;quot;clear picture&amp;quot; of what the class is doing, or has done in a period in the past.&lt;br /&gt;
GISMO is available for Moodle 1.9.x. and Moodle 2.x.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108239</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108239"/>
		<updated>2013-12-06T21:13:11Z</updated>

		<summary type="html">&lt;p&gt;Chuang: Wen Hao Chuang Moodle Profile Page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently (as of year 2013) I am working as a professional Moodle consultant and Instructional Designer for various clients.&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my LinkedIn page (http://www.linkedin.com/in/wchuang) and get connected!!&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org or Linkedin.com.&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108238</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=108238"/>
		<updated>2013-12-06T21:11:15Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently (as of year 2013) I&#039;m working as an professional Moodle consultant for various clients.&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my LinkedIn page (www.linkedin.com/in/wchuang) and get connected!!&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=NanoGong&amp;diff=105760</id>
		<title>NanoGong</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=NanoGong&amp;diff=105760"/>
		<updated>2013-06-22T07:28:19Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;NanoGong provides a very simple and transparent voice support for Moodle. Using a NanoGong activity and  filter, it provides two different types of voice support for Moodle.&lt;br /&gt;
&lt;br /&gt;
NanoGong icon can be used to record, playback and save a voice file, in a web page. The playback can be changed by the listener. The Listener&#039;s version of can be saved to the listener&#039;s hard disk.  A NanoGong activity allows the student to submit their recording to the teacher.&lt;br /&gt;
&lt;br /&gt;
==Features==&lt;br /&gt;
*Record at one speed &lt;br /&gt;
*Create individual copy at a different speed&lt;br /&gt;
*Save copy on local hard drive&lt;br /&gt;
*Student can send back to teacher&lt;br /&gt;
*As of version 3.3, the NanoGong activity module supports backup/restore functionality. Administrators can now easily backup/restore a course with NanoGong activity using the standard Moodle backup/restore procedure.&lt;br /&gt;
&lt;br /&gt;
==Tips &amp;amp; Tricks==&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;Note:&#039;&#039;  When downloaded, the HTML area (HTML edit tool) for a specific version of Moodle, will change the core Moodle code.  &lt;br /&gt;
*&#039;&#039;&#039;Warning 2:&#039;&#039;&#039; When you install Nanogong in 1.9.x, you must also visit the admin page of the HTML-editor and switch the editorhidebuttons off for the Nanogong button. (default hide is on after install)&lt;br /&gt;
* If you install the minimum NanoGong (that is, without the HTML editor component), only the student role has the ability to record. The teacher can create a NanoGong activity and adjust the activity settings, but will not see any NanoGong recorder. To give the teacher access to the NanoGong recorder, the HTML editor component must be installed.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=1209&amp;amp;filter=1  NanoGong 3] is a Modules and plugins database page that has downloads and more information.&lt;br /&gt;
*Discussions: &lt;br /&gt;
**Please create or find a discussion topic in the [http://moodle.org/mod/forum/view.php?id=44  Contributed Code forum]&lt;br /&gt;
**The contributor also maintains a Moodle site that contains one or more [http://gong.ust.hk/moodle forums using and supporting NanoGong], outside of Moodle.org .&lt;br /&gt;
*Additional documentation&lt;br /&gt;
**[http://gong.ust.hk/nanogong/moodle_inst.html Installing NanoGong in Moodle] (outside of Moodle.org)&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=2612 Nanogong repository plugin] for Moodle 2.0&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=170422 Release of NanoGong 4.1, an important update for Moodle users]&lt;br /&gt;
&lt;br /&gt;
* [[NanoGong/Converting to Moodle 2.0]] - work in progress --[[User:Frank Ralf|Frank Ralf]] 10:34, 7 April 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
* [https://moodle.org/mod/forum/discuss.php?d=170422 Nanogong Moodle Forum Discussion] (inside of Moodle.org)&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=105648</id>
		<title>User talk:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=105648"/>
		<updated>2013-06-14T20:06:48Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle professional consultants in the Moodle community. Currently I&#039;m working on several projects, including a project (KnowHBV) with Stanford University.&lt;br /&gt;
&lt;br /&gt;
Feel free to get connected with me on Linkin:  http://www.linkedin.com/in/wchuang&lt;br /&gt;
&lt;br /&gt;
I can be reached by email at (whchuang at gmail dot com)&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=105647</id>
		<title>User talk:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=105647"/>
		<updated>2013-06-14T20:06:13Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle professional consultants in the Moodle community. Currently I&#039;m working on several projects, including a project (KnowHBV) with Stanford University.&lt;br /&gt;
&lt;br /&gt;
Feel free to get connected with me on Linkin:  http://www.linkedin.com/in/wchuang&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=103478</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=103478"/>
		<updated>2013-03-06T01:04:41Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently I&#039;m working as an &amp;quot;Academic Technology Consultant&amp;quot; at San Francisco State University (full-time), and teaches part-time in the department of Instructional Technology (ITEC).&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my personal website (always under construction) at http://wenhaochuang.myefolio.com/&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Moodle_version&amp;diff=99563</id>
		<title>Moodle version</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Moodle_version&amp;diff=99563"/>
		<updated>2012-07-26T22:56:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Discovering Version programmatically */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Managing a Moodle site}}[[Image:moodleversion.png|thumb|Moodle version with (build number) and copyright]]&lt;br /&gt;
The version of Moodle which your site is using can be found if you login as an administrator and go to &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Notifications&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
For a list of all past Moodle versions, see [[:dev:Releases]].&lt;br /&gt;
&lt;br /&gt;
==Version.php file==&lt;br /&gt;
Your exact Moodle version may be obtained by viewing the file &#039;&#039;moodle/version.php&#039;&#039; in a text editor. Here is a typical &#039;&#039;version.php&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// MOODLE VERSION INFORMATION&lt;br /&gt;
&lt;br /&gt;
// This file defines the current version of the core Moodle code being used.&lt;br /&gt;
// This is compared against the values stored in the database to determine&lt;br /&gt;
// whether upgrades should be performed (see lib/db/*.php)&lt;br /&gt;
&lt;br /&gt;
    $version = 2007101580.00; // YYYYMMDD      = date of the 1.9 branch (don&#039;t change)&lt;br /&gt;
                              //         X     = release number 1.9.[0,1,2,3,4,5...]&lt;br /&gt;
                              //          Y.YY = micro-increments between releases&lt;br /&gt;
&lt;br /&gt;
    $release = &#039;1.9.8+ (Build: 20100512)&#039;;     // Human-friendly version name&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: You cannot view the contents of version.php in your browser - you must use a text editor.&lt;br /&gt;
&lt;br /&gt;
== Discovering Version programmatically ==&lt;br /&gt;
&lt;br /&gt;
The above variables are copied into the $CFG global object. If you are writing custom code for Moodle you can access $CFG-&amp;gt;version and $CFG-&amp;gt;release.&lt;br /&gt;
&lt;br /&gt;
IF you have system administrator level of account, you can also use the Site administration block =&amp;gt; Server =&amp;gt; Environment and it will show ou which Moodle 2.x code base you are using.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* MDL-26852 No way provided for users to determine Moodle build information&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=question/type/conceptmap&amp;diff=99523</id>
		<title>question/type/conceptmap</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=question/type/conceptmap&amp;diff=99523"/>
		<updated>2012-07-26T05:49:08Z</updated>

		<summary type="html">&lt;p&gt;Chuang: Created page with &amp;quot;There are currently two important Moodle forum discussion about concept map:  http://moodle.org/mod/forum/discuss.php?d=168814 and http://moodle.org/mod/forum/discuss.php?d=118931&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;There are currently two important Moodle forum discussion about concept map:&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=168814&lt;br /&gt;
and&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=118931&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=LTI_External_tool&amp;diff=99108</id>
		<title>LTI External tool</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=LTI_External_tool&amp;diff=99108"/>
		<updated>2012-07-11T04:12:20Z</updated>

		<summary type="html">&lt;p&gt;Chuang: Adding LTI link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
The external tool enables Moodle users to interact with [http://www.imsglobal.org/toolsinteroperability2.cfm LTI]-compliant learning resources and activities on other web sites. For instance, an external tool could provide access to a new activity type or learning materials from a publisher.&lt;br /&gt;
&lt;br /&gt;
[[File:chemvantage.png]]&lt;br /&gt;
&lt;br /&gt;
*[[External tool settings]]&lt;br /&gt;
*[[Using External tool]]&lt;br /&gt;
*[[External tool FAQ]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=Hqezqc3ukhM&amp;amp;feature=youtu.be&amp;amp;a IMS LTI demo]by Gavin Henrick&lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2011/11/28/moodle-2-supports-connecting-to-ims-lti-tools/ Moodle 2.2 will support connecting to IMS LTI tools] blog post by Gavin Henrick&lt;br /&gt;
*[http://vimeo.com/8073453 Video explaining LTI (Learning Tools Interoperability)]&lt;br /&gt;
[[Category:External tool]]&lt;br /&gt;
*[http://moodle.org/plugins/view.php?plugin=local_ltiprovider A contributed module - local plugin to make Moodle an LTI provider tool]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=193355 New contrib: LTI Provider] forum discussion&lt;br /&gt;
&lt;br /&gt;
*[http://vimeo.com/34752767 Video on using the LTI provider plugin]&lt;br /&gt;
&lt;br /&gt;
*[http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ Review of the LTI provider plugin] by Gavin Henrick&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=LTI_External_tool&amp;diff=99107</id>
		<title>LTI External tool</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=LTI_External_tool&amp;diff=99107"/>
		<updated>2012-07-11T04:11:25Z</updated>

		<summary type="html">&lt;p&gt;Chuang: Adding LTI link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Activities}}&lt;br /&gt;
The external tool enables Moodle users to interact with [LTI]-compliant learning resources and activities on other web sites. For instance, an external tool could provide access to a new activity type or learning materials from a publisher.&lt;br /&gt;
&lt;br /&gt;
[[File:chemvantage.png]]&lt;br /&gt;
&lt;br /&gt;
*[[External tool settings]]&lt;br /&gt;
*[[Using External tool]]&lt;br /&gt;
*[[External tool FAQ]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[http://www.youtube.com/watch?v=Hqezqc3ukhM&amp;amp;feature=youtu.be&amp;amp;a IMS LTI demo]by Gavin Henrick&lt;br /&gt;
* [http://www.somerandomthoughts.com/blog/2011/11/28/moodle-2-supports-connecting-to-ims-lti-tools/ Moodle 2.2 will support connecting to IMS LTI tools] blog post by Gavin Henrick&lt;br /&gt;
*[http://vimeo.com/8073453 Video explaining LTI (Learning Tools Interoperability)]&lt;br /&gt;
[[Category:External tool]]&lt;br /&gt;
*[http://moodle.org/plugins/view.php?plugin=local_ltiprovider A contributed module - local plugin to make Moodle an LTI provider tool]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=193355 New contrib: LTI Provider] forum discussion&lt;br /&gt;
&lt;br /&gt;
*[http://vimeo.com/34752767 Video on using the LTI provider plugin]&lt;br /&gt;
&lt;br /&gt;
*[http://www.somerandomthoughts.com/blog/2012/01/08/review-lti-provider-for-moodle-2-2/ Review of the LTI provider plugin] by Gavin Henrick&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=97440</id>
		<title>User talk:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User_talk:Wen_Hao_Chuang&amp;diff=97440"/>
		<updated>2012-05-03T02:44:19Z</updated>

		<summary type="html">&lt;p&gt;Chuang: Created page with &amp;quot;I&amp;#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently I&amp;#039;m working as an &amp;quot;Academic Technology Consultant&amp;quot; at San Francisco State University (...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently I&#039;m working as an &amp;quot;Academic Technology Consultant&amp;quot; at San Francisco State University (full-time), and teaches part-time in the department of Instructional Technology (ITEC).&lt;br /&gt;
Feel free to check out my personal website (very much outdated) at http://userwww.sfsu.edu/~wchuang&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=ad-hoc_contributed_reports&amp;diff=95959</id>
		<title>ad-hoc contributed reports</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=ad-hoc_contributed_reports&amp;diff=95959"/>
		<updated>2012-02-18T00:12:13Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Sitewide reports}}&lt;br /&gt;
These are community contributed reports for the [[Custom SQL queries report]] site-wide report plugin (module) &amp;lt;br/&amp;gt;&lt;br /&gt;
Everyone is welcome to add their own. until we find a better way to exchange reports between us.&amp;lt;br/&amp;gt;&lt;br /&gt;
Enjoy :-)&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
===Generate a list of instructors and their email addresses for those courses that has &amp;quot;essay questions&amp;quot; in their quizzes===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT qu.id AS quiz_id, qu.course AS course_id, qu.questions,&lt;br /&gt;
                co.fullname AS course_fullname, co.shortname AS course_shortname,&lt;br /&gt;
                qu.name AS quiz_name, FROM_UNIXTIME(qu.timeopen) AS quiz_timeopen, FROM_UNIXTIME(qu.timeclose) AS quiz_timeclose,&lt;br /&gt;
                u.firstname, u.lastname, u.email,&lt;br /&gt;
FROM mdl_quiz qu, mdl_course co, mdl_role re, mdl_context ct, mdl_role_assignments ra, mdl_user u&lt;br /&gt;
WHERE FROM_UNIXTIME(timeopen) &amp;gt; &#039;2008-05-14&#039; AND&lt;br /&gt;
                qu.course = co.id AND&lt;br /&gt;
                co.id = ct.instanceid AND&lt;br /&gt;
                ra.roleid = re.id AND&lt;br /&gt;
                re.name = &#039;Teacher&#039; AND&lt;br /&gt;
                ra.contextid = ct.id AND&lt;br /&gt;
                ra.userid = u.id&lt;br /&gt;
 &lt;br /&gt;
SELECT Count(&#039;x&#039;) As NumOfStudents&lt;br /&gt;
                                FROM mdl_role_assignments a&lt;br /&gt;
                                JOIN mdl_user u ON userid = u.id&lt;br /&gt;
                                WHERE roleid = 5 AND contextid = (SELECT id FROM mdl_context WHERE instanceid = 668 AND contextlevel = 50)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed ACTIONs for each MODULE===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT module,action,count(id) as counter&lt;br /&gt;
FROM prefix_log&lt;br /&gt;
GROUP BY module,action&lt;br /&gt;
ORDER BY module,counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed ACTIONs for each ROLE (TEACHER,NONE-EDITING TEACHER and STUDENT)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT r.name,l.action, count( l.userid ) as counter&lt;br /&gt;
FROM `prefix_log` as l&lt;br /&gt;
JOIN `prefix_role_assignments` AS ra on l.userid = ra.userid&lt;br /&gt;
JOIN prefix_role AS r ON ra.roleid = r.id&lt;br /&gt;
WHERE ra.roleid IN (3,4,5)&lt;br /&gt;
GROUP BY roleid,l.action&lt;br /&gt;
ORDER BY counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed &amp;quot;VIEW&amp;quot; ACTION for each ROLE (TEACHER,NONE-EDITING TEACHER and STUDENT)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT l.action, count( l.userid ) as counter , r.name&lt;br /&gt;
FROM `prefix_log` as l&lt;br /&gt;
JOIN `prefix_role_assignments` AS ra on l.userid = ra.userid&lt;br /&gt;
JOIN `prefix_role` AS r ON ra.roleid = r.id&lt;br /&gt;
WHERE (ra.roleid IN (3,4,5)) AND (l.action LIKE &#039;%view%&#039; )&lt;br /&gt;
GROUP BY roleid,l.action&lt;br /&gt;
order by r.name,counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Most Active courses===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) hits, l.course courseId, c.fullname coursename&lt;br /&gt;
FROM prefix_log l INNER JOIN prefix_course c ON l.course = c.id&lt;br /&gt;
GROUP BY courseId&lt;br /&gt;
ORDER BY hits DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===RESOURCE count for each COURSE===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) count, l.course, c.fullname coursename&lt;br /&gt;
FROM prefix_resource l INNER JOIN prefix_course c on l.course = c.id&lt;br /&gt;
GROUP BY course&lt;br /&gt;
ORDER BY count DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Most popular ACTIVITY===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(l.id) hits, module&lt;br /&gt;
FROM prefix_log l&lt;br /&gt;
WHERE module != &#039;login&#039; AND module != &#039;course&#039; AND module != &#039;role&#039;&lt;br /&gt;
GROUP BY module&lt;br /&gt;
ORDER BY hits DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===System wide use of ACTIVITIES and RESOURCES===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT count( cm.id ) AS counter, m.name&lt;br /&gt;
FROM `prefix_course_modules` AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
GROUP BY cm.module&lt;br /&gt;
ORDER BY counter DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LOG file ACTIONS per MODULE per COURSE (IDs)===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select course,module,action,count(action) as summa from prefix_log&lt;br /&gt;
where action &amp;lt;&amp;gt; &#039;new&#039;&lt;br /&gt;
group by course,action,module&lt;br /&gt;
order by course,module,action&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===&amp;quot;Compose Web Page&amp;quot; RESOURCE count===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT course,prefix_course.fullname, COUNT(*) AS Total&lt;br /&gt;
FROM `prefix_resource`&lt;br /&gt;
JOIN `prefix_course` ON prefix_course.id = prefix_resource.course&lt;br /&gt;
WHERE type=&#039;html&#039;&lt;br /&gt;
GROUP BY course&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Total Activity of Roles:&amp;quot;Teacher&amp;quot; and &amp;quot;None-Editing Teacher&amp;quot; by Dates and by Hours===&lt;br /&gt;
The output columns of this report table can be used as base for a Pivot-Table&lt;br /&gt;
which will show the amount of &#039;&#039;&#039;activity&#039;&#039;&#039; per &#039;&#039;&#039;hour&#039;&#039;&#039; per &#039;&#039;&#039;days&#039;&#039;&#039; in 3D graph view.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT DATE_FORMAT( FROM_UNIXTIME( l.time ) , &#039;%Y/%m/%d&#039; ) AS grptimed ,&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( l.time ) , &#039;%k&#039; ) AS grptimeh  , count( l.userid ) AS counter &lt;br /&gt;
FROM `prefix_log` AS l&lt;br /&gt;
JOIN prefix_user AS u ON u.id = l.userid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON l.userid = ra.userid&lt;br /&gt;
JOIN prefix_role AS r ON r.id = ra.roleid&lt;br /&gt;
WHERE ra.roleid IN (3,4)&lt;br /&gt;
GROUP BY grptimed,grptimeh&lt;br /&gt;
ORDER BY grptimed,grptimeh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FORUM use Count per COURSE -- not including NEWS Forum!===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course.fullname, prefix_forum.course, count(*) as total FROM prefix_forum&lt;br /&gt;
INNER JOIN prefix_course&lt;br /&gt;
ON prefix_course.id = prefix_forum.course&lt;br /&gt;
WHERE NOT(prefix_forum.type = &#039;news&#039;)&lt;br /&gt;
GROUP BY prefix_forum.course&lt;br /&gt;
ORDER BY total desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===FORUM use Count per COURSE by type -- not including NEWS Forum!===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course.fullname, prefix_forum.course, prefix_forum.type, count(*) as total FROM prefix_forum&lt;br /&gt;
INNER JOIN prefix_course&lt;br /&gt;
ON prefix_course.id = prefix_forum.course&lt;br /&gt;
WHERE NOT(prefix_forum.type = &#039;news&#039;)&lt;br /&gt;
GROUP BY prefix_forum.course,prefix_forum.type&lt;br /&gt;
ORDER BY total desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LIST of all site USERS by COURSE enrollment (Moodle 1.9.x)===&lt;br /&gt;
&lt;br /&gt;
Reports a site global list of all users enroled in each course&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user.firstname AS Firstname,&lt;br /&gt;
user.lastname AS Lastname,&lt;br /&gt;
user.email AS Email,&lt;br /&gt;
user.city AS City,&lt;br /&gt;
course.fullname AS Course&lt;br /&gt;
,(SELECT name FROM prefix_role WHERE id=asg.roleid)&lt;br /&gt;
FROM&lt;br /&gt;
prefix_user AS user,&lt;br /&gt;
prefix_course AS course,&lt;br /&gt;
prefix_role_assignments AS asg&lt;br /&gt;
INNER JOIN prefix_context AS context ON asg.contextid=context.id   &lt;br /&gt;
WHERE&lt;br /&gt;
context.contextlevel = 50&lt;br /&gt;
AND&lt;br /&gt;
user.id=asg.userid&lt;br /&gt;
AND&lt;br /&gt;
context.instanceid=course.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===LIST of all site USERS by COURSE enrollment (Moodle 2.x)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
user2.firstname AS Firstname,&lt;br /&gt;
user2.lastname AS Lastname,&lt;br /&gt;
user2.email AS Email,&lt;br /&gt;
user2.city AS City,&lt;br /&gt;
course.fullname AS Course&lt;br /&gt;
,(SELECT shortname FROM prefix_role WHERE id=en.roleid) as Role&lt;br /&gt;
,(SELECT name FROM prefix_role WHERE id=en.roleid) as RoleName&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course as course &lt;br /&gt;
JOIN prefix_enrol AS en ON en.courseid = course.id&lt;br /&gt;
JOIN prefix_user_enrolments AS ue ON ue.enrolid = en.id&lt;br /&gt;
JOIN prefix_user AS user2 ON ue.userid = user2.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Permissions Overides on Categories===&lt;br /&gt;
(By: [http://moodle.org/mod/forum/discuss.php?d=153059#p712834 Séverin Terrier] )&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT rc.id, ct.instanceid, ccat.name, rc.roleid, rc.capability, rc.permission, &lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME( rc.timemodified ) , &#039;%Y-%m-%d&#039; ) AS timemodified, rc.modifierid, ct.instanceid, ct.path, ct.depth&lt;br /&gt;
FROM `prefix_role_capabilities` AS rc&lt;br /&gt;
INNER JOIN `prefix_context` AS ct ON rc.contextid = ct.id&lt;br /&gt;
INNER JOIN `prefix_course_categories` AS ccat ON ccat.id = ct.instanceid&lt;br /&gt;
AND `contextlevel` =40&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists &amp;quot;Totally Opened Courses&amp;quot; (visible, opened to guests, with no password)===&lt;br /&gt;
(By: [http://moodle.org/mod/forum/discuss.php?d=153059#p712837 Séverin Terrier] )&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT id , category , fullname , shortname , enrollable&lt;br /&gt;
FROM `prefix_course`&lt;br /&gt;
WHERE `guest` =1&lt;br /&gt;
AND `password` = &amp;quot;&amp;quot;&lt;br /&gt;
AND `visible` =1&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Lists &amp;quot;loggedin users&amp;quot; from the last 120 days===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT id,username,FROM_UNIXTIME(`lastlogin`) as days &lt;br /&gt;
FROM `prefix_user` &lt;br /&gt;
WHERE DATEDIFF( NOW(),FROM_UNIXTIME(`lastlogin`) ) &amp;lt; 120&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;and user count for that same population:&#039;&#039;&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(id) as Users  FROM `prefix_user` &lt;br /&gt;
WHERE DATEDIFF( NOW(),FROM_UNIXTIME(`lastlogin`) ) &amp;lt; 120&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List &amp;quot;Recently uploaded files&amp;quot;===&lt;br /&gt;
see what users are uploading&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT FROM_UNIXTIME(time,&#039;%Y %M %D %h:%i:%s&#039;) as time ,ip,userid,url,info  &lt;br /&gt;
FROM `prefix_log` &lt;br /&gt;
WHERE `action` LIKE &#039;upload&#039; &lt;br /&gt;
ORDER BY `prefix_log`.`time`  DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===List Courses that loaded a specific file: &amp;quot;X&amp;quot;===&lt;br /&gt;
Did the Teacher (probably) uploaded course&#039;s Syllabus ?&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.id, c.fullname  FROM `prefix_log` as l &lt;br /&gt;
JOIN prefix_course as c ON c.id = l.course &lt;br /&gt;
WHERE `action` LIKE &#039;%upload%&#039; AND ( info LIKE &#039;%Syllabus%&#039; OR info LIKE &#039;%Sylabus%&#039; ) GROUP BY c.id&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Students in all courses of some institute===&lt;br /&gt;
What is the status (deleted or not) of all Students (roleid = 5) in all courses of some Institute&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.id, c.fullname, u.firstname, u.lastname, u.deleted&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
AND u.institution = &#039;please enter school name here&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Full User info (for deleted users)===&lt;br /&gt;
Including extra custom profile fields (from mdl_user_info_data)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT * &lt;br /&gt;
FROM prefix_user as u &lt;br /&gt;
JOIN prefix_user_info_data as uid ON uid.userid = u.id &lt;br /&gt;
JOIN prefix_user_info_field as uif ON (uid.fieldid = uif.id AND uif.shortname = &#039;class&#039;)&lt;br /&gt;
WHERE `deleted` = &amp;quot;1&amp;quot; and `institution`=&amp;quot;your school name&amp;quot; and `department` = &amp;quot;your department&amp;quot; and `data` = &amp;quot;class level and number&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Activity In Forums===&lt;br /&gt;
Trying to figure out how much real activity we have in Forums by aggregating:&lt;br /&gt;
Users in Course, Number of Posts, Number of Discussions, Unique student post, Unique student discussions, Number of Teachers , Number of Students, ratio between unique Student posts and the number of students in the Course...&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.fullname,f.name,f.type &lt;br /&gt;
,(SELECT count(id) FROM prefix_forum_discussions as fd WHERE f.id = fd.forum) as Discussions&lt;br /&gt;
,(SELECT count(distinct fd.userid) FROM prefix_forum_discussions as fd WHERE fd.forum = f.id) as UniqueUsersDiscussions&lt;br /&gt;
,(SELECT count(fp.id) FROM prefix_forum_discussions fd JOIN prefix_forum_posts as fp ON fd.id = fp.discussion WHERE f.id = fd.forum) as Posts&lt;br /&gt;
,(SELECT count(distinct fp.userid) FROM prefix_forum_discussions fd JOIN prefix_forum_posts as fp ON fd.id = fp.discussion WHERE f.id = fd.forum) as UniqueUsersPosts&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Students&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid =5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS StudentsCount&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Teachers&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid =3&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS &#039;Teacher&amp;lt;br/&amp;gt;Count&#039;&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid IN (3,5)&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS UserCount&lt;br /&gt;
, (SELECT (UniqueUsersDiscussions / StudentsCount )) as StudentDissUsage&lt;br /&gt;
, (SELECT (UniqueUsersPosts /StudentsCount)) as StudentPostUsage&lt;br /&gt;
FROM prefix_forum as f &lt;br /&gt;
JOIN prefix_course as c ON f.course = c.id&lt;br /&gt;
WHERE `type` != &#039;news&#039;&lt;br /&gt;
ORDER BY StudentPostUsage DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Blog activity per Course (not including VIEW)===&lt;br /&gt;
Filter activity logging to some specific Course Categories!&lt;br /&gt;
+ link course name to actual course (for quick reference)&lt;br /&gt;
(you can change %blog% to %wiki% to filter down all wiki activity or any other module you wish)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,cm.course,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as CourseID&lt;br /&gt;
,m.name ,count(cm.id) as counter &lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5&lt;br /&gt;
AND ctx.instanceid = c.id&lt;br /&gt;
) AS Students&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE `module` LIKE &#039;%blog%&#039; AND course = c.id AND action NOT LIKE &#039;%view%&#039; ) as BlogActivity&lt;br /&gt;
FROM `prefix_course_modules` as cm JOIN prefix_modules as m ON cm.module=m.id JOIN prefix_course as c ON cm.course = c.id &lt;br /&gt;
WHERE m.name LIKE &#039;%blog%&#039; AND c.category IN ( 8,13,15)&lt;br /&gt;
GROUP BY cm.course,cm.module order by counter desc&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Detailed WIKI activity (per wiki per course)===&lt;br /&gt;
Including Number of Students in course (for reference)&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,cm.course,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as CourseID  &lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id ) AS Students&lt;br /&gt;
,m.name&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%updat%&#039; ) as &#039;UPDAT E&#039;&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%annotate%&#039; ) as ANNOTATE&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%comment%&#039; ) as COMMENT&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%add%&#039; ) as &#039;A DD&#039;&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action LIKE &#039;%edit%&#039; ) as EDIT&lt;br /&gt;
, ( SELECT count(id) FROM prefix_log WHERE cmid = cm.id AND action NOT LIKE &#039;%view%&#039; ) as &#039;All (NO View)&#039;&lt;br /&gt;
FROM `prefix_course_modules` as cm &lt;br /&gt;
JOIN prefix_modules as m ON cm.module=m.id &lt;br /&gt;
JOIN prefix_course as c ON cm.course = c.id &lt;br /&gt;
WHERE m.name LIKE &#039;%wiki%&#039;&lt;br /&gt;
GROUP BY cm.course,cm.module&lt;br /&gt;
ORDER BY &#039;All (NO View)&#039; DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Courses which uploaded a Syllabus file===&lt;br /&gt;
+ under specific Category&lt;br /&gt;
+ show first Teacher in that course&lt;br /&gt;
+ link Course&#039;s fullname to actual course&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
,c.shortname,r.name&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) as Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user as u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) as Teacher&lt;br /&gt;
FROM prefix_resource as r &lt;br /&gt;
JOIN prefix_course as c ON r.course = c.id&lt;br /&gt;
WHERE ( r.name LIKE &#039;%סילבוס%&#039; OR r.name LIKE &#039;%סילאבוס%&#039; OR r.name LIKE &#039;%syllabus%&#039; OR r.name LIKE &#039;%תכנית הקורס%&#039; ) &lt;br /&gt;
AND c.category IN (10,18,26,13,28)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All resources that link to some specific external website===&lt;br /&gt;
+ link to course&lt;br /&gt;
+ who&#039;s the teacher&lt;br /&gt;
+ link to external resource&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,c.shortname,r.name&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/resource/view.php?id=&#039;,r.id,&#039;&amp;quot;&amp;gt;&#039;,r.name,&#039;&amp;lt;/a&amp;gt;&#039;) AS Resource&lt;br /&gt;
FROM prefix_resource AS r &lt;br /&gt;
JOIN prefix_course AS c ON r.course = c.id&lt;br /&gt;
WHERE r.reference LIKE &#039;http://info.oranim.ac.il/home%&#039; &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===How many LOGINs per user and user&#039;s Activity===&lt;br /&gt;
+ link username to a user activity graph report&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/user.php?id=1&amp;amp;user=&#039;,u.id,&#039;&amp;amp;mode=alllogs&amp;quot;&amp;gt;&#039;,u.firstname ,&#039; &#039;,u.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) as Username&lt;br /&gt;
,count(*) as logins&lt;br /&gt;
,(SELECT count(*) FROM prefix_log WHERE userid = l.userid GROUP BY userid) as Activity &lt;br /&gt;
FROM prefix_log as l JOIN prefix_user as u ON l.userid = u.id &lt;br /&gt;
WHERE `action` LIKE &#039;%login%&#039; group by userid&lt;br /&gt;
ORDER BY Activity DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===User&#039;s courses===&lt;br /&gt;
change &amp;quot;u.id = 2&amp;quot; with a new user id&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname, u.lastname, c.id, c.fullname&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE u.id = 2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All Forum type:NEWS===&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT f.id, f.name&lt;br /&gt;
FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
JOIN prefix_forum AS f ON cm.instance = f.id&lt;br /&gt;
WHERE m.name = &#039;forum&#039;&lt;br /&gt;
AND f.type = &#039;news&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===All new forum NEWS items (discussions) from all my Courses===&lt;br /&gt;
change &amp;quot;userid = 26&amp;quot; and &amp;quot;id = 26&amp;quot; to a new user id&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname,f.name,fd.name,FROM_UNIXTIME(fd.timemodified ,&amp;quot;%d %M %Y &amp;quot;) as Date&lt;br /&gt;
FROM prefix_forum_discussions as fd &lt;br /&gt;
JOIN prefix_forum as f ON f.id = fd.forum &lt;br /&gt;
JOIN prefix_course as c ON c.id = f.course &lt;br /&gt;
JOIN prefix_user_lastaccess as ul ON (c.id = ul.courseid AND ul.userid = 26)&lt;br /&gt;
WHERE fd.timemodified &amp;gt; ul.timeaccess  &lt;br /&gt;
 AND fd.forum IN (SELECT f.id&lt;br /&gt;
 FROM prefix_course_modules AS cm&lt;br /&gt;
 JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
 JOIN prefix_forum AS f ON cm.instance = f.id&lt;br /&gt;
 WHERE m.name = &#039;forum&#039;&lt;br /&gt;
 AND f.type = &#039;news&#039;)&lt;br /&gt;
  AND c.id IN (SELECT c.id&lt;br /&gt;
   FROM prefix_course AS c&lt;br /&gt;
   JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
   JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
   JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
   WHERE u.id = 26) ORDER BY `fd`.`timemodified` DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Resource count in courses==&lt;br /&gt;
+ (First)Teacher name&lt;br /&gt;
+ Where course is inside some specific Categories&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
COUNT(*) AS count&lt;br /&gt;
,r.course &lt;br /&gt;
,c.shortname shortname&lt;br /&gt;
,c.fullname coursename&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user as u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = r.course AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
FROM prefix_resource r &lt;br /&gt;
JOIN prefix_course c ON r.course = c.id&lt;br /&gt;
WHERE c.category IN (10,13,28,18,26)&lt;br /&gt;
GROUP BY r.course&lt;br /&gt;
ORDER BY COUNT(*) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==News Forum - Discussions COUNT==&lt;br /&gt;
Which is actually... How much instructions students get from their teachers&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT c.shortname ,&lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/mod/forum/view.php?f=&#039;,fd.forum,&#039;&amp;quot;&amp;gt;&#039;,count(fd.id),&#039;&amp;lt;/a&amp;gt;&#039;) AS DiscussionsSum&lt;br /&gt;
FROM prefix_forum_discussions AS fd&lt;br /&gt;
INNER JOIN prefix_forum AS f ON f.id = fd.forum&lt;br /&gt;
INNER JOIN prefix_course AS c ON c.id = f.course&lt;br /&gt;
WHERE f.type = &#039;news&#039; AND c.category IN (10,13,28,18,26)&lt;br /&gt;
GROUP BY fd.forum&lt;br /&gt;
ORDER BY count(fd.id) DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Special Roles==&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT ra.roleid,r.name&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/user.php?id=1&amp;amp;user=&#039;,ra.userid,&#039;&amp;quot;&amp;gt;&#039;,u.firstname ,&#039; &#039;,u.lastname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Username&lt;br /&gt;
,concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_role AS r ON r.id = ra.roleid&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_context AS ctx ON (ctx.id = ra.contextid AND ctx.contextlevel = 50)&lt;br /&gt;
JOIN prefix_course AS c ON ctx.instanceid = c.id&lt;br /&gt;
WHERE ra.roleid &amp;gt; 6&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Courses without Teachers==&lt;br /&gt;
Actually, shows the number of Teachers in a course.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id) AS Teachers&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
ORDER BY Teachers ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Site-Wide Grade Report with All Items==&lt;br /&gt;
Shows grades for all course items along with course totals for each student.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;First&#039; , u.lastname AS &#039;Last&#039;, u.firstname + &#039; &#039; + u.lastname AS &#039;Display Name&#039;, &lt;br /&gt;
c.fullname AS &#039;Course&#039;, &lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN gi.itemtype = &#039;course&#039; &lt;br /&gt;
   THEN c.fullname + &#039; Course Total&#039;&lt;br /&gt;
  ELSE gi.itemname&lt;br /&gt;
END AS &#039;Item Name&#039;,&lt;br /&gt;
&lt;br /&gt;
ROUND(gg.finalgrade,2) AS Grade,&lt;br /&gt;
DATEADD(ss,gi.timemodified,&#039;1970-01-01&#039;) AS Time&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id&lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid&lt;br /&gt;
JOIN prefix_course_categories as cc ON cc.id = c.category&lt;br /&gt;
&lt;br /&gt;
WHERE  gi.courseid = c.id &lt;br /&gt;
ORDER BY lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
For MySQL users, you&#039;ll need to use the MySQL DATE_ADD function instead of DATEADD:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DATE_ADD(&#039;1970-01-01&#039;, INTERVAL gi.timemodified SECONDS) AS Time&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Site-Wide Grade Report with Just Course Totals==&lt;br /&gt;
A second site-wide grade report for all students that just shows course totals.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;First&#039; , u.lastname AS &#039;Last&#039;, u.firstname + &#039; &#039; + u.lastname AS &#039;Display Name&#039;, &lt;br /&gt;
cc.name AS &#039;Category&#039;,&lt;br /&gt;
CASE &lt;br /&gt;
  WHEN gi.itemtype = &#039;course&#039; &lt;br /&gt;
   THEN c.fullname + &#039; Course Total&#039;&lt;br /&gt;
  ELSE gi.itemname&lt;br /&gt;
END AS &#039;Item Name&#039;,&lt;br /&gt;
&lt;br /&gt;
ROUND(gg.finalgrade,2) AS Grade,&lt;br /&gt;
DATEADD(ss,gi.timemodified,&#039;1970-01-01&#039;) AS Time&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid&lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id&lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid&lt;br /&gt;
JOIN prefix_course_categories as cc ON cc.id = c.category&lt;br /&gt;
&lt;br /&gt;
WHERE  gi.courseid = c.id AND gi.itemtype = &#039;course&#039;&lt;br /&gt;
&lt;br /&gt;
ORDER BY lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
For MySQL users, you&#039;ll need to use the MySQL DATE_ADD function instead of DATEADD:&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
DATE_ADD(&#039;1970-01-01&#039;, INTERVAL gi.timemodified SECONDS) AS Time&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==All Ungraded Assignments==&lt;br /&gt;
Returns all the submitted assignments that still need grading&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
u.firstname AS &amp;quot;First&amp;quot;,&lt;br /&gt;
u.lastname AS &amp;quot;Last&amp;quot;,&lt;br /&gt;
c.fullname AS &amp;quot;Course&amp;quot;,&lt;br /&gt;
a.name AS &amp;quot;Assignment&amp;quot;&lt;br /&gt;
&lt;br /&gt;
from prefix_assignment_submissions as asb&lt;br /&gt;
join prefix_assignment as a ON a.id = asb.assignment&lt;br /&gt;
join prefix_user as u ON u.id = asb.userid&lt;br /&gt;
join prefix_course as c ON c.id = a.course&lt;br /&gt;
join prefix_course_modules as cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
where asb.grade &amp;lt; 0 and cm.instance = a.id&lt;br /&gt;
and cm.module = 1&lt;br /&gt;
&lt;br /&gt;
order by c.fullname, a.name, u.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==All Ungraded Assignments w/ Link==&lt;br /&gt;
Returns all the submitted assignments that still need grading, along with a link that goes directly to the submission to grade it. The links work if you view the report within Moodle.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
select &lt;br /&gt;
u.firstname AS &amp;quot;First&amp;quot;,&lt;br /&gt;
u.lastname AS &amp;quot;Last&amp;quot;,&lt;br /&gt;
c.fullname AS &amp;quot;Course&amp;quot;,&lt;br /&gt;
a.name AS &amp;quot;Assignment&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
&#039;&amp;lt;a href=&amp;quot;http://education.varonis.com/mod/assignment/submissions.php&#039; + char(63) +&lt;br /&gt;
+ &#039;id=&#039; + cast(cm.id as varchar) + &#039;&amp;amp;userid=&#039; + cast(u.id as varchar) &lt;br /&gt;
+ &#039;&amp;amp;mode=single&amp;amp;filter=0&amp;amp;offset=2&amp;quot;&amp;gt;&#039; + a.name + &#039;&amp;lt;/a&amp;gt;&#039;&lt;br /&gt;
AS &amp;quot;Assignmentlink&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
from prefix_assignment_submissions as asb&lt;br /&gt;
join prefix_assignment as a ON a.id = asb.assignment&lt;br /&gt;
join prefix_user as u ON u.id = asb.userid&lt;br /&gt;
join prefix_course as c ON c.id = a.course&lt;br /&gt;
join prefix_course_modules as cm ON c.id = cm.course&lt;br /&gt;
&lt;br /&gt;
where asb.grade &amp;lt; 0 and cm.instance = a.id and cm.module = 1&lt;br /&gt;
&lt;br /&gt;
order by c.fullname, a.name, u.lastname&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Wiki usage, system wide==&lt;br /&gt;
(you can filter the output by selecting some specific course categories : &amp;quot;WHERE c.category IN ( 8,13,15)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;) AS Wikis&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039;) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ALL&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%add%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ADD&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%edit%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;EDIT&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%annotate%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;ANNOTATE&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.course = c.id AND l.module LIKE &#039;%wiki%&#039; and l.action LIKE &#039;%comments%&#039; ) AS &#039;WikiActivity&amp;lt;br/&amp;gt;Comments&#039;&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
,(SELECT count(*) FROM prefix_ouwiki_pages as ouwp&lt;br /&gt;
JOIN prefix_ouwiki as ouw ON ouw.id = ouwp.subwikiid&lt;br /&gt;
WHERE ouw.course = c.id GROUP BY ouw.course  ) as OUWikiPages&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( DISTINCT nwp.pagename ) FROM prefix_wiki_pages AS nwp&lt;br /&gt;
JOIN prefix_wiki AS nw ON nw.id = nwp.dfwiki WHERE nw.course = c.id ) As NWikiPages&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
WHERE c.category IN ( 8,13,15)&lt;br /&gt;
HAVING Wikis &amp;gt; 0&lt;br /&gt;
ORDER BY &#039;WikiActivity&amp;lt;br/&amp;gt;ALL&#039; DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Aggregated Teacher activity by &amp;quot;WEB2&amp;quot; Modules==&lt;br /&gt;
(Tested and works fine in Moodle 2.x)&lt;br /&gt;
The NV column shows activity without VIEW log activity&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT ra.userid, u.firstname,u.lastname&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%wiki%&#039;) AS Wiki&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%wiki%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Wiki_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%forum%&#039;) AS Forum&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%forum%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Forum_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%blog%&#039;) AS Blog&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%blog%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Blog_NV&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%assignment%&#039;) AS Assignment&lt;br /&gt;
,(SELECT count(*) FROM prefix_log as l WHERE l.userid = u.id AND l.module LIKE &#039;%assignment%&#039; AND l.action NOT LIKE &#039;%view%&#039;) AS Assignment_NV&lt;br /&gt;
FROM prefix_role_assignments AS ra &lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid &lt;br /&gt;
WHERE ra.roleid = 3 &lt;br /&gt;
GROUP BY ra.userid&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Courses that are defined as using GROUPs==&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/group/index.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
 FROM `prefix_course` AS c&lt;br /&gt;
WHERE groupmode &amp;gt; 0&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==System Wide usage count of various course Activities==&lt;br /&gt;
(Tested and works fine in Moodle 2.x)&lt;br /&gt;
Like: Forum, Wiki, Blog, Assignment, Database,&lt;br /&gt;
#Within specific category&lt;br /&gt;
#Teacher name in course&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher &lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%wiki%&#039;) AS Wikis&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%blog%&#039;) AS Blogs&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM &lt;br /&gt;
prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%forum%&#039;) AS Forums&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%data%&#039;) AS Databses&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%assignment%&#039;) AS Assignments&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c&lt;br /&gt;
WHERE c.category IN ( 18)&lt;br /&gt;
ORDER BY Wikis DESC,Blogs DESC, Forums DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==List all the certificates issued, sort by variables in the custom profile fields==&lt;br /&gt;
Note: The SQL queries look intimidating at first, but isn&#039;t really that difficult to learn. I&#039;ve seen in the forums that users wanted to do &#039;site-wide&#039; groups in 1.9x. This is sort of the idea. It pulls all the certificates issued to all users sorted by the custom profile fields, which in my case is the Units or Depts (i.e. my site wide groups). Why certificates? I&#039;ve explored with both grades and quizzes, the course admins are not really interested in the actual grades but whether the learner received a certificate (i.e. passed the course with x, y, z activities). It also saves me from creating groups and assigning them into the right groups. Even assigning in bulk is not efficient, since I have upward of 25 groups per course and constantly new learners enrolling in courses. The limitation is something to do with the server? as it only pull 5000 rows of data. If anyone figured out how to change this, please let me know. In the meantime, the work around is to pull only a few units/depts at a time to limit the number of rows. This is fine at the moment, since each course admin are only responsible for certain units/depts.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT&lt;br /&gt;
DATE_FORMAT( FROM_UNIXTIME(prefix_certificate_issues.timecreated), &#039;%Y/%m/%d&#039; ) AS Date,&lt;br /&gt;
prefix_certificate_issues.classname AS Topic,&lt;br /&gt;
prefix_certificate.name AS Certificate,&lt;br /&gt;
prefix_certificate_issues.studentname as Name,&lt;br /&gt;
prefix_user_info_data.data AS Units&lt;br /&gt;
&lt;br /&gt;
FROM&lt;br /&gt;
prefix_certificate_issues&lt;br /&gt;
&lt;br /&gt;
INNER JOIN prefix_user_info_data&lt;br /&gt;
on prefix_certificate_issues.userid = prefix_user_info_data.userid&lt;br /&gt;
&lt;br /&gt;
INNER JOIN prefix_certificate&lt;br /&gt;
on prefix_certificate_issues.certificateid = prefix_certificate.id&lt;br /&gt;
&lt;br /&gt;
WHERE prefix_user_info_data.data=&#039;Unit 1&#039;&lt;br /&gt;
OR prefix_user_info_data.data=&#039;Unit 2&#039;&lt;br /&gt;
OR prefix_user_info_data.data=&#039;Unit 3&#039;&lt;br /&gt;
&lt;br /&gt;
ORDER BY Units, Name, Topic ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
==List all Courses in and below a certain category==&lt;br /&gt;
Use this SQL code to retrieve all courses that exist in or under a set category.&lt;br /&gt;
&lt;br /&gt;
$s should be the id of the category you want to know about...&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT prefix_course. * , prefix_course_categories. *&lt;br /&gt;
FROM prefix_course, prefix_course_categories&lt;br /&gt;
WHERE prefix_course.category = prefix_course_categories.id&lt;br /&gt;
AND (&lt;br /&gt;
prefix_course_categories.path LIKE &#039;/$s/%&#039;&lt;br /&gt;
OR prefix_course_categories.path LIKE &#039;/$s&#039;&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Who is using &amp;quot;Single File Upload&amp;quot; assignment==&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) AS Course&lt;br /&gt;
 &lt;br /&gt;
,(SELECT CONCAT(u.firstname,&#039; &#039;, u.lastname) AS Teacher&lt;br /&gt;
FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid&lt;br /&gt;
WHERE ra.roleid = 3 AND ctx.instanceid = c.id LIMIT 1) AS Teacher &lt;br /&gt;
&lt;br /&gt;
,ass.name as &amp;quot;Assignment Name&amp;quot;&lt;br /&gt;
&lt;br /&gt;
FROM &lt;br /&gt;
prefix_assignment as ass&lt;br /&gt;
&lt;br /&gt;
JOIN &lt;br /&gt;
prefix_course as c ON c.id = ass.course&lt;br /&gt;
&lt;br /&gt;
WHERE `assignmenttype` LIKE &#039;uploadsingle&#039;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Counter Blog usage in Courses,system wide==&lt;br /&gt;
What teachers in what courses, uses blogs and how many + student count in that course.&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
SELECT ( @counter := @counter+1) as counter, &lt;br /&gt;
concat(&#039;&amp;lt;a target=&amp;quot;_new&amp;quot; href=&amp;quot;%%WWWROOT%%/course/view.php?id=&#039;,c.id,&#039;&amp;quot;&amp;gt;&#039;,c.fullname,&#039;&amp;lt;/a&amp;gt;&#039;) as Course&lt;br /&gt;
&lt;br /&gt;
,( SELECT DISTINCT CONCAT(u.firstname,&#039; &#039;,u.lastname)&lt;br /&gt;
  FROM prefix_role_assignments AS ra&lt;br /&gt;
  JOIN prefix_user AS u ON ra.userid = u.id&lt;br /&gt;
  JOIN prefix_context AS ctx ON ctx.id = ra.contextid&lt;br /&gt;
  WHERE ra.roleid = 3 AND ctx.instanceid = c.id AND ctx.contextlevel = 50 LIMIT 1) AS Teacher&lt;br /&gt;
&lt;br /&gt;
,(SELECT count( m.name ) AS count FROM prefix_course_modules AS cm&lt;br /&gt;
JOIN prefix_modules AS m ON cm.module = m.id&lt;br /&gt;
WHERE cm.course = c.id AND m.name LIKE &#039;%blog%&#039;) AS Blogs&lt;br /&gt;
&lt;br /&gt;
,(SELECT Count( ra.userid ) AS Users FROM prefix_role_assignments AS ra&lt;br /&gt;
JOIN prefix_context AS ctx ON ra.contextid = ctx.id&lt;br /&gt;
WHERE ra.roleid = 5 AND ctx.instanceid = c.id) AS Students&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c, (SELECT @counter := 0) as s_init&lt;br /&gt;
WHERE c.category IN ( 8,13,15)&lt;br /&gt;
HAVING Blogs &amp;gt; 0&lt;br /&gt;
ORDER BY Blogs DESC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Learner report by Learner with grades==&lt;br /&gt;
Which Learners in which course and what are the grades&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT u.firstname AS &#039;Name&#039; , u.lastname AS &#039;Surname&#039;, c.fullname AS &#039;Course&#039;, cc.name AS &#039;Category&#039;, &lt;br /&gt;
CASE WHEN gi.itemtype = &#039;Course&#039;    &lt;br /&gt;
THEN c.fullname + &#039; Course Total&#039;  &lt;br /&gt;
ELSE gi.itemname &lt;br /&gt;
END AS &#039;Item Name&#039;, ROUND(gg.finalgrade,2) AS Score,ROUND(gg.rawgrademax,2) AS Max, ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) as Percentage,&lt;br /&gt;
&lt;br /&gt;
if (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) &amp;gt; 79,&#039;Yes&#039; , &#039;No&#039;) as Pass&lt;br /&gt;
&lt;br /&gt;
FROM prefix_course AS c &lt;br /&gt;
JOIN prefix_context AS ctx ON c.id = ctx.instanceid &lt;br /&gt;
JOIN prefix_role_assignments AS ra ON ra.contextid = ctx.id &lt;br /&gt;
JOIN prefix_user AS u ON u.id = ra.userid &lt;br /&gt;
JOIN prefix_grade_grades AS gg ON gg.userid = u.id &lt;br /&gt;
JOIN prefix_grade_items AS gi ON gi.id = gg.itemid &lt;br /&gt;
JOIN prefix_course_categories AS cc ON cc.id = c.category &lt;br /&gt;
WHERE  gi.courseid = c.id and gi.itemname != &#039;Attendance&#039;&lt;br /&gt;
ORDER BY `Name` ASC&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:Blocks&amp;diff=81588</id>
		<title>Development:Blocks</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:Blocks&amp;diff=81588"/>
		<updated>2011-02-24T17:44:24Z</updated>

		<summary type="html">&lt;p&gt;Chuang: minor typo correction&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039; A Step-by-step Guide To Creating Blocks &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Original Author: Jon Papaioannou ([mailto:pj@moodle.org pj@moodle.org])&lt;br /&gt;
&lt;br /&gt;
{{Moodle 1.9}}&lt;br /&gt;
&lt;br /&gt;
The present document serves as a guide to developers who want to create their own blocks for use in Moodle. It applies to the 1.5 development version of Moodle (and any newer) &#039;&#039;&#039;only&#039;&#039;&#039;, as the blocks subsystem was rewritten and expanded for the 1.5 release. However, you can also find it useful if you want to modify blocks written for Moodle 1.3 and 1.4 to work with the latest versions (look at [[Development:Blocks/Appendix_B| Appendix B]]).&lt;br /&gt;
&lt;br /&gt;
The guide is written as an interactive course which aims to develop a configurable, multi-purpose block that displays arbitrary HTML. It&#039;s targeted mainly at people with little experience with Moodle or programming in general and aims to show how easy it is to create new blocks for Moodle. A certain small amount of PHP programming knowledge is still required, though. &lt;br /&gt;
&lt;br /&gt;
Experienced developers and those who just want a &#039;&#039;&#039;reference&#039;&#039;&#039; text should refer to [[Development:Blocks/Appendix_A| Appendix A]] because the main guide has a rather low concentration of pure information in the text.&lt;br /&gt;
&lt;br /&gt;
== Basic Concepts ==&lt;br /&gt;
&lt;br /&gt;
Through this guide, we will be following the creation of an &amp;quot;HTML&amp;quot; block from scratch in order to demonstrate most of the block features at our disposal. Our block will be named &amp;quot;SimpleHTML&amp;quot;. This does not constrain us regarding the name of the actual directory on the server where the files for our block will be stored, but for consistency we will follow the practice of using the lowercased form &amp;quot;simplehtml&amp;quot; in any case where such a name is required. &lt;br /&gt;
&lt;br /&gt;
Whenever we refer to a file or directory name which contains &amp;quot;simplehtml&amp;quot;, it&#039;s important to remember that &#039;&#039;only&#039;&#039; the &amp;quot;simplehtml&amp;quot; part is up to us to change; the rest is standardized and essential for Moodle to work correctly.&lt;br /&gt;
&lt;br /&gt;
Whenever a file&#039;s path is mentioned in this guide, it will always start with a slash. This refers to the Moodle home directory; all files and directories will be referred to with respect to that directory.&lt;br /&gt;
&lt;br /&gt;
== Ready, Set, Go! ==&lt;br /&gt;
&lt;br /&gt;
To define a &amp;quot;block&amp;quot; in Moodle, in the most basic case we need to provide just one source code file. We start by creating the directory &#039;&#039;/blocks/simplehtml/&#039;&#039; and creating a file named &#039;&#039;/blocks/simplehtml/&#039;&#039;&#039;&#039;&#039;block_simplehtml.php&#039;&#039;&#039; which will hold our code. We then begin coding the block:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
class block_simplehtml extends block_base {&lt;br /&gt;
  function init() {&lt;br /&gt;
    $this-&amp;gt;title   = get_string(&#039;simplehtml&#039;, &#039;block_simplehtml&#039;);&lt;br /&gt;
    $this-&amp;gt;version = 2004111200;&lt;br /&gt;
  }&lt;br /&gt;
  // The PHP tag and the curly bracket for the class definition &lt;br /&gt;
  // will only be closed after there is another function added in the next section.&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first line is our block class definition; it must be named exactly in the manner shown. Again, only the &amp;quot;simplehtml&amp;quot; part can (and indeed must) change; everything else is standardized.&lt;br /&gt;
&lt;br /&gt;
Our class is then given a small method: [[Development:Blocks/Appendix_A#init.28.29| init()]]. This is essential for all blocks, and its purpose is to set the two class member variables listed inside it. But what do these values actually mean? Here&#039;s a more detailed description.&lt;br /&gt;
&lt;br /&gt;
[[Development:Blocks/Appendix_A#.24this-.3Etitle| $this-&amp;gt;title]] is the title displayed in the header of our block. We can set it to whatever we like; in this case it&#039;s set to read the actual title from a language file we are presumably distributing together with the block. I &#039;ll skip ahead a bit here and say that if you want your block to display &#039;&#039;&#039;no&#039;&#039;&#039; title at all, then you should set this to any descriptive value you want (but &#039;&#039;&#039;not&#039;&#039;&#039; make it an empty string). We will later see [[Development:Blocks#Eye_Candy| how to disable the title&#039;s display]].&lt;br /&gt;
&lt;br /&gt;
[[Development:Blocks/Appendix_A#.24this-.3Eversion| $this-&amp;gt;version]] is the version of our block. This actually would only make a difference if your block wanted to keep its own data in special tables in the database (i.e. for very complex blocks). In that case the version number is used exactly as it&#039;s used in activities; an upgrade script uses it to incrementally upgrade an &amp;quot;old&amp;quot; version of the block&#039;s data to the latest. We will outline this process further ahead, since blocks tend to be relatively simple and not hold their own private data. &lt;br /&gt;
&lt;br /&gt;
In our example, this is certainly the case so we just set [[Development:Blocks/Appendix_A#.24this-.3Eversion| $this-&amp;gt;version]] to &#039;&#039;&#039;YYYYMMDD00&#039;&#039;&#039; and forget about it.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATING:&#039;&#039;&#039;&amp;lt;br /&amp;gt; &lt;br /&gt;
Prior to version 1.5, the basic structure of each block class was slightly different. Refer to [[Development:Blocks/Appendix_B| Appendix B]] for more information on the changes that old blocks have to make to conform to the new standard.&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
If you are using Moodle 2.0 and starting to develop your own block. You have to put the version information of the block in a separate file named version.php in &#039;&#039;/blocks/simplehtml/&#039;&#039;&#039;&#039;&#039;version.php&#039;&#039;&#039;. This file has no reference in its name or content to the block&#039;s name (simplehtml).&lt;br /&gt;
&lt;br /&gt;
Moodle 2.0 will also require a name for your plugin to show in the upgrading page. You set this value in a language package (the same file where you put your string for the plugin title). Create the file &#039;&#039;/blocks/simplehtml/lang/en/&#039;&#039;&#039;&#039;&#039;block_simplehtml.php&#039;&#039;&#039; and paste the following code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
  $string[&#039;pluginname&#039;] = &#039;Simple html block&#039;;&lt;br /&gt;
  $string[&#039;simplehtml&#039;] = &#039;Simple html&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== I Just Hear Static ==&lt;br /&gt;
In order to get our block to actually display something on screen, we need to add one more method to our class (before the final closing brace in our file). The new code is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;  &lt;br /&gt;
  function get_content() {&lt;br /&gt;
    if ($this-&amp;gt;content !== NULL) {&lt;br /&gt;
      return $this-&amp;gt;content;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    $this-&amp;gt;content         =  new stdClass;&lt;br /&gt;
    $this-&amp;gt;content-&amp;gt;text   = &#039;The content of our SimpleHTML block!&#039;;&lt;br /&gt;
    $this-&amp;gt;content-&amp;gt;footer = &#039;Footer here...&#039;;&lt;br /&gt;
 &lt;br /&gt;
    return $this-&amp;gt;content;&lt;br /&gt;
  }&lt;br /&gt;
}   // Here&#039;s the closing curly bracket for the class definition&lt;br /&gt;
    // and here&#039;s the closing PHP tag from the section above.&lt;br /&gt;
?&amp;gt;  &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It can&#039;t get any simpler than that, can it? Let&#039;s dissect this method to see what&#039;s going on...&lt;br /&gt;
&lt;br /&gt;
First of all, there is a check that returns the current value of [[Development:Blocks/Appendix_A#.24this-.3Econtent| $this-&amp;gt;content]] if it&#039;s not NULL; otherwise we proceed with &amp;quot;computing&amp;quot; it. Since the computation is potentially a time-consuming operation and it &#039;&#039;&#039;will&#039;&#039;&#039; be called several times for each block (Moodle works that way internally), we take a precaution and include this time-saver.&lt;br /&gt;
Supposing the content had not been computed before (it was NULL), we then define it from scratch. The code speaks for itself there, so there isn&#039;t much to say. Just keep in mind that we can use HTML both in the text &#039;&#039;&#039;and&#039;&#039;&#039; in the footer, if we want to.&lt;br /&gt;
&lt;br /&gt;
At this point our block should be capable of being automatically installed in Moodle and added to courses; visit your administration page to install it (Click &amp;quot;Notifications&amp;quot; under the Site Administration Block) and after seeing it in action come back to continue our tutorial.&lt;br /&gt;
&lt;br /&gt;
== Configure That Out ==&lt;br /&gt;
&lt;br /&gt;
The current version of our block doesn&#039;t really do much; it just displays a fixed message, which is not very useful. What we &#039;d really like to do is allow the teachers to customize what goes into the block. This, in block-speak, is called &amp;quot;instance configuration&amp;quot;. So let&#039;s give our block some instance configuration...&lt;br /&gt;
First of all, we need to tell Moodle that we want it to provide instance-specific configuration amenities to our block. That&#039;s as simple as adding one more method to our block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function instance_allow_config() {&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This small change is enough to make Moodle display an &amp;quot;Edit...&amp;quot; icon in our block&#039;s header when we turn editing mode on in any course. However, if you try to click on that icon you will be presented with a notice that complains about the block&#039;s configuration not being implemented correctly. Try it, it&#039;s harmless.&lt;br /&gt;
Moodle&#039;s complaints do make sense. We told it that we want to have configuration, but we didn&#039;t say &#039;&#039;what&#039;&#039; kind of configuration we want, or how it should be displayed. To do that, we need to create one more file: &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/blocks/simplehtml/&#039;&#039;&#039;config_instance.html&#039;&#039;&#039;&amp;lt;/span&amp;gt; (which has to be named exactly like that). For the moment, copy paste the following into it and save:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;table cellpadding=&amp;quot;9&amp;quot; cellspacing=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;?php print_string(&#039;configcontent&#039;, &#039;block_simplehtml&#039;); ?&amp;gt;:&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
    &amp;lt;td&amp;gt;&lt;br /&gt;
       &amp;lt;?php print_textarea(true, 10, 50, 0, 0, &#039;text&#039;, $this-&amp;gt;config-&amp;gt;text); ?&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
  &amp;lt;tr&amp;gt;&lt;br /&gt;
    &amp;lt;td colspan=&amp;quot;2&amp;quot; align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
      &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;&amp;lt;?php print_string(&#039;savechanges&#039;) ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
    &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php use_html_editor(); ?&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It isn&#039;t difficult to see that the above code just provides us with a wysiwyg-editor-enabled textarea to write our block&#039;s desired content in and a submit button to save. But... what&#039;s $this-&amp;gt;config-&amp;gt;text? Well...&lt;br /&gt;
Moodle goes a long way to make things easier for block developers. Did you notice that the textarea is actually named &amp;quot;text&amp;quot;? When the submit button is pressed, Moodle saves each and every field it can find in our &#039;&#039;&#039;config_instance.html&#039;&#039;&#039; file as instance configuration data. &lt;br /&gt;
&lt;br /&gt;
We can then access that data as &#039;&#039;&#039;$this-&amp;gt;config-&amp;gt;&#039;&#039;variablename&#039;&#039;&#039;&#039;&#039;, where &#039;&#039;variablename&#039;&#039; is the actual name we used for our field; in this case, &amp;quot;text&amp;quot;. So in essence, the above form just pre-populates the textarea with the current content of the block (as indeed it should) and then allows us to change it.&lt;br /&gt;
&lt;br /&gt;
You also might be surprised by the presence of a submit button and the absence of any &amp;lt;form&amp;gt; element at the same time. But the truth is, we don&#039;t need to worry about that at all; Moodle goes a really long way to make things easier for developers! We just print the configuration options we want, in any format we want; include a submit button, and Moodle will handle all the rest itself. The instance configuration variables are automatically at our disposal to access from any of the class methods &#039;&#039;except&#039;&#039; [[Development:Blocks/Appendix_A#init.28.29| init()]].&lt;br /&gt;
&lt;br /&gt;
In the event where the default behaviour is not satisfactory, we can still override it. However, this requires advanced modifications to our block class and will not be covered here; refer to [[Development:Blocks/Appendix_A| Appendix A]] for more details.&lt;br /&gt;
Having now the ability to refer to this instance configuration data through [[Development:Blocks/Appendix_A#.24this-.3Econfig| $this-&amp;gt;config]], the final twist is to tell our block to actually &#039;&#039;display&#039;&#039; what is saved in its configuration data. To do that, find this snippet in &#039;&#039;/blocks/simplehtml/block_simplehtml.php&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $this-&amp;gt;content = new stdClass;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;text   = &#039;The content of our SimpleHTML block!&#039;;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;footer = &#039;Footer here...&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and change it to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $this-&amp;gt;content = new stdClass;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;text   = $this-&amp;gt;config-&amp;gt;text;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;footer = &#039;Footer here...&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Oh, and since the footer isn&#039;t really exciting at this point, we remove it from our block because it doesn&#039;t contribute anything. We could just as easily have decided to make the footer configurable in the above way, too. So for our latest code, the snippet becomes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $this-&amp;gt;content = new stdClass;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;text   = $this-&amp;gt;config-&amp;gt;text;&lt;br /&gt;
 $this-&amp;gt;content-&amp;gt;footer = &#039;&#039;;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After this discussion, our block is ready for prime time! Indeed, if you now visit any course with a SimpleHTML block, you will see that modifying its contents is now a snap.&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 there is a simpler way to create the interface to configure your block. Instead of creating the &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/blocks/simplehtml/&#039;&#039;&#039;config_instance.html&#039;&#039;&#039;&amp;lt;/span&amp;gt; file, you have to create a &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/blocks/simplehtml/&#039;&#039;&#039;edit_form.php&#039;&#039;&#039;&amp;lt;/span&amp;gt; file which contains only php code and no HTML. Moodle will process this file and add its elements to the configuration page for your block.&lt;br /&gt;
&lt;br /&gt;
Create the edit_form.php file and paste the following code:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
class block_simplehtml_edit_form extends block_edit_form {&lt;br /&gt;
	&lt;br /&gt;
    protected function specific_definition($mform) {&lt;br /&gt;
    	&lt;br /&gt;
        // Section header title according to language file.&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;header&#039;, &#039;configheader&#039;, get_string(&#039;blocksettings&#039;, &#039;block&#039;));&lt;br /&gt;
&lt;br /&gt;
        // A sample string variable with a default value.&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;config_text&#039;, get_string(&#039;blockstring&#039;, &#039;block_simplehtml&#039;));&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;config_text&#039;, &#039;default value&#039;);&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;config_text&#039;, PARAM_MULTILANG);        &lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
The first line declares a class that inherits from block_edit_form, this allows Moodle to identify the code to execute in the configuration page. The specific_definition function does two things: It indicates the header for the configuration section, which in this case we took from the &#039;blocksettings&#039; string for blocks. The second part is where you define the variables that will be defined in the config part of your block. Three lines define this: The first one adds an element, each element is a variable within config, that is of text type, and is described by the blockstring string in the language file for the simplehtml block. The second line indicates a default value (in case it is not yet defined). The third line sets a type for our variable, in this case PARAM_MULTILANG.&lt;br /&gt;
{{Top}}&lt;br /&gt;
&lt;br /&gt;
== The Specialists ==&lt;br /&gt;
&lt;br /&gt;
Implementing instance configuration for the block&#039;s contents was good enough to whet our appetite, but who wants to stop there? Why not customize the block&#039;s title, too?&lt;br /&gt;
&lt;br /&gt;
Why not, indeed. Well, our first attempt to achieve this is natural enough: let&#039;s add another field to &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/blocks/simplehtml/config_instance.html&amp;lt;/span&amp;gt;. Here goes:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;tr valign=&amp;quot;top&amp;quot;&amp;gt;&lt;br /&gt;
  &amp;lt;td align=&amp;quot;right&amp;quot;&amp;gt;&amp;lt;p&amp;gt;&lt;br /&gt;
    &amp;lt;?php print_string(&#039;configtitle&#039;, &#039;block_simplehtml&#039;); ?&amp;gt;:&amp;lt;/p&amp;gt;&lt;br /&gt;
  &amp;lt;/td&amp;gt;&lt;br /&gt;
  &amp;lt;td&amp;gt;&lt;br /&gt;
    &amp;lt;input type=&amp;quot;text&amp;quot; name=&amp;quot;title&amp;quot; size=&amp;quot;30&amp;quot; value=&amp;quot;&amp;lt;?php echo $this-&amp;gt;config-&amp;gt;title; ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
  &amp;lt;/td&amp;gt;&lt;br /&gt;
&amp;lt;/tr&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We save the edited file, go to a course, edit the title of the block and... nothing happens! The instance configuration is saved correctly, all right (editing it once more proves that) but it&#039;s not being displayed. All we get is just the simple &amp;quot;SimpleHTML&amp;quot; title.&lt;br /&gt;
&lt;br /&gt;
That&#039;s not too weird, if we think back a bit. Do you remember that [[Development:Blocks/Appendix_A#init.28.29|init()]] method, where we set [[Development:Blocks/Appendix_A#.24this-.3Etitle|$this-&amp;gt;title]]? We didn&#039;t actually change its value from then, and [[Development:Blocks/Appendix_A#.24this-.3Etitle|$this-&amp;gt;title]] is definitely not the same as &#039;&#039;&#039;$this-&amp;gt;config-&amp;gt;title&#039;&#039;&#039; (to Moodle, at least). What we need is a way to update [[Development:Blocks/Appendix_A#.24this-.3Etitle|$this-&amp;gt;title]] with the value in the instance configuration. But as we said a bit earlier, we can use [[Development:Blocks/Appendix_A#.24this-.3Econfig| $this-&amp;gt;config]] in all methods &#039;&#039;except&#039;&#039; [[Development:Blocks/Appendix_A#init.28.29|init()]]! So what can we do?&lt;br /&gt;
&lt;br /&gt;
Let&#039;s pull out another ace from our sleeve, and add this small method to our block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function specialization() {&lt;br /&gt;
  if (!empty($this-&amp;gt;config-&amp;gt;title)) {&lt;br /&gt;
    $this-&amp;gt;title = $this-&amp;gt;config-&amp;gt;title;&lt;br /&gt;
  } else {&lt;br /&gt;
    $this-&amp;gt;config-&amp;gt;title = &#039;Some title ...&#039;;&lt;br /&gt;
  }&lt;br /&gt;
  if (empty($this-&amp;gt;config-&amp;gt;text)) {&lt;br /&gt;
    $this-&amp;gt;config-&amp;gt;text = &#039;Some text ...&#039;;&lt;br /&gt;
  }    &lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Aha, here&#039;s what we wanted to do all along! But what&#039;s going on with the [[Development:Blocks/Appendix_A#specialization.28.29| specialization()]] method?&lt;br /&gt;
&lt;br /&gt;
This &amp;quot;magic&amp;quot; method has actually a very nice property: it&#039;s &#039;&#039;guaranteed&#039;&#039; to be automatically called by Moodle as soon as our instance configuration is loaded and available (that is, immediately after [[Development:Blocks/Appendix_A#init.28.29|init()]] is called). That means before the block&#039;s content is computed for the first time, and indeed before &#039;&#039;anything&#039;&#039; else is done with the block. Thus, providing a [[Development:Blocks/Appendix_A#specialization.28.29| specialization()]] method is the natural choice for any configuration data that needs to be acted upon &amp;quot;as soon as possible&amp;quot;, as in this case.&lt;br /&gt;
&lt;br /&gt;
== Now You See Me, Now You Don&#039;t ==&lt;br /&gt;
&lt;br /&gt;
Now would be a good time to mention another nifty technique that can be used in blocks, and which comes in handy quite often. Specifically, it may be the case that our block will have something interesting to display some of the time; but in some other cases, it won&#039;t have anything useful to say. (An example here would be the &amp;quot;Recent Activity&amp;quot; block, in the case where no recent activity in fact exists. &lt;br /&gt;
&lt;br /&gt;
However in that case the block chooses to explicitly inform you of the lack of said activity, which is arguably useful). It would be nice, then, to be able to have our block &amp;quot;disappear&amp;quot; if it&#039;s not needed to display it.&lt;br /&gt;
&lt;br /&gt;
This is indeed possible, and the way to do it is to make sure that after the [[Development:Blocks/Appendix_A#get_content.28.29| get_content()]] method is called, the block is completely void of content. Specifically, &amp;quot;void of content&amp;quot; means that both $this-&amp;gt;content-&amp;gt;text and $this-&amp;gt;content-&amp;gt;footer are each equal to the empty string (&amp;lt;nowiki&amp;gt;&#039;&#039;&amp;lt;/nowiki&amp;gt;). Moodle performs this check by calling the block&#039;s [[Development:Blocks/Appendix_A#is_empty.28.29| is_empty()]] method, and if the block is indeed empty then it is not displayed at all.&lt;br /&gt;
&lt;br /&gt;
Note that the exact value of the block&#039;s title and the presence or absence of a [[Development:Blocks/Appendix_A#hide_header.28.29| hide_header()]] method do &#039;&#039;not&#039;&#039; affect this behavior. A block is considered empty if it has no content, irrespective of anything else.&lt;br /&gt;
&lt;br /&gt;
== We Are Legion ==&lt;br /&gt;
&lt;br /&gt;
Right now our block is fully configurable, both in title and content. It&#039;s so versatile, in fact, that we could make pretty much anything out of it. It would be really nice to be able to add multiple blocks of this type to a single course. And, as you might have guessed, doing that is as simple as adding another small method to our block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function instance_allow_multiple() {&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This tells Moodle that it should allow any number of instances of the SimpleHTML block in any course. After saving the changes to our file, Moodle immediately allows us to add multiple copies of the block without further ado!&lt;br /&gt;
&lt;br /&gt;
There are a couple more of interesting points to note here. First of all, even if a block itself allows multiple instances in the same page, the administrator still has the option of disallowing such behavior. This setting can be set separately for each block from the Administration / Configuration / Blocks page.&lt;br /&gt;
&lt;br /&gt;
And finally, a nice detail is that as soon as we defined an [[Development:Blocks/Appendix_A#instance_allow_multiple.28.29| instance_allow_multiple()]] method, the method [[Development:Blocks/Appendix_A#instance_allow_config.28.29| instance_allow_config()]] that was already defined became obsolete. &lt;br /&gt;
&lt;br /&gt;
Moodle assumes that if a block allows multiple instances of itself, those instances will want to be configured (what is the point of same multiple instances in the same page if they are identical?) and thus automatically provides an &amp;quot;Edit&amp;quot; icon. So, we can also remove the whole [[Development:Blocks/Appendix_A#instance_allow_config.28.29| instance_allow_config()]] method now without harm. We had only needed it when multiple instances of the block were not allowed.&lt;br /&gt;
&lt;br /&gt;
{{Top}}&lt;br /&gt;
&lt;br /&gt;
== The Effects of Globalization ==&lt;br /&gt;
&lt;br /&gt;
Configuring each block instance with its own personal data is cool enough, but sometimes administrators need some way to &amp;quot;touch&amp;quot; all instances of a specific block at the same time. In the case of our SimpleHTML block, a few settings that would make sense to apply to all instances aren&#039;t that hard to come up with. &lt;br /&gt;
&lt;br /&gt;
For example, we might want to limit the contents of each block to only so many characters, or we might have a setting that filters HTML out of the block&#039;s contents, only allowing pure text in. Granted, such a feature wouldn&#039;t win us any awards for naming our block &amp;quot;SimpleHTML&amp;quot; but some tormented administrator somewhere might actually find it useful.&lt;br /&gt;
&lt;br /&gt;
This kind of configuration is called &amp;quot;global configuration&amp;quot; and applies only to a specific block type (all instances of that block type are affected, however). Implementing such configuration for our block is quite similar to implementing the instance configuration. We will now see how to implement the second example, having a setting that only allows text and not HTML in the block&#039;s contents.&lt;br /&gt;
First of all, we need to tell Moodle that we want our block to provide global configuration by, what a surprise, adding a small method to our block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
function has_config() {&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then, we need to create a HTML file that actually prints out the configuration screen. In our case, we &#039;ll just print out a checkbox saying &amp;quot;Do not allow HTML in the content&amp;quot; and a &amp;quot;submit&amp;quot; button. Let&#039;s create the file &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/blocks/simplehtml/config_global.html&amp;lt;/span&amp;gt; which again must be named just so, and copy paste the following into it:&lt;br /&gt;
&lt;br /&gt;
[[Development_talk:Blocks|TODO: New settings.php method]] &lt;br /&gt;
: Just to note that general documentation about admin settings is at [[Development:Admin_settings#Individual_settings]]. In the absence of documentation, you can look at blocks/course_list, blocks/online_users and blocks/rss_client. They all use a settings.php file.--[[User:Tim Hunt|Tim Hunt]] 19:38, 28 January 2009 (CST)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
&amp;lt;div style=&amp;quot;text-align: center;&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;block_simplehtml_strict&amp;quot; value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;checkbox&amp;quot; name=&amp;quot;block_simplehtml_strict&amp;quot; value=&amp;quot;1&amp;quot;&lt;br /&gt;
   &amp;lt;?php if(!empty($CFG-&amp;gt;block_simplehtml_strict)) &lt;br /&gt;
             echo &#039;checked=&amp;quot;checked&amp;quot;&#039;; ?&amp;gt; /&amp;gt;&lt;br /&gt;
   &amp;lt;?php print_string(&#039;donotallowhtml&#039;, &#039;block_simplehtml&#039;); ?&amp;gt;&lt;br /&gt;
 &amp;lt;p&amp;gt;&lt;br /&gt;
 &amp;lt;input type=&amp;quot;submit&amp;quot; value=&amp;quot;&amp;lt;?php print_string(&#039;savechanges&#039;); ?&amp;gt;&amp;quot; /&amp;gt;&lt;br /&gt;
 &amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
True to our block&#039;s name, this looks simple enough. What it does is that it displays a checkbox named &amp;quot;block_simplehtml_strict&amp;quot; and if the Moodle configuration variable with the same name (i.e., $CFG-&amp;gt;block_simplehtml_strict) is set and not empty (that means it&#039;s not equal to an empty string, to zero, or to boolean FALSE) it displays the box as pre-checked (reflecting the current status). &lt;br /&gt;
&lt;br /&gt;
Why does it check the configuration setting with the same name? Because the default implementation of the global configuration saving code takes all the variables we have in our form and saves them as Moodle configuration options with the same name. Thus, it&#039;s good practice to use a descriptive name and also one that won&#039;t possibly conflict with the name of another setting. &lt;br /&gt;
&lt;br /&gt;
&amp;quot;block_simplehtml_strict&amp;quot; clearly satisfies both requirements.&lt;br /&gt;
&lt;br /&gt;
The astute reader may have noticed that we actually have &#039;&#039;two&#039;&#039; input fields named &amp;quot;block_simplehtml_strict&amp;quot; in our configuration file. One is hidden and its value is always 0; the other is the checkbox and its value is 1. What gives? Why have them both there?&lt;br /&gt;
&lt;br /&gt;
Actually, this is a small trick we use to make our job as simple as possible. HTML forms work this way: if a checkbox in a form is not checked, its name does not appear at all in the variables passed to PHP when the form is submitted. That effectively means that, when we uncheck the box and click submit, the variable is not passed to PHP at all. Thus, PHP does not know to update its value to &amp;quot;0&amp;quot;, and our &amp;quot;strict&amp;quot; setting cannot be turned off at all once we turn it on for the first time. Not the behavior we want, surely.&lt;br /&gt;
&lt;br /&gt;
However, when PHP handles received variables from a form, the variables are processed in the order in which they appear in the form. If a variable comes up having the same name with an already-processed variable, the new value overwrites the old one. Taking advantage of this, our logic runs as follows: the variable &amp;quot;block_simplehtml_strict&amp;quot; is first unconditionally set to &amp;quot;0&amp;quot;. Then, &#039;&#039;if&#039;&#039; the box is checked, it is set to &amp;quot;1&amp;quot;, overwriting the previous value as discussed. The net result is that our configuration setting behaves as it should.&lt;br /&gt;
&lt;br /&gt;
To round our bag of tricks up, notice that the use of &#039;&#039;if(!empty($CFG-&amp;gt;block_simplehtml_strict))&#039;&#039; in the test for &amp;quot;should the box be checked by default?&amp;quot; is quite deliberate. The first time this script runs, the variable &#039;&#039;&#039;$CFG-&amp;gt;block_simplehtml_strict&#039;&#039;&#039; will not exist at all. After it&#039;s set for the first time, its value can be either &amp;quot;0&amp;quot; or &amp;quot;1&amp;quot;. Given that both &amp;quot;not set&amp;quot; and the string &amp;quot;0&amp;quot; evaluate as empty while the sting &amp;quot;1&amp;quot; does not, we manage to avoid any warnings from PHP regarding the variable not being set at all, &#039;&#039;and&#039;&#039; have a nice human-readable representation for its two possible values (&amp;quot;0&amp;quot; and &amp;quot;1&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
=== config_save() ===&lt;br /&gt;
&lt;br /&gt;
Now that we have managed to cram a respectable amount of tricks into a few lines of HTML, we might as well discuss the alternative in case that tricks are not enough for a specific configuration setup we have in mind. Saving the data is done in the method [[Development:Blocks/Appendix_A#config_save.28.29| config_save()]], the default implementation of which is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
function config_save($data) {&lt;br /&gt;
  // Default behavior: save all variables as $CFG properties&lt;br /&gt;
  foreach ($data as $name =&amp;gt; $value) {&lt;br /&gt;
    set_config($name, $value);&lt;br /&gt;
  }&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
As can be clearly seen, Moodle passes this method an associative array $data which contains all the variables coming in from our configuration screen. If we wanted to do the job without the &amp;quot;hidden variable with the same name&amp;quot; trick we used above, one way to do it would be by overriding this method with the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function config_save($data) {&lt;br /&gt;
  if(isset($data[&#039;block_simplehtml_strict&#039;])) {&lt;br /&gt;
    set_config(&#039;block_simplehtml_strict&#039;, &#039;1&#039;);&lt;br /&gt;
  }else {&lt;br /&gt;
    set_config(&#039;block_simplehtml_strict&#039;, &#039;0&#039;);&lt;br /&gt;
  }&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Quite straightfoward: if the variable &amp;quot;block_simplehtml_strict&amp;quot; is passed to us, then it can only mean that the user has checked it, so set the configuration variable with the same name to &amp;quot;1&amp;quot;. Otherwise, set it to &amp;quot;0&amp;quot;. Of course, this version would need to be updated if we add more configuration options because it doesn&#039;t respond to them as the default implementation does. Still, it&#039;s useful to know how we can override the default implementation if it does not fit our needs (for example, we might not want to save the variable as part of the Moodle configuration but do something else with it).&lt;br /&gt;
&lt;br /&gt;
So, we are now at the point where we know if the block should allow HTML tags in its content or not. How do we get the block to actually respect that setting?&lt;br /&gt;
&lt;br /&gt;
We could decide to do one of two things: either have the block &amp;quot;clean&amp;quot; HTML out from the input before saving it in the instance configuration and then display it as-is (the &amp;quot;eager&amp;quot; approach); or have it save the data &amp;quot;as is&amp;quot; and then clean it up each time just before displaying it (the &amp;quot;lazy&amp;quot; approach). The eager approach involves doing work once when saving the configuration; the lazy approach means doing work each time the block is displayed and thus it promises to be worse performance-wise. We shall hence go with the eager approach.&lt;br /&gt;
&lt;br /&gt;
===String me up ===&lt;br /&gt;
&lt;br /&gt;
Now that we have a working config_global with saved values we want to be able to read the values from it. The simplest way to do this is to assign the config setting to a string and then use the string as we would any other. IE;&lt;br /&gt;
&lt;br /&gt;
$string = $CFG-&amp;gt;configsetting;&lt;br /&gt;
&lt;br /&gt;
You can check all the configuration settings available to a module by displaying them all with;&lt;br /&gt;
&lt;br /&gt;
print_object($CFG);  &lt;br /&gt;
&lt;br /&gt;
{{Top}}&lt;br /&gt;
&lt;br /&gt;
=== instance_config_save() ===&lt;br /&gt;
&lt;br /&gt;
Much as we did just before with overriding [[Development:Blocks/Appendix_A#config_save.28.29| config_save()]], what is needed here is overriding the method [[Development:Blocks/Appendix_A#instance_config_save.28.29| instance_config_save()]] which handles the instance configuration. The default implementation is as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function instance_config_save($data) {&lt;br /&gt;
  $data = stripslashes_recursive($data);&lt;br /&gt;
  $this-&amp;gt;config = $data;&lt;br /&gt;
  return set_field(&#039;block_instance&#039;, &lt;br /&gt;
                   &#039;configdata&#039;,&lt;br /&gt;
                    base64_encode(serialize($data)),&lt;br /&gt;
                   &#039;id&#039;, &lt;br /&gt;
                   $this-&amp;gt;instance-&amp;gt;id);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This may look intimidating at first (what&#039;s all this stripslashes_recursive() and base64_encode() and serialize() stuff?) but do not despair; we won&#039;t have to touch any of it. We will only add some extra validation code in the beginning and then instruct Moodle to additionally call this default implementation to do the actual storing of the data. Specifically, we will add a method to our class which goes like this:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function instance_config_save($data) {&lt;br /&gt;
  // Clean the data if we have to&lt;br /&gt;
  global $CFG;&lt;br /&gt;
  if(!empty($CFG-&amp;gt;block_simplehtml_strict)) {&lt;br /&gt;
    $data-&amp;gt;text = strip_tags($data-&amp;gt;text);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  // And now forward to the default implementation defined in the parent class&lt;br /&gt;
  return parent::instance_config_save($data);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At last! Now the administrator has absolute power of life and death over what type of content is allowed in our &amp;quot;SimpleHTML&amp;quot; block! Absolute? Well... not exactly. In fact, if we think about it for a while, it will become apparent that if at some point in time HTML is allowed and some blocks have saved their content with HTML included, and afterwards the administrator changes the setting to &amp;quot;off&amp;quot;, this will only prevent subsequent content changes from including HTML. Blocks which already had HTML in their content would continue to display it!&lt;br /&gt;
&lt;br /&gt;
Following that train of thought, the next stop is realizing that we wouldn&#039;t have this problem if we had chosen the lazy approach a while back, because in that case we would &amp;quot;sanitize&amp;quot; each block&#039;s content just before it was displayed. &lt;br /&gt;
&lt;br /&gt;
The only thing we can do with the eager approach is strip all the tags from the content of all SimpleHTML instances as soon as the admin setting is changed to &amp;quot;HTML off&amp;quot;; but even then, turning the setting back to &amp;quot;HTML on&amp;quot; won&#039;t bring back the tags we stripped away. On the other hand, the lazy approach might be slower, but it&#039;s more versatile; we can choose whether to strip or keep the HTML before displaying the content, and we won&#039;t lose it at all if the admin toggles the setting off and on again. Isn&#039;t the life of a developer simple and wonderful?&lt;br /&gt;
&lt;br /&gt;
=== Exercise === &lt;br /&gt;
We will let this part of the tutorial come to a close with the obligatory exercise for the reader: &lt;br /&gt;
In order to have the SimpleHTML block work &amp;quot;correctly&amp;quot;, find out how to strengthen the eager approach to strip out all tags from the existing configuration of all instances of our block, &#039;&#039;&#039;or&#039;&#039;&#039; go back and implement the lazy approach instead. &lt;br /&gt;
(Hint: Do that in the [[Development:Blocks/Appendix_A#get_content.28.29| get_content()]] method.)&lt;br /&gt;
&lt;br /&gt;
=== UPDATING: === &lt;br /&gt;
Prior to version 1.5, the file &#039;&#039;config_global.html&#039;&#039; was named simply &#039;&#039;config.html&#039;&#039;. Also, the methods [[Blocks_Howto#method_config_save| config_save]] and [[Blocks_Howto#method_config_print| config_print]] were named &#039;&#039;&#039;handle_config&#039;&#039;&#039; and &#039;&#039;&#039;print_config&#039;&#039;&#039; respectively. Upgrading a block to work with Moodle 1.5 involves updating these aspects; refer to [[Blocks_Howto#appendix_b| Appendix B]] for more information.&lt;br /&gt;
&lt;br /&gt;
== Eye Candy ==&lt;br /&gt;
&lt;br /&gt;
Our block is just about complete functionally, so now let&#039;s take a look at some of the tricks we can use to make its behavior customized in a few more useful ways.&lt;br /&gt;
&lt;br /&gt;
First of all, there are a couple of ways we can adjust the visual aspects of our block. For starters, it might be useful to create a block that doesn&#039;t display a header (title) at all. You can see this effect in action in the Course Description block that comes with Moodle. This behavior is achieved by, you guessed it, adding one more method to our block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function hide_header() {&lt;br /&gt;
  return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One more note here: we cannot just set an empty title inside the block&#039;s [[Development:Blocks/Appendix_A#init.28.29| init()]] method; it&#039;s necessary for each block to have a unique, non-empty title after [[Development:Blocks/Appendix_A#init.28.29| init()]] is called so that Moodle can use those titles to differentiate between all of the installed blocks.&lt;br /&gt;
&lt;br /&gt;
Another adjustment we might want to do is instruct our block to take up a certain amount of width on screen. Moodle handles this as a two-part process: first, it queries each block about its preferred width and takes the maximum number as the desired value. Then, the page that&#039;s being displayed can choose to use this value or, more probably, bring it within some specific range of values if it isn&#039;t already. That means that the width setting is a best-effort settlement; your block can &#039;&#039;request&#039;&#039; a certain width and Moodle will &#039;&#039;try&#039;&#039; to provide it, but there&#039;s no guarantee whatsoever about the end result. As a concrete example, all standard Moodle course formats will deliver any requested width between 180 and 210 pixels, inclusive.&lt;br /&gt;
&lt;br /&gt;
To instruct Moodle about our block&#039;s preferred width, we add one more method to the block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function preferred_width() {&lt;br /&gt;
  // The preferred value is in pixels&lt;br /&gt;
  return 200;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
This will make our block (and all the other blocks displayed at the same side of the page) a bit wider than standard.&lt;br /&gt;
&lt;br /&gt;
Finally, we can also affect some properties of the actual HTML that will be used to print our block. Each block is fully contained within a &amp;amp;lt;div&amp;amp;gt; or &amp;amp;lt;table&amp;amp;gt; elements, inside which all the HTML for that block is printed. We can instruct Moodle to add HTML attributes with specific values to that container. This would be done to either a) directly affect the end result (if we say, assign bgcolor=&amp;quot;black&amp;quot;), or b) give us freedom to customize the end result using CSS (this is in fact done by default as we&#039;ll see below).&lt;br /&gt;
&lt;br /&gt;
The default behavior of this feature in our case will assign to our block&#039;s container the class HTML attribute with the value &amp;quot;sideblock block_simplehtml&amp;quot; (the prefix &amp;quot;block_&amp;quot; followed by the name of our block, lowercased). We can then use that class to make CSS selectors in our theme to alter this block&#039;s visual style (for example, &amp;quot;.sideblock.block_simplehtml { border: 1px black solid}&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
To change the default behavior, we will need to define a method which returns an associative array of attribute names and values. For example, the version&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function html_attributes() {&lt;br /&gt;
  return array(&lt;br /&gt;
    &#039;class&#039;       =&amp;gt; &#039;sideblock block_&#039;. $this-&amp;gt;name(),&lt;br /&gt;
    &#039;onmouseover&#039; =&amp;gt; &amp;quot;alert(&#039;Mouseover on our block!&#039;);&amp;quot;&lt;br /&gt;
  );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
will result in a mouseover event being added to our block using JavaScript, just as if we had written the onmouseover=&amp;quot;alert(...)&amp;quot; part ourselves in HTML. Note that we actually duplicate the part which sets the class attribute (we want to keep that, and since we override the default behavior it&#039;s our responsibility to emulate it if required). &lt;br /&gt;
&lt;br /&gt;
And the final elegant touch is that we don&#039;t set the class to the hard-coded value &amp;quot;block_simplehtml&amp;quot; but instead use the [[Development:Blocks/Appendix_A#name.28.29| name()]] method to make it dynamically match our block&#039;s name.&lt;br /&gt;
&lt;br /&gt;
===and some other useful examples too:===&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function html_attributes() {&lt;br /&gt;
    // Default case: an id with the instance and a class with our name in it&lt;br /&gt;
    return array(&#039;id&#039; =&amp;gt; &#039;inst&#039;.$this-&amp;gt;instance-&amp;gt;id, &#039;class&#039; =&amp;gt; &#039;block_&#039;. $this-&amp;gt;name());&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This method should return an associative array of HTML attributes that will be given to your block&#039;s container element when Moodle constructs the output HTML. No sanitization will be performed in these elements at all.&lt;br /&gt;
&lt;br /&gt;
If you intend to override this method, you should return the default attributes as well as those you add yourself. The recommended way to do this is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function html_attributes() {&lt;br /&gt;
    $attrs = parent::html_attributes();&lt;br /&gt;
    // Add your own attributes here, e.g.&lt;br /&gt;
    // $attrs[&#039;width&#039;] = &#039;50%&#039;;&lt;br /&gt;
    return $attrs;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Authorized Personnel Only ==&lt;br /&gt;
&lt;br /&gt;
It&#039;s not difficult to imagine a block which is very useful in some circumstances but it simply cannot be made meaningful in others. An example of this would be the &amp;quot;Social Activities&amp;quot; block which is indeed useful in a course with the social format, but doesn&#039;t do anything useful in a course with the weeks format. There should be some way of allowing the use of such blocks only where they are indeed meaningful, and not letting them confuse users if they are not.&lt;br /&gt;
&lt;br /&gt;
Moodle allows us to declare which course formats each block is allowed to be displayed in, and enforces these restrictions as set by the block developers at all times. The information is given to Moodle as a standard associative array, with each key corresponding to a page format and defining a boolean value (true/false) that declares whether the block should be allowed to appear in that page format.&lt;br /&gt;
&lt;br /&gt;
Notice the deliberate use of the term &#039;&#039;page&#039;&#039; instead of &#039;&#039;course&#039;&#039; in the above paragraph. This is because in Moodle 1.5 and onwards, blocks can be displayed in any page that supports them. The best example of such pages are the course pages, but we are not restricted to them. For instance, the quiz view page (the first one we see when we click on the name of the quiz) also supports blocks.&lt;br /&gt;
&lt;br /&gt;
The format names we can use for the pages derive from the name of the script which is actually used to display that page. For example, when we are looking at a course, the script is &amp;lt;span class=&amp;quot;filename&amp;quot;&amp;gt;/course/view.php&amp;lt;/span&amp;gt; (this is evident from the browser&#039;s address line). Thus, the format name of that page is &#039;&#039;&#039;course-view&#039;&#039;&#039;. It follows easily that the format name for a quiz view page is &#039;&#039;&#039;mod-quiz-view&#039;&#039;&#039;. This rule of thumb does have a few exceptions, however:&lt;br /&gt;
&lt;br /&gt;
# The format name for the front page of Moodle is &#039;&#039;&#039;site-index&#039;&#039;&#039;.&lt;br /&gt;
# The format name for courses is actually not just &#039;&#039;&#039;course-view&#039;&#039;&#039;&amp;lt;nowiki&amp;gt;; it is &amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;course-view-weeks&#039;&#039;&#039;, &#039;&#039;&#039;course-view-topics&#039;&#039;&#039;, etc.&lt;br /&gt;
# Even though there is no such page, the format name &#039;&#039;&#039;all&#039;&#039;&#039; can be used as a catch-all option.&lt;br /&gt;
&lt;br /&gt;
We can include as many format names as we want in our definition of the applicable formats. Each format can be allowed or disallowed, and there are also three more rules that help resolve the question &amp;quot;is this block allowed into this page or not?&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
# Prefixes of a format name will match that format name; for example, &#039;&#039;&#039;mod&#039;&#039;&#039; will match all the activity modules. &#039;&#039;&#039;course-view&#039;&#039;&#039; will match any course, regardless of the course format. And finally, &#039;&#039;&#039;site&#039;&#039;&#039; will also match the front page (remember that its full format name is &#039;&#039;&#039;site-index&#039;&#039;&#039;).&lt;br /&gt;
# The more specialized a format name that matches our page is, the higher precedence it has when deciding if the block will be allowed. For example, &#039;&#039;&#039;mod&#039;&#039;&#039;, &#039;&#039;&#039;mod-quiz&#039;&#039;&#039; and &#039;&#039;&#039;mod-quiz-view&#039;&#039;&#039; all match the quiz view page. But if all three are present, &#039;&#039;&#039;mod-quiz-view&#039;&#039;&#039; will take precedence over the other two because it is a better match.&lt;br /&gt;
# The character &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; can be used in place of any word. For example, &#039;&#039;&#039;mod&#039;&#039;&#039; and &#039;&#039;&#039;mod-*&#039;&#039;&#039; are equivalent. At the time of this document&#039;s writing, there is no actual reason to utilize this &amp;quot;wildcard matching&amp;quot; feature, but it exists for future usage.&lt;br /&gt;
# The order that the format names appear does not make any difference.&lt;br /&gt;
All of the above are enough to make the situation sound complex, so let&#039;s look at some specific examples. First of all, to have our block appear &#039;&#039;&#039;only&#039;&#039;&#039; in the site front page, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
function applicable_formats() {&lt;br /&gt;
  return array(&#039;site&#039; =&amp;gt; true);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Since &#039;&#039;&#039;all&#039;&#039;&#039; is missing, the block is disallowed from appearing in &#039;&#039;any&#039;&#039; course format; but then &#039;&#039;&#039;site&#039;&#039;&#039; is set to TRUE, so it&#039;s explicitly allowed to appear in the site front page (remember that &#039;&#039;&#039;site&#039;&#039;&#039; matches &#039;&#039;&#039;site-index&#039;&#039;&#039; because it&#039;s a prefix).&lt;br /&gt;
&lt;br /&gt;
For another example, if we wanted to allow the block to appear in all course formats &#039;&#039;except&#039;&#039; social, and also to &#039;&#039;not&#039;&#039; be allowed anywhere but in courses, we would use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
function applicable_formats() {&lt;br /&gt;
  return array(&lt;br /&gt;
           &#039;course-view&#039; =&amp;gt; true, &lt;br /&gt;
    &#039;course-view-social&#039; =&amp;gt; false);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This time, we first allow the block to appear in all courses and then we explicitly disallow the social format.&lt;br /&gt;
For our final, most complicated example, suppose that a block can be displayed in the site front page, in courses (but not social courses) and also when we are viewing any activity module, &#039;&#039;except&#039;&#039; quiz. This would be:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function applicable_formats() {&lt;br /&gt;
  return array(&lt;br /&gt;
           &#039;site-index&#039; =&amp;gt; true,&lt;br /&gt;
          &#039;course-view&#039; =&amp;gt; true, &lt;br /&gt;
   &#039;course-view-social&#039; =&amp;gt; false,&lt;br /&gt;
                  &#039;mod&#039; =&amp;gt; true, &lt;br /&gt;
             &#039;mod-quiz&#039; =&amp;gt; false&lt;br /&gt;
  );&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not difficult to realize that the above accomplishes the objective if we remember that there is a &amp;quot;best match&amp;quot; policy to determine the end result.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;UPDATING:&#039;&#039;&#039; &amp;lt;br /&amp;gt;&lt;br /&gt;
Prior to version 1.5, blocks were only allowed in courses (and in Moodle 1.4, in the site front page). Also, the keywords used to describe the valid course formats at the time were slightly different and had to be changed in order to allow for a more open architecture. Refer to [[Development:Blocks/Appendix_B| Appendix B]] for more information on the changes that old blocks have to make to conform to the new standard.&lt;br /&gt;
&lt;br /&gt;
== Responding to Cron ==&lt;br /&gt;
&lt;br /&gt;
It is possible to have your block respond to the cron process. That is have a method that is run at regular intervals regardless of user interaction. There are two parts to this. Firstly you need to define a new function within your block class:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function cron() {&lt;br /&gt;
    mtrace( &amp;quot;Hey, my cron script is running&amp;quot; );&lt;br /&gt;
&lt;br /&gt;
    // do something&lt;br /&gt;
&lt;br /&gt;
    return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then within your init function you will need to set the (minimum) execution interval for your cron function. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    $this-&amp;gt;cron = 300;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Will set the minimum interval to 5 minutes. However, the function can only be called as frequently as cron has been set to run in the Moodle installation. Remember that if you change any values in the init function you &#039;&#039;&#039;must&#039;&#039;&#039; bump the version number and visit the Notifications page otherwise they will be ignored.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
The block cron is designed to call the cron script for that block &#039;&#039;&#039;type&#039;&#039;&#039; only. That is, cron does not care about individual instances of blocks. Inside your cron function although $this is defined it has almost nothing in it (only title, content type, version and cron fields are populated). If you need to execute cron for individual instances it is your own responsibility to iterate over them in the block&#039;s cron function. Example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function cron() {&lt;br /&gt;
&lt;br /&gt;
    // get the block type from the name&lt;br /&gt;
    $blocktype = get_record( &#039;block&#039;, &#039;name&#039;, &#039;my_block_name&#039; );&lt;br /&gt;
&lt;br /&gt;
    // get the instances of the block&lt;br /&gt;
    $instances = get_records( &#039;block_instance&#039;,&#039;blockid&#039;,$blocktype-&amp;gt;id );&lt;br /&gt;
&lt;br /&gt;
    // iterate over the instances&lt;br /&gt;
    foreach ($instances as $instance) {&lt;br /&gt;
&lt;br /&gt;
        // recreate block object&lt;br /&gt;
        $block = block_instance( &#039;my_block_name&#039;, $instance );&lt;br /&gt;
&lt;br /&gt;
        // $block is now the equivalent of $this in &#039;normal&#039; block&lt;br /&gt;
        // usage, e.g.&lt;br /&gt;
        $someconfigitem = $block-&amp;gt;config-&amp;gt;item2;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;my_block_name&#039; will coincide with the name of the directory the block is stored in.&lt;br /&gt;
&lt;br /&gt;
TIP: This also means that creating a block is a possible way to create code that can respond to cron with a reasonably low overhead. No actual instances of the block are required.&lt;br /&gt;
&lt;br /&gt;
== Lists and Icons ==&lt;br /&gt;
&lt;br /&gt;
In this final part of the guide we will briefly discuss an additional capability of Moodle&#039;s block system, namely the ability to very easily create blocks that display a list of choices to the user. This list is displayed with one item per line, and an optional image (icon) next to the item. An example of such a &#039;&#039;list block&#039;&#039; is the standard Moodle &amp;quot;admin&amp;quot; block, which illustrates all the points discussed in this section.&lt;br /&gt;
&lt;br /&gt;
As we have seen so far, blocks use two properties of [[Development:Blocks/Appendix_A#.24this-.3Econtent| $this-&amp;gt;content]]: &amp;quot;text&amp;quot; and &amp;quot;footer&amp;quot;. The text is displayed as-is as the block content, and the footer is displayed below the content in a smaller font size. List blocks use $this-&amp;gt;content-&amp;gt;footer in the exact same way, but they ignore $this-&amp;gt;content-&amp;gt;text.&lt;br /&gt;
&lt;br /&gt;
Instead, Moodle expects such blocks to set two other properties when the [[Development:Blocks/Appendix_A#get_content.28.29| get_content()]] method is called: $this-&amp;gt;content-&amp;gt;items and $this-&amp;gt;content-&amp;gt;icons. $this-&amp;gt;content-&amp;gt;items should be a numerically indexed array containing elements that represent the HTML for each item in the list that is going to be displayed. Usually these items will be HTML anchor tags which provide links to some page. $this-&amp;gt;content-&amp;gt;icons should also be a numerically indexed array, with exactly as many items as $this-&amp;gt;content-&amp;gt;items has. Each of these items should be a fully qualified HTML &amp;lt;img&amp;gt; tag, with &amp;quot;src&amp;quot;, &amp;quot;height&amp;quot;, &amp;quot;width&amp;quot; and &amp;quot;alt&amp;quot; attributes. Obviously, it makes sense to keep the images small and of a uniform size.&lt;br /&gt;
&lt;br /&gt;
In order to tell Moodle that we want to have a list block instead of the standard text block, we need to make a small change to our block class declaration. Instead of extending class &#039;&#039;&#039;block_base&#039;&#039;&#039;, our block will extend class &#039;&#039;&#039;block_list&#039;&#039;&#039;. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
 class block_my_menu extends block_list {&lt;br /&gt;
     // The init() method does not need to change at all&lt;br /&gt;
 }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to making this change, we must of course also modify the [[Development:Blocks/Appendix_A#get_content.28.29| get_content()]] method to construct the [[Development:Blocks/Appendix_A#.24this-.3Econtent| $this-&amp;gt;content]] variable as discussed above:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt; &lt;br /&gt;
function get_content() {&lt;br /&gt;
  if ($this-&amp;gt;content !== null) {&lt;br /&gt;
    return $this-&amp;gt;content;&lt;br /&gt;
  }&lt;br /&gt;
 &lt;br /&gt;
  $this-&amp;gt;content         = new stdClass;&lt;br /&gt;
  $this-&amp;gt;content-&amp;gt;items  = array();&lt;br /&gt;
  $this-&amp;gt;content-&amp;gt;icons  = array();&lt;br /&gt;
  $this-&amp;gt;content-&amp;gt;footer = &#039;Footer here...&#039;;&lt;br /&gt;
 &lt;br /&gt;
  $this-&amp;gt;content-&amp;gt;items[] = &#039;&amp;lt;a href=&amp;quot;some_file.php&amp;quot;&amp;gt;Menu Option 1&amp;lt;/a&amp;gt;&#039;;&lt;br /&gt;
  $this-&amp;gt;content-&amp;gt;icons[] = &#039;&amp;lt;img src=&amp;quot;images/icons/1.gif&amp;quot; class=&amp;quot;icon&amp;quot; alt=&amp;quot;&amp;quot; /&amp;gt;&#039;;&lt;br /&gt;
 &lt;br /&gt;
  // Add more list items here&lt;br /&gt;
 &lt;br /&gt;
  return $this-&amp;gt;content;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To summarize, if we want to create a list block instead of a text block, we just need to change the block class declaration and the [[Development:Blocks/Appendix_A#get_content.28.29| get_content()]] method. Adding the mandatory [[Development:Blocks/Appendix_A#init.28.29| init()]] method as discussed earlier will then give us our first list block in no time!&lt;br /&gt;
&lt;br /&gt;
{{Top}}&lt;br /&gt;
&lt;br /&gt;
== Database support ==&lt;br /&gt;
In case you need to have a database table that holds some specific information that is used with your block. you will need to create a sub folder &#039;&#039;&#039;db&#039;&#039;&#039; and have an &#039;&#039;&#039;install.xml&#039;&#039;&#039; file with the table schema setup.&lt;br /&gt;
&lt;br /&gt;
To create the install.xml file, use the [[XMLDB editor]]. See [[Database_FAQ#XMLDB|Database FAQ &amp;gt; XMLDB]] for further details.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [http://dev.moodle.org/mod/resource/view.php?id=48 Unit 7 of the Introduction to Moodle Programming course] is a follow up to this course. (But you should follow the forum discussions of that course closely as there are still some bugs and inconsistencies.)&lt;br /&gt;
* A [http://cvs.moodle.org/contrib/plugins/blocks/NEWBLOCK/ NEWBLOCK template] you can all use to start you own block.&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
; Moodle 2.0&lt;br /&gt;
* See [[Development:Migrating contrib code to 2.0]] and [[User:Frank Ralf/Experience of converting a module to Moodle 2]] for information on relevant changes for Moodle 2.0.&lt;br /&gt;
&lt;br /&gt;
== Appendices ==&lt;br /&gt;
&lt;br /&gt;
The appendices have been moved to separate pages:&lt;br /&gt;
&lt;br /&gt;
* Appendix A: [[Development:Blocks/Appendix A|&#039;&#039;block_base&#039;&#039; Reference]] &lt;br /&gt;
* Appendix B: [[Development:Blocks/Appendix B|Differences in the Blocks API for Moodle Versions prior to 1.5]]&lt;br /&gt;
* Appendix C: [[Development:Blocks/Appendix C|Creating Database Tables for Blocks (prior to 1.7)]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Blocks]]&lt;br /&gt;
[[Category:Tutorial]]&lt;br /&gt;
&lt;br /&gt;
[[es:Desarrollo de bloques]]&lt;br /&gt;
[[ja:開発:ブロック]]&lt;br /&gt;
[[ru:Development:Blocks]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Forum_activity&amp;diff=76341</id>
		<title>Forum activity</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Forum_activity&amp;diff=76341"/>
		<updated>2010-09-30T22:49:12Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Guidelines for Teaching and Learning Forums */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forums}}&lt;br /&gt;
Forums [[Teacher_documentation#Activity_modules|activities]] can contribute significantly to successful communication and community building in an online environment.  You can use forums for many innovative purposes in educational settings, but teaching forums and student forums are arguably the two more significant distinctions. &lt;br /&gt;
&lt;br /&gt;
==Guidelines for Teaching and Learning Forums==&lt;br /&gt;
&lt;br /&gt;
When you decide to use a discussion forum as an activity in an e-learning environment it is important to be aware that your time will be needed in some sense in order to make the activity successful. If your goal is to encourage discussion, the forum will only work if: &lt;br /&gt;
&lt;br /&gt;
a) &#039;&#039;&#039;participants feel there is a need/reason to participate and they will gain something from the experience.&#039;&#039;&#039; Incentives for learning, gathering support, etc. should be explored and encouraged early on in order to clearly convey the purpose of the forum to others.  Anyone considering offering grades or marks for participation is advised to think very carefully about the difference between quantity and quality of discussions in forums.&lt;br /&gt;
&lt;br /&gt;
b) a sense of community and purpose can be fostered amongst participants.  This sense of community can be fostered through tutor/teacher initiative and scaffolding, or primarily through the students/participants themselves depending on the intentions of the activity.&lt;br /&gt;
&lt;br /&gt;
==Selecting forum type==&lt;br /&gt;
&lt;br /&gt;
Moodle has four kinds of forums each with a slightly different [[Viewing a forum|layout]] and purpose.&lt;br /&gt;
&lt;br /&gt;
Which of the forums will best suit your needs for a particular activity? In order to answer this question it is useful to think how you might lead such a discussion in a face-to-face environment. Would you throw the question out to the class and sit back to observe them in their answers? Or would you break them up into smaller groups first and ask them to have discussions with a partner before bringing them back to the main group? Or perhaps you would like to keep them focused on a particular aspect of a question and ensure that they do not wander away from the topic at hand? All of the above approaches are both valid and useful, depending on your learning outcomes, and you can replicate all of them in Moodle forums.&lt;br /&gt;
&lt;br /&gt;
===A standard forum for general use===&lt;br /&gt;
The standard forum ([[Viewing_a_forum#Standard_forum_for_general_use|view here]]) probably most useful for large discussions that you intend to monitor/guide or for social forums that are student led. This does not mean that you need to make a new posting for each reply in each topic although, in order to ensure that discussion does not get &#039;out of control&#039;, you may need to be prepared to spend a significant amount of time finding the common threads amongst the various discussions and weaving them together. Providing overall remarks for particular topics can also be a key aspect of your responsibilities in the discussion. Alternatively, you could ask students to summarize discussion topics at agreed points, once a week or when a thread comes to an agreed conclusion. Such a learner-centred approach may be particularly useful once the online community has been established and, perhaps, when you have modeled the summarizing process.&lt;br /&gt;
&lt;br /&gt;
===A single simple discussion=== &lt;br /&gt;
The simple forum ([[Viewing_a_forum#A_single_simple_discussion|view here]]) is most useful for short/time-limited discussion on a single subject or topic. This kind of forum is very productive if you are interested in keeping students focused on a particular issue.  &lt;br /&gt;
&lt;br /&gt;
===Each person posts one discussion===&lt;br /&gt;
This forum ([[Viewing_a_forum#Each_person_posts_one_discussion|view here]]) is most useful when you want to achieve a happy medium between a large discussion and a short and focused discussion. A single discussion topic per person allows students a little more freedom than a single discussion forum, but not as much as a standard forum where each student can create as many topics as he or she wishes.  Successful forums of this selection can be active, yet focused, as students are not limited in the number of times they can respond to others within threads.&lt;br /&gt;
&lt;br /&gt;
===Question and Answer forum=== &lt;br /&gt;
The Q &amp;amp; A forum ([[Viewing_a_forum#Question_and_Answer_forum|view here]]) is best used when you have a particular question that you wish to have answered.  In a Q and A forum, tutors post the question and students respond with possible answers. By default a Q and A forum requires students to post once before viewing other students&#039; postings. After the initial posting, students can view and respond to others&#039; postings. This feature allows equal initial posting opportunity among all students, thus encouraging original and independent thinking.&lt;br /&gt;
&lt;br /&gt;
====Caveat:====&lt;br /&gt;
A student can post in  Q&amp;amp;A forum, then have a look at other posts, and then has the editing time (usualy 30 minutes) to edit their own post in the light of what thy read of other&#039;s posts.  In effect this waters down the intent of this setting for the forum.  The bug tracker reference is here: http://tracker.moodle.org/browse/MDL-9376&lt;br /&gt;
&lt;br /&gt;
====Tips for Question and Answer====&lt;br /&gt;
When the Question and Answer mode is selected, Moodle hides the replies to the initial thread post by the teacher but not the entire forum itself. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Post each question as a thread in the forum and then have students post replies to the question. In this fashion, Moodle will protect the replies from being viewable (subject to the caveat above) by other students but allow the initial post/thread visible for reply by all students.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Do not post the question in the forum summary because every student answer will become a thread and visible to all students.  In this scenario, it may appear as if the Question and Answer forum is not working correctly, since the new initial posts in the thread are intentionally designed not to be hidden, just their replies.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; If you have set up groups for your forum the facilitator needs to post a question to each of the groups and not to &#039;all participants&#039; as questions asked of all participants (students) are able to be read by ALL students. Questions posed to group members are only visible to those group members and replies are only visible once a group member has posted a message.&lt;br /&gt;
&lt;br /&gt;
==Concepts for use in forums==&lt;br /&gt;
===Participation and Scaffolding ===&lt;br /&gt;
&lt;br /&gt;
Whilst one of the great advantages of e-learning is the flexibility it affords participants, this does not mean that days or weeks should pass without response and discussion in a forum (unless it is appropriate for it to do so).  This is perhaps most especially true at the beginning of a course or programme when students and tutors are new to each other and in need of welcome messages/encouragement. Whilst e-learning, and discussions in particular, can support learning that is not always tutor/teacher-centred, your role will be important, especially as an online community begins to develop. It is during these initial stages of introductory material that a group of students can become a community of participants who begin to grow in their understandings of course material and individual contributions to the knowledge construction process.&lt;br /&gt;
&lt;br /&gt;
As the discussions progress and learners become accustomed to the mechanics and the tone of the forums then there are key ways in which your input can be reduced, thereby helping to foster a community that is less dependent on the tutor/teacher. Even then, however, you will probably want to be a presence in the discussions although you may choose to be one of many contributors rather than the font of all wisdom.&lt;br /&gt;
&lt;br /&gt;
===Commitment and Participation===&lt;br /&gt;
&lt;br /&gt;
Ask yourself if&lt;br /&gt;
&lt;br /&gt;
# you wish to have involvement in the forum or if you want the students to lead and own the space&lt;br /&gt;
# you want the forum to add value to the face to face environment or have a life of its own in its own right outside the lecture theatre/classroom or seminar room&lt;br /&gt;
# you are prepared to make appropriate contributions to the discussion in order to: &lt;br /&gt;
## encourage discussion if students are quiet&lt;br /&gt;
## help shape ideas if students begin to wander off-task&lt;br /&gt;
## your role will be defined as discussions/a course progresses &lt;br /&gt;
## you will explicitly but gradually relinquish control of the discussions&lt;br /&gt;
## you will encourage and support learners to share control of discussions(for example you might ask a learner/group of learners to summarise contributions to a discussion thread/topic or you might ask learners to initiate discussion topics)&lt;br /&gt;
&lt;br /&gt;
===Student Centered Forums===&lt;br /&gt;
&lt;br /&gt;
With the growing popularity of social networking software like Facebook, Bebo, MySpace and the like, students are leaving schools and coming to Higher and Further Education with a new technological sophistication and with new expectations for communication.  And as school, colleges and universities recognise that reflective and life long learning are significant goals in education, student centered learning and the creation of student centered spaces online are also gaining credence in educational settings.  We know that effective learning requires access to social and academic networks for both study material and emotional support; as such, online communities can offer a holistic knowledge construction and support mechanism and recognize that affective activity is effective.  &lt;br /&gt;
&lt;br /&gt;
Social forums, often called ‘Virtual Cafes’ or ‘Common Rooms’ can be set up for courses or for programmes, depending on the student need.  Such spaces provide a common area for students to come together and discuss unlimited topics, including social activities and educational ideas.  They are supportive spaces for students, most successful with large first and second year courses where students would not otherwise have the opportunity to communicate with others outside their own tutorial group.  It is arguable that students will experience a greater sense of community within and a sense of belonging to an educational institution or individual department having had the experience and convenience of the social forum on their course; this could arguably have implications for retention.&lt;br /&gt;
&lt;br /&gt;
These spaces are typically highly active, especially in first term.  Depending on your institution, they are usually self monitored by students, who understand that the same ‘rules’ and ‘netiquette’ that apply to them within any computing space, also apply in Moodle.&lt;br /&gt;
&lt;br /&gt;
===The News Forum===&lt;br /&gt;
&lt;br /&gt;
Moodle courses automatically generate a [[News forum]] which defaults to automatically subscribe all participants in a course.  The name of the News Forum can be changed to something more appropriate, such as ‘Important Announcements’ or the like.  This is a useful feature and many use this forum in a Moodle course to announce exam dates, times or changes to exams, lectures or seminars, as well as important information about course work throughout a term or special announcements relating to events.&lt;br /&gt;
&lt;br /&gt;
===Teacher/Tutor forums===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Prior to Moodle 1.7, each course had a teacher forum, accessible via a link in the course administration block.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A teacher/tutor-only forum may be added to a course by creating a hidden forum. Teachers are able to view hidden course activities whereas students cannot.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Some forum suggestions to consider==&lt;br /&gt;
&lt;br /&gt;
#If your course is at a distance, if your face to face time is limited, or if you just wish to foster a sense of community in your Moodle course which supplements your face to face course, it is good practice to begin with a welcome or introductory message or thread in one of your forums.  This welcome or introduction from you invites participants, for example, to post some specific details to introduce themselves to you and their peers. This can be your icebreaker or you can have an icebreaker separately.&lt;br /&gt;
#If you have two questions for participants to answer, starting the two strands or topics within the forum itself will both help learners to see where to put their responses, and remind them to answer all parts of your question.&lt;br /&gt;
#Remember that you are communicating in an environment that does not have the benefit of verbal tone, eye contact, body language and the like. Careful consideration of your communication is, therefore, necessary.&lt;br /&gt;
#Postings to a forum are always written but they can take different forms and you may wish to consider what form best suits the activity. For instance, you might choose to articulate a form of contribution in order to be explicit. Thus you might say, &#039;This is a think-aloud forum in which, together, we will try to tease out ideas and possibilities&#039; or &#039;This is a formal forum in which you are invited to share your ideas on (topic)&#039; and, where you select the latter, you might have already suggested learners plan those ideas offline or in another kind of activity within Moodle.&lt;br /&gt;
#Create a forum where only the teacher can start discussions, but the students can only reply. Each thread you start contains an essay question (or several similar ones). The students make a bullet point plan for the essay and post it as a reply.  This works well as a revision strategy as the students can see how others have approached the same task. Once everyone has posted their plan, you can start a discussion as to which plans seem better and why. Creating a scale to use for rating the posts can be useful so that the students can see how helpful other people think their effort were.&lt;br /&gt;
&lt;br /&gt;
===Grading forums===&lt;br /&gt;
The teacher can use the [[Forum ratings|ratings]] [[Scales|scales]] to [[Grades|grade]] student activities in a forum. There are several methods for calculating the grade for a forum that can be found in the [[Adding/editing_a_forum#Grade|Forum settings under grades]].  There are 5 ways in Moodle 1.9 to [[Adding/editing_a_forum#Aggregate_type|aggregate ratings]] automatically to calculate a forum grade for the [[Gradebook]]. These include: Average, Max, Min, Count and Sum.&lt;br /&gt;
&lt;br /&gt;
*In older versions of Moodle, only the average aggregate function was available.  Teachers often use the Assignment module as a work around in order to manually calculate and then manually give a grade for a specific or all forum activities. The Forum grade would appear in the gradebook as an assignment, called for example &amp;quot;Weather forum participation&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
===Best Practice and shared discussions===&lt;br /&gt;
*There are lots of discussions about Forum best use and Forum assessment in the Teaching Strategies Forum http://moodle.org/mod/forum/view.php?id=41.&lt;br /&gt;
&lt;br /&gt;
*A useful discussion about Forum assessment can be found here http://moodle.org/mod/forum/discuss.php?d=66008.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Using Moodle book]] Chapter 5: Forums, Chats, and Messaging&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/view.php?f=116 Forum module]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=5367 The philosophy underlying &amp;quot;no editing after 30 minutes&amp;quot;]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=66008 Best Practices for grading discussions]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88000 Two Courses, One Forum?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=93304 Using a forum for 1 to 1 teaching]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=95470 Technicalities of managing a Forum]&lt;br /&gt;
&lt;br /&gt;
[[Category:Modules]]&lt;br /&gt;
&lt;br /&gt;
[[de:Forum]]&lt;br /&gt;
[[es:Foros]]&lt;br /&gt;
[[eu:Foroak]]&lt;br /&gt;
[[fr:Forum]]&lt;br /&gt;
[[it:Modulo forum]]&lt;br /&gt;
[[ja:フォーラムモジュール]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=75043</id>
		<title>User:Wen Hao Chuang</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=User:Wen_Hao_Chuang&amp;diff=75043"/>
		<updated>2010-08-23T23:22:16Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I&#039;m one of the Moodle developers / most helpful Moodlers in the Moodle community. Currently I&#039;m working as an &amp;quot;Academic Technology Consultant&amp;quot; at San Francisco State University (full-time), and teaches part-time in the department of Instructional Technology (ITEC).&lt;br /&gt;
&lt;br /&gt;
Feel free to check out my personal website (very much outdated) at http://userwww.sfsu.edu/~wchuang&lt;br /&gt;
&lt;br /&gt;
For more info about me please read my profile on moodle.org&lt;br /&gt;
&lt;br /&gt;
http://moodle.org/user/view.php?id=18123&amp;amp;course=1&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74090</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74090"/>
		<updated>2010-07-21T05:07:19Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by Wen Hao Chuang. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;br /&gt;
&lt;br /&gt;
[http://awstats.sourceforge.net/ awstats]&lt;br /&gt;
AWStats is a free powerful and featureful tool that generates advanced web, streaming, ftp or mail server statistics, graphically. This log analyzer works as a CGI or from command line and shows you all possible information your log contains, in few graphical web pages. It uses a partial information file to be able to process large log files, often and quickly. It can analyze log files from all major server tools like Apache log files (NCSA combined/XLF/ELF log format or common/CLF log format), WebStar, IIS (W3C log format) and a lot of other web, proxy, wap, streaming servers, mail servers and some ftp servers.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74089</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74089"/>
		<updated>2010-07-21T05:06:20Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by Wen Hao Chuang. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/ Munin]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/ nmon]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74088</id>
		<title>System Monitoring and Server Statistic Software</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=System_Monitoring_and_Server_Statistic_Software&amp;diff=74088"/>
		<updated>2010-07-21T05:05:47Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article started off as a brain-dump by Wen Hao Chuang. Hopefully more people will contribute to this article in the near future.&lt;br /&gt;
&lt;br /&gt;
The [http://www.mrunix.net/webalizer/ Webalizer]&lt;br /&gt;
The Webalizer is a fast, free web server log file analysis program. It produces highly detailed, easily configurable usage reports in HTML format, for viewing with a standard web browser.&lt;br /&gt;
&lt;br /&gt;
[http://www.nagios.org/ Nagios]&lt;br /&gt;
Nagios is a host and service monitor designed to inform you of network problems before your clients, end-users or managers do. It has been designed to run under the Linux operating system, but works fine under most *NIX variants as well. The monitoring daemon runs intermittent checks on hosts and services you specify using external &amp;quot;plugins&amp;quot; which return status information to Nagios. When problems are encountered, the daemon can send notifications out to administrative contacts in a variety of different ways (email, instant message, SMS, etc.). Current status information, historical logs, and reports can all be accessed via a web browser.&lt;br /&gt;
&lt;br /&gt;
[http://munin-monitoring.org/]&lt;br /&gt;
Munin is a networked resource monitoring tool that can help analyze resource trends and &amp;quot;what just happened to kill our performance?&amp;quot; problems. It is designed to be very plug and play. A default installation provides a lot of graphs with almost no work.&lt;br /&gt;
&lt;br /&gt;
[http://www.ibm.com/developerworks/aix/library/au-analyze_aix/]&lt;br /&gt;
The nmon tool is designed for AIX and Linux performance specialists to use for monitoring and analyzing performance data.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Cron&amp;diff=69305</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Cron&amp;diff=69305"/>
		<updated>2010-03-05T20:13:45Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Cron is the name of a Unix program that runs predefined tasks on a computer at regular intervals. It assists some of Moodle&#039;s modules to perform tasks on a scheduled basis. For example, the cron process might tell Moodle to check all discussion forums so it can mail out copies of new posts to people who have subscribed to that forum. &lt;br /&gt;
&lt;br /&gt;
The primary Moodle script that does all this is located in the admin directory, and is called cron.php. However, it can not tell itself to run, so you need to set up a mechanism where this script is run regularly (eg every five or ten minutes). This provides a &amp;quot;heartbeat&amp;quot; so that the script can perform functions at periods defined by each module. This kind of regular mechanism is known as a &#039;&#039;&#039;cron service&#039;&#039;&#039;. The service can be part of a webhost or can be something run from a different server or computer.&lt;br /&gt;
&lt;br /&gt;
==Overview of cron==&lt;br /&gt;
===Script overview===&lt;br /&gt;
&lt;br /&gt;
The cron.php script looks through the mdl_modules table (assuming the default table prefix is mdl_) in the Moodle database for modules scheduled to have their cron functions run; it then looks in each such module directory for a function called module-name_cron in the lib.php file and runs it.  It also looks through the mdl_block table for blocks scheduled for their cron methods (object functions) to be run; it then, for each such block, runs the cron method for a new object associated with that block (I&#039;m omitting details for the benefit of non-programmers; programmers can read admin/cron.php for themselves). These files (the lib.php files and the files where the block classes are defined) can contain cleanup functions, email functions or anything that needs to be run on a regular basis. For example, cron will trigger the system to create the backups of courses at the time specified in the administration settings. It also triggers any messaging module or forum email notifications, but not all functions are called each time the cron runs. Some functions, such as unenrolling students who have not logged in or deleting old copies of log files, are only run occasionally. The cron.php file has a section which will randomly call these core tasks approximately 1 in 5 times the cron runs.&lt;br /&gt;
&lt;br /&gt;
===Invocation===&lt;br /&gt;
There are now (1.9) a number of options with respect to how one can invoke cron.php. First off, one can password the invocation of cron.php via its URL. This means whether one calls the script via a browser through an application like wget or curl, or via your own code to the web daemon, the script will not run unless the password is provided,  and this would be transmitted in clear text.&lt;br /&gt;
&lt;br /&gt;
You can also now bar invocation by URL be selecting cronclionly. This sets Moodle so that cron.php cannot be invoked by the Moodle URL. See the illustration below. (Menu: Security/Site policies)&lt;br /&gt;
&lt;br /&gt;
[[Image:Moodelcronadmin.png]]&lt;br /&gt;
&lt;br /&gt;
While this is identified as CLI (command line interface) this is a bit misleading in that it does not mean that you have to be sitting at a shell account entering the command. If you enable this switch you can invoke cron.php through any set of batch or script files you wish,  but it must be invoked via its correct location in the operating systems file structure.  This can be especially frustrating for those not used to scripting in that environment is not typically provided.&lt;br /&gt;
&lt;br /&gt;
===Cron service location and timing===&lt;br /&gt;
Note that the machine performing the cron &#039;&#039;&#039;does not need to be the same machine that is running Moodle&#039;&#039;&#039;. For example, if you have a limited web hosting service that does not have a cron service, then you might choose to run cron on another server or on your home computer. All that matters is that the cron.php file is called regularly.&lt;br /&gt;
&lt;br /&gt;
The load of this script is not very high, so 5 minutes is usually reasonable, but if you&#039;re worried about it you can reduce the time period to something like 15 minutes or even 30 minutes. It&#039;s best not to make the time period too long, as delaying mail-outs can slow down activity within the course. Remember that mail-outs also wait for the editing time to expire before being queued for sending.&lt;br /&gt;
&lt;br /&gt;
===Testing cron and manual trigger===&lt;br /&gt;
&lt;br /&gt;
First, test that the script works by running it directly from your browser: &#039;&#039;&amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If cron is called from the command line by any user logged in to your Moodle it will create a temporary admin environment in order to run and then log the user out. You can disable command line running of cron by disabling the appropriate section in the cron.php file.&lt;br /&gt;
&lt;br /&gt;
Now, you need to set up some of way of running the script automatically and regularly.&lt;br /&gt;
&lt;br /&gt;
==Managing Cron on Windows systems==&lt;br /&gt;
&lt;br /&gt;
There are two different ways for setting-up Moodle cron.php on Windows systems:&lt;br /&gt;
&lt;br /&gt;
*Use the &#039;&#039;&#039;Moodle Cron package&#039;&#039;&#039;. The simplest way is to use this little package [http://download.moodle.org/download.php/windows/MoodleCron-Setup.exe MoodleCron-Setup.exe], which makes this whole thing very easy by installing a small Windows service. Run it and forget about it! :-)&lt;br /&gt;
*Use a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. If you prefer to use the built-in Windows Scheduler or are having trouble with moodle-cron-for-windows package, you can use wget for windows or php from the command line and setup a scheduled task. Just follow these steps:&lt;br /&gt;
** Choose either the &#039;&#039;&#039;php.exe/php-win.exe (command line binary)&#039;&#039;&#039; or &#039;&#039;&#039;wget&#039;&#039;&#039;&lt;br /&gt;
::The php.exe or php-win.exe binary (for PHP version 5 or later) is installed in your php folder (e.g. c:\php) will give you better performance when running the cron script.&lt;br /&gt;
::If you want to use wget, download a compiled version of wget for windows from the native GNU Win32 ports (http://unxutils.sourceforge.net/), from Heiko Herold&#039;s wget for windows page (http://xoomer.virgilio.it/hherold/) or Bart Puype&#039;s wget for windows page (http://users.ugent.be/~bpuype/wget/). If you use Heiko Herold&#039;s package, copy all of the .DLL files to your C:\Windows\system32 directory. Copy the wget.exe file to c:\windows (this makes sure wget is always in the search path).&lt;br /&gt;
:* Setup a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. &lt;br /&gt;
:: - Go to Start &amp;gt;&amp;gt; Control Panel &amp;gt;&amp;gt; Scheduled Tasks &amp;gt;&amp;gt; Add Scheduled Task.&lt;br /&gt;
:: - Click &amp;quot;Next&amp;quot; to start the wizard:&lt;br /&gt;
:: - Click in the &amp;quot;Browse...&amp;quot; button and browse to c:\php\php.exe or c:\windows\wget.exe and click &amp;quot;Open&amp;quot;&lt;br /&gt;
:: - Type &amp;quot;Moodle Cron&amp;quot; as the name of the task and select &amp;quot;Daily&amp;quot; as the schedule. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Select &amp;quot;12:00 AM&amp;quot; as the start time, perform the task &amp;quot;Every Day&amp;quot; and choose today&#039;s date as the starting date. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Enter the username and password of the user the task will run under (it doesn&#039;t have to be a priviledged account at all). Make sure you type the password correctly. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Mark the checkbox titled &amp;quot;Open advanced properties for this task when I click Finish&amp;quot; and click &amp;quot;Finish&amp;quot;.&lt;br /&gt;
:: - In the new dialog box, type the following in the &amp;quot;Run:&amp;quot; text box: &amp;lt;pre&amp;gt;c:\windows\wget.exe -q -O NUL http://my.moodle.site/moodle/admin/cron.php&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;c:\php\php-win.exe -f c:\moodle\admin\cron.php&amp;lt;/pre&amp;gt; Replace &amp;quot;c:\moodle&amp;quot; with the path to your moodle directory or &amp;quot;my.moode.site&amp;quot; with the name of your site.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:: - Click on the &amp;quot;Schedule&amp;quot; tab and there in the &amp;quot;Advanced...&amp;quot; button.&lt;br /&gt;
:: - Mark the &amp;quot;Repeat task&amp;quot; checkbox and set &amp;quot;Every:&amp;quot; to 5 minutes, and set &amp;quot;Until:&amp;quot; to &amp;quot;Duration&amp;quot; and type &amp;quot;23&amp;quot; hours and &amp;quot;59&amp;quot; minutes.&lt;br /&gt;
:: - Click &amp;quot;OK&amp;quot; and you are done.&lt;br /&gt;
* &#039;&#039;&#039;Test your scheduled task&#039;&#039;&#039;. You can test that your scheduled task can run successfully by clicking it with the right button and chosing &amp;quot;Run&amp;quot;. If everything is correctly setup, you will briefly see a DOS command window while wget/php executes and fetches the cron page and then it disappears. If you refresh the scheduled tasks folder, you will see the &#039;&#039;Last Run Time column&#039;&#039; (in detailed folder view) reflects the current time, and that the Last Result column displays &amp;quot;0x0&amp;quot; (everything went OK). If either of these is different, then you should recheck your setup.&lt;br /&gt;
* &#039;&#039;&#039;Logging cron output&#039;&#039;&#039;. You may want to log the output of the cron script as it executes, in case you see the job is producing errors, backups are not being completed or users are experiencing delays in receiving forum emails. To do this, adjust the command so that it uses the php.exe and stores the output in a file called (for example c:\moodle\admin\cron.log). Here is an example of the php.exe command:&lt;br /&gt;
&amp;lt;pre&amp;gt;c:\php\php.exe -f c:\moodle\admin\cron.php &amp;gt; c:\moodle\admin\cron.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
If you experience problems logging the output of cron.php to a text file using the above command then read [http://moodle.org/mod/forum/discuss.php?d=139263#p609060 this] message by Iñaki Arenaza for an alternative way to log the output of Cron.&lt;br /&gt;
&lt;br /&gt;
==Managing the cron job on Mac OS X with launchd==&lt;br /&gt;
&lt;br /&gt;
It&#039;s really important to start the cron job every 5 minutes. The cron job assists most of Moodle&#039;s modules to perform tasks on a scheduled basis. For example, the discussion forums can only mail out copies of new posts to all subscribers if the cron job tells Moodle to do this.&lt;br /&gt;
&lt;br /&gt;
In Mac OS X 10.5 you will find the system daemon &#039;&#039;launchd&#039;&#039; for this service. This daemon offers a standardized interface to any user and all programs started automatically by the system. Please look at http://developer.apple.com/macosx/launchd.html for more informations about the configurations and all parameters. &lt;br /&gt;
&lt;br /&gt;
In our case the service should get the web page http://your-server-address/moodle19/admin/cron.php every 5 minutes. The configuration will be done by the file named &#039;&#039;moodle4mac.cron.plist&#039;&#039; which must be placed in the system folder &#039;&#039;/Library/LaunchDaemons/&#039;&#039; ... surely you can use any other file name but it should say something about the function of the service. The extension must be &#039;&#039;.plist&#039;&#039;. After any reboot of your Mac server the cron service will start automaticly because the file is placed in the correct system folder.&lt;br /&gt;
&lt;br /&gt;
===Use the graphical way===&lt;br /&gt;
You can use Lingon to add a new daemon plist or to edit one. It produces the same text as you can write in your text editor. http://sourceforge.net/projects/lingon/files/&lt;br /&gt;
&lt;br /&gt;
[[Image:macosx-lingon.png]]&lt;br /&gt;
&lt;br /&gt;
===Use a text editor===&lt;br /&gt;
Please use a text editor to write the needed file. You can open the Terminal and use the system editors vi or pico. But you can also write the text file with any GUI text editor ... I mostly use TextWrangler ... but do NOT take an editor for formatted texts like Microsoft Word or OpenOffice Writer. You must get pure text!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;!DOCTYPE plist PUBLIC &amp;quot;-//Apple Computer//DTD PLIST 1.0//EN&amp;quot; &lt;br /&gt;
      &amp;quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;plist version=&amp;quot;1.0&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;dict&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;KeepAlive&amp;lt;/key&amp;gt;&amp;lt;false/&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;Label&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;moodle4mac.cron&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;ProgramArguments&amp;lt;/key&amp;gt;&lt;br /&gt;
 &amp;lt;array&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;curl&amp;lt;/string&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;-s&amp;lt;/string&amp;gt;&lt;br /&gt;
      &amp;lt;string&amp;gt;http://your-server-address/moodle19/admin/cron.php&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/array&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;RunAtLoad&amp;lt;/key&amp;gt;&amp;lt;true /&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StartInterval&amp;lt;/key&amp;gt;&amp;lt;integer&amp;gt;300&amp;lt;/integer&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StandardErrorPath&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;/dev/null&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;key&amp;gt;StandardOutPath&amp;lt;/key&amp;gt;&amp;lt;string&amp;gt;/dev/null&amp;lt;/string&amp;gt;&lt;br /&gt;
 &amp;lt;/dict&amp;gt;&lt;br /&gt;
 &amp;lt;/plist&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The label string must be the same as the file name is but without the extension &#039;&#039;.plist&#039;&#039;. Save the text file &#039;&#039;/Library/LaunchDaemons/moodle4mac.cron.plist&#039;&#039;. The owner of the file must be set to the system user &#039;&#039;root&#039;&#039;. That&#039;s all, really!&lt;br /&gt;
&lt;br /&gt;
===How to start and stop the cron service===&lt;br /&gt;
You can start the new cron service in the Terminal.&lt;br /&gt;
&lt;br /&gt;
 sudo launchctl load /Library/LaunchDaemons/moodle4mac.cron.plist&lt;br /&gt;
&lt;br /&gt;
The following command would stop the service. If you want to activate changes in the cron service you need to &#039;&#039;unload&#039;&#039; and then to &#039;&#039;load&#039;&#039; the daemon again.&lt;br /&gt;
&lt;br /&gt;
 sudo launchctl unload /Library/LaunchDaemons/moodle4mac.cron.plist&lt;br /&gt;
&lt;br /&gt;
===Only one service for two servers?===&lt;br /&gt;
For my server I needed to have a cron service for to instances &#039;&#039;moodle19&#039;&#039; and &#039;&#039;moodle20&#039;&#039; ... no problem ... with the typo &#039;&#039;moodle[19-20]&#039;&#039; I will get a cron service for both.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;curl -s http://your-server-address/moodle[19-20]/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To see if the cron service works correctly you should look at the &#039;&#039;access.log&#039;&#039; of your web server. The cron.php should be accessed every 5 minutes ... on my server for both Moodle instances &#039;&#039;moodle19&#039;&#039; and &#039;&#039;moodle20&#039;&#039; ... oh yes, it works!!&lt;br /&gt;
&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:10:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 1136&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:10:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 1403&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:11:18 +0200] &amp;quot;OPTIONS * HTTP/1.0&amp;quot; 200 -&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:15:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 735&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:15:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 964&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:20:56 +0200] &amp;quot;GET /moodle19/admin/cron.php HTTP/1.1&amp;quot; 200 1136&lt;br /&gt;
 192.168.0.220 - - [30/Jul/2009:22:20:57 +0200] &amp;quot;GET /moodle20/admin/cron.php HTTP/1.1&amp;quot; 200 1365&lt;br /&gt;
&lt;br /&gt;
==Managing cron on web hosting services==&lt;br /&gt;
&lt;br /&gt;
Your web-based control panel may have a web page that allows you to set up a cron service process. &lt;br /&gt;
&lt;br /&gt;
===CPanel cron service===&lt;br /&gt;
If you are using CPanel, login then look for &amp;quot;Advanced&amp;quot; category towards the bottom of the page. Click on Cron Jobs -&amp;gt; Advanced (Unix style). Enter the following for the cron to run every 30 minutes.&lt;br /&gt;
&lt;br /&gt;
 Email address for output: emailaddress@mydomain.con&lt;br /&gt;
 Minute:*/30&lt;br /&gt;
 Hour:*&lt;br /&gt;
 Day:*&lt;br /&gt;
 Month:*&lt;br /&gt;
 Weekday:* &lt;br /&gt;
 &amp;lt;nowiki&amp;gt;Command: wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Click Commit Changes. Check your email for the output. &lt;br /&gt;
&lt;br /&gt;
[[Image:Cpanel-cron-setup.JPG]]&lt;br /&gt;
&lt;br /&gt;
===Other systems cron service===&lt;br /&gt;
For other systems, look for a button called &amp;quot;Cron jobs&amp;quot;. In there you can put the same sort of Unix commands as listed below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have permissions to run the &#039;wget&#039; command on the server, you can use this php command:&lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/php -q /real/path/to/script/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
For example: &lt;br /&gt;
&lt;br /&gt;
 /usr/local/bin/php -q /home/username/public_html/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t know what is the real path of your Moodle folder you can use the PHP command realpath.&lt;br /&gt;
&lt;br /&gt;
Another alternative, if you do not have permission to run the &#039;wget&#039; command, may be to use a curl command.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
curl --silent --compressed http://mydomain.com/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
==Using a cron command line in Unix==&lt;br /&gt;
&lt;br /&gt;
There are different command line programs you can use to call the page from the command line. Not all of them may be available on a given server.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The examples with wget, lynx, and similar are &#039;&#039;&#039;not&#039;&#039;&#039; the same as the &amp;quot;CLI only&amp;quot; cron checkbox, mentioned above (the configuration variable &amp;quot;cronclionly&amp;quot;). wget, lynx, and other similar utilities are Unix command-line HTTP clients, and thus running cron.php in this way is the same as running it in a browser, from Moodle&#039;s point of view.&lt;br /&gt;
&lt;br /&gt;
For example, you can use a Unix utility like &#039;wget&#039;:&lt;br /&gt;
&lt;br /&gt;
 wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
A number of users of Moodle have found that &#039;wget&#039; sometimes fails. Especially if you have trouble with email digests not being sent on a daily basis to all users, an alternative command that solves the problem is:&lt;br /&gt;
&lt;br /&gt;
 php &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same thing using lynx:&lt;br /&gt;
&lt;br /&gt;
 lynx -dump &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt; &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
Alternatively, you can use a standalone version of PHP, compiled to be run on the command line. The disadvantage is that you need to have access to a command-line version of php. The advantage is that your web server logs aren&#039;t filled with constant requests to cron.php and you can run at a lower I/O and CPU priority.&lt;br /&gt;
&lt;br /&gt;
 /opt/bin/php /web/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
Example command to run at lower priority:&lt;br /&gt;
&lt;br /&gt;
  ionice -c3 -p$$;nice -n 10 /usr/bin/php /moodle/admin/cron.php &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
===Using the crontab program on Unix===&lt;br /&gt;
&lt;br /&gt;
All that Cpanel does is provide a web interface to a Unix utility known as crontab. If you have a command line, you can set up crontab yourself using the command:&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and then adding one of the above commands like:&lt;br /&gt;
&lt;br /&gt;
 */30 * * * * wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first five entries are the times to run values, followed by the command to run. The asterisk is a wildcard, indicating any time. The above example means run the command &#039;&#039;wget -q -O /dev/null...&#039;&#039; every 30 minutes (*/30), every hour (*), every day of the month (*), every month (*), every day of the week (*). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;O&amp;quot; of &amp;quot;-O&amp;quot; is the capital letter not zero, and refers the output file destination, in this case &amp;quot;/dev/null&amp;quot; which is a black hole and discards the output. If you want to see the output of your cron.php then enter its url in your browser. &lt;br /&gt;
&lt;br /&gt;
* [http://linuxweblog.com/node/24 A basic crontab tutorial] &lt;br /&gt;
* [http://www.freebsd.org/cgi/man.cgi?query=crontab&amp;amp;apropos=0&amp;amp;sektion=5&amp;amp;manpath=FreeBSD+6.0-RELEASE+and+Ports&amp;amp;format=html Online version of the man page] &lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;beginners&#039;&#039;&#039;, &amp;quot;EDITOR=nano crontab -e&amp;quot; will allow you to edit the crontab using the [http://www.nano-editor.org/dist/v1.2/faq.html nano] editor. Ubuntu defaults to using the nano editor.&lt;br /&gt;
&lt;br /&gt;
Usually, the &amp;quot;crontab -e&amp;quot; command will put you into the &#039;vi&#039; editor. You enter &amp;quot;insert mode&amp;quot; by pressing &amp;quot;i&amp;quot;, then type in the line as above, then exit insert mode by pressing ESC. You save and exit by typing &amp;quot;:wq&amp;quot;, or quit without saving using &amp;quot;:q!&amp;quot; (without the quotes). Here is an [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html intro] to the &#039;vi&#039; editor.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97684 Cronjob Question]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97457 Slow cron : avoiding simultaneous cron]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=117168 Visibility of cron.php]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=139263#p609060 How to log the output of a Scheduled Task on Windows] - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[nl:Cron]]&lt;br /&gt;
[[sk:Cron]]&lt;br /&gt;
[[pl:Cron]]&lt;br /&gt;
[[ja:Cron]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Performance_recommendations&amp;diff=59480</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Performance_recommendations&amp;diff=59480"/>
		<updated>2009-07-07T18:35:12Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Hardware configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; Performance&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made as has any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: &lt;br /&gt;
*[[Server cluster]]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=4801 Scalability] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing] forum dicsussion.&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (eg 4GB). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause (using VMWare): [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules] ([http://video.yahoo.com/video/play?vid=1040890 video]) for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS ISAPI module&#039;&#039;&#039; (rather than a CGI).&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB, so a general rule of thumb is to divide your available memory in megabytes by 10 to get the value of MaxClients. To find the max memory usage of apache processes read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* A warning about the previous performance tip.  Microsoft Internet Explorer has a (little) known bug that causes seriously problems with SSL-enabled Apache websites.   The issue is that if a web server&#039;s KeepAlive timeout is set to less than 60 seconds (say to the default of 15 seconds), MSIE can get confused about whether a keep-alive connection is available or not.  As a result, any browser POST requests (which always use a keep-alive if available) will fail to reach the server.  This is easily reproduced with postings to the Moodle forums.   Using MSIE, connect to an ssl-enabled Moodle site.  Write a quick forum post, and submit it when the form has been displayed for between 15 seconds and 60 seconds.   You will see a browser error message, and your post content will be lost.  In some cases, doing this will even crash the Windows TCP stack on the client machine. &#039;&#039;&#039; So, if your site is SSL-enabled, and you use Apache, you should set the KeepAliveTimeout to at least 60 seconds&#039;&#039;&#039;.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
*&#039;&#039;&#039;Caching&#039;&#039;&#039; - Apache can be told to make pages load a lot faster by specifying that the browser should cache some various page elements such as images and reuse them from local memory rather than ask for them again every time a page is requested. How to do this varies slightly between OSes but there are two basic steps:&lt;br /&gt;
&lt;br /&gt;
# Install and enable mod_expires - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;IfModule mod_expires.c&amp;gt;&lt;br /&gt;
  ExpiresActive On&lt;br /&gt;
  ExpiresDefault &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType text/html &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType image/gif &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/jpeg &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/png &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/css &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType application/x-javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/xml &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect is to make everything stay in the cache except HTML and XML, which change dynamically. It&#039;s possible to gain a several hundred percent decrease in load times this way. Adjust the cache times according to how often your images etc change.&lt;br /&gt;
&lt;br /&gt;
More info: [http://www.metaskills.net/blog/heuristics/sysadmin/how-to-control-browser-caching-with-apache-2 www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd performance===&lt;br /&gt;
You can increase web server performance by using the &#039;&#039;&#039;light-weight webserver&#039;&#039;&#039; [http://www.lighttpd.net/ lighttpd] in combination with PHP in fastCGI-mode. Lighttpd has a lower memory consumption than Apache - typically 10M for each process. See this [[lighttpd | MoodleDocs Lighttpd page]] for configuration and administration links.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
Moodle contains a script which will display some key database performance statistics from the [http://phplens.com/lens/adodb/docs-perf.htm ADOdb performance monitor]. Run the script in your browser as in the following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/dbperformance.php&lt;br /&gt;
&lt;br /&gt;
Use the data displayed as a guide to tune and improve the performance of your database server.&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://wiki.mysqltuner.com/MySQLTuner MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 &lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 &lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
* Moodle&#039;s tables are in the MyISAM format, so &#039;&#039;&#039;turn InnoDB off&#039;&#039;&#039; as there is no performance gain. Add &amp;lt;code&amp;gt;skip-innodb&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;my.cnf&amp;lt;/code&amp;gt; file. If you must use InnoDB, you&#039;ll have to convert all of Moodle&#039;s tables. To do this run the innodb script:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/innodb.php&lt;br /&gt;
&lt;br /&gt;
:See also [http://moodle.org/mod/forum/discuss.php?d=12961 this forum discussion] which looks at the MyISAM vs InnoDB options.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL, and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [[Increasing the database connection lifetime | Try increasing the database connection lifetime]]&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Moodle Admin settings==&lt;br /&gt;
* In Moodle 1.7 or later, set the &#039;&#039;&#039;Cache type&#039;&#039;&#039; for your server: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Cache type. There are several options available. &lt;br /&gt;
:*If you do not have eaccelerator or mmemcached installed, choose &amp;quot;internal&amp;quot; (which makes use of the record/internal cache - see the next bullet point). &lt;br /&gt;
:* If you have a single server and have compiled &#039;&#039;&#039;eaccelerator with shared memory support&#039;&#039;&#039;, set the cache type to the eaccelerator option. &lt;br /&gt;
:* If you have a &#039;&#039;&#039;separate memcached server&#039;&#039;&#039;, set the cache type to memcached and enter a csv list of server IP addresses.&lt;br /&gt;
* Enable the &#039;&#039;&#039;record/internal cache&#039;&#039;&#039;: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Record cache = True. Set the maximum amount of memory allocated to the cache in the Int Cache Max box. This will enable a primary cache for database records, without using any database engine cache, e.g. MySQL/PostgreSQL cache. See [http://tracker.moodle.org/browse/MDL-7196 this Tracker entry] for a full discussion.&lt;br /&gt;
* Enable the &#039;&#039;&#039;language cache&#039;&#039;&#039;.&lt;br /&gt;
* Large log files can cause overall performance to degrade over time. If you observe that the site has gradually got slower loading pages in the browser, &#039;&#039;&#039;reduce your Log life time&#039;&#039;&#039; setting (Admin/Server/Cleanup).&lt;br /&gt;
* Performance can be greatly improved by allowing Moodle to use the system &#039;&#039;&#039;zip/unzip&#039;&#039;&#039; commands (rather than PHP-based zip libraries) - visit Admin/Server/System Paths and enter the path to the relevant executables. (Similarly, filling in the path to &#039;&#039;&#039;du&#039;&#039;&#039; will improve Moodle&#039;s speed at listing directory contents.)&lt;br /&gt;
* Note that using &#039;&#039;&#039;secure web connections&#039;&#039;&#039; (&#039;&#039;&#039;https&#039;&#039;&#039; rather than &#039;&#039;&#039;http&#039;&#039;&#039;) carries a higher processing burden, both for the webserver and the client - particularly because cacheing cannot be used as effectively, so the number of file requests is likely to increase dramatically. For this reason using https for all Moodle pages is not recommended. You can enable https just for the login screen, simply from Moodle&#039;s config page.&lt;br /&gt;
* Check your &#039;&#039;&#039;filters&#039;&#039;&#039;. Having too many filters active can have serious effects on server load, especially on lower-end systems. The number of active filters has a direct effect on the perceived latency of your site; that is the time taken for each page impression. &lt;br /&gt;
* Enable the &#039;&#039;&#039;text cache&#039;&#039;&#039; but do not &amp;quot;Filter all strings&amp;quot; unless you have a specific need. If in doubt profile the performance, and see how your changes affect the processing time.&lt;br /&gt;
* Check your &#039;&#039;&#039;anti-virus&#039;&#039;&#039; measures on the server.  Although they are useful for preventing security holes being exploited, some &amp;quot;On-Demand&amp;quot; scanners can affect performance by scanning page content (word, ppt files etc).&lt;br /&gt;
* If there are performance problems loading course pages, check the &#039;&#039;&#039;Resource module settings&#039;&#039;&#039;. The setting resource_filterexternalpages is known to slow-down course pages and should be set to &#039;No&#039; for better performance.&lt;br /&gt;
* Check your &#039;&#039;&#039;forum settings&#039;&#039;&#039;. To improve performance set forum_trackreadposts = No and forum_usermarksread = Yes (this will impact on the convenience of your users&#039; forum experience). Also consider setting the time of the day when old posts are cleared from the read table (forum_cleanreadtime) to when your site is less busy.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. Try to optimise your database server by tuning. See [http://moodle.org/mod/forum/discuss.php?d=25616&amp;amp;parent=120770 for a brief report on performance for 55 students simultaneously using quizzes]&lt;br /&gt;
** See this Case Study for an extensive server stress test with 300 quiz users.[http://moodle.org/mod/forum/discuss.php?d=68579]  And this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.png&#039; -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.gif&#039; -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.jpg&#039; -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Performance FAQ]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance forum]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[pl:Wydajność]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Performance_recommendations&amp;diff=59477</id>
		<title>Performance recommendations</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Performance_recommendations&amp;diff=59477"/>
		<updated>2009-07-07T18:17:35Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Hardware configuration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Location: &#039;&#039;Administration &amp;gt; Server &amp;gt; Performance&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Moodle can be made to perform very well, at small usage levels or scaling up to many thousands of users. The factors involved in performance are basically the same as for any PHP-based database-driven system. When trying to optimize your server, try to focus on the factor which will make the most difference to the user. For example, if you have relatively more users browsing than accessing the database, look to improve the webserver performance.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Obtain a baseline benchmark==&lt;br /&gt;
&lt;br /&gt;
Before attempting any optimization, you should obtain a baseline benchmark of the component of the system you are trying to improve. For Linux try [http://lbs.sourceforge.net/ LBS] and for Windows use the Performance Monitor. Once you have quantitative data about how your system is performing currently, you&#039;ll be able to determine if the change you have made as has any real impact.&lt;br /&gt;
&lt;br /&gt;
The overall aim of adjustments to improve performance is to use RAM (cacheing) and to reduce disk-based activity. It is especially important to try to eliminate swap file usage as much as you can. If your system starts swapping, this is a sign that you need more RAM. &lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;optimization order preference&#039;&#039;&#039; is usually: primary storage (more RAM), secondary storage (faster hard disks/improved hard disk configuration), processor (more and faster).&lt;br /&gt;
&lt;br /&gt;
==Scalability==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s design (with clear separation of application layers) allows for strongly scalable setups. (Please check the list of [[Large installations|large Moodle installations]].)&lt;br /&gt;
&lt;br /&gt;
Large sites usually separate the web server and database onto separate servers, although for smaller installations this is typically not necessary.&lt;br /&gt;
&lt;br /&gt;
It is possible to load-balance a Moodle installation, for example by using more than one webserver. The separate webservers should query the same database and refer to the same filestore area, but otherwise the separation of the application layers is complete enough to make this kind of clustering feasible. Similarly, the database could be a cluster of servers (e.g. a MySQL cluster), but this is not an easy task and you should seek expert support, e.g. from a Moodle Partner.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;See also&#039;&#039;&#039;: &lt;br /&gt;
*[[Server cluster]]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=4801 Scalability] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=57202 Moodle clustering] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=44470 Software load balancing] forum discussion.&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=49986 TCP load balancing] forum dicsussion.&lt;br /&gt;
&lt;br /&gt;
==Hardware configuration==&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: The fastest and most effective change that you can make to improve performance is to &#039;&#039;&#039;increase the amount of RAM on your web server&#039;&#039;&#039; - get as much as possible (eg 4GB). Increasing primary memory will reduce the need for processes to swap to disk and will enable your server to handle more users.&lt;br /&gt;
* Better performance is gained by obtaining the best &#039;&#039;&#039;processor capability&#039;&#039;&#039; you can, i.e. dual or dual core processors. A modern BIOS should allow you to enable hyperthreading, but check if this makes a difference to the overall performance of the processors by using a [http://en.wikipedia.org/wiki/Super_PI CPU benchmarking tool].&lt;br /&gt;
* If you can afford them, use &#039;&#039;&#039;SCSI hard disks&#039;&#039;&#039; instead of SATA drives. SATA drives will increase your system&#039;s CPU utilization, whereas SCSI drives have their own integrated processors and come into their own when you have multiple drives. If you must have SATA drives, check that your motherboard and the drives themselves support NCQ (Native Command Queuing).&lt;br /&gt;
* Purchase hard disks with a &#039;&#039;&#039;low seek time&#039;&#039;&#039;. This will improve the overall speed of your system, especially when accessing Moodle&#039;s reports.&lt;br /&gt;
* Size your &#039;&#039;&#039;swap file&#039;&#039;&#039; correctly. The general advice is to set it to 4 x physical RAM.&lt;br /&gt;
* Use a &#039;&#039;&#039;RAID disk system&#039;&#039;&#039;. Although there are many different RAID configurations you can create, the following generally works best:&lt;br /&gt;
** install a hardware RAID controller (if you can)&lt;br /&gt;
** the operating system and swap drive on one set of disks configured as RAID-1.&lt;br /&gt;
** Moodle, Web server and Database server on another set of disks configured as RAID-5.&lt;br /&gt;
* Use &#039;&#039;&#039;gigabit ethernet&#039;&#039;&#039; for improved latency and throughput. This is especially important when you have your webserver and database server separated out on different hosts.&lt;br /&gt;
* Check the settings on your &#039;&#039;&#039;network card&#039;&#039;&#039;. You may get an improvement in performance by increasing the use of buffers and transmit/receive descriptors (balance this with processor and memory overheads) and off-loading TCP checksum calculation onto the card instead of the OS.&lt;br /&gt;
*  Read this [http://moodle.org/mod/forum/discuss.php?d=68579 Case Study] on a server stress test with 300 users.  &lt;br /&gt;
* See this [http://elearning.sgu.ac.jp/doc/PT/ accompanying report] on network traffic and server loads.&lt;br /&gt;
* See the [[Moodle.org configuration]]&lt;br /&gt;
* Also see this SFSU presentation at Educause: [http://www.educause.edu/Resources/AnOpenSourceLMSforaMissionCrit/162843]&lt;br /&gt;
&lt;br /&gt;
==Operating System==&lt;br /&gt;
* You can use [http://en.wikipedia.org/wiki/Linux Linux](recommended), Unix-based, Windows or Mac OS X for the server &#039;&#039;&#039;operating system&#039;&#039;&#039;. *nix operating systems generally require less memory than Mac OS X or Windows servers for doing the same task as the server is configured with just a shell interface. Additionally Linux does not have licensing fees attached, but can have a big learning curve if you&#039;re used to another operating system. If you have a large number of processors running SMP, you may also want to consider using a highly tuned OS such as [http://en.wikipedia.org/wiki/Solaris_Operating_Environment Solaris].&lt;br /&gt;
* Check your own OS and &#039;&#039;&#039;vendor specific instructions&#039;&#039;&#039; for optimization steps.&lt;br /&gt;
** For Linux look at the [http://linuxperf.sourceforge.net/ Linux Performance Team] site. &lt;br /&gt;
** For Linux investigate the hdparm command, e.g. hdparm -m16 -d1 can be used to enable read/write on multiple sectors and DMA. Mount disks with the async and noatime options.&lt;br /&gt;
** For Windows set the sever to be optimized for network applications (Control Panel, Network Connections, LAN connection, Properties, File &amp;amp; Printer Sharing for Microsoft Networks, Properties, Optimization). You can also search the [http://technet.microsoft.com/ Microsoft TechNet site] for optimization documents.&lt;br /&gt;
&lt;br /&gt;
==Web server performance==&lt;br /&gt;
&lt;br /&gt;
Installing [http://www.mozilla.com/en-US/ Firefox] and the [https://addons.mozilla.org/en-US/firefox/addon/1843 firebug] extension will allow you to watch the time it takes for each page component to load. Also, the [https://addons.mozilla.org/en-US/firefox/addon/5369 Yslow] extension will evaluate your page against Yahoo&#039;s [http://www.skrenta.com/2007/05/14_rules_for_fast_web_pages_by_1.html 14 rules] ([http://video.yahoo.com/video/play?vid=1040890 video]) for fast loading websites.&lt;br /&gt;
&lt;br /&gt;
===PHP performance===&lt;br /&gt;
* You are strongly recommended to use a &#039;&#039;&#039;PHP accelerator&#039;&#039;&#039; to ease CPU load, such as [http://pecl.php.net/apc APC], [http://www.php-accelerator.co.uk/ PHPA], [http://trac.lighttpd.net/xcache/ Xcache] or [http://eaccelerator.net/ eAccelerator]. (Take care to choose a PHP accelerator that is known to work well with your version of PHP and note that Turck MMCache is [http://turckmmcache.exeprod.com/TheManifestoEnglish no longer maintained] and can cause failures with PHP 5). &lt;br /&gt;
* Improvements in read/write performance can be improved by putting the cached PHP pages on a [[TMPFS]] filesystem - but remember that you&#039;ll lose the cache contents when there is a power failure or the server is rebooted.&lt;br /&gt;
* Performance of PHP is better when installed as an &#039;&#039;&#039;Apache/IIS ISAPI module&#039;&#039;&#039; (rather than a CGI).&lt;br /&gt;
* Also check the &#039;&#039;&#039;memory_limit&#039;&#039;&#039; in php.ini, reduce it to 16M for Moodle version earlier than 1.7 ([http://moodle.org/mod/forum/discuss.php?d=39656 See this forum discussion]). For Moodle 1.7 or later, it is recommended that the value of memory_limit should be 40M. As of [http://www.php.net/ChangeLog-5.php PHP 5.2.1] the default value for the memory_limit directive is 128M.&lt;br /&gt;
&lt;br /&gt;
===Apache performance===&lt;br /&gt;
* If you are using Apache on a Windows server, use the build from [http://www.apachelounge.com Apache Lounge] which is reported to have [http://moodle.org/mod/forum/discuss.php?d=93358 performance and stability improvements] compared to the official Apache download. Note that this is an unofficial build, so may not keep up with official releases.&lt;br /&gt;
* Set the &#039;&#039;&#039;MaxClients&#039;&#039;&#039; directive correctly. Use this formula to help (which uses 80% of available memory to leave room for spare):&lt;br /&gt;
 MaxClients = Total available memory * 80% / Max memory usage of apache process&lt;br /&gt;
:Memory usage of apache process is usually 10MB, so a general rule of thumb is to divide your available memory in megabytes by 10 to get the value of MaxClients. To find the max memory usage of apache processes read the value from the shell command:&lt;br /&gt;
 #ps -ylC httpd --sort:rss&lt;br /&gt;
&lt;br /&gt;
:If you need to increase the value of &#039;&#039;&#039;MaxClients&#039;&#039;&#039; beyond 256, you will also need to set the &#039;&#039;&#039;ServerLimit&#039;&#039;&#039; directive. &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: Do not be tempted to set the value of MaxClients higher than your available memory as your server will consume more RAM than available and start to swap to disk. &lt;br /&gt;
* Consider reducing the &#039;&#039;&#039;number of modules&#039;&#039;&#039; that Apache loads in the httpd.conf file to the minumum necessary to reduce the memory needed. &lt;br /&gt;
* Use the &#039;&#039;&#039;latest version of Apache&#039;&#039;&#039; - Apache 2 has an improved memory model which reduces memory usage further.&lt;br /&gt;
* For Unix/Linux systems, consider lowering &#039;&#039;&#039;MaxRequestsPerChild&#039;&#039;&#039; in httpd.conf to as low as 20-30 (if you set it any lower the overhead of forking begins to outweigh the benefits). &lt;br /&gt;
* For a heavily loaded server, consider setting &#039;&#039;&#039;KeepAlive Off&#039;&#039;&#039; (do this only if your Moodle pages do not contain links to resources or uploaded images) or lowering the &#039;&#039;&#039;KeepAliveTimeout&#039;&#039;&#039; to between 2 and 5. The default is 15 (seconds) - the higher the value the more server processes will be kept waiting for possibly idle connections. A more accurate value for KeepAliveTimeout is obtained by observing how long it takes your users to download a page. After altering any of the KeepAlive variables, monitor your CPU utilization as there may be an additional overhead in initiating more worker processes/threads.&lt;br /&gt;
* A warning about the previous performance tip.  Microsoft Internet Explorer has a (little) known bug that causes seriously problems with SSL-enabled Apache websites.   The issue is that if a web server&#039;s KeepAlive timeout is set to less than 60 seconds (say to the default of 15 seconds), MSIE can get confused about whether a keep-alive connection is available or not.  As a result, any browser POST requests (which always use a keep-alive if available) will fail to reach the server.  This is easily reproduced with postings to the Moodle forums.   Using MSIE, connect to an ssl-enabled Moodle site.  Write a quick forum post, and submit it when the form has been displayed for between 15 seconds and 60 seconds.   You will see a browser error message, and your post content will be lost.  In some cases, doing this will even crash the Windows TCP stack on the client machine. &#039;&#039;&#039; So, if your site is SSL-enabled, and you use Apache, you should set the KeepAliveTimeout to at least 60 seconds&#039;&#039;&#039;.&lt;br /&gt;
* As an alternative to using KeepAlive Off, consider setting-up a &#039;&#039;&#039;Reverse Proxy server&#039;&#039;&#039; infront of the Moodle server to cache HTML files with images. You can then return Apache to using keep-alives on the Moodle server.&lt;br /&gt;
* If you do not use a .htaccess file, set the &#039;&#039;&#039;AllowOverride&#039;&#039;&#039; variable to AllowOverride None to prevent .htaccess lookups.&lt;br /&gt;
* Set &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; correctly so as to avoid content-negotiation. Here&#039;s an example from a production server:&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
* Unless you are doing development work on the server, set &#039;&#039;&#039;ExtendedStatus Off&#039;&#039;&#039; and disable mod_info as well as mod_status.&lt;br /&gt;
* Leave &#039;&#039;&#039;HostnameLookups Off&#039;&#039;&#039; (as default) to reduce DNS latency.&lt;br /&gt;
* Consider reducing the value of &#039;&#039;&#039;TimeOut&#039;&#039;&#039; to between 30 to 60 (seconds). &lt;br /&gt;
* For the &#039;&#039;&#039;Options directive&#039;&#039;&#039;, avoid Options Multiviews as this performs a directory scan. To reduce disk I/O further use&lt;br /&gt;
 Options -Indexes FollowSymLinks&lt;br /&gt;
*&#039;&#039;&#039;Caching&#039;&#039;&#039; - Apache can be told to make pages load a lot faster by specifying that the browser should cache some various page elements such as images and reuse them from local memory rather than ask for them again every time a page is requested. How to do this varies slightly between OSes but there are two basic steps:&lt;br /&gt;
&lt;br /&gt;
# Install and enable mod_expires - refer to documentation or man pages&lt;br /&gt;
# Add this code to the virtual server config file within the &amp;lt;directory&amp;gt; section for the root directory (or within the .htaccess file if AllowOverrides is On):&lt;br /&gt;
 &amp;lt;IfModule mod_expires.c&amp;gt;&lt;br /&gt;
  ExpiresActive On&lt;br /&gt;
  ExpiresDefault &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType text/html &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
  ExpiresByType image/gif &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/jpeg &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType image/png &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/css &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType application/x-javascript &amp;quot;access plus 1 week&amp;quot;&lt;br /&gt;
  ExpiresByType text/xml &amp;quot;access plus 1 seconds&amp;quot;&lt;br /&gt;
 &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The effect is to make everything stay in the cache except HTML and XML, which change dynamically. It&#039;s possible to gain a several hundred percent decrease in load times this way. Adjust the cache times according to how often your images etc change.&lt;br /&gt;
&lt;br /&gt;
More info: [http://www.metaskills.net/blog/heuristics/sysadmin/how-to-control-browser-caching-with-apache-2 www.metaskills.net]&lt;br /&gt;
&lt;br /&gt;
===IIS performance===&lt;br /&gt;
All alter this location in the registry:&lt;br /&gt;
 HKLM\SYSTEM\CurrentControlSet\Services\Inetinfo\Parameters\&lt;br /&gt;
* The equivalent to KeepAliveTimeout is &#039;&#039;&#039;ListenBackLog&#039;&#039;&#039; (IIS - registry location is HKLM\ SYSTEM\ CurrentControlSet\ Services\ Inetinfo\ Parameters). Set this to between 2 to 5.&lt;br /&gt;
*Change the &#039;&#039;&#039;MemCacheSize&#039;&#039;&#039; value to adjust the amount of memory (Mb) that IIS will use for its file cache (50% of available memory by default).&lt;br /&gt;
*Change the &#039;&#039;&#039;MaxCachedFileSize&#039;&#039;&#039; to adjust the maximum size of a file cached in the file cache in bytes. Default is 262,144 (256K).&lt;br /&gt;
*Create a new DWORD called &#039;&#039;&#039;ObjectCacheTTL&#039;&#039;&#039; to change the length of time (in milliseconds) that objects in the cache are held in memory. Default is 30,000 milliseconds (30 seconds).&lt;br /&gt;
&lt;br /&gt;
===Lighttpd performance===&lt;br /&gt;
You can increase web server performance by using the &#039;&#039;&#039;light-weight webserver&#039;&#039;&#039; [http://www.lighttpd.net/ lighttpd] in combination with PHP in fastCGI-mode. Lighttpd has a lower memory consumption than Apache - typically 10M for each process. See this [[lighttpd | MoodleDocs Lighttpd page]] for configuration and administration links.&lt;br /&gt;
&lt;br /&gt;
==Database performance==&lt;br /&gt;
&lt;br /&gt;
Moodle contains a script which will display some key database performance statistics from the [http://phplens.com/lens/adodb/docs-perf.htm ADOdb performance monitor]. Run the script in your browser as in the following example:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/dbperformance.php&lt;br /&gt;
&lt;br /&gt;
Use the data displayed as a guide to tune and improve the performance of your database server.&lt;br /&gt;
&lt;br /&gt;
===MySQL performance===&lt;br /&gt;
&lt;br /&gt;
The following are MySQL specific settings which can be adjusted for better performance in your my.cnf (my.ini in Windows). The file contains a list of settings and their values. To see the current values use these commands&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
 SHOW VARIABLES; &lt;br /&gt;
&#039;&#039;&#039;Important&#039;&#039;&#039;: You must make backups of your database before attempting to change any MySQL server configuration. After any change to the my.cnf, restart mysqld.&lt;br /&gt;
&lt;br /&gt;
If you are able, the [http://wiki.mysqltuner.com/MySQLTuner MySQLTuner] tool can be run against your MySQL server and will calculate appropriate configuration values for most of the following settings based on your current load, status and variables automatically.&lt;br /&gt;
&lt;br /&gt;
* Enable the &#039;&#039;&#039;query cache&#039;&#039;&#039; with &lt;br /&gt;
 query_cache_type = 1. &lt;br /&gt;
For most Moodle installs, set the following:&lt;br /&gt;
 query_cache_size = 36M &lt;br /&gt;
 query_cache_min_res_unit = 2K. &lt;br /&gt;
The query cache will improve performance if you are doing few updates on the database. &lt;br /&gt;
* Set the &#039;&#039;&#039;table cache&#039;&#039;&#039; correctly. For Moodle 1.6 set &lt;br /&gt;
 table_cache = 256 &lt;br /&gt;
(min), and for Moodle 1.7 set &lt;br /&gt;
 table_cache = 512 &lt;br /&gt;
(min). The table cache is used by all threads (connections), so monitor the value of opened_tables to further adjust - if opened_tables &amp;gt; 3 * table_cache then increase table_cache upto your OS limit. Note also that the figure for table_cache will also change depending on the number of modules and plugins you have installed. Find the number for your server by executing the mysql statement below. Look at the number returned and set table_cache to this value.&lt;br /&gt;
 mysql&amp;gt;SELECT COUNT(table_name) FROM information_schema.tables WHERE table_schema=&#039;yourmoodledbname&#039;;&lt;br /&gt;
* Set the &#039;&#039;&#039;thread cache&#039;&#039;&#039; correctly. Adjust the value so that your thread cache utilization is as close to 100% as possible by this formula:&lt;br /&gt;
 thread cache utilization (%) = (threads_created / connections) * 100&lt;br /&gt;
* The &#039;&#039;&#039;key buffer&#039;&#039;&#039; can improve the access speed to Moodle&#039;s SELECT queries. The correct size depends on the size of the index files (.myi) and in Moodle 1.6 or later (without any additional modules and plugins), the recommendation for this value is key_buffer_size = 32M. Ideally you want the database to be reading once from the disk for every 100 requests so monitor that the value is suitable for your install by adjusting the value of key_buffer_size so that the following formulas are true:&lt;br /&gt;
 key_read / key_read_requests &amp;lt; 0.01&lt;br /&gt;
 key_write / key_write_requests &amp;lt;= 1.0&lt;br /&gt;
* Set the &#039;&#039;&#039;maximum number of connections&#039;&#039;&#039; so that your users will not see a &amp;quot;Too many connections&amp;quot; message. Be careful that this may have an impact on the total memory used. MySQL connections usually last for milliseconds, so it is unusual even for a heavily loaded server for this value to be over 200.&lt;br /&gt;
* Manage &#039;&#039;&#039;high burst activity&#039;&#039;&#039;. If your Moodle install uses a lot of quizzes and you are experiencing performance problems (check by monitoring the value of threads_connected - it should not be rising) consider increasing the value of back_log.&lt;br /&gt;
* &#039;&#039;&#039;Optimize your tables weekly and after upgrading Moodle&#039;&#039;&#039;. It is good practice to also optimize your tables after performing a large data deletion exercise, e.g. at the end of your semester or academic year. This will ensure that index files are up to date. Backup your database first and then use:&lt;br /&gt;
 mysql&amp;gt;CHECK TABLE mdl_tablename;&lt;br /&gt;
 mysql&amp;gt;OPTIMIZE TABLE mdl_tablename;&lt;br /&gt;
:The common tables in Moodle to check are mdl_course_sections, mdl_forum_posts, mdl_log and mdl_sessions (if using dbsessions). Any errors need to be corrected using REPAIR TABLE (see the [http://dev.mysql.com/doc/refman/5.0/en/repair-table.html MySQL manual] and this [http://moodle.org/mod/forum/discuss.php?d=58208#p279638 forum script]).&lt;br /&gt;
* &#039;&#039;&#039;Maintain the key distribution&#039;&#039;&#039;. Every month or so it is a good idea to stop the mysql server and run these myisamchk commands.&lt;br /&gt;
 #myisamchk -a -S /pathtomysql/data/moodledir/*.MYI&lt;br /&gt;
:&#039;&#039;&#039;Warning&#039;&#039;&#039;: You must stop the mysql database process (mysqld) before running any myisamchk command. If you do not, you risk data loss.&lt;br /&gt;
* Reduce the number of &#039;&#039;&#039;temporary tables saved to disk&#039;&#039;&#039;. Check this with the created_tmp_disk_tables value. If this is relatively large (&amp;gt;5%) increase tmp_table_size until you see a reduction. Note that this will have an impact on RAM usage.&lt;br /&gt;
* Moodle&#039;s tables are in the MyISAM format, so &#039;&#039;&#039;turn InnoDB off&#039;&#039;&#039; as there is no performance gain. Add &amp;lt;code&amp;gt;skip-innodb&amp;lt;/code&amp;gt; to your &amp;lt;code&amp;gt;my.cnf&amp;lt;/code&amp;gt; file. If you must use InnoDB, you&#039;ll have to convert all of Moodle&#039;s tables. To do this run the innodb script:&lt;br /&gt;
&lt;br /&gt;
 http://www.mymoodle.com/admin/innodb.php&lt;br /&gt;
&lt;br /&gt;
:See also [http://moodle.org/mod/forum/discuss.php?d=12961 this forum discussion] which looks at the MyISAM vs InnoDB options.&lt;br /&gt;
&lt;br /&gt;
===PostgreSQL performance===&lt;br /&gt;
&lt;br /&gt;
There are some good papers around on tuning PostgreSQL, and Moodle&#039;s case does not seem to be different to the general case.&lt;br /&gt;
&lt;br /&gt;
The first thing to recognise is that if you really need to worry about tuning you should be using a separate machine for the database server. If you are not using a separate machine then the answers to many performance questions are substantially muddied by the memory requirements of the rest of the application.&lt;br /&gt;
&lt;br /&gt;
You should probably &#039;&#039;&#039;enable autovacuum&#039;&#039;&#039;, unless you know what you are doing. Many e-learning sites have predictable periods of low use, so disabling autovacuum and running a specific vacuum at those times can be a good option. Or perhaps leave autovacuum running but do a full vacuum weekly in a quiet period.&lt;br /&gt;
&lt;br /&gt;
Set &#039;&#039;&#039;shared_buffers&#039;&#039;&#039; to something reasonable. For versions up to 8.1 my testing has shown that peak performance is almost always obtained with buffers &amp;lt; 10000, so if you are using such a version, and have more than 512M of RAM just set shared_buffers to 10,000 (8MB).&lt;br /&gt;
&lt;br /&gt;
The buffer management had a big overhaul in 8.2 and &amp;quot;reasonable&amp;quot; is now a much larger number. I have not conducted performance tests with 8.2, but the recommendations from others are generally that you should now scale shared_buffers much more with memory and may continue to reap benefits even up to values like 100,000 (80MB). Consider using 1-2% of system RAM.&lt;br /&gt;
&lt;br /&gt;
PostgreSQL will also assume that the operating system is caching its files, so setting &#039;&#039;&#039;effective_cache_size&#039;&#039;&#039; to a reasonable value is also a good idea. A reasonable value will usually be (total RAM - RAM in use by programs). If you are running Linux and leave the system running for a day or two you can look at &#039;free&#039; and under the &#039;cached&#039; column you will see what it currently is. Consider taking that number (which is kB) and dividing it by 10 (i.e. allow 20% for other programs cache needs and then divide by 8 to get pages). If you are not using a dedicated database server you will need to decrease that value to account for usage by other programs.&lt;br /&gt;
&lt;br /&gt;
Some other useful parameters that can have positive effects, and the values I would typically set them to on a machine with 4G RAM, are:&lt;br /&gt;
&lt;br /&gt;
 work_mem = 10240&lt;br /&gt;
&lt;br /&gt;
That&#039;s 10M of RAM to use instead of on-disk sorting and so forth. That can give a big speed increase, but it is per connection and 200 connections * 10M is 2G, so it can theoretically chew up a lot of RAM.&lt;br /&gt;
&lt;br /&gt;
 maintenance_work_mem = 163840&lt;br /&gt;
&lt;br /&gt;
That&#039;s 160M of RAM which will be used by (e.g.) VACUUM, index rebuild, cluster and so forth. This should only be used periodically and should be freed when those processes exit, so I believe it is well worth while.&lt;br /&gt;
&lt;br /&gt;
 max_fsm_pages = 100000&lt;br /&gt;
 max_fsm_relations = 5000&lt;br /&gt;
&lt;br /&gt;
These are used to hold the free-space map, and if they are too small you will see performance degradation after the database has been operating for some time. The exact numbers to set can be gleaned from the output of VACUUM VERBOSE, which prints the required FSM pages at the end of it&#039;s run. The 5x increase seems to be useful for a Moodle installation, from experience.&lt;br /&gt;
&lt;br /&gt;
 wal_buffers = 64&lt;br /&gt;
&lt;br /&gt;
These buffers are used for the write-ahead log, and there have been a number of reports on the PostgreSQL mailing lists of improvement from this level of increase.&lt;br /&gt;
&lt;br /&gt;
This is a little out of date now (version 8.0) but still worth a read: http://www.powerpostgresql.com/Docs&lt;br /&gt;
&lt;br /&gt;
And there is lots of good stuff here as well: http://www.varlena.com/varlena/GeneralBits/Tidbits/index.php&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Based on Andrew McMillan&#039;s post at [http://moodle.org/mod/forum/discuss.php?d=68558 Tuning PostgreSQL] forum thread.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Other database performance links===&lt;br /&gt;
* Consider using a &#039;&#039;&#039;distributed cacheing system&#039;&#039;&#039; like [http://en.wikipedia.org/wiki/Memcached memcached] but note that memcached does not have any security features so it should be used behind a firewall.&lt;br /&gt;
* Consider using PostgreSQL. See [[Arguments in favour of PostgreSQL]] and [http://moodle.org/mod/forum/discuss.php?d=49195 how to migrate from MySQL to PostgreSQL] (forum discussion).&lt;br /&gt;
* [[Increasing the database connection lifetime | Try increasing the database connection lifetime]]&lt;br /&gt;
* [http://dev.mysql.com/doc/refman/5.0/en/server-parameters.html General advice on tuning MySQL parameters] (advice from the MySQL manual)&lt;br /&gt;
* [http://www.mysqlperformanceblog.com/2007/11/01/innodb-performance-optimization-basics/ InnoDB performance optimization] taken from the [http://www.mysqlperformanceblog.com/ MySQL performance blog] site.&lt;br /&gt;
&lt;br /&gt;
==Moodle Admin settings==&lt;br /&gt;
* In Moodle 1.7 or later, set the &#039;&#039;&#039;Cache type&#039;&#039;&#039; for your server: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Cache type. There are several options available. &lt;br /&gt;
:*If you do not have eaccelerator or mmemcached installed, choose &amp;quot;internal&amp;quot; (which makes use of the record/internal cache - see the next bullet point). &lt;br /&gt;
:* If you have a single server and have compiled &#039;&#039;&#039;eaccelerator with shared memory support&#039;&#039;&#039;, set the cache type to the eaccelerator option. &lt;br /&gt;
:* If you have a &#039;&#039;&#039;separate memcached server&#039;&#039;&#039;, set the cache type to memcached and enter a csv list of server IP addresses.&lt;br /&gt;
* Enable the &#039;&#039;&#039;record/internal cache&#039;&#039;&#039;: Site Admin -&amp;gt; Server -&amp;gt; Performance -&amp;gt; Record cache = True. Set the maximum amount of memory allocated to the cache in the Int Cache Max box. This will enable a primary cache for database records, without using any database engine cache, e.g. MySQL/PostgreSQL cache. See [http://tracker.moodle.org/browse/MDL-7196 this Tracker entry] for a full discussion.&lt;br /&gt;
* Enable the &#039;&#039;&#039;language cache&#039;&#039;&#039;.&lt;br /&gt;
* Large log files can cause overall performance to degrade over time. If you observe that the site has gradually got slower loading pages in the browser, &#039;&#039;&#039;reduce your Log life time&#039;&#039;&#039; setting (Admin/Server/Cleanup).&lt;br /&gt;
* Performance can be greatly improved by allowing Moodle to use the system &#039;&#039;&#039;zip/unzip&#039;&#039;&#039; commands (rather than PHP-based zip libraries) - visit Admin/Server/System Paths and enter the path to the relevant executables. (Similarly, filling in the path to &#039;&#039;&#039;du&#039;&#039;&#039; will improve Moodle&#039;s speed at listing directory contents.)&lt;br /&gt;
* Note that using &#039;&#039;&#039;secure web connections&#039;&#039;&#039; (&#039;&#039;&#039;https&#039;&#039;&#039; rather than &#039;&#039;&#039;http&#039;&#039;&#039;) carries a higher processing burden, both for the webserver and the client - particularly because cacheing cannot be used as effectively, so the number of file requests is likely to increase dramatically. For this reason using https for all Moodle pages is not recommended. You can enable https just for the login screen, simply from Moodle&#039;s config page.&lt;br /&gt;
* Check your &#039;&#039;&#039;filters&#039;&#039;&#039;. Having too many filters active can have serious effects on server load, especially on lower-end systems. The number of active filters has a direct effect on the perceived latency of your site; that is the time taken for each page impression. &lt;br /&gt;
* Enable the &#039;&#039;&#039;text cache&#039;&#039;&#039; but do not &amp;quot;Filter all strings&amp;quot; unless you have a specific need. If in doubt profile the performance, and see how your changes affect the processing time.&lt;br /&gt;
* Check your &#039;&#039;&#039;anti-virus&#039;&#039;&#039; measures on the server.  Although they are useful for preventing security holes being exploited, some &amp;quot;On-Demand&amp;quot; scanners can affect performance by scanning page content (word, ppt files etc).&lt;br /&gt;
* If there are performance problems loading course pages, check the &#039;&#039;&#039;Resource module settings&#039;&#039;&#039;. The setting resource_filterexternalpages is known to slow-down course pages and should be set to &#039;No&#039; for better performance.&lt;br /&gt;
* Check your &#039;&#039;&#039;forum settings&#039;&#039;&#039;. To improve performance set forum_trackreadposts = No and forum_usermarksread = Yes (this will impact on the convenience of your users&#039; forum experience). Also consider setting the time of the day when old posts are cleared from the read table (forum_cleanreadtime) to when your site is less busy.&lt;br /&gt;
&lt;br /&gt;
==Performance of different Moodle modules==&lt;br /&gt;
&lt;br /&gt;
Moodle&#039;s activity modules, filters, and other plugins can be activated/deactivated. If necessary, you may wish to deactivate some features (such as chat) if not required - but this isn&#039;t necessary. Some notes on the performance of certain modules:&lt;br /&gt;
&lt;br /&gt;
* The &#039;&#039;&#039;Chat&#039;&#039;&#039; module is [http://moodle.org/mod/forum/discuss.php?d=37979&amp;amp;parent=175079 said] to be a hog in terms of frequent HTTP requests to the main server. This can be reduced by setting the module to use &#039;&#039;Streamed&#039;&#039; updates, or, if you&#039;re using a Unix-based webserver, by running the chat in daemon mode. When using the Chat module use the configuration settings to tune for your expected load. Pay particular attention to the &#039;&#039;chat_old_ping&#039;&#039; and &#039;&#039;chat_refresh&#039;&#039; parameters as these can have greatest impact on server load.&lt;br /&gt;
* The &#039;&#039;&#039;Quiz&#039;&#039;&#039; module is known to stretch database performance. Try to optimise your database server by tuning. See [http://moodle.org/mod/forum/discuss.php?d=25616&amp;amp;parent=120770 for a brief report on performance for 55 students simultaneously using quizzes]&lt;br /&gt;
** See this Case Study for an extensive server stress test with 300 quiz users.[http://moodle.org/mod/forum/discuss.php?d=68579]  And this accompanying report on network traffic and server loads. [http://elearning.sgu.ac.jp/doc/PT/]&lt;br /&gt;
* The Moodle &#039;&#039;&#039;Cron&#039;&#039;&#039; task is triggered by calling the script &#039;&#039;cron.php&#039;&#039;. If this is called over HTTP (e.g. using wget or curl) it can take a large amount of memory on large installations. If it is called by directly invoking the php command (e.g. &#039;&#039;php -f /path/to/moodle/directory/admin/cron.php&#039;&#039;) efficiency can be much improved.&lt;br /&gt;
* The &#039;&#039;&#039;Recent activities&#039;&#039;&#039; block is consuming to much resources if you have huge number of records &amp;lt;code&amp;gt;mdl_log&amp;lt;/code&amp;gt;. this is being tested to optimize the SQL query.&lt;br /&gt;
&lt;br /&gt;
==Moodle Image Optimization==&lt;br /&gt;
&lt;br /&gt;
The base images delivered in the original Moodle distribution package provide unoptimized graphics, most of which can benefit from lossless recompression utilizing [http://optipng.sourceforge.net/ optipng] for PNGs, [http://www.lcdf.org/gifsicle/ gifsicle] for GIFs and [http://www.kokkonen.net/tjko/projects.html jpegoptim] for JPGs.  Optimized graphics transfer faster and provide a faster perceived response for clients[http://www.websiteoptimization.com/speed/12/], especially distance learners.  The following example will recursively optimize (without any loss of quality) all the graphics and image files included in a base Moodle installation directory on a server with the above commands installed and available.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.png&#039; -exec optipng -o7 {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.gif&#039; -exec gifsicle -O2 -b {} \;&lt;br /&gt;
find /example/directory/moodle-1.9 -iname &#039;*.jpg&#039; -exec jpegoptim -p {} \;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Both [http://optipng.sourceforge.net/ optipng] and [http://www.lcdf.org/gifsicle/ gifsicle] are provided in the base repositories of most newer Linux distributions; [http://www.kokkonen.net/tjko/projects.html jpegoptim] must be downloaded and installed manually.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Performance FAQ]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/view.php?f=94 Hardware and Performance forum]&lt;br /&gt;
&lt;br /&gt;
There have been a lot of discussions on moodle.org about performance, here are some of the more interesting and (potentially) useful ones:&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=83057 Performance woes!]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=57028 Performance perspectives - a little script]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88927 Comments on planned server hardware]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=102978#p461624 Moodle performance in a pil by Martin Langhoff]&lt;br /&gt;
[[Category:Performance]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Performance]]&lt;br /&gt;
[[ja:パフォーマンス]]&lt;br /&gt;
[[pl:Wydajność]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=sessions&amp;diff=53210</id>
		<title>sessions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=sessions&amp;diff=53210"/>
		<updated>2009-03-24T21:11:52Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Overview of HTTP Sessions&lt;br /&gt;
&lt;br /&gt;
Session tracking enables you to track a user&#039;s progress over multiple servlets or HTML pages, which, by nature, are stateless. A session is defined as a series of related browser requests that come from the same client during a certain time period. Session tracking ties together a series of browser requests—think of these requests as pages—that may have some meaning as a whole, such as a shopping cart application.&lt;br /&gt;
&lt;br /&gt;
By default, moodle does NOT use database to store session information. However, after moodle 1.8, moodle introduced an option (a site setting actually) to store sessions information in the database. If enabled, this setting will use the database to store information about current sessions. This is especially useful for large/busy sites or sites built on cluster of servers. For most sites this should probably be left disabled so that the server disk is used instead. Note that changing this setting now will log out all current users (including you). If you are using MySQL please make sure that &#039;max_allowed_packet&#039; in my.cnf (or my.ini) is at least 4M.&lt;br /&gt;
&lt;br /&gt;
However, this option currently is still somehow buggy and is NOT recommended. Please see MDL-16641 or ask Petr for more details.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Capabilities/moodle/grade:manageoutcomes&amp;diff=48236</id>
		<title>Capabilities/moodle/grade:manageoutcomes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Capabilities/moodle/grade:manageoutcomes&amp;diff=48236"/>
		<updated>2008-12-17T00:33:55Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.9}}* This allows a user to manage [[Outcomes]]. For example, when you login as a teacher you should be able to see a link called &amp;quot;Outcome&amp;quot; in the Course Administration block and be able to &amp;quot;manage &amp;quot;Outcome&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Category:Capabilities|Grade]]&lt;br /&gt;
[[Category:Grades]]&lt;br /&gt;
&lt;br /&gt;
[[eu:Capabilities/moodle/grade:manageoutcomes]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Capabilities/&amp;diff=46015</id>
		<title>Capabilities/</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Capabilities/&amp;diff=46015"/>
		<updated>2008-10-31T16:24:20Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* Capabilities you don&#039;t want students to have should be Not set, not Prevent.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Capabilities/&amp;diff=46014</id>
		<title>Capabilities/</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Capabilities/&amp;diff=46014"/>
		<updated>2008-10-31T16:21:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang: New page: Capabilities you don&amp;#039;t want students to have should be Not set, not Prevent.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Capabilities you don&#039;t want students to have should be Not set, not Prevent.&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Forum_settings&amp;diff=44784</id>
		<title>Forum settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Forum_settings&amp;diff=44784"/>
		<updated>2008-10-03T23:17:20Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Can a student post to this forum? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forums}}&lt;br /&gt;
There are 4 sections in a forum&#039;s settings: &amp;quot;General&amp;quot;, &amp;quot;Grade&amp;quot;, &amp;quot;Post threshold for blocking&amp;quot;, and &amp;quot;Common module settings&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
[[Image:Adding a forum.png|thumb|center|Adding a forum, showing General and Grade sections]]To add a forum:&lt;br /&gt;
#As an editing teacher for a course, click &amp;quot;Turn Editing On&amp;quot;, and go to the topic or week section in which you want to create the forum.&lt;br /&gt;
#From the dropdown menu labeled &amp;quot;Add an activity&amp;quot;, select &amp;quot;Forum&amp;quot;.  This will take you to the forum settings page titled &amp;quot;Adding a new forum&amp;quot; page.  &lt;br /&gt;
&lt;br /&gt;
In an existing forum, use the &amp;quot;Update this forum&amp;quot; button to see the forum settings page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==General==&lt;br /&gt;
&lt;br /&gt;
===Forum name===&lt;br /&gt;
&lt;br /&gt;
A short name of the forum (e.g. &amp;quot;Favourite colour&amp;quot;), which will be displayed on the course homepage.&lt;br /&gt;
&lt;br /&gt;
===Forum type===&lt;br /&gt;
&lt;br /&gt;
There are four forum types to choose from:&lt;br /&gt;
*A single simple discussion - A single topic discussion developed on one page, which is useful for short focussed discussions&lt;br /&gt;
*Standard forum for general use - An open forum where anyone can start a new topic at any time; this is the best general-purpose forum&lt;br /&gt;
*Each person posts one discussion - Each person can post exactly one new discussion topic (everyone can reply to them though); this is useful when you want each student to start a discussion about, say, their reflections on the week&#039;s topic, and everyone else responds to these&lt;br /&gt;
*Q and A Forum - Instead of initiating discussions Teachers (only) pose a question in the initial post of a discussion. Students may reply with an answer, but they will not see the replies of other Students to the question in that discussion until they have themselves replied to the same discussion.&lt;br /&gt;
&lt;br /&gt;
A [[News forum]] is a special type of forum that is automatically created with a new course. &lt;br /&gt;
&lt;br /&gt;
===Forum introduction===&lt;br /&gt;
&lt;br /&gt;
Place the description of the forum here.  It has the standard Moodle [[HTML editor]] toolbar to assist the teacher.&lt;br /&gt;
&lt;br /&gt;
*Tip:  It is a good practice to include precise instructions for students regarding the subject of the forum and the rating and grading criteria that might be used in this forum (see below).&lt;br /&gt;
&lt;br /&gt;
===Force everyone to be subscribed?===&lt;br /&gt;
&lt;br /&gt;
When a person is subscribed to a forum it means that they will be sent email copies of every post in that forum.  This will over ride some [[Edit profile|student settings in their profile]]. By default, posts are recorded about 30 minutes after the post was first written.  Depending upon the email settings of each forum member, they maybe sent an email immediately after the 30 minute edit window is closed, or in a batch at a time fixed by the site administrator.&lt;br /&gt;
&lt;br /&gt;
People can usually choose whether or not they want to be subscribed to each forum. However, the teacher can choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If the teacher selects the option &amp;quot;Yes, initially&amp;quot; then all current and future course users will be subscribed initially but they can unsubscribe themselves at any time. If the teacher chooses &amp;quot;Yes, forever&amp;quot; then the forum members will not be able to unsubscribe themselves. &lt;br /&gt;
====Subscription Tips====&lt;br /&gt;
* Forcing everyone to subscribe is especially useful in the [[News forum]] and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).&lt;br /&gt;
* Changing the setting from &amp;quot;Yes, initially&amp;quot; to &amp;quot;No&amp;quot; will not unsubscribe existing users, it will only affect those who enrol in the course in the future. Similarly changing &amp;quot;Yes, initially&amp;quot; will not subscribe existing course users but only those enrolling later.&lt;br /&gt;
* From Moodle 1.6 onwards there is an &amp;quot;Subscriptions not allowed&amp;quot; setting which prevents Students from subscribing to a Forum. Teachers may choose to subscribe to a forum if they wish.&lt;br /&gt;
&lt;br /&gt;
===Read tracking for this forum?===&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Read tracking&amp;quot; for a forum allows users to track read and unread messages in the forum. &lt;br /&gt;
&lt;br /&gt;
There are three options for this setting:&lt;br /&gt;
* Optional (default) - students can turn tracking on or off for the forum at their discretion &lt;br /&gt;
* On - tracking is always on in this forum for all members&lt;br /&gt;
* Off - tracking is always off in this forum for all members&lt;br /&gt;
&lt;br /&gt;
===Maximum attachment size===&lt;br /&gt;
The maximum file size that may be attached to a forum post will first be determined by the Moodle site settings.  The teacher may want a smaller size limit for the forum.  Server file capacity, student downloading speeds and discouraging images in a document centered discussion are a few reasons to limit file size.&lt;br /&gt;
&lt;br /&gt;
==Grade==&lt;br /&gt;
Forum posts can be rated using a [[Scales|scale]] (pre existing number or word scales). By default, only teachers can rate forum posts.  The [[Override permissions|role override]] feature can allow students to rate each others’ posts (see [[Forum permissions]]). This is a useful tool for giving students participation grades. Any ratings given in the forum are recorded in the [[Gradebook|gradebook]].&lt;br /&gt;
&lt;br /&gt;
===Aggregate type===&lt;br /&gt;
{{Moodle 1.9}}In Moodle 1.9 onwards, you can set an aggregate type, in other words, decide how all the ratings given to posts in a forum are combined to form the final grade (for each post and for the whole forum activity).  Some scales do not lend themselves to certain types of aggregates.&lt;br /&gt;
&lt;br /&gt;
There are five options:&lt;br /&gt;
====Average of ratings==== &lt;br /&gt;
Average of ratings (default) is the mean of all the ratings given to posts in that forum. This is especially useful with peer grading when there are a lot of ratings being made.&lt;br /&gt;
&lt;br /&gt;
====Count of ratings==== &lt;br /&gt;
The counts the number of rated posts which becomes the final grade. This is useful when the number of posts is important. Note that the total can not exceed the maximum grade allowed for the forum. A count may be used if the teacher simply wants to acknowledge that a reply was given in the case students being required to make a certain number of posts in the discussion. Note: Count of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
====Maximum rating====&lt;br /&gt;
The highest rating is returned as the final grade. This method is useful for emphasising the best work from participants, allowing them to post one high-quality post as well as a number of more casual responses to others.&lt;br /&gt;
&lt;br /&gt;
====Minimum rating==== &lt;br /&gt;
The smallest rating is returned as the final grade. This method promotes a culture of high quality for all posts.&lt;br /&gt;
&lt;br /&gt;
====Sum of ratings====&lt;br /&gt;
All the ratings for a particular user are added together. Note that the total is not allowed to exceed the maximum grade for the forum. Note: Sum of ratings does not work for the &amp;quot;Separate or Connected Ways of Knowing&amp;quot; scale or custom scales due to the limitation imposed by the max grade.&lt;br /&gt;
&lt;br /&gt;
===Grades===&lt;br /&gt;
This is a pulldown menu which sets the [[Scales|scale]] used in [[Grades|grading]] a forum post.  See &amp;quot;Aggregate type&amp;quot; above for options on how multiple, rated posts of a student are entered as a single grade in the gradebook.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Restrict ratings to posts with dates in this range===&lt;br /&gt;
The teacher can allow only posts within a certain date range to be rated. This is useful if the teacher wants to keep students focused on the most recent content and maintain a specific pace within the forum or course.&lt;br /&gt;
&lt;br /&gt;
==Post threshold for blocking==&lt;br /&gt;
&lt;br /&gt;
===Post threshold for warning===&lt;br /&gt;
&lt;br /&gt;
Students (only) will be blocked from posting after a specified number of posts in a given period - this option is for setting the number of posts a Student may make before receiving a warning. Set to 0 to disable warnings.&lt;br /&gt;
&lt;br /&gt;
===Post threshold for blocking===&lt;br /&gt;
&lt;br /&gt;
This option is for setting the number of posts a Student may make in the period defined below. Set to 0 to disable blocking. If blocking is disabled, warnings will automatically be disabled.&lt;br /&gt;
&lt;br /&gt;
===Time period for blocking===&lt;br /&gt;
&lt;br /&gt;
Earlier  version of Moodle had an this option.  See  &amp;quot;Restrict ratings to posts with dates in this range&amp;quot; above.&lt;br /&gt;
&lt;br /&gt;
==Common module settings==&lt;br /&gt;
&lt;br /&gt;
===Group mode===&lt;br /&gt;
&lt;br /&gt;
The [[Groups|group]] mode setting has three options:&lt;br /&gt;
&lt;br /&gt;
# No groups&lt;br /&gt;
# Separate groups - each group can only see their own group, others are invisible&lt;br /&gt;
# Visible groups - each group works in their own group, but can also see other groups&lt;br /&gt;
&lt;br /&gt;
If the group mode is set to separate or visible groups:&lt;br /&gt;
[[Image:Forum set to separate groups.png|thumb|Adding a new discussion topic to a forum set to separate groups]]&lt;br /&gt;
* Teachers are given the option of adding a new discussion topic for all participants or for a selected group. If a teacher adds a new discussion topic for a selected group, then only group members can reply to it.&lt;br /&gt;
* Students can only start discussions for their own group.&lt;br /&gt;
* Students can only reply to discussions started by other group members or teachers.&lt;br /&gt;
&lt;br /&gt;
Teachers, and other users with the capability [[Capabilities/moodle/site:accessallgroups|moodle/site:accessallgroups]] set to allow, can view and post in all forum discussions, regardless of the group mode setting.&lt;br /&gt;
&lt;br /&gt;
Note: Single simple discussions cannot be set to separate groups (as this feature is not implemented). Instead, a standard forum should be used, with the teacher copying and pasting the same discussion topic for each separate group. If required, a permissions override may be set to prevent students from starting new discussions.&lt;br /&gt;
&lt;br /&gt;
===Visible to students===&lt;br /&gt;
&lt;br /&gt;
You can hide the activity from students by selecting &amp;quot;Hide&amp;quot; here. It is useful if you wouldn&#039;t like to make the activity available immediately.&lt;br /&gt;
&lt;br /&gt;
==Pre-Moodle 1.7 settings==&lt;br /&gt;
&lt;br /&gt;
Note: From Moodle 1.7 onwards, forum permissions may be accessed via the Roles tab on the update/edit forum page and the override roles link.&lt;br /&gt;
&lt;br /&gt;
===Can a student post to this forum?===&lt;br /&gt;
&lt;br /&gt;
This option allows you to restrict students from posting new content in this forum. There are three options to choose from:&lt;br /&gt;
&lt;br /&gt;
#&#039;&#039;&#039;Discussions and replies are allowed&#039;&#039;&#039; - This option leaves students unrestricted, which is the case for most forums. Thus, you choose to allow them to start new discussion topics (threads), and also to post replies within those threads.&lt;br /&gt;
#&#039;&#039;&#039;No discussions, but replies are allowed&#039;&#039;&#039; - This option should be chosen if only teachers are to be allowed to start new discussions. Students will still be allowed to reply within those threads (for example within the news forum on the site home page). &lt;br /&gt;
#&#039;&#039;&#039;No discussions, no replies&#039;&#039;&#039; - Choosing this option bars students from starting new discussion topics and replying within those threads. This is useful for the News forum when you only want teachers to post new items that appear on the course main page.&lt;br /&gt;
&lt;br /&gt;
===Use ratings===&lt;br /&gt;
 &lt;br /&gt;
If you decide to rate posts on the forum, you will have to define settings of the three following aspects: &lt;br /&gt;
&lt;br /&gt;
*Users - If you want everybody to rate posts, choose &#039;Everyone can rate posts&#039;. Otherwise, pick &#039;Only teachers can rate posts&#039;. &lt;br /&gt;
*View - If you want to keep the grades known only to the individual students graded, you should choose the option &#039;Students can only see their own ratings&#039;. If there is no such a need, opt for &#039;Students can see everyone&#039;s ratings&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Forum permissions]]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=65162 No discussions, no replies?] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=86487 Forum Ratings - Some Students Cannot Be Rated] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[fr:Ajouter/modifier un forum]]&lt;br /&gt;
[[ja:フォーラムの追加/編集]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=NTLM_authentication&amp;diff=40962</id>
		<title>NTLM authentication</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=NTLM_authentication&amp;diff=40962"/>
		<updated>2008-07-30T22:06:48Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.9}}This document describes how to set up &#039;&#039;&#039;NTLM/Integrated Authentication&#039;&#039;&#039; in Moodle. &lt;br /&gt;
&lt;br /&gt;
This is integrated into Moodle 1.9 onwards.&lt;br /&gt;
&lt;br /&gt;
For earlier versions, it uses a modified version of LDAP Authentication.&lt;br /&gt;
The NTLM Authentication module is available in the Modules and Plugins database here:&lt;br /&gt;
http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=314&lt;br /&gt;
&lt;br /&gt;
Note: When a particular note is specific to earlier versions of the NTLM plugin, this is noted by the &#039;&#039;&#039;(pre-1.9 only)&#039;&#039;&#039; string.&lt;br /&gt;
&lt;br /&gt;
==Assumptions==&lt;br /&gt;
&lt;br /&gt;
#You are running MS Active Directory for Authentication.&lt;br /&gt;
#The Server hosting your website is a member of the Active Directory Domain that your users are also members of.&lt;br /&gt;
#You are able to define people inside your Network (and authenticated to the Domain) from an IP range of computers.&lt;br /&gt;
#&#039;&#039;&#039;(pre-1.9 only)&#039;&#039;&#039; You have &amp;quot;some&amp;quot; basic knowledge of php and are able to configure the index.php with the range of internal IP addresses.&lt;br /&gt;
#You are familar with or have read the LDAP authentication documentation.&lt;br /&gt;
#The Active Directory domain credentials of your users are returned as &#039;&#039;&#039;DOMAINNAME\username&#039;&#039;&#039; from your authentication service. If you are using the Winbind service from the Samba project, this can be untrue, depending on your Winbind configuration settings.&lt;br /&gt;
&lt;br /&gt;
If you can not modify your settings to satisfy this last assumption, then you will need to remove or comment out the line that reads:&lt;br /&gt;
    $username = substr(strrchr($username, &#039;\\&#039;), 1); //strip domain info&lt;br /&gt;
and add the relevant lines of code to extract the username part from the domain user credentials and store it in $username.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
::&#039;&#039;&#039;VERY IMPORTANT&#039;&#039;&#039;: In Moodle 1.9 and onwards, NTLM authentication depends on LDAP authentication. So before trying to configure NTLM, make sure you have [[LDAP_authentication|LDAP authentication]] properly setup and working.&lt;br /&gt;
&lt;br /&gt;
==Installation on 1.9==&lt;br /&gt;
&lt;br /&gt;
No installation needed. See the Auth/LDAP settings for the NTLM config options. You only have to&lt;br /&gt;
&lt;br /&gt;
*Set the IP/Subnet mask&lt;br /&gt;
*On IIS: turn on Integrated Authentication&lt;br /&gt;
*On Apache - use one of the 3 methods outlined below&lt;br /&gt;
&lt;br /&gt;
If you have used previous versions of NTLM in your Moodle database you will need to make two further changes. &lt;br /&gt;
&lt;br /&gt;
#The type of authentication held against each user now needs to be ldap, and ntlm will not be recognised and Moodle will fall through and try to use CAS. To edit the fields open up a sql query for your Moodle server and use the following query &amp;quot;update mdl_user set auth = &#039;ldap&#039; where auth = &#039;ntlm&#039; &amp;quot;&lt;br /&gt;
#If you had a previous .htaccess file in the auth/ntlm directory, you will need to move it to the auth/ldap directory. Regardless of whether it is in a .htaccess file of the httpd.conf, the &amp;lt;Files&amp;gt; line now needs to refer to ntlmsso_magic.php. If it is in the httpd.conf, the &amp;lt;Directory&amp;gt; will need to change too. This is covered later on for new installs, but is one of the fundamental changes that needs to be made for those upgrading.&lt;br /&gt;
&lt;br /&gt;
==Installation on 1.6/1.7==&lt;br /&gt;
#Copy the folder AUTH/NTLM into the AUTH folder of your moodle installation.&lt;br /&gt;
#Configure the IP/Subnet Mask in the Config screen.&lt;br /&gt;
[https://docs.moodle.org/en/NTLM_authentication#Configuring IP/Subnet Mask see below for more help]&lt;br /&gt;
If the IP/Subnet Mask does not give enough complexity for your network, Modify the auth/ntlm/index.php file - for instructions on doing this, view the comments in the file.&lt;br /&gt;
#Turn Integrated Authentication ON and Anonymous Authentication OFF for the moodle\auth\ntlm\oncampuslogin.php file. [https://docs.moodle.org/en/NTLM_authentication#How_to_Turn_Integrated_Authentication_on see below for more detailed instructions]&lt;br /&gt;
#Visit the admin page of your moodle installation - you should see notification that the NTLM_AUTH module has been installed.&lt;br /&gt;
#go to the configuration &amp;gt; variables page, find the dbsessions setting (in 1.8 on admin page server \ sessions page), and set it to &amp;quot;YES&amp;quot; then save the page.&lt;br /&gt;
#go to the Authentication admin page and select auth_ntlmtitle as your authentication method Note: - this doesn&#039;t display full text as I haven&#039;t created a language file for this module - you will also see auth_ntlmdescription instead of a proper description - you don&#039;t need to worry about this, as you will be the only one who ever sees this.&lt;br /&gt;
#Configure this page with your normal LDAP settings. NOTE: the Alternate Login URL at the bottom of this page (or on the main authentication page in 1.8 - and needs to be set manually to the oncampus url)has been set to the NTLM page. - if you wish uninstall this auth module, you must reset this variable on the new authentication type page. eg - if you wish to revert back to manual authentication, then change to manual, and then make sure you delete the alternate login url at the bottom of the page.&lt;br /&gt;
#(OPTIONAL) modify the offcampuslogin page to give errors when students try to prefix their usercode with your domain.&lt;br /&gt;
around line 216 find this code, uncomment all the lines and replace the letters &#039;DOM&#039; with your domain:&lt;br /&gt;
&lt;br /&gt;
    if (empty($errormsg)) {&lt;br /&gt;
        if (strstr(strtolower($frm-&amp;gt;username), &amp;quot;DOM\\&amp;quot;) &amp;lt;&amp;gt; false) { //NAD - DOM messages.&lt;br /&gt;
            $errormsg = get_string(&amp;quot;invalidlogin&amp;quot;) . &amp;quot; DOM\\ is not required!&amp;quot;;&lt;br /&gt;
        } else if (strpos($frm-&amp;gt;username, &amp;quot;@&amp;quot;) &amp;lt;&amp;gt; false) {&lt;br /&gt;
            $errormsg = get_string(&amp;quot;invalidlogin&amp;quot;) . &amp;quot; enter your username - not your e-mail address.&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            $errormsg = get_string(&amp;quot;invalidlogin&amp;quot;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
==Installation on 1.5==&lt;br /&gt;
&lt;br /&gt;
See the README in the auth/ntml package.&lt;br /&gt;
&lt;br /&gt;
==How to Turn Integrated Authentication on==&lt;br /&gt;
The File ntlmsso_magic.php (1.9 or above) or oncampuslogin.php (1.8 or below) MUST have NTLM/Integrated Authentication enabled at the server or the page will not work.&lt;br /&gt;
===IIS Configuration===&lt;br /&gt;
Open up IIS, and find the auth/ldap/ntlmsso_magic.php (1.9 or above) or auth/ntlm/oncampuslogin.php (1.8 or below) file, &lt;br /&gt;
#right click on the file, choose properties&lt;br /&gt;
#under the &amp;quot;file security&amp;quot; tab, click on the Authentication and Access control &amp;quot;edit&amp;quot; button&lt;br /&gt;
#untick &amp;quot;Enable Anonymous Access&amp;quot; and tick &amp;quot;Integrated Windows Authentication&amp;quot;&lt;br /&gt;
===APACHE Configuration===&lt;br /&gt;
There are currently 3 possible methods for this:&lt;br /&gt;
&lt;br /&gt;
====Using the NTLM part of Samba (Linux)====&lt;br /&gt;
&lt;br /&gt;
* Get the plugin here: http://samba.org/ftp/unpacked/lorikeet/mod_auth_ntlm_winbind/ and follow the instructions inside the README file. You&#039;ll need to install the Apache development packages in addition to the core C develpment packages.&lt;br /&gt;
* Once you have compiled it, put it inside Apache&#039;s modules subdirectory (this location depends on a number of factors, like compiling Apache yourself, using different Linux distributions packages, an so on), and load and enable the module in Apache&#039;s configuration. For example, if your Apache modules are under &amp;lt;code&amp;gt;/usr/lib/apache2/modules&amp;lt;/code&amp;gt;, you&#039;ll need something like this in your Apache configuration file (usually called &amp;lt;code&amp;gt;apache2.conf&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;http2.conf&amp;lt;/code&amp;gt;):&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;IfModule !mod_auth_ntlm_winbind.c&amp;gt;&lt;br /&gt;
       LoadModule auth_ntlm_winbind_module /usr/lib/apache2/modules/mod_auth_ntlm_winbind.so&lt;br /&gt;
   &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Install the Samba &amp;lt;code&amp;gt;winbind&amp;lt;/code&amp;gt; daemon package. This packages relies on Samba&#039;s configuration file to get some important settings (like the Windows domain name, uid and gid range mappings, and so on). In addition to that, you&#039;ll need to make your Linux/Unix machine part of the domain. Otherwise winbind won&#039;t be able to pull user and groups informationi from the domain controllers. You should read the Samba documentation to perform this step, but the most important part is having something like the following lines in your &amp;lt;code&amp;gt;smb.conf&amp;lt;/code&amp;gt; file (in addition to what you already have there):&lt;br /&gt;
&lt;br /&gt;
  workgroup = DOMAINNAME&lt;br /&gt;
  password server = *&lt;br /&gt;
  security = domain&lt;br /&gt;
  encrypt passwords = true&lt;br /&gt;
  idmap uid = 10000-20000&lt;br /&gt;
  idmap gid = 10000-20000&lt;br /&gt;
&lt;br /&gt;
: and executing the command (as root):&lt;br /&gt;
&lt;br /&gt;
  # net join DOMAINNAME -U Administrator&lt;br /&gt;
&lt;br /&gt;
: where &#039;&#039;&#039;DOMAINNAME&#039;&#039;&#039; is the NetBIOS windows domain name, and &#039;&#039;&#039;Administrator&#039;&#039;&#039; an account with enough privileges to add new machines to the domain.&amp;lt;br/&amp;gt; You&#039;ll need to type this account&#039;s password for the command to succeed.&lt;br /&gt;
&lt;br /&gt;
: Also, make sure you have disabled &amp;quot;Microsoft Network Server: digitally sign communications (always)&amp;quot; in your Domain Controllers Security Policy, unless you are using a version of Samba that can sign SMB packets.&lt;br /&gt;
&lt;br /&gt;
* Restart the &amp;lt;code&amp;gt;winbind&amp;lt;/code&amp;gt; service to apply the changes and test that it&#039;s running ok by executing:&lt;br /&gt;
&lt;br /&gt;
  $ wbinfo -u&lt;br /&gt;
&lt;br /&gt;
: You should get the full list of Windows domain users. If you use &#039;&#039;&#039;&amp;lt;code&amp;gt;-g&amp;lt;/code&amp;gt;&#039;&#039;&#039; instead, you&#039;ll get the domain groups list.&lt;br /&gt;
&lt;br /&gt;
* Check that your &amp;lt;code&amp;gt;winbind&amp;lt;/code&amp;gt; package installed the authentication helper command &amp;lt;code&amp;gt;ntlm_auth&amp;lt;/code&amp;gt;, as we&#039;ll need it later. We&#039;ll assume the helper is located at &amp;lt;code&amp;gt;/usr/bin/ntlm_auth&amp;lt;/code&amp;gt;. If yours is at a different location, make sure you adjust the path in the example below.&lt;br /&gt;
&lt;br /&gt;
* Add something like this to your Apache configuration file (usually called &amp;lt;code&amp;gt;apache2.conf&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;http2.conf&amp;lt;/code&amp;gt;). We&#039;ll assume that your Moodle &amp;lt;code&amp;gt;$CFG-&amp;gt;dirroot&amp;lt;/code&amp;gt; directory is located at &amp;lt;code&amp;gt;/var/www/moodle&amp;lt;/code&amp;gt; in the example:&lt;br /&gt;
: &#039;&#039;&#039;For 1.9 or above use&#039;&#039;&#039;:&lt;br /&gt;
    &amp;lt;Directory &amp;quot;/var/www/moodle/auth/ldap/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
            NTLMAuth on&lt;br /&gt;
            AuthType NTLM&lt;br /&gt;
            AuthName &amp;quot;Moodle NTLM Authentication&amp;quot;&lt;br /&gt;
            NTLMAuthHelper &amp;quot;/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp&amp;quot;&lt;br /&gt;
            NTLMBasicAuthoritative on&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
: &#039;&#039;&#039;For 1.8 or below use&#039;&#039;&#039;:&lt;br /&gt;
    &amp;lt;Directory &amp;quot;/var/www/moodle/auth/ntlm/&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files oncampuslogin.php&amp;gt;&lt;br /&gt;
            NTLMAuth on&lt;br /&gt;
            AuthType NTLM&lt;br /&gt;
            AuthName &amp;quot;Moodle NTLM Authentication&amp;quot;&lt;br /&gt;
            NTLMAuthHelper &amp;quot;/usr/bin/ntlm_auth --helper-protocol=squid-2.5-ntlmssp&amp;quot;&lt;br /&gt;
            NTLMBasicAuthoritative on&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
* Check the permissions of the Winbind pipe directory (Ubuntu places it under &amp;lt;code&amp;gt;/var/run/samba/winbindd_privileged&amp;lt;/code&amp;gt;, yours may be placed at a different location). Apache will need to be able to enter that directory, so we need to make sure it has the right permissions. So have a look at the permissions of that directory and note the name of the group assigned to it. The following example is from a Ubuntu 7.10 machine:&lt;br /&gt;
&lt;br /&gt;
  $ ls -ald /var/run/samba/winbindd_privileged&lt;br /&gt;
  drwxr-x--- 2 root winbindd_priv 60 2007-11-17 16:18 /var/run/samba/winbindd_privileged/&lt;br /&gt;
&lt;br /&gt;
:so we see the group is &amp;lt;code&amp;gt;winbindd_priv&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Instead of modifying the directory permissions (which could break other services that use winbind) we are goint to make the Apache user (&amp;lt;code&amp;gt;www-data&amp;lt;/code&amp;gt; in our example, but could be &amp;lt;code&amp;gt;httpd&amp;lt;/code&amp;gt;, or &amp;lt;code&amp;gt;nobody&amp;lt;/code&amp;gt;, etc.) is part of the appropiate group. Execute the following as root:&lt;br /&gt;
&lt;br /&gt;
  # adduser www-data winbindd_priv&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt; is available in Debian and Ubuntu at least. If your distribution doesn&#039;t have &amp;lt;code&amp;gt;adduser&amp;lt;/code&amp;gt;, you can edit &amp;lt;code&amp;gt;/etc/group&amp;lt;/code&amp;gt; manually to achive the same effect.&lt;br /&gt;
&lt;br /&gt;
* Restart the Apache service to apply the changes. Have a look at Apache&#039;s error log to see that everything is ok.&lt;br /&gt;
&lt;br /&gt;
* Couple of gotchas - in Fedora Core, keep alive is turned OFF by default in the httpd.conf - see this bug for further info: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=188138&amp;lt;br /&amp;gt;&lt;br /&gt;
* Email Dan if you get this working - I&#039;m keen to hear how people go using the samba winbind option!&lt;br /&gt;
::-- Hi Dan! I made it work using Ubuntu 7.04. That&#039;s what I&#039;ve used to update the documentation. [[User:Iñaki Arenaza|Iñaki Arenaza]] 10:43, 30 September 2007 (CDT)&lt;br /&gt;
&lt;br /&gt;
====Using the NTLM Auth Module for Apache====&lt;br /&gt;
#get the Module from: http://modntlm.sourceforge.net/&lt;br /&gt;
#use something like this in your httpd.conf: http://moodle.org/mod/forum/discuss.php?d=45887#211074&lt;br /&gt;
&lt;br /&gt;
====Using the mod_auth_sspi Module for Apache 2 on Windows====&lt;br /&gt;
NOTE: This setup is currently being used in a live production environment, and is therefore suitable for such use provided it is correctly configured and tested.&lt;br /&gt;
&lt;br /&gt;
This is the recommended method for Apache 2 on Windows, however it will &#039;&#039;&#039;not&#039;&#039;&#039; work on Linux/UNIX systems.&lt;br /&gt;
It provides better stability and higher performance than other NTLM modules.&lt;br /&gt;
&lt;br /&gt;
* Download the mod_auth_sspi Module from: http://sourceforge.net/projects/mod-auth-sspi/. At the moment of writing this (2007.09.30), the current version is mod_auth_sspi 1.0.4, which has two different ZIP files to download:&lt;br /&gt;
&lt;br /&gt;
::* mod_auth_sspi-1.0.4-2.0.58.zip :   Use this file if you are using Apache 2.0.x.&lt;br /&gt;
::* mod_auth_sspi-1.0.4-2.2.2.zip :   Use this file if you are using Apache 2.2.x.&lt;br /&gt;
&lt;br /&gt;
* Unzip the right file and copy mod_auth_sspi.so (it&#039;s inside &#039;&#039;&#039;bin&#039;&#039;&#039; subdirectory) to your Apache modules directory.&lt;br /&gt;
* Edit your Apache 2 configuration file (httpd.conf) to load the module.&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;IfModule !mod_auth_sspi.c&amp;gt;&lt;br /&gt;
        LoadModule sspi_auth_module modules/mod_auth_sspi.so&lt;br /&gt;
    &amp;lt;/IfModule&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Choose one of the two methods below&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Method 1&#039;&#039;&#039;: This method is recommended for servers that will host a single Moodle instance. Configure NTLM from the main configuration file, add the following to httpd.conf (substitute &amp;quot;C:\moodle&amp;quot; with the path to your Moodle installation e.g. &amp;quot;C:\my-moodle&amp;quot;&lt;br /&gt;
&lt;br /&gt;
:: &#039;&#039;&#039;For 1.9 or above use&#039;&#039;&#039;:&lt;br /&gt;
    &amp;lt;Directory &amp;quot;C:\moodle\auth\ldap&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
            AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
            AuthType SSPI&lt;br /&gt;
            SSPIAuth On&lt;br /&gt;
            SSPIOfferBasic Off&lt;br /&gt;
            SSPIAuthoritative On&lt;br /&gt;
            SSPIDomain mycollege.ac.uk&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
:: &#039;&#039;&#039;For 1.8 or below use&#039;&#039;&#039;:&lt;br /&gt;
    &amp;lt;Directory &amp;quot;C:\moodle\auth\ntlm&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;Files oncampuslogin.php&amp;gt;&lt;br /&gt;
            AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
            AuthType SSPI&lt;br /&gt;
            SSPIAuth On&lt;br /&gt;
            SSPIOfferBasic Off&lt;br /&gt;
            SSPIAuthoritative On&lt;br /&gt;
            SSPIDomain mycollege.ac.uk&lt;br /&gt;
            require valid-user&lt;br /&gt;
        &amp;lt;/Files&amp;gt;&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: &#039;&#039;&#039;Method 2&#039;&#039;&#039;: The alternative method is to use a .htaccess file&lt;br /&gt;
:This method is recommended for servers that will host multiple Moodle instances. It allows additional Moodle instances to be configured without restarting apache, and also makes the solution a little more portable. We need to add a directive to the main httpd.conf to allow configuration of authentication within .htaccess files.&lt;br /&gt;
    &amp;lt;Directory C:\moodle&amp;gt;&lt;br /&gt;
        AllowOverride AuthConfig&lt;br /&gt;
    &amp;lt;/Directory&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: &#039;&#039;&#039;For 1.9 or above&#039;&#039;&#039;:&lt;br /&gt;
:::Create a new text file named &#039;.htaccess&#039; in the directory &#039;C:\moodle\moodle\auth\ldap&#039; and add the following directives:&lt;br /&gt;
    &amp;lt;Files ntlmsso_magic.php&amp;gt;&lt;br /&gt;
        AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
        AuthType SSPI&lt;br /&gt;
        SSPIAuth On&lt;br /&gt;
        SSPIOfferBasic Off&lt;br /&gt;
        SSPIAuthoritative On&lt;br /&gt;
        SSPIDomain mycollege.ac.uk&lt;br /&gt;
        require valid-user&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:: &#039;&#039;&#039;For 1.8 or below&#039;&#039;&#039;:&lt;br /&gt;
:::Create a new text file named &#039;.htaccess&#039; in the directory &#039;C:\moodle\moodle\auth\ntlm&#039; and add the following directives:&lt;br /&gt;
    &amp;lt;Files oncampuslogin.php&amp;gt;&lt;br /&gt;
        AuthName &amp;quot;Moodle at My College&amp;quot;&lt;br /&gt;
        AuthType SSPI&lt;br /&gt;
        SSPIAuth On&lt;br /&gt;
        SSPIOfferBasic Off&lt;br /&gt;
        SSPIAuthoritative On&lt;br /&gt;
        SSPIDomain mycollege.ac.uk&lt;br /&gt;
        require valid-user&lt;br /&gt;
    &amp;lt;/Files&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:This enables the Moodle folder to be moved to any apache webserver that is configured to allow authentication configuration through .htaccess&lt;br /&gt;
&lt;br /&gt;
For further help and discussion: http://moodle.org/mod/forum/discuss.php?d=56565&lt;br /&gt;
&lt;br /&gt;
==Configuring IP/Subnet Mask==&lt;br /&gt;
Subnet masks are based on binary patterns so need a bit of knowledge to understand. The best way to find out what IP/Subnet masks to use is to ask your Network Admin. &lt;br /&gt;
* &#039;&#039;&#039;(pre-1.9 only)&#039;&#039;&#039; Once you have configured your IP/Subnet masks, you can use the check_ip.php page to test if you have set these ranges up correctly.&lt;br /&gt;
* The new way of specifiying subnets is even easier/more flexible than before 1.9. Just type them one after the other, separated by commas. You can use several syntaxes:&lt;br /&gt;
** Type the network-number/prefix-length combination. E.g. 192.168.1.0/24&lt;br /&gt;
** Type the network &#039;prefix&#039;, ending in a period character. E.g. 192.168.1.&lt;br /&gt;
** Type the network address range (&#039;&#039;&#039;this only works for the last address octect&#039;&#039;&#039;). E.g. 192.168.1.1-254&lt;br /&gt;
:All the three examples refer to the same subnetwork. So assuming you need to specify the following subnetworks:&lt;br /&gt;
::* 10.1.0/255.255.0.0&lt;br /&gt;
::* 10.2.0.0/255.255.0.0&lt;br /&gt;
::* 172.16.0.0/255.255.0.0&lt;br /&gt;
::* 192.168.100.0/255.255.255.240&lt;br /&gt;
:You can type:&lt;br /&gt;
 10.1.0.0/16, 10.2.0.0/16, 172.16.0.0/16, 192.168.100.0/28&lt;br /&gt;
: or:&lt;br /&gt;
  10.1.0.0/16, 10.2.0.0/16, 172.16.0.0/16, 192.168.100.240-255&lt;br /&gt;
:or even:&lt;br /&gt;
  10.1., 10.2., 172.16., 192.168.100.0/28&lt;br /&gt;
:(the last one cannot be expressed as a network &#039;prefix&#039; as the netmask does not fall on an octect boundary).&lt;br /&gt;
&lt;br /&gt;
==Notes/Tips==&lt;br /&gt;
# &#039;&#039;&#039;(pre-1.9 only)&#039;&#039;&#039; When using IIS, dbsessions is required to be set to &amp;quot;YES&amp;quot; because when Integrated authentication is turned on for the oncampuslogin.php page, and dbsessions is set to &amp;quot;NO&amp;quot; then the server impersonates the user to write the session in the moodledata\sessions folder. The recommended fix is to set dbsessions to &amp;quot;YES&amp;quot; so that sessions are stored in the db. The non-recommended alternative method is to allow domain users write access to the sessions directory.&lt;br /&gt;
# &#039;&#039;&#039;(pre-1.9 only)&#039;&#039;&#039; If you forget to change the internal IP addresses in index.php to your own, you can just use the offcampuslogin url to login using your admin account. eg: http://yoursite.com/moodle/auth/ntlm/offcampuslogin.php&lt;br /&gt;
#If you are using Firefox, you will need to follow these steps:&lt;br /&gt;
:*Load Firefox and type about:config in the address box. The configuration settings page should be displayed.&lt;br /&gt;
:*In the Filter box, type the word &amp;quot;ntlm&amp;quot; to filter the NTLM strings. You should see three settings displayed.&lt;br /&gt;
:*Double-click on &amp;quot;network.automatic-ntlm-auth.trusted-uris&amp;quot;.&lt;br /&gt;
:*In the box, enter the full URL of your Moodle server. For example &amp;lt;pre&amp;gt;http://moodle.mydomain.com, (the comma is important)&amp;lt;/pre&amp;gt;&lt;br /&gt;
:*Close Firefox and restart.&lt;br /&gt;
&lt;br /&gt;
==Specific File information (pre-1.9 only)== &lt;br /&gt;
(mainly for developers)&lt;br /&gt;
#auth\ntlm\index.php&amp;lt;br /&amp;gt;This is the page used for the Alternate Login URL setting on the config page for the NTLM plugin.&amp;lt;br&amp;gt;The index.php file handles which login page to use based on the IP address of the user.&amp;lt;br&amp;gt;if inside your network, they should be directed to the oncampuslogin.php screen.&amp;lt;br&amp;gt;if outside your network, they should be directed to the offcampuslogin.php screen.&amp;lt;br&amp;gt;you will need to modify the if statements in this file to match the IP ranges inside your network.&lt;br /&gt;
#auth\ntlm\index_form.html&amp;lt;br /&amp;gt;this is a copy of the file login\index_form.php.&amp;lt;br /&amp;gt; The only change in this file from the standard one is that the form action=&amp;quot;index.php&amp;quot; is changed to form action=&amp;quot;offcampuslogin.php&amp;quot; this is because anyone who is displayed the form will be an offcampus user.&lt;br /&gt;
#auth\ntlm\offcampuslogin.php&amp;lt;br /&amp;gt;this is a copy of the file moodle\login\index.php with a couple of minor modifications.&amp;lt;br /&amp;gt;the modifications to this file involve the setting of a variable ($onoroffcampus = &amp;quot;offcampus&amp;quot;;) this is used by the auth plugin to define which page is being used for authentication. the other modification is for displaying extra error messages to the user. - with all the authentication methods we have students are constantly confused about how to enter their credentials if you use NTLM authentication elsewhere at your site you will be aware of the users having to enter the domain\username when authenticating. - this code block sits around line 215 in the file.&lt;br /&gt;
#auth\ntlm\oncampuslogin.php&amp;lt;br /&amp;gt;this is a copy of the file login\index.php&amp;lt;br /&amp;gt;This file has been modified to get the details of the authenticated user via NTLM.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=42 Using Moodle: User authentication] forum&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=45887 NTLM Authentication] forum discussion&lt;br /&gt;
*[http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=314 Download the NTLM Authentication Module]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=80104 Merging AD NTLM SSO into auth/ldap] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;br /&gt;
[[Category:Authentication]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Authentification NTLM]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40886</id>
		<title>RedHat Linux installation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40886"/>
		<updated>2008-07-29T18:58:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Try your new installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note : These instructions apply to RedHat version 8. They have also been found to work for RedHat 9.0 and for Fedora Core 1 and 2. &#039;&#039;&#039;Fedora Core 3 requires the php-gd package in addition to php.&#039;&#039;&#039; I see no reason why they should not work for later versions. In addition, later distributions of Fedora (after 7) contain a moodle yum package. Installation is as easy as &#039;&#039;&#039;yum install moodle&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Redhat installation considerations: There are many installation options available when installing Redhat. I assume that you are installing on a server and will have selected a Server type install. There is however no reason why this should not work on a desktop or Workstation installation.&lt;br /&gt;
&lt;br /&gt;
== Make sure you have installed the following packages ==&lt;br /&gt;
(You will need to select the option to customize the default set of packages on installation OR bring up the package manager by putting disk 1 back in the drive for an existing system):&lt;br /&gt;
&lt;br /&gt;
* X Windows System (not vital but easier)&lt;br /&gt;
* Gnome or KDE desktop environment (as above)&lt;br /&gt;
* Server Configuration Tools&lt;br /&gt;
* Web Server&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and make sure all PHP modules are ticked (except ODBC and PGSQL, they&#039;re not neccesary)&lt;br /&gt;
** make sure not to miss the MYSQL-PHP module (not installed by default)&lt;br /&gt;
* SQL Database&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and tick MySQL server box&lt;br /&gt;
* Also make sure you set up the firewall. You probably only need to enable HTTP (and perhaps FTP and SSH) access to your server machine, unless you know different.&lt;br /&gt;
&lt;br /&gt;
== Configure hostname and domain name==&lt;br /&gt;
&lt;br /&gt;
Type system-config-network to open the GUI editor.  Click on the DNS tab. In the &amp;quot;DNS Search Path&amp;quot; fill in your domain name for example myuniversity.edu. Now ensure the &amp;quot;Hostname&amp;quot; contains the computer name you will use and click activate to make changes&lt;br /&gt;
&lt;br /&gt;
== Download Moodle==&lt;br /&gt;
(I will install under /usr/moodle, data in /usr/moodle_data)&lt;br /&gt;
&lt;br /&gt;
* Download your favourite version of Moodle from moodle.org (.zip archive is easiest)&lt;br /&gt;
* as Root create folder under /usr and copy zip&lt;br /&gt;
** su&lt;br /&gt;
** mkdir /usr/moodle&lt;br /&gt;
** mkdir /usr/moodle_data&lt;br /&gt;
** cp moodle_111.zip /usr/moodle&lt;br /&gt;
* If you prefer you can install the CVS version directly for all the latest features. Instead of downloading and copying the zip file..&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** cvs -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle login&lt;br /&gt;
** cvs -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co moodle&lt;br /&gt;
&lt;br /&gt;
== Unpack and set file permission etc ==&lt;br /&gt;
&lt;br /&gt;
* Still as root we unpack moodle and rename to something appropiate (I have multiple moodle installs, hence this setup). I will call this install mymoodle.&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** unzip moodle_xxx.zip&lt;br /&gt;
** mv moodle mymoodle&lt;br /&gt;
*** (optional step - I have more than one install under /usr/moodle)&lt;br /&gt;
** mkdir /usr/moodle_data/mymoodle&lt;br /&gt;
*** (same name as the moodle install above)&lt;br /&gt;
** chown -R apache:apache /usr/moodle&lt;br /&gt;
*** (! Giving Apache full rights to your Moodle programs is not secure. Check out the forums for recomendations on how to secure a production environment.)&lt;br /&gt;
** chown -R apache:apache /usr/moodle_data&lt;br /&gt;
&lt;br /&gt;
== Setup config.php ==&lt;br /&gt;
&lt;br /&gt;
* Still as root copy and edit the config file, you should know the host/domain name for your server&lt;br /&gt;
** cd /usr/moodle/mymoodle&lt;br /&gt;
** cp config-dist.php config.php&lt;br /&gt;
** vi config.php (or whatever your favourite editor is!)&lt;br /&gt;
* Your config.php settings should be something like...&lt;br /&gt;
** dbtype = &amp;quot;mysql&amp;quot;&lt;br /&gt;
** dbhost = &amp;quot;localhost&amp;quot;&lt;br /&gt;
** dbname = &amp;quot;mymoodle&amp;quot;&lt;br /&gt;
** dbuser = &amp;quot;moodleuser&amp;quot;&lt;br /&gt;
** dbpass = &amp;quot;moodlepass&amp;quot; (&amp;lt;-- better make this something of your own)&lt;br /&gt;
** prefix = &amp;quot;&amp;quot;&lt;br /&gt;
*** (keep the default &#039;mdl_&#039; prefix if you plan on sharing the database with other applications)&lt;br /&gt;
** wwwroot = &amp;quot;http://myhost.mydomain/mymoodle&amp;quot;&lt;br /&gt;
*** (If you only want to try moodle out and will not be accessing it from other machines you can use &amp;quot;http://localhost/mymoodle&amp;quot;)&lt;br /&gt;
** dirroot = &#039;/usr/moodle/mymoodle&#039;&lt;br /&gt;
** dataroot = &#039;/usr/moodle_data/mymoodle&#039;&lt;br /&gt;
* Save your changes and exit from the editor&lt;br /&gt;
&lt;br /&gt;
== Setup MySQL ==&lt;br /&gt;
&lt;br /&gt;
* First you need to get the MySQL daemon running, it is not running by default.&lt;br /&gt;
** On the Desktop find and launch &amp;quot;Services&amp;quot; (on KDE and Gnome it&#039;s under System Settings=&amp;gt;Server Settings=&amp;gt;Services, but you might have to hunt around).&lt;br /&gt;
** Tick the box for MySQL and (with it selected) press the Start icon - ensure it starts up&lt;br /&gt;
** Choose &amp;quot;Save Changes&amp;quot; from the menu, and exit the program.&lt;br /&gt;
* If you haven&#039;t yet, as root, change the MySQL root password&lt;br /&gt;
** mysqladmin -u root password mysqlpass (&amp;lt;-- should change this to something of your own)&lt;br /&gt;
* Next, set up the MySQL database (see http://moodle.org/doc/?file=install.html#database for more details)&lt;br /&gt;
* Launch MySQL as root&lt;br /&gt;
** mysql -u root -p&lt;br /&gt;
*** (at the password prompt, enter the password from above)&lt;br /&gt;
* At the &#039;&amp;gt;&#039; MySQL prompt, enter the following commands (MySQL commands are ended with a &#039;;&#039;)&lt;br /&gt;
** CREATE DATABASE mymoodle;&lt;br /&gt;
*** (the name &#039;mymoodle&#039; is the same name as the database from Step 4)&lt;br /&gt;
** GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON mymoodle.*&lt;br /&gt;
*** (as above, &#039;mymoodle&#039; is from Step 4)&lt;br /&gt;
** TO moodleuser@localhost IDENTIFIED BY &#039;moodlepass&#039;;&lt;br /&gt;
*** (&#039;moodleuser&#039; and &#039;moodlepass&#039; are from Step 4)&lt;br /&gt;
** flush privileges;&lt;br /&gt;
** quit&lt;br /&gt;
* (! Consider MySQL security - not covered here. If you run a firewall, you don&#039;t have too much to worry about.)&lt;br /&gt;
&lt;br /&gt;
== Setup Apache ==&lt;br /&gt;
&lt;br /&gt;
* Edit the Apache configuration file at /etc/httpd/conf/httpd.conf&lt;br /&gt;
* Right at the end of the file add the following lines: (once again &#039;mymoodle&#039; as from Step 3)&lt;br /&gt;
** &amp;lt;Directory &amp;quot;/usr/moodle/mymoodle&amp;quot;&amp;gt;&lt;br /&gt;
** DirectoryIndex index.php&lt;br /&gt;
** AcceptPathInfo on&lt;br /&gt;
** AllowOverride None&lt;br /&gt;
** Options None&lt;br /&gt;
** Order allow,deny&lt;br /&gt;
** Allow from all&lt;br /&gt;
** &amp;lt;/Directory&amp;gt;&lt;br /&gt;
** Alias /mymoodle &amp;quot;/usr/moodle/mymoodle&amp;quot;&lt;br /&gt;
* Don&#039;t insert a space in &amp;quot;allow,deny&amp;quot; (common mistake!)&lt;br /&gt;
* You might also want to run through the rest of the config file and make some other (obvious) changes - administrator email and suchlike. Not vital though.&lt;br /&gt;
* Run the Services application (same as for Mysql) - tick and start &amp;quot;httpd&amp;quot;, then save changes and exit.&lt;br /&gt;
&lt;br /&gt;
== Set up the cron job ==&lt;br /&gt;
&lt;br /&gt;
As root user edit the /etc/crontab file using vi (or another editor) OR you can add a line to the root user&#039;s &amp;quot;personal&amp;quot; crontab (don&#039;t do both!).&lt;br /&gt;
&lt;br /&gt;
* If you wish to place an entry in your root user&#039;s crontab use:&lt;br /&gt;
** crontab -e&lt;br /&gt;
** Add the following line:&lt;br /&gt;
*** */5 * * * * /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
**** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* If you wish to add an entry in /etc/crontab:&lt;br /&gt;
* Open the /etc/crontab file in an editor (vi).&lt;br /&gt;
* Add the following line:&lt;br /&gt;
** */5 * * * * root /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
*** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* In either case, don&#039;t forget to save the file and exit (in vi that is &amp;lt;Esc&amp;gt;, then &#039;:wq&#039;)&lt;br /&gt;
&lt;br /&gt;
== Try your new installation ==&lt;br /&gt;
&lt;br /&gt;
http://myhost.mydomain/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
or, if you are running the browser on the same machine&lt;br /&gt;
&lt;br /&gt;
http://localhost/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[pl:Instalacja_w_RedHat]]&lt;br /&gt;
&lt;br /&gt;
== Reference ==&lt;br /&gt;
Please also see these discussion for GD:&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40885</id>
		<title>RedHat Linux installation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40885"/>
		<updated>2008-07-29T17:46:22Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Unpack and set file permission etc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note : These instructions apply to RedHat version 8. They have also been found to work for RedHat 9.0 and for Fedora Core 1 and 2. &#039;&#039;&#039;Fedora Core 3 requires the php-gd package in addition to php.&#039;&#039;&#039; I see no reason why they should not work for later versions. In addition, later distributions of Fedora (after 7) contain a moodle yum package. Installation is as easy as &#039;&#039;&#039;yum install moodle&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Redhat installation considerations: There are many installation options available when installing Redhat. I assume that you are installing on a server and will have selected a Server type install. There is however no reason why this should not work on a desktop or Workstation installation.&lt;br /&gt;
&lt;br /&gt;
== Make sure you have installed the following packages ==&lt;br /&gt;
(You will need to select the option to customize the default set of packages on installation OR bring up the package manager by putting disk 1 back in the drive for an existing system):&lt;br /&gt;
&lt;br /&gt;
* X Windows System (not vital but easier)&lt;br /&gt;
* Gnome or KDE desktop environment (as above)&lt;br /&gt;
* Server Configuration Tools&lt;br /&gt;
* Web Server&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and make sure all PHP modules are ticked (except ODBC and PGSQL, they&#039;re not neccesary)&lt;br /&gt;
** make sure not to miss the MYSQL-PHP module (not installed by default)&lt;br /&gt;
* SQL Database&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and tick MySQL server box&lt;br /&gt;
* Also make sure you set up the firewall. You probably only need to enable HTTP (and perhaps FTP and SSH) access to your server machine, unless you know different.&lt;br /&gt;
&lt;br /&gt;
== Configure hostname and domain name==&lt;br /&gt;
&lt;br /&gt;
Type system-config-network to open the GUI editor.  Click on the DNS tab. In the &amp;quot;DNS Search Path&amp;quot; fill in your domain name for example myuniversity.edu. Now ensure the &amp;quot;Hostname&amp;quot; contains the computer name you will use and click activate to make changes&lt;br /&gt;
&lt;br /&gt;
== Download Moodle==&lt;br /&gt;
(I will install under /usr/moodle, data in /usr/moodle_data)&lt;br /&gt;
&lt;br /&gt;
* Download your favourite version of Moodle from moodle.org (.zip archive is easiest)&lt;br /&gt;
* as Root create folder under /usr and copy zip&lt;br /&gt;
** su&lt;br /&gt;
** mkdir /usr/moodle&lt;br /&gt;
** mkdir /usr/moodle_data&lt;br /&gt;
** cp moodle_111.zip /usr/moodle&lt;br /&gt;
* If you prefer you can install the CVS version directly for all the latest features. Instead of downloading and copying the zip file..&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** cvs -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle login&lt;br /&gt;
** cvs -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co moodle&lt;br /&gt;
&lt;br /&gt;
== Unpack and set file permission etc ==&lt;br /&gt;
&lt;br /&gt;
* Still as root we unpack moodle and rename to something appropiate (I have multiple moodle installs, hence this setup). I will call this install mymoodle.&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** unzip moodle_xxx.zip&lt;br /&gt;
** mv moodle mymoodle&lt;br /&gt;
*** (optional step - I have more than one install under /usr/moodle)&lt;br /&gt;
** mkdir /usr/moodle_data/mymoodle&lt;br /&gt;
*** (same name as the moodle install above)&lt;br /&gt;
** chown -R apache:apache /usr/moodle&lt;br /&gt;
*** (! Giving Apache full rights to your Moodle programs is not secure. Check out the forums for recomendations on how to secure a production environment.)&lt;br /&gt;
** chown -R apache:apache /usr/moodle_data&lt;br /&gt;
&lt;br /&gt;
== Setup config.php ==&lt;br /&gt;
&lt;br /&gt;
* Still as root copy and edit the config file, you should know the host/domain name for your server&lt;br /&gt;
** cd /usr/moodle/mymoodle&lt;br /&gt;
** cp config-dist.php config.php&lt;br /&gt;
** vi config.php (or whatever your favourite editor is!)&lt;br /&gt;
* Your config.php settings should be something like...&lt;br /&gt;
** dbtype = &amp;quot;mysql&amp;quot;&lt;br /&gt;
** dbhost = &amp;quot;localhost&amp;quot;&lt;br /&gt;
** dbname = &amp;quot;mymoodle&amp;quot;&lt;br /&gt;
** dbuser = &amp;quot;moodleuser&amp;quot;&lt;br /&gt;
** dbpass = &amp;quot;moodlepass&amp;quot; (&amp;lt;-- better make this something of your own)&lt;br /&gt;
** prefix = &amp;quot;&amp;quot;&lt;br /&gt;
*** (keep the default &#039;mdl_&#039; prefix if you plan on sharing the database with other applications)&lt;br /&gt;
** wwwroot = &amp;quot;http://myhost.mydomain/mymoodle&amp;quot;&lt;br /&gt;
*** (If you only want to try moodle out and will not be accessing it from other machines you can use &amp;quot;http://localhost/mymoodle&amp;quot;)&lt;br /&gt;
** dirroot = &#039;/usr/moodle/mymoodle&#039;&lt;br /&gt;
** dataroot = &#039;/usr/moodle_data/mymoodle&#039;&lt;br /&gt;
* Save your changes and exit from the editor&lt;br /&gt;
&lt;br /&gt;
== Setup MySQL ==&lt;br /&gt;
&lt;br /&gt;
* First you need to get the MySQL daemon running, it is not running by default.&lt;br /&gt;
** On the Desktop find and launch &amp;quot;Services&amp;quot; (on KDE and Gnome it&#039;s under System Settings=&amp;gt;Server Settings=&amp;gt;Services, but you might have to hunt around).&lt;br /&gt;
** Tick the box for MySQL and (with it selected) press the Start icon - ensure it starts up&lt;br /&gt;
** Choose &amp;quot;Save Changes&amp;quot; from the menu, and exit the program.&lt;br /&gt;
* If you haven&#039;t yet, as root, change the MySQL root password&lt;br /&gt;
** mysqladmin -u root password mysqlpass (&amp;lt;-- should change this to something of your own)&lt;br /&gt;
* Next, set up the MySQL database (see http://moodle.org/doc/?file=install.html#database for more details)&lt;br /&gt;
* Launch MySQL as root&lt;br /&gt;
** mysql -u root -p&lt;br /&gt;
*** (at the password prompt, enter the password from above)&lt;br /&gt;
* At the &#039;&amp;gt;&#039; MySQL prompt, enter the following commands (MySQL commands are ended with a &#039;;&#039;)&lt;br /&gt;
** CREATE DATABASE mymoodle;&lt;br /&gt;
*** (the name &#039;mymoodle&#039; is the same name as the database from Step 4)&lt;br /&gt;
** GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON mymoodle.*&lt;br /&gt;
*** (as above, &#039;mymoodle&#039; is from Step 4)&lt;br /&gt;
** TO moodleuser@localhost IDENTIFIED BY &#039;moodlepass&#039;;&lt;br /&gt;
*** (&#039;moodleuser&#039; and &#039;moodlepass&#039; are from Step 4)&lt;br /&gt;
** flush privileges;&lt;br /&gt;
** quit&lt;br /&gt;
* (! Consider MySQL security - not covered here. If you run a firewall, you don&#039;t have too much to worry about.)&lt;br /&gt;
&lt;br /&gt;
== Setup Apache ==&lt;br /&gt;
&lt;br /&gt;
* Edit the Apache configuration file at /etc/httpd/conf/httpd.conf&lt;br /&gt;
* Right at the end of the file add the following lines: (once again &#039;mymoodle&#039; as from Step 3)&lt;br /&gt;
** &amp;lt;Directory &amp;quot;/usr/moodle/mymoodle&amp;quot;&amp;gt;&lt;br /&gt;
** DirectoryIndex index.php&lt;br /&gt;
** AcceptPathInfo on&lt;br /&gt;
** AllowOverride None&lt;br /&gt;
** Options None&lt;br /&gt;
** Order allow,deny&lt;br /&gt;
** Allow from all&lt;br /&gt;
** &amp;lt;/Directory&amp;gt;&lt;br /&gt;
** Alias /mymoodle &amp;quot;/usr/moodle/mymoodle&amp;quot;&lt;br /&gt;
* Don&#039;t insert a space in &amp;quot;allow,deny&amp;quot; (common mistake!)&lt;br /&gt;
* You might also want to run through the rest of the config file and make some other (obvious) changes - administrator email and suchlike. Not vital though.&lt;br /&gt;
* Run the Services application (same as for Mysql) - tick and start &amp;quot;httpd&amp;quot;, then save changes and exit.&lt;br /&gt;
&lt;br /&gt;
== Set up the cron job ==&lt;br /&gt;
&lt;br /&gt;
As root user edit the /etc/crontab file using vi (or another editor) OR you can add a line to the root user&#039;s &amp;quot;personal&amp;quot; crontab (don&#039;t do both!).&lt;br /&gt;
&lt;br /&gt;
* If you wish to place an entry in your root user&#039;s crontab use:&lt;br /&gt;
** crontab -e&lt;br /&gt;
** Add the following line:&lt;br /&gt;
*** */5 * * * * /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
**** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* If you wish to add an entry in /etc/crontab:&lt;br /&gt;
* Open the /etc/crontab file in an editor (vi).&lt;br /&gt;
* Add the following line:&lt;br /&gt;
** */5 * * * * root /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
*** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* In either case, don&#039;t forget to save the file and exit (in vi that is &amp;lt;Esc&amp;gt;, then &#039;:wq&#039;)&lt;br /&gt;
&lt;br /&gt;
== Try your new installation ==&lt;br /&gt;
&lt;br /&gt;
http://myhost.mydomain/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
or, if you are running the browser on the same machine&lt;br /&gt;
&lt;br /&gt;
http://localhost/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[pl:Instalacja_w_RedHat]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40884</id>
		<title>RedHat Linux installation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=RedHat_Linux_installation&amp;diff=40884"/>
		<updated>2008-07-29T17:44:31Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Note : These instructions apply to RedHat version 8. They have also been found to work for RedHat 9.0 and for Fedora Core 1 and 2. &#039;&#039;&#039;Fedora Core 3 requires the php-gd package in addition to php.&#039;&#039;&#039; I see no reason why they should not work for later versions. In addition, later distributions of Fedora (after 7) contain a moodle yum package. Installation is as easy as &#039;&#039;&#039;yum install moodle&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Redhat installation considerations: There are many installation options available when installing Redhat. I assume that you are installing on a server and will have selected a Server type install. There is however no reason why this should not work on a desktop or Workstation installation.&lt;br /&gt;
&lt;br /&gt;
== Make sure you have installed the following packages ==&lt;br /&gt;
(You will need to select the option to customize the default set of packages on installation OR bring up the package manager by putting disk 1 back in the drive for an existing system):&lt;br /&gt;
&lt;br /&gt;
* X Windows System (not vital but easier)&lt;br /&gt;
* Gnome or KDE desktop environment (as above)&lt;br /&gt;
* Server Configuration Tools&lt;br /&gt;
* Web Server&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and make sure all PHP modules are ticked (except ODBC and PGSQL, they&#039;re not neccesary)&lt;br /&gt;
** make sure not to miss the MYSQL-PHP module (not installed by default)&lt;br /&gt;
* SQL Database&lt;br /&gt;
** Click &amp;quot;Details&amp;quot; and tick MySQL server box&lt;br /&gt;
* Also make sure you set up the firewall. You probably only need to enable HTTP (and perhaps FTP and SSH) access to your server machine, unless you know different.&lt;br /&gt;
&lt;br /&gt;
== Configure hostname and domain name==&lt;br /&gt;
&lt;br /&gt;
Type system-config-network to open the GUI editor.  Click on the DNS tab. In the &amp;quot;DNS Search Path&amp;quot; fill in your domain name for example myuniversity.edu. Now ensure the &amp;quot;Hostname&amp;quot; contains the computer name you will use and click activate to make changes&lt;br /&gt;
&lt;br /&gt;
== Download Moodle==&lt;br /&gt;
(I will install under /usr/moodle, data in /usr/moodle_data)&lt;br /&gt;
&lt;br /&gt;
* Download your favourite version of Moodle from moodle.org (.zip archive is easiest)&lt;br /&gt;
* as Root create folder under /usr and copy zip&lt;br /&gt;
** su&lt;br /&gt;
** mkdir /usr/moodle&lt;br /&gt;
** mkdir /usr/moodle_data&lt;br /&gt;
** cp moodle_111.zip /usr/moodle&lt;br /&gt;
* If you prefer you can install the CVS version directly for all the latest features. Instead of downloading and copying the zip file..&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** cvs -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle login&lt;br /&gt;
** cvs -z3 -d:pserver:anonymous@uk.cvs.moodle.org:/cvsroot/moodle co moodle&lt;br /&gt;
&lt;br /&gt;
== Unpack and set file permission etc ==&lt;br /&gt;
&lt;br /&gt;
* Still as root we unpack moodle and rename to something appropiate (I have multiple moodle installs, hence this setup). I will call this install mymoodle.&lt;br /&gt;
** cd /usr/moodle&lt;br /&gt;
** unzip moodle_111.zip&lt;br /&gt;
** mv moodle mymoodle&lt;br /&gt;
*** (optional step - I have more than one install under /usr/moodle)&lt;br /&gt;
** mkdir /usr/moodle_data/mymoodle&lt;br /&gt;
*** (same name as the moodle install above)&lt;br /&gt;
** chown -R apache:apache /usr/moodle&lt;br /&gt;
*** (! Giving Apache full rights to your Moodle programs is not secure. Check out the forums for recomendations on how to secure a production environment.)&lt;br /&gt;
** chown -R apache:apache /usr/moodle_data&lt;br /&gt;
&lt;br /&gt;
== Setup config.php ==&lt;br /&gt;
&lt;br /&gt;
* Still as root copy and edit the config file, you should know the host/domain name for your server&lt;br /&gt;
** cd /usr/moodle/mymoodle&lt;br /&gt;
** cp config-dist.php config.php&lt;br /&gt;
** vi config.php (or whatever your favourite editor is!)&lt;br /&gt;
* Your config.php settings should be something like...&lt;br /&gt;
** dbtype = &amp;quot;mysql&amp;quot;&lt;br /&gt;
** dbhost = &amp;quot;localhost&amp;quot;&lt;br /&gt;
** dbname = &amp;quot;mymoodle&amp;quot;&lt;br /&gt;
** dbuser = &amp;quot;moodleuser&amp;quot;&lt;br /&gt;
** dbpass = &amp;quot;moodlepass&amp;quot; (&amp;lt;-- better make this something of your own)&lt;br /&gt;
** prefix = &amp;quot;&amp;quot;&lt;br /&gt;
*** (keep the default &#039;mdl_&#039; prefix if you plan on sharing the database with other applications)&lt;br /&gt;
** wwwroot = &amp;quot;http://myhost.mydomain/mymoodle&amp;quot;&lt;br /&gt;
*** (If you only want to try moodle out and will not be accessing it from other machines you can use &amp;quot;http://localhost/mymoodle&amp;quot;)&lt;br /&gt;
** dirroot = &#039;/usr/moodle/mymoodle&#039;&lt;br /&gt;
** dataroot = &#039;/usr/moodle_data/mymoodle&#039;&lt;br /&gt;
* Save your changes and exit from the editor&lt;br /&gt;
&lt;br /&gt;
== Setup MySQL ==&lt;br /&gt;
&lt;br /&gt;
* First you need to get the MySQL daemon running, it is not running by default.&lt;br /&gt;
** On the Desktop find and launch &amp;quot;Services&amp;quot; (on KDE and Gnome it&#039;s under System Settings=&amp;gt;Server Settings=&amp;gt;Services, but you might have to hunt around).&lt;br /&gt;
** Tick the box for MySQL and (with it selected) press the Start icon - ensure it starts up&lt;br /&gt;
** Choose &amp;quot;Save Changes&amp;quot; from the menu, and exit the program.&lt;br /&gt;
* If you haven&#039;t yet, as root, change the MySQL root password&lt;br /&gt;
** mysqladmin -u root password mysqlpass (&amp;lt;-- should change this to something of your own)&lt;br /&gt;
* Next, set up the MySQL database (see http://moodle.org/doc/?file=install.html#database for more details)&lt;br /&gt;
* Launch MySQL as root&lt;br /&gt;
** mysql -u root -p&lt;br /&gt;
*** (at the password prompt, enter the password from above)&lt;br /&gt;
* At the &#039;&amp;gt;&#039; MySQL prompt, enter the following commands (MySQL commands are ended with a &#039;;&#039;)&lt;br /&gt;
** CREATE DATABASE mymoodle;&lt;br /&gt;
*** (the name &#039;mymoodle&#039; is the same name as the database from Step 4)&lt;br /&gt;
** GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON mymoodle.*&lt;br /&gt;
*** (as above, &#039;mymoodle&#039; is from Step 4)&lt;br /&gt;
** TO moodleuser@localhost IDENTIFIED BY &#039;moodlepass&#039;;&lt;br /&gt;
*** (&#039;moodleuser&#039; and &#039;moodlepass&#039; are from Step 4)&lt;br /&gt;
** flush privileges;&lt;br /&gt;
** quit&lt;br /&gt;
* (! Consider MySQL security - not covered here. If you run a firewall, you don&#039;t have too much to worry about.)&lt;br /&gt;
&lt;br /&gt;
== Setup Apache ==&lt;br /&gt;
&lt;br /&gt;
* Edit the Apache configuration file at /etc/httpd/conf/httpd.conf&lt;br /&gt;
* Right at the end of the file add the following lines: (once again &#039;mymoodle&#039; as from Step 3)&lt;br /&gt;
** &amp;lt;Directory &amp;quot;/usr/moodle/mymoodle&amp;quot;&amp;gt;&lt;br /&gt;
** DirectoryIndex index.php&lt;br /&gt;
** AcceptPathInfo on&lt;br /&gt;
** AllowOverride None&lt;br /&gt;
** Options None&lt;br /&gt;
** Order allow,deny&lt;br /&gt;
** Allow from all&lt;br /&gt;
** &amp;lt;/Directory&amp;gt;&lt;br /&gt;
** Alias /mymoodle &amp;quot;/usr/moodle/mymoodle&amp;quot;&lt;br /&gt;
* Don&#039;t insert a space in &amp;quot;allow,deny&amp;quot; (common mistake!)&lt;br /&gt;
* You might also want to run through the rest of the config file and make some other (obvious) changes - administrator email and suchlike. Not vital though.&lt;br /&gt;
* Run the Services application (same as for Mysql) - tick and start &amp;quot;httpd&amp;quot;, then save changes and exit.&lt;br /&gt;
&lt;br /&gt;
== Set up the cron job ==&lt;br /&gt;
&lt;br /&gt;
As root user edit the /etc/crontab file using vi (or another editor) OR you can add a line to the root user&#039;s &amp;quot;personal&amp;quot; crontab (don&#039;t do both!).&lt;br /&gt;
&lt;br /&gt;
* If you wish to place an entry in your root user&#039;s crontab use:&lt;br /&gt;
** crontab -e&lt;br /&gt;
** Add the following line:&lt;br /&gt;
*** */5 * * * * /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
**** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* If you wish to add an entry in /etc/crontab:&lt;br /&gt;
* Open the /etc/crontab file in an editor (vi).&lt;br /&gt;
* Add the following line:&lt;br /&gt;
** */5 * * * * root /usr/bin/wget -O /dev/null http://localhost/mymoodle/admin/cron.php&lt;br /&gt;
*** (change the URL as appropriate for your site)&lt;br /&gt;
---&lt;br /&gt;
* In either case, don&#039;t forget to save the file and exit (in vi that is &amp;lt;Esc&amp;gt;, then &#039;:wq&#039;)&lt;br /&gt;
&lt;br /&gt;
== Try your new installation ==&lt;br /&gt;
&lt;br /&gt;
http://myhost.mydomain/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
or, if you are running the browser on the same machine&lt;br /&gt;
&lt;br /&gt;
http://localhost/mymoodle/admin&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
[[pl:Instalacja_w_RedHat]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Installations_10000_plus&amp;diff=37212</id>
		<title>Installations 10000 plus</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Installations_10000_plus&amp;diff=37212"/>
		<updated>2008-06-09T02:47:28Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* United States */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Large Installations}}&lt;br /&gt;
&lt;br /&gt;
Please add your school info here, if you have a Moodle installation catering (or expecting to cater) for 10,000 or more users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Brazil==&lt;br /&gt;
* [http://www.escolatecnica.ufrgs.br Escola Técnica da Universidade Federal do Rio Grande do Sul] - Professional school in Brazil, with 1,200 students. Adopted Moodle in 2004 and has been using it since then.&lt;br /&gt;
&lt;br /&gt;
==Canada==&lt;br /&gt;
&lt;br /&gt;
* [http://www.athabascau.ca/ Athabasca University] - Canada&#039;s leading distance-education and online university: Canada&#039;s Open University, serving about 30,000 students per year. Athabasca has decided to adopt Moodle as a single platform instead of WebCT Vista (i.e. the top of the line version). You can read their [http://www.athabascau.ca/media/index.php?id=132 press release] for more info.&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.mala.bc.ca/ Malaspina University-College] - Malaspina U-C is located on Vancouver Island in British Columbia, Canada. MUC was established in 1969, and has over 10,000 full-time Canadian students, plus 1,000 international students from more than 50 countries. MUC offers graduate and undergraduate degrees, diplomas and certificates, and a 5-level English Language program. MUC offers classroom-student support through Moodle, as well as a range of fully online courses through [http://pr.malaonline.ca/ Malaspina Continuing Education]. MUC switched from WebCT to Moodle in 2006.&lt;br /&gt;
&lt;br /&gt;
==China==&lt;br /&gt;
&lt;br /&gt;
* [http://english.bit.edu.cn/ Beijing Institute of Technology]&lt;br /&gt;
&lt;br /&gt;
==France==&lt;br /&gt;
&lt;br /&gt;
* [http://cursus.uhb.fr/ Université de Rennes 2 - Haute Bretagne] - 20,000 to 30,000 users in 800 courses&lt;br /&gt;
** 5,000 different users connected every month&lt;br /&gt;
** 200 teachers actually involved&lt;br /&gt;
** integration with LDAP and Esup-Portail (based on uPortal) ; &lt;br /&gt;
** authentication via CAS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [http://foad.univ-tlse1.fr/ Université Toulouse 1 - Sciences Sociales] - 18,000 users in 360 courses&lt;br /&gt;
** authentication via LDAP (CAS planned for september, when updating from 1.6.x to 1.8.x)&lt;br /&gt;
&lt;br /&gt;
==Germany==&lt;br /&gt;
&lt;br /&gt;
* [http://www.isis.tu-berlin.de/ Technische Universität Berlin] - 10,400 Users in 402 courses (updated: 07.June.2007)&lt;br /&gt;
** After a test period, the Information System for Instructors and Students (ISIS) was launched in september 2006. &lt;br /&gt;
&lt;br /&gt;
==India==&lt;br /&gt;
* [http://www.amieindia.net AMIE India] is a website for [http://www.amieindia.net AMIE] students currently (as of September 2007) having 239 courses, 11246 users.&lt;br /&gt;
&lt;br /&gt;
==Ireland==&lt;br /&gt;
&lt;br /&gt;
* [http://www.dcu.ie Dublin City University] 18,000 users in 3,600 courses.&lt;br /&gt;
&lt;br /&gt;
==Italy==&lt;br /&gt;
&lt;br /&gt;
* [http://www.aulaweb.unige.it/ AulaWeb - University of Genoa] AulaWeb is an university-wide installation of Moodle, organized in virtual instances, one for each laurea degree. In March 2007, it hosts more than 78 instances used by 10.500 students.&lt;br /&gt;
&lt;br /&gt;
* [http://elearning.uniroma1.it/ CITICoRD - University of Rome La Sapienza] CITICoRD hosts more than 330 courses for about 20.100 students from about 20 faculties, ranging from enginering scientific courses to literature and medicine.&lt;br /&gt;
&lt;br /&gt;
==New Zealand==&lt;br /&gt;
&lt;br /&gt;
*[http://campus.openpolytechnic.ac.nz/ The Open Polytechnic of New Zealand] - 35,000+ students, 6,500+ courses, single sign-on for library services using Ezy Proxy, single sign-on for webmail, using SquirrelMail, uses LDAP for interface with Sears Student Management System. Comments by [https://eduforge.org/wiki/wiki/nzvle/wiki?pagename=Comments%20by%20Ken%20Udas%2C%20Director%20of%20eLearning%20at%20the%20Open%20Polytechnic Ken Udas, Director of eLearning at the Open Polytechnic]&lt;br /&gt;
&lt;br /&gt;
==Jamaica==&lt;br /&gt;
*[http://ourvle.mona.uwi.edu The University of the West Indies] - 23,000+ users in 1600+ courses&lt;br /&gt;
&lt;br /&gt;
== Portugal ==&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.fct.unl.pt Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa] - 5000+ users in 400+ pages.&lt;br /&gt;
&lt;br /&gt;
== Spain ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://aulavirtual.uji.es/ Universitat Jaume I] - 13,000 users in 600 courses.&lt;br /&gt;
&lt;br /&gt;
*[http://www.upc.edu La Universitat Politecnica de Cataluña] on september 2005 started a pilot Moodle installation with 3.000 Students. On september 2006 the migration from the old campus to Moodle will be complete with more than 30.00 students [http://atenea.upc.edu El campus Atenea 4] runs Moodle 1.4.5 y an will be updated to Moodle 1.5.3 in september 2006. [http://www.upc.edu UPC] has developed several applicatons adn bridges between its own informacion systems.&lt;br /&gt;
** Integration with the academic management informatio system &amp;quot;Prisma&amp;quot;.   &lt;br /&gt;
** [http://appserv.lsi.upc.es/palangana/moodle/course/view.php?id=18 Internalmail] (developed also in  UPC) is used for as email internal system.&lt;br /&gt;
** Moodle integration with [http://bibliotecnica.upc.edu the upc library system].&lt;br /&gt;
** Adaptation of Moodle grades to spanish university grading system.&lt;br /&gt;
** And other stuff&lt;br /&gt;
&lt;br /&gt;
*[http://www.urv.cat/ Universitat Rovira i Virgili] using Moodle for three academic years. At present version 1.5.4+ to be updated to 1.6.4+ in short. In march 2007, 22701 users registered and 3500 courses created aprox.&lt;br /&gt;
** Integration with the academic management information system&lt;br /&gt;
** Integration with the corporative LDAP user’s directory&lt;br /&gt;
** Average of 504 courses used regularly (logs at least once a week)&lt;br /&gt;
** Average of 3200 students login at least once a day&lt;br /&gt;
** Average of 7200 students login at least once a week&lt;br /&gt;
** 10500 users (teachers and students) accessed at least once during the last month (data from 26th march 2007)&lt;br /&gt;
&lt;br /&gt;
*[http://www.ulpgc.es/index.php?pagina=campusvirtual&amp;amp;ver=inicio Universidad de Las Palmas de Gran Canaria (ULPGC)] - 24.000 users in aprox. 1800 courses. We started with Moodle 1.4 four years ago as a test pilot project for a small number of courses. Now offered as a basic service for all courses at ULPGC: 55 official EU titles and 5 more offered ONLY through Web. &lt;br /&gt;
** We are using version 1.6.3 with LDAP authentification&lt;br /&gt;
** Custom modules: ULPGCAssignment and ULPGCDialogUe, heavily modified Appointment/Scheduler&lt;br /&gt;
** Custom groupings/scopes for small team activities (e.g. group assignment)&lt;br /&gt;
** Regular-intense usage ranks by 60% of courses/students.&lt;br /&gt;
&lt;br /&gt;
*[http://campusvirtual.ub.edu/ Universitat de Barcelona] - 60.000 users in 7.300 courses. Started in September 2006 as a project, UB Moodle site will be open for all next September.&lt;br /&gt;
&lt;br /&gt;
*[http://campuvirtual.unex.es Universidad de Extremadura] - 15000 users in aprox. 700 courses.&lt;br /&gt;
&lt;br /&gt;
==United Kingdom==&lt;br /&gt;
&lt;br /&gt;
*[http://www.open.ac.uk/ The Open University (OU)] - the United Kingdom&#039;s only university dedicated to distance learning. They have around 150,000 undergraduate and more than 30,000 postgraduate students. They are in the middle on a two-year programme to build a VLE based on Moodle. In November 2007, the OU&#039;s Moodle database contains over 400,000 users and 3,000 courses.&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Now, The Open University’s Learning and Teaching Office has started a new programme worth nearly £5 million to build a comprehensive online student learning environment for the 21st century. &lt;br /&gt;
&lt;br /&gt;
:The development, which will first appear in May of 2006, and be fully operational for February 2007 courses, will see the largest use of Moodle in the world. Moodle is a free, Open Source software package course management system used by educators to create effective online learning communities.&lt;br /&gt;
&lt;br /&gt;
:Currently Open University students use a variety of software in a network to access their course work, interact with tutors and other students, use the library, submit assignments and handle administrative paperwork. The new development incorporating Moodle will ensure the network is much more user-friendly and uniform.&amp;quot; Source: [http://www3.open.ac.uk/events/7/2005118_40887_nr.doc OU press release] (.doc format).&lt;br /&gt;
&lt;br /&gt;
*[http://openlearn.open.ac.uk/ OpenLearn] The Open University&#039;s open content initiative. Website development began in May 2006 and the site was launched in October 2006, supported by a grant from The William and Flora Hewlett Foundation. By April 2008, 5,400 learning hours of content will be available online. Currenly (early 2007) over 10,000 unique users.&lt;br /&gt;
&lt;br /&gt;
*[http://www.gla.ac.uk/ The University of Glasgow] - A long-established (founded 1451) and high-profile research university in the UK, with 20,000 students (16,000 undergrad, 4,000 postgrad), 6,000 staff, 20,000 unique users of Moodle (as of Jan 2008). Uses LDAP for integration with Novell and a custom MIS system for user authentication. Their site is organised on a one Moodle site per faculty basis to facilitate both appropriate themeing and to simplify balancing across servers.&lt;br /&gt;
&lt;br /&gt;
==United States==&lt;br /&gt;
*[http://moodle.cpcc.edu Central Piedmont Community College (CPCC) ] uses moodle for both curriculum and Corporate and Continuing Education. For curriculum it runs in parallel to Blackboard as faculty migrate to moodle over time. There are currently no plans to go moodle only, although many administrators favor this option. The server has 30,000 or so users on it, but the actual number of active users varies widely. It is used for both hybrid and full-online classes. Corporate and Continuing Education runs its own branded instance and uses only moodle for distance education. We have about 80,000 students total, covering the range from GED, adult-ed, curriculum, and other areas serviced by 7 campuses in and around Charlotte, North Carolina. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://ilearn.sfsu.edu San Francisco State University (SFSU) ] uses moodle for more than three years now. We use moodle for our main campus and the College of Extended Learning (CEL). For curriculum, moodle used to run in parallel with Blackboard as faculty migrate to moodle over time (SFSU officially phased out Blackboard, as of 6/30/2007). The servers have total of 89K users (as of 09/05/2007), among these 89K users, 28K are considered as currently active. As for courses, we have total of 57K courses sitting on our database, and among them, around 53K are considered as active. We also have integrated Moodle with our SIMS/R system (see http://www.sfsu.edu/sims/overview.htm). We also have courses that have more than 1,300+ students in one course with lots of quizzes (20+) and quiz attempts. The student population in SFSU covers the range from undergraduate, graduate, and first professional students.&lt;br /&gt;
&lt;br /&gt;
==Taiwan==&lt;br /&gt;
{{Template:Large Installations}}&lt;br /&gt;
[http://www.thu.edu.tw/english/enindex.htm Tunghai University]&lt;br /&gt;
*More then 17,000 registed Users&lt;br /&gt;
*16,000 users login in one day( Max. )&lt;br /&gt;
*3,000 courses per semester&lt;br /&gt;
*integration with novell ichan for single sign on&lt;br /&gt;
*integration with school support system&lt;br /&gt;
&lt;br /&gt;
our moodle web site: [http://elearning.thu.edu.tw]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Installations_10000_plus&amp;diff=37211</id>
		<title>Installations 10000 plus</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Installations_10000_plus&amp;diff=37211"/>
		<updated>2008-06-09T02:45:51Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* United States */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Large Installations}}&lt;br /&gt;
&lt;br /&gt;
Please add your school info here, if you have a Moodle installation catering (or expecting to cater) for 10,000 or more users.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Brazil==&lt;br /&gt;
* [http://www.escolatecnica.ufrgs.br Escola Técnica da Universidade Federal do Rio Grande do Sul] - Professional school in Brazil, with 1,200 students. Adopted Moodle in 2004 and has been using it since then.&lt;br /&gt;
&lt;br /&gt;
==Canada==&lt;br /&gt;
&lt;br /&gt;
* [http://www.athabascau.ca/ Athabasca University] - Canada&#039;s leading distance-education and online university: Canada&#039;s Open University, serving about 30,000 students per year. Athabasca has decided to adopt Moodle as a single platform instead of WebCT Vista (i.e. the top of the line version). You can read their [http://www.athabascau.ca/media/index.php?id=132 press release] for more info.&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.mala.bc.ca/ Malaspina University-College] - Malaspina U-C is located on Vancouver Island in British Columbia, Canada. MUC was established in 1969, and has over 10,000 full-time Canadian students, plus 1,000 international students from more than 50 countries. MUC offers graduate and undergraduate degrees, diplomas and certificates, and a 5-level English Language program. MUC offers classroom-student support through Moodle, as well as a range of fully online courses through [http://pr.malaonline.ca/ Malaspina Continuing Education]. MUC switched from WebCT to Moodle in 2006.&lt;br /&gt;
&lt;br /&gt;
==China==&lt;br /&gt;
&lt;br /&gt;
* [http://english.bit.edu.cn/ Beijing Institute of Technology]&lt;br /&gt;
&lt;br /&gt;
==France==&lt;br /&gt;
&lt;br /&gt;
* [http://cursus.uhb.fr/ Université de Rennes 2 - Haute Bretagne] - 20,000 to 30,000 users in 800 courses&lt;br /&gt;
** 5,000 different users connected every month&lt;br /&gt;
** 200 teachers actually involved&lt;br /&gt;
** integration with LDAP and Esup-Portail (based on uPortal) ; &lt;br /&gt;
** authentication via CAS&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* [http://foad.univ-tlse1.fr/ Université Toulouse 1 - Sciences Sociales] - 18,000 users in 360 courses&lt;br /&gt;
** authentication via LDAP (CAS planned for september, when updating from 1.6.x to 1.8.x)&lt;br /&gt;
&lt;br /&gt;
==Germany==&lt;br /&gt;
&lt;br /&gt;
* [http://www.isis.tu-berlin.de/ Technische Universität Berlin] - 10,400 Users in 402 courses (updated: 07.June.2007)&lt;br /&gt;
** After a test period, the Information System for Instructors and Students (ISIS) was launched in september 2006. &lt;br /&gt;
&lt;br /&gt;
==India==&lt;br /&gt;
* [http://www.amieindia.net AMIE India] is a website for [http://www.amieindia.net AMIE] students currently (as of September 2007) having 239 courses, 11246 users.&lt;br /&gt;
&lt;br /&gt;
==Ireland==&lt;br /&gt;
&lt;br /&gt;
* [http://www.dcu.ie Dublin City University] 18,000 users in 3,600 courses.&lt;br /&gt;
&lt;br /&gt;
==Italy==&lt;br /&gt;
&lt;br /&gt;
* [http://www.aulaweb.unige.it/ AulaWeb - University of Genoa] AulaWeb is an university-wide installation of Moodle, organized in virtual instances, one for each laurea degree. In March 2007, it hosts more than 78 instances used by 10.500 students.&lt;br /&gt;
&lt;br /&gt;
* [http://elearning.uniroma1.it/ CITICoRD - University of Rome La Sapienza] CITICoRD hosts more than 330 courses for about 20.100 students from about 20 faculties, ranging from enginering scientific courses to literature and medicine.&lt;br /&gt;
&lt;br /&gt;
==New Zealand==&lt;br /&gt;
&lt;br /&gt;
*[http://campus.openpolytechnic.ac.nz/ The Open Polytechnic of New Zealand] - 35,000+ students, 6,500+ courses, single sign-on for library services using Ezy Proxy, single sign-on for webmail, using SquirrelMail, uses LDAP for interface with Sears Student Management System. Comments by [https://eduforge.org/wiki/wiki/nzvle/wiki?pagename=Comments%20by%20Ken%20Udas%2C%20Director%20of%20eLearning%20at%20the%20Open%20Polytechnic Ken Udas, Director of eLearning at the Open Polytechnic]&lt;br /&gt;
&lt;br /&gt;
==Jamaica==&lt;br /&gt;
*[http://ourvle.mona.uwi.edu The University of the West Indies] - 23,000+ users in 1600+ courses&lt;br /&gt;
&lt;br /&gt;
== Portugal ==&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.fct.unl.pt Faculdade de Ciências e Tecnologia da Universidade Nova de Lisboa] - 5000+ users in 400+ pages.&lt;br /&gt;
&lt;br /&gt;
== Spain ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://aulavirtual.uji.es/ Universitat Jaume I] - 13,000 users in 600 courses.&lt;br /&gt;
&lt;br /&gt;
*[http://www.upc.edu La Universitat Politecnica de Cataluña] on september 2005 started a pilot Moodle installation with 3.000 Students. On september 2006 the migration from the old campus to Moodle will be complete with more than 30.00 students [http://atenea.upc.edu El campus Atenea 4] runs Moodle 1.4.5 y an will be updated to Moodle 1.5.3 in september 2006. [http://www.upc.edu UPC] has developed several applicatons adn bridges between its own informacion systems.&lt;br /&gt;
** Integration with the academic management informatio system &amp;quot;Prisma&amp;quot;.   &lt;br /&gt;
** [http://appserv.lsi.upc.es/palangana/moodle/course/view.php?id=18 Internalmail] (developed also in  UPC) is used for as email internal system.&lt;br /&gt;
** Moodle integration with [http://bibliotecnica.upc.edu the upc library system].&lt;br /&gt;
** Adaptation of Moodle grades to spanish university grading system.&lt;br /&gt;
** And other stuff&lt;br /&gt;
&lt;br /&gt;
*[http://www.urv.cat/ Universitat Rovira i Virgili] using Moodle for three academic years. At present version 1.5.4+ to be updated to 1.6.4+ in short. In march 2007, 22701 users registered and 3500 courses created aprox.&lt;br /&gt;
** Integration with the academic management information system&lt;br /&gt;
** Integration with the corporative LDAP user’s directory&lt;br /&gt;
** Average of 504 courses used regularly (logs at least once a week)&lt;br /&gt;
** Average of 3200 students login at least once a day&lt;br /&gt;
** Average of 7200 students login at least once a week&lt;br /&gt;
** 10500 users (teachers and students) accessed at least once during the last month (data from 26th march 2007)&lt;br /&gt;
&lt;br /&gt;
*[http://www.ulpgc.es/index.php?pagina=campusvirtual&amp;amp;ver=inicio Universidad de Las Palmas de Gran Canaria (ULPGC)] - 24.000 users in aprox. 1800 courses. We started with Moodle 1.4 four years ago as a test pilot project for a small number of courses. Now offered as a basic service for all courses at ULPGC: 55 official EU titles and 5 more offered ONLY through Web. &lt;br /&gt;
** We are using version 1.6.3 with LDAP authentification&lt;br /&gt;
** Custom modules: ULPGCAssignment and ULPGCDialogUe, heavily modified Appointment/Scheduler&lt;br /&gt;
** Custom groupings/scopes for small team activities (e.g. group assignment)&lt;br /&gt;
** Regular-intense usage ranks by 60% of courses/students.&lt;br /&gt;
&lt;br /&gt;
*[http://campusvirtual.ub.edu/ Universitat de Barcelona] - 60.000 users in 7.300 courses. Started in September 2006 as a project, UB Moodle site will be open for all next September.&lt;br /&gt;
&lt;br /&gt;
*[http://campuvirtual.unex.es Universidad de Extremadura] - 15000 users in aprox. 700 courses.&lt;br /&gt;
&lt;br /&gt;
==United Kingdom==&lt;br /&gt;
&lt;br /&gt;
*[http://www.open.ac.uk/ The Open University (OU)] - the United Kingdom&#039;s only university dedicated to distance learning. They have around 150,000 undergraduate and more than 30,000 postgraduate students. They are in the middle on a two-year programme to build a VLE based on Moodle. In November 2007, the OU&#039;s Moodle database contains over 400,000 users and 3,000 courses.&lt;br /&gt;
&lt;br /&gt;
:&amp;quot;Now, The Open University’s Learning and Teaching Office has started a new programme worth nearly £5 million to build a comprehensive online student learning environment for the 21st century. &lt;br /&gt;
&lt;br /&gt;
:The development, which will first appear in May of 2006, and be fully operational for February 2007 courses, will see the largest use of Moodle in the world. Moodle is a free, Open Source software package course management system used by educators to create effective online learning communities.&lt;br /&gt;
&lt;br /&gt;
:Currently Open University students use a variety of software in a network to access their course work, interact with tutors and other students, use the library, submit assignments and handle administrative paperwork. The new development incorporating Moodle will ensure the network is much more user-friendly and uniform.&amp;quot; Source: [http://www3.open.ac.uk/events/7/2005118_40887_nr.doc OU press release] (.doc format).&lt;br /&gt;
&lt;br /&gt;
*[http://openlearn.open.ac.uk/ OpenLearn] The Open University&#039;s open content initiative. Website development began in May 2006 and the site was launched in October 2006, supported by a grant from The William and Flora Hewlett Foundation. By April 2008, 5,400 learning hours of content will be available online. Currenly (early 2007) over 10,000 unique users.&lt;br /&gt;
&lt;br /&gt;
*[http://www.gla.ac.uk/ The University of Glasgow] - A long-established (founded 1451) and high-profile research university in the UK, with 20,000 students (16,000 undergrad, 4,000 postgrad), 6,000 staff, 20,000 unique users of Moodle (as of Jan 2008). Uses LDAP for integration with Novell and a custom MIS system for user authentication. Their site is organised on a one Moodle site per faculty basis to facilitate both appropriate themeing and to simplify balancing across servers.&lt;br /&gt;
&lt;br /&gt;
==United States==&lt;br /&gt;
*[http://moodle.cpcc.edu Central Piedmont Community College (CPCC) ] uses moodle for both curriculum and Corporate and Continuing Education. For curriculum it runs in parallel to Blackboard as faculty migrate to moodle over time. There are currently no plans to go moodle only, although many administrators favor this option. The server has 30,000 or so users on it, but the actual number of active users varies widely. It is used for both hybrid and full-online classes. Corporate and Continuing Education runs its own branded instance and uses only moodle for distance education. We have about 80,000 students total, covering the range from GED, adult-ed, curriculum, and other areas serviced by 7 campuses in and around Charlotte, North Carolina. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*[http://ilearn.sfsu.edu San Francisco State University (SFSU) ] uses moodle for more than three years now. We use moodle for our main campus and the College of Extended Learning (CEL). For curriculum, moodle used to run in parallel with Blackboard as faculty migrate to moodle over time (SFSU officially phased out Blackboard, as of 6/30/2007). The servers have total of 89K users (as of 09/05/2007), among these 89K users, 28K are considered as currently active. As for courses, we have total of 57K courses sitting on our database, and among them, around 53K are considered as active. We also have integrated Moodle with our SIMS/R system (see http://www.sfsu.edu/sims/overview.htm). The student population in SFSU covers the range from undergraduate, graduate, and first professional students.&lt;br /&gt;
&lt;br /&gt;
==Taiwan==&lt;br /&gt;
{{Template:Large Installations}}&lt;br /&gt;
[http://www.thu.edu.tw/english/enindex.htm Tunghai University]&lt;br /&gt;
*More then 17,000 registed Users&lt;br /&gt;
*16,000 users login in one day( Max. )&lt;br /&gt;
*3,000 courses per semester&lt;br /&gt;
*integration with novell ichan for single sign on&lt;br /&gt;
*integration with school support system&lt;br /&gt;
&lt;br /&gt;
our moodle web site: [http://elearning.thu.edu.tw]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36217</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36217"/>
		<updated>2008-05-15T22:57:55Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Custom Patches */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are developed by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;:  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;:  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
(not finished yet, will add more later)&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;:  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;:  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;:  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Customization for large courses&#039;&#039;&#039;:  Some moodle files are using some function calls that would go through the whole database with all users, which is not efficient. We did some customization to enhance this and reported back to moodle community already (e.g. MDL-xxxxx).&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36216</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36216"/>
		<updated>2008-05-15T22:57:34Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Custom Blocks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are developed by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;:  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;:  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
(not finished yet, will add more later)&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Customization for large courses&#039;&#039;&#039;  Some moodle files are using some function calls that would go through the whole database with all users, which is not efficient. We did some customization to enhance this and reported back to moodle community already (e.g. MDL-xxxxx).&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36215</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36215"/>
		<updated>2008-05-15T22:57:03Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Custom Patches */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are developed by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
(not finished yet, will add more later)&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Customization for large courses&#039;&#039;&#039;  Some moodle files are using some function calls that would go through the whole database with all users, which is not efficient. We did some customization to enhance this and reported back to moodle community already (e.g. MDL-xxxxx).&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36214</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36214"/>
		<updated>2008-05-15T22:00:38Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* San Francisco State University */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are developed by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
(not finished yet, will add more later)&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36212</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36212"/>
		<updated>2008-05-15T21:59:19Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* Custom Blocks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
(not finished yet, will add more later)&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36210</id>
		<title>Development:San Francisco State University</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:San_Francisco_State_University&amp;diff=36210"/>
		<updated>2008-05-15T21:57:19Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=San Francisco State University=&lt;br /&gt;
San Francisco State University has adopted moodle since 2005, and after June 2007 moodle has become the sole LMS in the campus. Here we document additional customizations to Moodle that are not yet part of the core Moodle code.&lt;br /&gt;
&lt;br /&gt;
These patches and custom blocks are by the SFSU development team, except where noted.&lt;br /&gt;
&lt;br /&gt;
TO DO:  ADD GRAPHICS AND FORMAT BETTER&lt;br /&gt;
&lt;br /&gt;
==Custom Blocks==&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;My iLearn Courses block&#039;&#039;&#039;:  A block that only list out semesters that a teacher want to see. See screenshots below:&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Quickmail v2 block&#039;&#039;&#039;: This also known as the &amp;quot;Quickmail for large classes&amp;quot; block. The GUI has been improved so that it would be more intuitive for users to use.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Who&#039;s On Skype block&#039;&#039;&#039;: Quite a few of our instructors (especially teaching assistants) found this block very useful, as they could setup virtual office hours to assist students with this block.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Contact iLearn block&#039;&#039;&#039;  This is a block that would launch a form and make sure that when users contacting with our support team, they need to fill out this form to indicate what browser they are using, which course they have problems with, etc.&lt;br /&gt;
[insert screenshots here]&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;PROG/ORG Courses block&#039;&#039;&#039;  This block allows our users to quickly identify a regular &amp;quot;academic&amp;quot; course from a special program/organizational courses. For example, some of the mandatory courses (e.g. good neighbor for freshman) will be put into this course category and this block.&lt;br /&gt;
&lt;br /&gt;
==Custom Patches==&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Seamless login&#039;&#039;&#039;  This script is similar to the &amp;quot;Moodle network&amp;quot; feature that is available in 1.8 and 1.9. We created this script so that we could create a &amp;quot;seamless login&amp;quot; if we need to redirect some courses from one server to another (without users noticing any changes).&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Alternate assignment grading system&#039;&#039;&#039;  Allows teachers to directly enter the grade for assignments instead of using the default pull-down menu.&lt;br /&gt;
&lt;br /&gt;
*  &#039;&#039;&#039;Improve pop-up assignment grading&#039;&#039;&#039;  The original assignment grading (with the quick grading option) come with a &amp;quot;Status&amp;quot; field where you could click on &amp;quot;Grade&amp;quot; and there will be a pop-up window which the GUI could be improved (lack of consistency). We improved this and this was reported as MDL-xxxxx. We also added a help button to improve the usability.&lt;br /&gt;
[insert screenshot here]&lt;br /&gt;
&lt;br /&gt;
More to come later...&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Cluster&amp;diff=34927</id>
		<title>Cluster</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Cluster&amp;diff=34927"/>
		<updated>2008-04-17T23:02:37Z</updated>

		<summary type="html">&lt;p&gt;Chuang: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When I have more time I will update this page with more information (most likely the real-world experience that we had here in San Francisco State University) - Wen&lt;br /&gt;
&lt;br /&gt;
To begin with, here are some interesting discussion about running moodle in a cluster configuration:&lt;br /&gt;
&lt;br /&gt;
TCP Load Balancing Discussion&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=49986&lt;br /&gt;
&lt;br /&gt;
Moodle Clustering&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=57202&lt;br /&gt;
&lt;br /&gt;
Installation for 3000 simultaneous users&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=88214&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/502/en/index.php?title=Development:CVS_for_developers&amp;diff=34849</id>
		<title>Development:CVS for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/502/en/index.php?title=Development:CVS_for_developers&amp;diff=34849"/>
		<updated>2008-04-15T18:34:43Z</updated>

		<summary type="html">&lt;p&gt;Chuang: /* CVS on Windows */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;CVS&#039;&#039;&#039; is the Concurrent Versioning System, a commonly-used way of managing source code for large software projects. CVS keeps all versions of all files so that nothing is ever lost, and usage by different people is tracked. It also provides ways to merge code if two or more people are working on the same file. All code and all versions are stored on a central server (in the case of Moodle, at cvs.moodle.org). The [http://cvsbook.red-bean.com/cvsbook.html CVS book] holds more information about CVS than you need.&lt;br /&gt;
&lt;br /&gt;
If you just want to download Moodle using CVS to run a site, then you probably don&#039;t need this page - please see [[CVS for Administrators]] instead.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Joining the project as a developer==&lt;br /&gt;
&lt;br /&gt;
So, you&#039;ve been offered CVS write access to help us develop and maintain Moodle!  Welcome aboard!&lt;br /&gt;
&lt;br /&gt;
To be able to write changes into [http://cvs.moodle.org/ Moodle&#039;s CVS archive], you first need to have an account on the server.  Only trusted developers get these accounts.  To request access, go to the &amp;quot;Apply for CVS Access&amp;quot; tab on the CVS page on Moodle.org (http://moodle.org/cvs).  Tell us what modules you&#039;d like to access (e.g. a language module), and why.  You&#039;ll receive notification in a day or so.&lt;br /&gt;
&lt;br /&gt;
With that done, you should have all the permissions you need, so you just need to set up your machine and download the current source code so you can start working on it. &lt;br /&gt;
&lt;br /&gt;
For the examples on this page, let&#039;s assume your username is &#039;&#039;&#039;myusername&#039;&#039;&#039; and your password is &#039;&#039;&#039;mypassword&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==CVS modules==&lt;br /&gt;
&lt;br /&gt;
Within CVS, the word &amp;quot;modules&amp;quot; refers to separate collections of code. In Moodle we have the following modules within our repository:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;moodle&#039;&#039;&#039; - the main Moodle source code&lt;br /&gt;
* &#039;&#039;&#039;lang&#039;&#039;&#039; - all the language packs&lt;br /&gt;
* &#039;&#039;&#039;[[Development:contrib|contrib]]&#039;&#039;&#039; - user contributions and other assorted code in development&lt;br /&gt;
* &#039;&#039;&#039;mysql&#039;&#039;&#039; - a customised phpMyAdmin to plug into Moodle for database admin&lt;br /&gt;
* &#039;&#039;&#039;windows-cron&#039;&#039;&#039; - a small package that makes cron possible on Windows systems&lt;br /&gt;
* &#039;&#039;&#039;docs&#039;&#039;&#039; - various extra user-contributed documentation&lt;br /&gt;
&lt;br /&gt;
Most people are working on the existing features in the moodle module, but many are also contributing new ideas in the contrib modules. Once code reaches a certain level of maturity in the contrib area, it can be migrated over into the main moodle tree.&lt;br /&gt;
&lt;br /&gt;
==Basic CVS commands==&lt;br /&gt;
&lt;br /&gt;
===CVS on Unix===&lt;br /&gt;
&lt;br /&gt;
Moodle CVS uses ssh as a transport layer for security, so you will have to set a CVS_RSH environment variable in your Unix shell. It&#039;s best to put these commands in your .bashrc or .cshrc so you don&#039;t have to type it all the time:&lt;br /&gt;
        setenv CVS_RSH ssh (for csh, tcsh etc)&lt;br /&gt;
        export CVS_RSH=ssh (for sh, bash etc)&lt;br /&gt;
&lt;br /&gt;
Next, you can check out the latest development version of Moodle using this (all one line). NOTE: Don&#039;t try to do run this first CVS command over an existing moodle installation: start fresh with a new directory!:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co moodle&lt;br /&gt;
&lt;br /&gt;
The command is similar for other CVS modules:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co contrib&lt;br /&gt;
&lt;br /&gt;
If you want to checkout a single plugin (attendance block as an example here) from contrib into the current directory, you can use:&lt;br /&gt;
        cvs -z3 -d:ext:myusername@cvs.moodle.org:/cvsroot/moodle co -d attendance contrib/plugins/blocks/attendance&lt;br /&gt;
&lt;br /&gt;
Note that you will be prompted for mypassword for each command unless you set up authorized keys.  Read [[Development:SSH_key|SSH Keys]] for more details on how to set those up.&lt;br /&gt;
&lt;br /&gt;
Now, you should have a new &#039;moodle&#039; directory. You can rename it and move it around if you like. Go into it:&lt;br /&gt;
        cd moodle&lt;br /&gt;
&lt;br /&gt;
All the latest Moodle files should be in there. You can now change files in your copy. To compare your files and directories against the main CVS copy on the server use cvs diff, e.g.:&lt;br /&gt;
        cvs diff -c config-dist.php&lt;br /&gt;
        cvs diff -c lang&lt;br /&gt;
&lt;br /&gt;
To fetch the latest updates from the server use:&lt;br /&gt;
        cvs update -dP&lt;br /&gt;
&lt;br /&gt;
To copy your new files back to the server you would do something like:&lt;br /&gt;
        cd lang/ca&lt;br /&gt;
        cvs commit&lt;br /&gt;
&lt;br /&gt;
You will be prompted to add some comments (depends on your default text editor).   Please write a meaningful, descriptive comment and &#039;&#039;&#039;always include the name of any tracker issues that talk about the issue you are fixing&#039;&#039;&#039; (eg &#039;&#039;&#039;MDL-XXXX&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
After that your changes will be sent to the CVS server and stored in the repository. Done!&lt;br /&gt;
&lt;br /&gt;
To save more time you can put default arguments into a file called .cvsrc in your home directory. For example, mine contains:&lt;br /&gt;
        diff -c&lt;br /&gt;
        update -dP&lt;br /&gt;
&lt;br /&gt;
Try &#039;cvs help&#039; for more details ...&lt;br /&gt;
&lt;br /&gt;
===CVS on Mac OSX===&lt;br /&gt;
&lt;br /&gt;
You can follow the same instructions as for Unix (above) in a terminal window. However, the cvs command is not installed by default in an OSX. You first need to install the XCode Tools. You should find this on your original installation disk. Failing that it can be downloaded (a fairly hefty download) from the Apple developer web site ([http://developer.apple.com]).&lt;br /&gt;
&lt;br /&gt;
===CVS on Windows===&lt;br /&gt;
&lt;br /&gt;
First, you need to download a completely fresh copy of Moodle using your developer account.&lt;br /&gt;
&lt;br /&gt;
1. Get TortoiseCVS from tortoisecvs.org and install it, then reboot.&lt;br /&gt;
&lt;br /&gt;
2. Find or create a new folder somewhere where you want Moodle to be downloaded to.&lt;br /&gt;
&lt;br /&gt;
3. Right-mouse-click that folder and choose &amp;quot;CVS Checkout&amp;quot; from the menu. You should see a dialog box.&lt;br /&gt;
&lt;br /&gt;
4. Copy this text into the CVSROOT field (using your own username!):&lt;br /&gt;
&lt;br /&gt;
           :ext:myusername@cvs.moodle.org:/cvsroot/moodle&lt;br /&gt;
&lt;br /&gt;
5. Under the &amp;quot;Module&amp;quot; field, type &amp;quot;moodle&amp;quot; to get the latest development version of Moodle, &amp;quot;contrib&amp;quot; to get the contributions directory, or &amp;quot;mysql&amp;quot; to get the MySQL Admin module.&lt;br /&gt;
&lt;br /&gt;
6. Press the button: &amp;quot;OK&amp;quot; and everything should be downloaded.&lt;br /&gt;
&lt;br /&gt;
A dialog box should show all the files being downloaded, and after a while you should have a complete copy of Moodle. After this first checkout, you can fetch the latest updated files from the CVS server:&lt;br /&gt;
&lt;br /&gt;
# Right-mouse-click on your Moodle folder (or any file) and select &amp;quot;CVS Update&amp;quot;.&lt;br /&gt;
# Sit back and watch the logs scroll by. Take note of conflicts that may occur if your local code has changes that conflict with the incoming versions - you will need to edit these files and resolve the conflicts manually.&lt;br /&gt;
&lt;br /&gt;
After modifying files (you will notice their icons change from green to red!), you can commit them back to the CVS server like this:&lt;br /&gt;
&lt;br /&gt;
# Right-mouse-click on your Moodle folder (or any file) and select &amp;quot;CVS Commit...&amp;quot;.&lt;br /&gt;
# In the dialog box, type a clear description of the changes you are committing.  &#039;&#039;&#039;Always include the name of any tracker issues related to what you are fixing&#039;&#039;&#039; (eg &#039;&#039;&#039;MDL-XXXX&#039;&#039;&#039;).&lt;br /&gt;
# Click &amp;quot;OK&amp;quot;. Your changes will be sent to the server.&lt;br /&gt;
# If you create a folder, BE CAREFUL about using the &amp;quot;CVS Add&amp;quot; option as it will add the folder to CVS without requiring a commit. Once added, the folder cannot be removed from CVS even though it will be pruned so long as it is empty.&lt;br /&gt;
&lt;br /&gt;
Please note that as of April 15 2008, TortoiseCVS 1.10.6 might not work really well with Windows Vista. You could report bugs to TortoiseCVS site (hosted by SourceForge) or google &amp;quot;TortoiseCVS vista&amp;quot; for more details.&lt;br /&gt;
&lt;br /&gt;
==Working with branches==&lt;br /&gt;
&lt;br /&gt;
This diagram shows how the main moodle module branches into different versions over time.&lt;br /&gt;
&lt;br /&gt;
[[Image:Cvstree.png|CVS tree]]&lt;br /&gt;
&lt;br /&gt;
To see all the current tags and branches that are available, use this command on any old file (such as index.php in the top moodle directory):&lt;br /&gt;
    cvs status -v index.php&lt;br /&gt;
&lt;br /&gt;
Some tagging guidelines:&lt;br /&gt;
* Tag and branch names should always be all upper-case.&lt;br /&gt;
* Tags and branches should ALWAYS be applied to the entire module (all of Moodle). Don&#039;t tag individual files or directories.&lt;br /&gt;
* We don&#039;t allow renaming of tags because people may be relying on them, so get them right the first time!&lt;br /&gt;
&lt;br /&gt;
===Trunk development===&lt;br /&gt;
&lt;br /&gt;
The Trunk of CVS is the main development version of Moodle. In CVS it is also known as the HEAD, or default branch.&lt;br /&gt;
&lt;br /&gt;
Moodle developers try to keep this stable as possible, but as it usually contains new code it probably has bugs and small instabilities.&lt;br /&gt;
&lt;br /&gt;
Every now and then we decide the product has enough features to make a release. At this time, the trunk is tagged with a MOODLE_XX_BETA tag (in case we ever want to roll back to that point) and a new branch is formed for the release, called MOODLE_XX_STABLE.&lt;br /&gt;
&lt;br /&gt;
A Beta package is also released at this point - it&#039;s for testers who don&#039;t use CVS but want to test the latest features and report bugs.&lt;br /&gt;
&lt;br /&gt;
===Stable branches for each release===&lt;br /&gt;
&lt;br /&gt;
As soon as the stable branch MOODLE_XX_STABLE is created, development efforts will fork into two streams for a while. Some people may continue working on new features in the trunk for the next release, but most developers should be concentrating on using the current STABLE branch and fixing bugs that are found in it.&lt;br /&gt;
&lt;br /&gt;
You can switch your local copy of Moodle to the STABLE version using the following command in Unix from the root directory:&lt;br /&gt;
    cvs update -dP -r MOODLE_XX_STABLE&lt;br /&gt;
&lt;br /&gt;
After that, all the commands described above will apply to that stable version. To return to the trunk version just issue:&lt;br /&gt;
    cvs update -dPA&lt;br /&gt;
&lt;br /&gt;
On Windows clients you should have a menu from which you can choose the branch.&lt;br /&gt;
&lt;br /&gt;
Once the new STABLE branch really stabilises, a release can be declared. Packages are created for distribution and the branch will be tagged (by Martin Dougiamas) with a tag named: MOODLE_XXX&lt;br /&gt;
&lt;br /&gt;
===Merging fixes===&lt;br /&gt;
&lt;br /&gt;
All bug fixes in any STABLE branch should be merged back into the trunk so that they become available in future versions of Moodle. A floating tag called MOODLE_XX_MERGED needs to be maintained to keep track of the last merge. The procedure for such a merge is as follows (I&#039;m using CVS on the Unix command line but the steps are the same for any CVS client):&lt;br /&gt;
&lt;br /&gt;
[[Image:Merging.png|thumb|right|300px|This diagram summarises the process]]&lt;br /&gt;
1. I highly recommend keeping one checked out copy of each stable branch and the trunk/head version locally to make it easier to jump between them.  Set them all up as virtual web sites on your development machine.  I use directories like /moodle/18, /moodle/19 /moodle/dev etc.&lt;br /&gt;
&lt;br /&gt;
2. Update to the latest stable version (I&#039;ll use XX in the example but it could be 18, 19 etc) for the relevant files, and do a cvs diff just to double-check exactly what you are checking in.  Note you only need to update the files/directories you are working in, but sometimes it help to update everything anyway just to do a final check on the functionality using the web.&lt;br /&gt;
&lt;br /&gt;
          cd /moodle/XX/user&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
          cvs diff -c file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
3. If all looks OK, check in the fix to the stable branch.  Make sure that the commit message contains the bug tracker ID (eg MDL-1111) and a decent description of your thoughts on the fix.  If you don&#039;t specify a message in the command line, you&#039;ll be put into an editor to type one.&lt;br /&gt;
&lt;br /&gt;
          cvs commit -m &amp;quot;MDL-1234 Corrected a small typo in the user name field&amp;quot; file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
4. Go to the very latest trunk version and make sure it&#039;s up-to-date.&lt;br /&gt;
          &lt;br /&gt;
          cd /moodle/dev/user&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
&lt;br /&gt;
5. Merge everything into your local copy of the trunk from your stable branch since the last merge.  You can use the same sequence of (4) and (5) to merge the changes into other stable branches too (to backport the fix to the previous stable versions).&lt;br /&gt;
&lt;br /&gt;
          cvs update -kk -j MOODLE_XX_MERGED -j MOODLE_XX_STABLE file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
6. Carefully watch the update logs for conflicts, and fix every file that you see with a conflict.  Afterwards, it may help to just run a diff to make sure the result is what you expected:&lt;br /&gt;
&lt;br /&gt;
          cvs diff -c file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
7. Check your merged local copy back into CVS trunk version&lt;br /&gt;
&lt;br /&gt;
          cvs commit -m &amp;quot;MDL-1234 Corrected a small typo in the user name field, merged from XX&amp;quot; file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
8. Go back to your branch version&lt;br /&gt;
&lt;br /&gt;
          cd /moodle/XX/user&lt;br /&gt;
&lt;br /&gt;
9. Update the floating merge tag for the affected files (so that it matches MOODLE_XX_STABLE) so that this process can be repeated next time&lt;br /&gt;
&lt;br /&gt;
          cvs tag -RF MOODLE_XX_MERGED file1.php file2.php&lt;br /&gt;
&lt;br /&gt;
Finally, the values for $version in all the Moodle version.php files within the stable branch should not be updated at all if possible (except the last digit if absolutely necessary). The reason is that someone updating from a very stable version to the next very stable version could miss database upgrades that happened on the trunk.&lt;br /&gt;
&lt;br /&gt;
===Feature branches for large changes===&lt;br /&gt;
&lt;br /&gt;
Occasionally, there may be a very large feature that needs to be checked in so several people can work on it, but it is too unstable to be included in the main development trunk.&lt;br /&gt;
&lt;br /&gt;
In these cases a short-term branch can be created to work on the feature, and then merged back into the main trunk as soon as possible. An example called MOODLE_17_WIDGET branch can be seen in the above diagram.&lt;br /&gt;
&lt;br /&gt;
If you need to do this for your new WIDGET feature, follow these steps:&lt;br /&gt;
&lt;br /&gt;
1. Discuss with other developers to make sure it&#039;s necessary!&lt;br /&gt;
&lt;br /&gt;
2. Make a new tag on the trunk (for all of moodle) called MOODLE_XX_WIDGET_PRE&lt;br /&gt;
&lt;br /&gt;
          cvs tag -R MOODLE_XX_WIDGET_PRE&lt;br /&gt;
&lt;br /&gt;
3. Create your branch called MOODLE_XX_WIDGET&lt;br /&gt;
&lt;br /&gt;
          cvs tag -Rb MOODLE_XX_WIDGET&lt;br /&gt;
&lt;br /&gt;
4. Work in that branch until the feature is reasonably stable. Commit as necessary.&lt;br /&gt;
&lt;br /&gt;
          cvs commit&lt;br /&gt;
&lt;br /&gt;
5. When ready, merge the whole branch into the trunk, fix conflicts, commit it to the trunk and then abandon the branch.&lt;br /&gt;
&lt;br /&gt;
          cvs update -dPA&lt;br /&gt;
          cvs update -kk -j MOODLE_XX_WIDGET&lt;br /&gt;
          cvs commit&lt;br /&gt;
&lt;br /&gt;
Good luck, be careful and have fun!&lt;br /&gt;
&lt;br /&gt;
==Who on earth is ...==&lt;br /&gt;
&lt;br /&gt;
Some of the people committing to the Moodle codebase have non-boring account names on the CVS server. If you are ever looking at a CVS commit, and wondering &amp;quot;who on earth is this purpleblob person?&amp;quot; This information is now available at: [http://moodle.org/mod/cvsadmin/view.php?cid=1 Moodle developers with write access].&lt;br /&gt;
&lt;br /&gt;
==Tips and Hints==&lt;br /&gt;
* [[Tracking Moodle CVS with git]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=34472 Merging Custom Moodle Code With Stable Releases]&lt;br /&gt;
* [[Unmerged files]]: To see if you&#039;ve forgotten to merge any file.&lt;br /&gt;
* [http://ximbiot.com/cvs/manual/ CVS Manual]&lt;br /&gt;
* [[Development:contrib|Introduction to the &#039;&#039;&#039;contrib&#039;&#039;&#039; area of CVS]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://tracker.moodle.org/browse/MDLSITE-193 &amp;quot;All developers should switch to using the cvs.moodle.org alias&amp;quot;]&lt;br /&gt;
* [[CVS for Administrators]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|CVS for developers]]&lt;br /&gt;
[[Category:Developer tools]]&lt;br /&gt;
&lt;br /&gt;
[[es:CVS para desarrolladores]]&lt;br /&gt;
[[fr:CVS pour développeurs]]&lt;/div&gt;</summary>
		<author><name>Chuang</name></author>
	</entry>
</feed>