<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nenashev</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/310/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Nenashev"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/Special:Contributions/Nenashev"/>
	<updated>2026-04-17T19:07:03Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77030</id>
		<title>Development:NEWMODULE Documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77030"/>
		<updated>2010-10-24T22:28:40Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* lang */ help&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Work in progress}}&lt;br /&gt;
{{New_Module}}&lt;br /&gt;
This first draft of Moodle Docs page about the creation of  a new module is divided into the some sections. See block NEWMODULE at right side.&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
&lt;br /&gt;
== Base module folder content ==&lt;br /&gt;
To download the newmodule package, please refer to:&lt;br /&gt;
:* 1.8: http://download.moodle.org/plugins18/mod/NEWMODULE.zip&lt;br /&gt;
:* 1.9: http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
:* HEAD: http://download.moodle.org/plugins/mod/NEWMODULE.zip&lt;br /&gt;
&lt;br /&gt;
Although you can download the newmodule package for moodle 1.8, such as 1.9 and head, this tutorial is intended for the newmodule development in Moodle 1.9 ONLY.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by getting an idea about what you find in the newmodule folder taken from http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
# db/install.xml&lt;br /&gt;
# db/upgrade.php&lt;br /&gt;
# icon.gif&lt;br /&gt;
# index.php&lt;br /&gt;
# lang/en_utf8/help/newmodule/index.html&lt;br /&gt;
# lang/en_utf8/help/newmodule/mods.html&lt;br /&gt;
# lang/en_utf8/newmodule.php&lt;br /&gt;
# lib.php&lt;br /&gt;
# mod_form.php&lt;br /&gt;
# README.txt&lt;br /&gt;
# version.php&lt;br /&gt;
# view.php&lt;br /&gt;
&lt;br /&gt;
The path where you find each file is the correct one. So don&#039;t change the path of files and folders in this newmodule package.&lt;br /&gt;
&lt;br /&gt;
Inside the db folder, at the beginning, you can only find install.xml and upgrade.php but sooner you will start to always add the new file &amp;quot;access.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== db/install.xml === &lt;br /&gt;
&#039;&#039;db/install.xml&#039;&#039; is the file to write the xml describing the tables needed by the module.&lt;br /&gt;
Tables are at least two, first named with the same name of the module, second named &amp;quot;log_display&amp;quot;. &lt;br /&gt;
They follow a strict syntax that you can learn by editing one of the several example you can find inside moodle modules. &lt;br /&gt;
Ultimately the only thing to take care is the &amp;lt;&amp;lt;previous&amp;gt;&amp;gt; &amp;lt;&amp;lt;next&amp;gt;&amp;gt; connection between tables and fields.&lt;br /&gt;
This is the mandatory file where you MUST write the structure of the tables your module is going to use. &lt;br /&gt;
The table &amp;quot;log_display&amp;quot; is the tables where you are requested to list all the &amp;quot;actions&amp;quot; that you will add to the logs of your module.&lt;br /&gt;
&lt;br /&gt;
=== db/upgrade.php ===&lt;br /&gt;
&#039;&#039;db/upgrade.php&#039;&#039; is the file that you will write each time you need to change the structure of the tables of your module.&lt;br /&gt;
&lt;br /&gt;
To learn how to write this file, please refer to the examples you may find in the file itself.&lt;br /&gt;
&lt;br /&gt;
=== icon.gif ===&lt;br /&gt;
It is a 16px per 16px icon identifying each instance of your module in the frame of a course.&lt;br /&gt;
&lt;br /&gt;
=== index.php ===&lt;br /&gt;
&#039;&#039;index.php&#039;&#039; is a page to list all instances of the functionality the module provides in a course.&lt;br /&gt;
&lt;br /&gt;
=== lang ===&lt;br /&gt;
&#039;&#039;lang&#039;&#039; is the folder reserved to language packs. &lt;br /&gt;
&lt;br /&gt;
A module language pack is a folder named &amp;quot;xx_utf8&amp;quot; containing, in turn, a folder named &amp;quot;help&amp;quot; and a language file named with the same name of the module. xx is the two char long name of the language, i.e. en, de, es, it, fr and so forth. Each language file is dedicated to a specific language. The lang folder may contain as much language packs as provided by different translators.&lt;br /&gt;
&lt;br /&gt;
The lang/xx_utf8/help/ folder contains all the help files you want to provide to your module. In order to link a help file from inside the code of your module pages use $mform-&amp;gt;[[Development:lib/formslib.php_Form_Definition#setHelpButton|setHelpButton]] in [[#mod_form.php|mod_form.php]] and in other places use &amp;lt;code php&amp;gt; helpbutton(&#039;&amp;lt;&amp;lt;name of your help file saved in lang/xx_utf8/help/&amp;gt;&amp;gt;&#039;, get_string(&#039;your_string&#039;,&#039;newmodule&#039;), &#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== lib.php ===&lt;br /&gt;
&#039;&#039;[[lib.php]]&#039;&#039; is the pre-filled file with &amp;quot;core&amp;quot; functions needed by each module.&lt;br /&gt;
&lt;br /&gt;
Almost all newmodule functions go here. Each of them must have a name that starts with newmodule_&lt;br /&gt;
This file should have two well differenced parts:&lt;br /&gt;
* All the core Moodle functions, neeeded to allow the module to work integrated in Moodle.&lt;br /&gt;
* All the newmodule specific functions, needed to implement all the module logic. &lt;br /&gt;
&lt;br /&gt;
Please, note that, if the module become complex and this lib grows a lot, it&#039;s HIGHLY recommended to move all these module specific functions to a new php file, called &amp;quot;locallib.php&amp;quot; (see forum, quiz...). This will help to save some memory when Moodle is performing actions across all modules.&lt;br /&gt;
&lt;br /&gt;
There are convention to name functions into lib.php and locallib.php. See: &lt;br /&gt;
* [[Development:Coding_style#Functions_and_Methods]]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
&lt;br /&gt;
There are some details just above the each function in lib.php.&lt;br /&gt;
&lt;br /&gt;
Mandatory function are, at least:&lt;br /&gt;
&lt;br /&gt;
Module instance editing form handlers, that called from [http://xref.moodle.org/course/mod.php.source.html /course/mod.php] or [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php]:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_add_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is after an editing teacher &#039;&#039;create an instance&#039;&#039; of newmodule.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_update_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;update an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_delete_instance($id)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;delete an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_outline()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_complete($course, $user, $mod, $newmodule)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_print_recent_activity($course, $isteacher, $timestart)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_cron()&#039;&#039;&#039;&lt;br /&gt;
Take care with this function. Differently by all the other functions, this function is not called by passing it the $newmodule record. This means that this function, called by moodle core cron has to look for each newmodule instance id before operating.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry, even if you have more than a single instance of your module among moodle courses, this function will be executed just one time.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_participants($newmoduleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used($newmoduleid, $scaleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used_anywhere($scaleid)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_install()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_uninstall()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some more functions should be added:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_definition(&amp;amp;$mform)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_defaults($course)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_userdata($data)&#039;&#039;&#039;&lt;br /&gt;
These three functions are responsible for the newmodule reset process during the more general course reset process. Please, refer to [[mod/data/lib.php]] or to [[mod/feedback/lib.php]], for instance, to understand them better.&lt;br /&gt;
&lt;br /&gt;
Two more functions should be added to lib.php are:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_view_actions()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_post_actions()&#039;&#039;&#039;&lt;br /&gt;
They distinguish between &amp;quot;read&amp;quot; and &amp;quot;post&amp;quot; log actions. These functions are used by moodle core during log gather.&lt;br /&gt;
The actions you list inside these two functions, must match the ones you listed in the table &amp;quot;log_display&amp;quot; in install.xml&lt;br /&gt;
&lt;br /&gt;
==== Connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039; ====&lt;br /&gt;
One important issue is about the connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039;. Who has to call the other, how and why?&lt;br /&gt;
It has to be locallib.php to call lib.php through: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  require_once(&amp;quot;$CFG-&amp;gt;dirroot/mod/newmodule/lib.php&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
as first line.&lt;br /&gt;
&lt;br /&gt;
In this way, if moodle core calls function inside mod/newmodule/lib.php no module specific function will be loaded in memory.&lt;br /&gt;
If it is your newmodule to call a function, it has to require_once(&#039;locallib.php&#039;); that, in turn, will require_once(&#039;lib.php&#039;) so that your module will &amp;quot;see&amp;quot; all its available functions.&lt;br /&gt;
&lt;br /&gt;
=== mod_form.php ===&lt;br /&gt;
&#039;&#039;mod_form.php&#039;&#039; is the file describing the form you get at the module instance creation or at the instance editing time.&lt;br /&gt;
&lt;br /&gt;
There are only one class definition, that extends class &#039;&#039;moodleform_mod&#039;&#039; from [http://xref.moodle.org/course/moodleform_mod.php.source.html /course/moodleform_mod.php].&lt;br /&gt;
&lt;br /&gt;
The syntax for add new form elements is very simple and by reading the file it is simple to change it on your need. It uses the syntax you can learn in [[Development:lib/formslib.php_Form_Definition]].&lt;br /&gt;
&lt;br /&gt;
This file used only from [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php].&lt;br /&gt;
&lt;br /&gt;
At date, there is a missing detail by the end of the file. You can read:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
  // add standard elements, common to all modules&lt;br /&gt;
  $this-&amp;gt;standard_coursemodule_elements();&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This part with one call of function inherited from moodleform_mod that is responsible for the common modules section at the end of your newmodule editing instance page. The section related to groups, outcomes, grades, visibility etc. This code can be customized by settings object passed to it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
  // add standard elements, common to all modules&lt;br /&gt;
  $features = new object();&lt;br /&gt;
  $features-&amp;gt;groups           = false;&lt;br /&gt;
  $features-&amp;gt;groupings        = false;&lt;br /&gt;
  $features-&amp;gt;groupmembersonly = true;&lt;br /&gt;
  $this-&amp;gt;standard_coursemodule_elements($features);&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One more tip about this file.&lt;br /&gt;
* Once you submit the form described by this file, your module executes the function: &#039;&#039;newmodule_add_instance&#039;&#039; or &#039;&#039;newmodule_update_instance&#039;&#039; both pre-written in [[#lib.php|lib.php]].&lt;br /&gt;
* It seems that check boxes in the editing instance form don&#039;t work. To test this, please verify the passed parameter $newmodule inside your function &#039;&#039;newmodule_update_instance&#039;&#039; through a simple: &amp;lt;code php&amp;gt;print_object($newmodule);&amp;lt;/code&amp;gt;&lt;br /&gt;
* You will find that even by selecting or unselecting the check box in the newmodule instance editing form, the corresponding value in the array doesn&#039;t change. This is not an error, but at least a lack of code. You will find that all works fine by adding at the beginning of both functions a simple code like this:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$checkboxes = array(&#039;myfirstcheckboxfield&#039;, &#039;mysecondcheckboxfield&#039;, and so fort with all your checkbox field);&lt;br /&gt;
foreach ($checkboxes as $checkbox) {&lt;br /&gt;
    if (empty($newmodule-&amp;gt;{$checkbox})) {&lt;br /&gt;
        $newmodule-&amp;gt;{$checkbox} = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== README.txt ===&lt;br /&gt;
This is the file where you are welcome to write what your newmodule does.&lt;br /&gt;
&lt;br /&gt;
=== version.php ===&lt;br /&gt;
&#039;&#039;version.php&#039;&#039; is a really very simple file as simple as important.&lt;br /&gt;
&lt;br /&gt;
To understand why it is important, you need to know that there are a bunch of actions that moodle performs for your newmodule ONLY (with only one exception) at the newmodule installation. They are, at least, db tables editing and load of capability. If during the development of your module (that you already installed on your development environment or that you already shared with remote users) you need to change the structure of your newmodule tables or you need to change the capability used by your newmodule, you need to force moodle to edit tables and reload capability.&lt;br /&gt;
&lt;br /&gt;
This is done by:&lt;br /&gt;
* adding the proper code in newmodule/db/upgrade.php (to do this, use XMLDB as stated in this same page below)&lt;br /&gt;
* increasing the newmodule version in version.php&lt;br /&gt;
* visiting the notification page of your installation of Moodle&lt;br /&gt;
&lt;br /&gt;
=== view.php ===&lt;br /&gt;
This is the first executed code of your module. By selecting the link of the instance of your module, the code of newmodule/view.php is executed.&lt;br /&gt;
&lt;br /&gt;
== Some very important missing files ==&lt;br /&gt;
There are five files that are not present in the newmodule package that 90% of times you will go to add to your newmodule.&lt;br /&gt;
&lt;br /&gt;
1. The first one is locallib.php already described before.&lt;br /&gt;
&lt;br /&gt;
2. The second one is access.php that has to be saved inside newmodule/db/ folder.&lt;br /&gt;
:In this file you will add all the capability used by your newmodule and loaded at the installation time or upgrade time. To learn the syntax of the capability, please refer to the same file in other modules or to: https://docs.moodle.org/en/Development:NEWMODULE_Adding_capabilities&lt;br /&gt;
3. The third missing file must be added to newmodule/ folder. It is settings.php and describes the form that can be accessed from: Site Administration block -&amp;gt; Modules -&amp;gt; Activities -&amp;gt; &amp;lt;&amp;lt;your newmodule name&amp;gt;&amp;gt;&lt;br /&gt;
:This form stores general settings for your newmodule into the site wide $CFG object. Because of this, it is strongly recommended to give to your newmodule general settings with names starting with &amp;quot;newmodule_&amp;quot;. This file is useful when there is a setting that doesn&#039;t depend from the instance. I.e., if your newmodule simulates a telephone, you will probably save your telephone number in this newmodule setting site wide form instead of typing it each time you add a new instance of your newmodule into a course. In this case, to refer to you telephone number inside your newmodule you will use: $CFG-&amp;gt;newmodule_telephonenumber&lt;br /&gt;
4. Directly in the newmodule folder, you need to add backuplib.php that is responsible for the backup of each instance of your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
5. Again in the newmodule folder, you need to add restorelib.php that is responsible for the restore of each instance your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
&lt;br /&gt;
==Let&#039;s start==&lt;br /&gt;
To start using a downloaded package, please perform the 7 actions described in [[Development:NEWMODULE_Tutorial]] in &#039;&#039;How to Begin the Creation of a New Module&#039;&#039; paragraph.&lt;br /&gt;
&lt;br /&gt;
Then, draw the structure of your tables on a sheet, edit the file db/install.xml according to your project, save, put your renamed newmodule folder in moodle/mod/ and visit the moodle notification page.&lt;br /&gt;
&lt;br /&gt;
To add code to db/upgrade.php never do it manually. I always make use of Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and I ask it to write the code for me. It never fails.&lt;br /&gt;
&lt;br /&gt;
Please remember: within your module, never use &amp;quot;embedded messages&amp;quot; like:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;Welcome to this newmodule&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
but make use of get_string or print_string. In this way your module will be multilang with a really small effort.&lt;br /&gt;
Use, for instance:&lt;br /&gt;
&amp;lt;code php&amp;gt;print_string(&#039;welcomemessage&#039;,&#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
saving in newmodule/lang/en_utf8/newmodule.php&lt;br /&gt;
&amp;lt;code php&amp;gt;$string[&#039;welcomemessage&#039;] = &#039;Welcome to this newmodule&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
==Some code snippets that I find useful==&lt;br /&gt;
&lt;br /&gt;
=== Check the capability of a user ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (newmodule_hascapabilitytodothis()) {&lt;br /&gt;
    //user is allowed&lt;br /&gt;
} else {&lt;br /&gt;
    // user is not allowed&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in locallib.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function newmodule_hascapabilitytodothis($cm) {&lt;br /&gt;
    $context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id);&lt;br /&gt;
&lt;br /&gt;
    return (has_capability(&#039;mod/newmodule:candothis&#039;, $context));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in db/access.php&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$mod_newmodule_capabilities = array(&lt;br /&gt;
    &#039;mod/newmodule:candothis&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;captype&#039; =&amp;gt; &#039;read&#039;,&lt;br /&gt;
        &#039;contextlevel&#039; =&amp;gt; CONTEXT_MODULE,&lt;br /&gt;
        &#039;legacy&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;teacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;editingteacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;admin&#039; =&amp;gt; CAP_ALLOW&lt;br /&gt;
        )&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Edit the tables in use by your newmodule ===&lt;br /&gt;
&lt;br /&gt;
* edit [[#db/install.xml|db/install.xml]] manually by editing fields and or tables in the xml structure.&lt;br /&gt;
* go to Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and load the tables of your module&lt;br /&gt;
* ask to the XMLDB editor the snippets of code you need to add to [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* copy and paste in [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* in the line: &amp;lt;code php&amp;gt;if ($result &amp;amp;&amp;amp; $oldversion &amp;lt; xxxxxxxxxxxx)&amp;lt;/code&amp;gt; (replace xxxxxxxxxxxx with the version number you are going to give to your newmodule)&lt;br /&gt;
* change (increase) the version number&lt;br /&gt;
* visit the Moodle notification page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a single line to logs from your newmodule ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
add_to_log($course-&amp;gt;id, &#039;newmodule&#039;, &#039;&amp;lt;&amp;lt;action already listed in log_display&amp;gt;&amp;gt;&#039;, &amp;quot;view.php?id=$cm-&amp;gt;id&amp;quot;, &amp;quot;$newmodule-&amp;gt;id&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ensure that remote user will not be able to contact your pages by typing their URL directly in the address bar ===&lt;br /&gt;
&lt;br /&gt;
as first line of each of your php script&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!defined(&#039;MOODLE_INTERNAL&#039;)) {&lt;br /&gt;
    die(&#039;Direct access to this script is forbidden.&#039;); // It must be included from a Moodle page&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some suggestion I find useful==&lt;br /&gt;
&#039;&#039;&#039;To include php scripts&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;myscript.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To include php library&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;locallib.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To periodically execute function newmodule_cron()&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;$module-&amp;gt;cron = xxxx;&amp;lt;/pre&amp;gt;&lt;br /&gt;
providing some code in: &amp;lt;pre&amp;gt;function newmodule_cron()&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your function newmodule_cron() will be executed about each xxxx seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not include config when it is not needed&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;config.php&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
is not needed in library scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use global $cm or $newmodule in your function&#039;&#039;&#039;&lt;br /&gt;
but use proper function parameters.&lt;br /&gt;
&lt;br /&gt;
So, never use:&lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky() {&lt;br /&gt;
    global $cm, $newmodule;&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
but use: &lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky($cm, $newmodule) {&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://dev.moodle.org/course/view.php?id=2 Moodle Developers&#039; Course]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
* [[Development:Places to search for lang strings|Where to put language strings for your plugin]]&lt;br /&gt;
* [[Development:Installing and upgrading plugin database tables|Defining the database tables for your plugin]]&lt;br /&gt;
&lt;br /&gt;
{{CategoryDeveloper}}&lt;br /&gt;
[[Category:Developer|Modules]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77029</id>
		<title>Development:NEWMODULE Documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77029"/>
		<updated>2010-10-24T20:30:33Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* mod_form.php */ a little more&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Work in progress}}&lt;br /&gt;
{{New_Module}}&lt;br /&gt;
This first draft of Moodle Docs page about the creation of  a new module is divided into the some sections. See block NEWMODULE at right side.&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
&lt;br /&gt;
== Base module folder content ==&lt;br /&gt;
To download the newmodule package, please refer to:&lt;br /&gt;
:* 1.8: http://download.moodle.org/plugins18/mod/NEWMODULE.zip&lt;br /&gt;
:* 1.9: http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
:* HEAD: http://download.moodle.org/plugins/mod/NEWMODULE.zip&lt;br /&gt;
&lt;br /&gt;
Although you can download the newmodule package for moodle 1.8, such as 1.9 and head, this tutorial is intended for the newmodule development in Moodle 1.9 ONLY.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by getting an idea about what you find in the newmodule folder taken from http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
# db/install.xml&lt;br /&gt;
# db/upgrade.php&lt;br /&gt;
# icon.gif&lt;br /&gt;
# index.php&lt;br /&gt;
# lang/en_utf8/help/newmodule/index.html&lt;br /&gt;
# lang/en_utf8/help/newmodule/mods.html&lt;br /&gt;
# lang/en_utf8/newmodule.php&lt;br /&gt;
# lib.php&lt;br /&gt;
# mod_form.php&lt;br /&gt;
# README.txt&lt;br /&gt;
# version.php&lt;br /&gt;
# view.php&lt;br /&gt;
&lt;br /&gt;
The path where you find each file is the correct one. So don&#039;t change the path of files and folders in this newmodule package.&lt;br /&gt;
&lt;br /&gt;
Inside the db folder, at the beginning, you can only find install.xml and upgrade.php but sooner you will start to always add the new file &amp;quot;access.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== db/install.xml === &lt;br /&gt;
&#039;&#039;db/install.xml&#039;&#039; is the file to write the xml describing the tables needed by the module.&lt;br /&gt;
Tables are at least two, first named with the same name of the module, second named &amp;quot;log_display&amp;quot;. &lt;br /&gt;
They follow a strict syntax that you can learn by editing one of the several example you can find inside moodle modules. &lt;br /&gt;
Ultimately the only thing to take care is the &amp;lt;&amp;lt;previous&amp;gt;&amp;gt; &amp;lt;&amp;lt;next&amp;gt;&amp;gt; connection between tables and fields.&lt;br /&gt;
This is the mandatory file where you MUST write the structure of the tables your module is going to use. &lt;br /&gt;
The table &amp;quot;log_display&amp;quot; is the tables where you are requested to list all the &amp;quot;actions&amp;quot; that you will add to the logs of your module.&lt;br /&gt;
&lt;br /&gt;
=== db/upgrade.php ===&lt;br /&gt;
&#039;&#039;db/upgrade.php&#039;&#039; is the file that you will write each time you need to change the structure of the tables of your module.&lt;br /&gt;
&lt;br /&gt;
To learn how to write this file, please refer to the examples you may find in the file itself.&lt;br /&gt;
&lt;br /&gt;
=== icon.gif ===&lt;br /&gt;
It is a 16px per 16px icon identifying each instance of your module in the frame of a course.&lt;br /&gt;
&lt;br /&gt;
=== index.php ===&lt;br /&gt;
&#039;&#039;index.php&#039;&#039; is a page to list all instances of the functionality the module provides in a course.&lt;br /&gt;
&lt;br /&gt;
=== lang ===&lt;br /&gt;
&#039;&#039;lang&#039;&#039; is the folder reserved to language packs. A module language pack is a folder named &amp;quot;xx_utf8&amp;quot; containing, in turn, a folder named &amp;quot;help&amp;quot; and a language file named with the same name of the module. xx is the two char long name of the language, i.e. en, de, es, it, fr and so forth.&lt;br /&gt;
&lt;br /&gt;
Each language file is dedicated to a specific language. The lang folder may contain as much language packs as provided by different translators. The lang/xx_utf8/newmodule/ folder contains all the help files you want to provide to your module. In order to link a help file from inside the code of your module pages try:&lt;br /&gt;
&amp;lt;code php&amp;gt; helpbutton(&#039;&amp;lt;&amp;lt;name of your help file saved in lang/xx_utf8/newmodule/&amp;gt;&amp;gt;&#039;, get_string(&#039;your_string&#039;,&#039;newmodule&#039;), &#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
:or, in mod_form.php,&lt;br /&gt;
&amp;lt;code php&amp;gt;$mform-&amp;gt;setHelpButton &amp;lt;/code&amp;gt; as stated in&lt;br /&gt;
&lt;br /&gt;
=== lib.php ===&lt;br /&gt;
&#039;&#039;[[lib.php]]&#039;&#039; is the pre-filled file with &amp;quot;core&amp;quot; functions needed by each module.&lt;br /&gt;
&lt;br /&gt;
Almost all newmodule functions go here. Each of them must have a name that starts with newmodule_&lt;br /&gt;
This file should have two well differenced parts:&lt;br /&gt;
* All the core Moodle functions, neeeded to allow the module to work integrated in Moodle.&lt;br /&gt;
* All the newmodule specific functions, needed to implement all the module logic. &lt;br /&gt;
&lt;br /&gt;
Please, note that, if the module become complex and this lib grows a lot, it&#039;s HIGHLY recommended to move all these module specific functions to a new php file, called &amp;quot;locallib.php&amp;quot; (see forum, quiz...). This will help to save some memory when Moodle is performing actions across all modules.&lt;br /&gt;
&lt;br /&gt;
There are convention to name functions into lib.php and locallib.php. See: &lt;br /&gt;
* [[Development:Coding_style#Functions_and_Methods]]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
&lt;br /&gt;
There are some details just above the each function in lib.php.&lt;br /&gt;
&lt;br /&gt;
Mandatory function are, at least:&lt;br /&gt;
&lt;br /&gt;
Module instance editing form handlers, that called from [http://xref.moodle.org/course/mod.php.source.html /course/mod.php] or [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php]:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_add_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is after an editing teacher &#039;&#039;create an instance&#039;&#039; of newmodule.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_update_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;update an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_delete_instance($id)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;delete an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_outline()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_complete($course, $user, $mod, $newmodule)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_print_recent_activity($course, $isteacher, $timestart)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_cron()&#039;&#039;&#039;&lt;br /&gt;
Take care with this function. Differently by all the other functions, this function is not called by passing it the $newmodule record. This means that this function, called by moodle core cron has to look for each newmodule instance id before operating.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry, even if you have more than a single instance of your module among moodle courses, this function will be executed just one time.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_participants($newmoduleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used($newmoduleid, $scaleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used_anywhere($scaleid)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_install()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_uninstall()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some more functions should be added:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_definition(&amp;amp;$mform)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_defaults($course)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_userdata($data)&#039;&#039;&#039;&lt;br /&gt;
These three functions are responsible for the newmodule reset process during the more general course reset process. Please, refer to [[mod/data/lib.php]] or to [[mod/feedback/lib.php]], for instance, to understand them better.&lt;br /&gt;
&lt;br /&gt;
Two more functions should be added to lib.php are:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_view_actions()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_post_actions()&#039;&#039;&#039;&lt;br /&gt;
They distinguish between &amp;quot;read&amp;quot; and &amp;quot;post&amp;quot; log actions. These functions are used by moodle core during log gather.&lt;br /&gt;
The actions you list inside these two functions, must match the ones you listed in the table &amp;quot;log_display&amp;quot; in install.xml&lt;br /&gt;
&lt;br /&gt;
==== Connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039; ====&lt;br /&gt;
One important issue is about the connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039;. Who has to call the other, how and why?&lt;br /&gt;
It has to be locallib.php to call lib.php through: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  require_once(&amp;quot;$CFG-&amp;gt;dirroot/mod/newmodule/lib.php&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
as first line.&lt;br /&gt;
&lt;br /&gt;
In this way, if moodle core calls function inside mod/newmodule/lib.php no module specific function will be loaded in memory.&lt;br /&gt;
If it is your newmodule to call a function, it has to require_once(&#039;locallib.php&#039;); that, in turn, will require_once(&#039;lib.php&#039;) so that your module will &amp;quot;see&amp;quot; all its available functions.&lt;br /&gt;
&lt;br /&gt;
=== mod_form.php ===&lt;br /&gt;
&#039;&#039;mod_form.php&#039;&#039; is the file describing the form you get at the module instance creation or at the instance editing time.&lt;br /&gt;
&lt;br /&gt;
There are only one class definition, that extends class &#039;&#039;moodleform_mod&#039;&#039; from [http://xref.moodle.org/course/moodleform_mod.php.source.html /course/moodleform_mod.php].&lt;br /&gt;
&lt;br /&gt;
The syntax for add new form elements is very simple and by reading the file it is simple to change it on your need. It uses the syntax you can learn in [[Development:lib/formslib.php_Form_Definition]].&lt;br /&gt;
&lt;br /&gt;
This file used only from [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php].&lt;br /&gt;
&lt;br /&gt;
At date, there is a missing detail by the end of the file. You can read:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
  // add standard elements, common to all modules&lt;br /&gt;
  $this-&amp;gt;standard_coursemodule_elements();&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This part with one call of function inherited from moodleform_mod that is responsible for the common modules section at the end of your newmodule editing instance page. The section related to groups, outcomes, grades, visibility etc. This code can be customized by settings object passed to it:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
  // add standard elements, common to all modules&lt;br /&gt;
  $features = new object();&lt;br /&gt;
  $features-&amp;gt;groups           = false;&lt;br /&gt;
  $features-&amp;gt;groupings        = false;&lt;br /&gt;
  $features-&amp;gt;groupmembersonly = true;&lt;br /&gt;
  $this-&amp;gt;standard_coursemodule_elements($features);&lt;br /&gt;
  //------------------------------------------------------------------------------&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One more tip about this file.&lt;br /&gt;
* Once you submit the form described by this file, your module executes the function: &#039;&#039;newmodule_add_instance&#039;&#039; or &#039;&#039;newmodule_update_instance&#039;&#039; both pre-written in [[#lib.php|lib.php]].&lt;br /&gt;
* It seems that check boxes in the editing instance form don&#039;t work. To test this, please verify the passed parameter $newmodule inside your function &#039;&#039;newmodule_update_instance&#039;&#039; through a simple: &amp;lt;code php&amp;gt;print_object($newmodule);&amp;lt;/code&amp;gt;&lt;br /&gt;
* You will find that even by selecting or unselecting the check box in the newmodule instance editing form, the corresponding value in the array doesn&#039;t change. This is not an error, but at least a lack of code. You will find that all works fine by adding at the beginning of both functions a simple code like this:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$checkboxes = array(&#039;myfirstcheckboxfield&#039;, &#039;mysecondcheckboxfield&#039;, and so fort with all your checkbox field);&lt;br /&gt;
foreach ($checkboxes as $checkbox) {&lt;br /&gt;
    if (empty($newmodule-&amp;gt;{$checkbox})) {&lt;br /&gt;
        $newmodule-&amp;gt;{$checkbox} = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== README.txt ===&lt;br /&gt;
This is the file where you are welcome to write what your newmodule does.&lt;br /&gt;
&lt;br /&gt;
=== version.php ===&lt;br /&gt;
&#039;&#039;version.php&#039;&#039; is a really very simple file as simple as important.&lt;br /&gt;
&lt;br /&gt;
To understand why it is important, you need to know that there are a bunch of actions that moodle performs for your newmodule ONLY (with only one exception) at the newmodule installation. They are, at least, db tables editing and load of capability. If during the development of your module (that you already installed on your development environment or that you already shared with remote users) you need to change the structure of your newmodule tables or you need to change the capability used by your newmodule, you need to force moodle to edit tables and reload capability.&lt;br /&gt;
&lt;br /&gt;
This is done by:&lt;br /&gt;
* adding the proper code in newmodule/db/upgrade.php (to do this, use XMLDB as stated in this same page below)&lt;br /&gt;
* increasing the newmodule version in version.php&lt;br /&gt;
* visiting the notification page of your installation of Moodle&lt;br /&gt;
&lt;br /&gt;
=== view.php ===&lt;br /&gt;
This is the first executed code of your module. By selecting the link of the instance of your module, the code of newmodule/view.php is executed.&lt;br /&gt;
&lt;br /&gt;
== Some very important missing files ==&lt;br /&gt;
There are five files that are not present in the newmodule package that 90% of times you will go to add to your newmodule.&lt;br /&gt;
&lt;br /&gt;
1. The first one is locallib.php already described before.&lt;br /&gt;
&lt;br /&gt;
2. The second one is access.php that has to be saved inside newmodule/db/ folder.&lt;br /&gt;
:In this file you will add all the capability used by your newmodule and loaded at the installation time or upgrade time. To learn the syntax of the capability, please refer to the same file in other modules or to: https://docs.moodle.org/en/Development:NEWMODULE_Adding_capabilities&lt;br /&gt;
3. The third missing file must be added to newmodule/ folder. It is settings.php and describes the form that can be accessed from: Site Administration block -&amp;gt; Modules -&amp;gt; Activities -&amp;gt; &amp;lt;&amp;lt;your newmodule name&amp;gt;&amp;gt;&lt;br /&gt;
:This form stores general settings for your newmodule into the site wide $CFG object. Because of this, it is strongly recommended to give to your newmodule general settings with names starting with &amp;quot;newmodule_&amp;quot;. This file is useful when there is a setting that doesn&#039;t depend from the instance. I.e., if your newmodule simulates a telephone, you will probably save your telephone number in this newmodule setting site wide form instead of typing it each time you add a new instance of your newmodule into a course. In this case, to refer to you telephone number inside your newmodule you will use: $CFG-&amp;gt;newmodule_telephonenumber&lt;br /&gt;
4. Directly in the newmodule folder, you need to add backuplib.php that is responsible for the backup of each instance of your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
5. Again in the newmodule folder, you need to add restorelib.php that is responsible for the restore of each instance your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
&lt;br /&gt;
==Let&#039;s start==&lt;br /&gt;
To start using a downloaded package, please perform the 7 actions described in [[Development:NEWMODULE_Tutorial]] in &#039;&#039;How to Begin the Creation of a New Module&#039;&#039; paragraph.&lt;br /&gt;
&lt;br /&gt;
Then, draw the structure of your tables on a sheet, edit the file db/install.xml according to your project, save, put your renamed newmodule folder in moodle/mod/ and visit the moodle notification page.&lt;br /&gt;
&lt;br /&gt;
To add code to db/upgrade.php never do it manually. I always make use of Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and I ask it to write the code for me. It never fails.&lt;br /&gt;
&lt;br /&gt;
Please remember: within your module, never use &amp;quot;embedded messages&amp;quot; like:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;Welcome to this newmodule&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
but make use of get_string or print_string. In this way your module will be multilang with a really small effort.&lt;br /&gt;
Use, for instance:&lt;br /&gt;
&amp;lt;code php&amp;gt;print_string(&#039;welcomemessage&#039;,&#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
saving in newmodule/lang/en_utf8/newmodule.php&lt;br /&gt;
&amp;lt;code php&amp;gt;$string[&#039;welcomemessage&#039;] = &#039;Welcome to this newmodule&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
==Some code snippets that I find useful==&lt;br /&gt;
&lt;br /&gt;
=== Check the capability of a user ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (newmodule_hascapabilitytodothis()) {&lt;br /&gt;
    //user is allowed&lt;br /&gt;
} else {&lt;br /&gt;
    // user is not allowed&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in locallib.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function newmodule_hascapabilitytodothis($cm) {&lt;br /&gt;
    $context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id);&lt;br /&gt;
&lt;br /&gt;
    return (has_capability(&#039;mod/newmodule:candothis&#039;, $context));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in db/access.php&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$mod_newmodule_capabilities = array(&lt;br /&gt;
    &#039;mod/newmodule:candothis&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;captype&#039; =&amp;gt; &#039;read&#039;,&lt;br /&gt;
        &#039;contextlevel&#039; =&amp;gt; CONTEXT_MODULE,&lt;br /&gt;
        &#039;legacy&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;teacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;editingteacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;admin&#039; =&amp;gt; CAP_ALLOW&lt;br /&gt;
        )&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Edit the tables in use by your newmodule ===&lt;br /&gt;
&lt;br /&gt;
* edit [[#db/install.xml|db/install.xml]] manually by editing fields and or tables in the xml structure.&lt;br /&gt;
* go to Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and load the tables of your module&lt;br /&gt;
* ask to the XMLDB editor the snippets of code you need to add to [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* copy and paste in [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* in the line: &amp;lt;code php&amp;gt;if ($result &amp;amp;&amp;amp; $oldversion &amp;lt; xxxxxxxxxxxx)&amp;lt;/code&amp;gt; (replace xxxxxxxxxxxx with the version number you are going to give to your newmodule)&lt;br /&gt;
* change (increase) the version number&lt;br /&gt;
* visit the Moodle notification page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a single line to logs from your newmodule ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
add_to_log($course-&amp;gt;id, &#039;newmodule&#039;, &#039;&amp;lt;&amp;lt;action already listed in log_display&amp;gt;&amp;gt;&#039;, &amp;quot;view.php?id=$cm-&amp;gt;id&amp;quot;, &amp;quot;$newmodule-&amp;gt;id&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ensure that remote user will not be able to contact your pages by typing their URL directly in the address bar ===&lt;br /&gt;
&lt;br /&gt;
as first line of each of your php script&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!defined(&#039;MOODLE_INTERNAL&#039;)) {&lt;br /&gt;
    die(&#039;Direct access to this script is forbidden.&#039;); // It must be included from a Moodle page&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some suggestion I find useful==&lt;br /&gt;
&#039;&#039;&#039;To include php scripts&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;myscript.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To include php library&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;locallib.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To periodically execute function newmodule_cron()&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;$module-&amp;gt;cron = xxxx;&amp;lt;/pre&amp;gt;&lt;br /&gt;
providing some code in: &amp;lt;pre&amp;gt;function newmodule_cron()&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your function newmodule_cron() will be executed about each xxxx seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not include config when it is not needed&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;config.php&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
is not needed in library scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use global $cm or $newmodule in your function&#039;&#039;&#039;&lt;br /&gt;
but use proper function parameters.&lt;br /&gt;
&lt;br /&gt;
So, never use:&lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky() {&lt;br /&gt;
    global $cm, $newmodule;&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
but use: &lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky($cm, $newmodule) {&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://dev.moodle.org/course/view.php?id=2 Moodle Developers&#039; Course]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
* [[Development:Places to search for lang strings|Where to put language strings for your plugin]]&lt;br /&gt;
* [[Development:Installing and upgrading plugin database tables|Defining the database tables for your plugin]]&lt;br /&gt;
&lt;br /&gt;
{{CategoryDeveloper}}&lt;br /&gt;
[[Category:Developer|Modules]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77028</id>
		<title>Development:NEWMODULE Documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:NEWMODULE_Documentation&amp;diff=77028"/>
		<updated>2010-10-24T18:58:16Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: just a little wikification&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Work in progress}}&lt;br /&gt;
{{New_Module}}&lt;br /&gt;
This first draft of Moodle Docs page about the creation of  a new module is divided into the some sections. See block NEWMODULE at right side.&lt;br /&gt;
&lt;br /&gt;
=Getting started=&lt;br /&gt;
&lt;br /&gt;
== Base module folder content ==&lt;br /&gt;
To download the newmodule package, please refer to:&lt;br /&gt;
:* 1.8: http://download.moodle.org/plugins18/mod/NEWMODULE.zip&lt;br /&gt;
:* 1.9: http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
:* HEAD: http://download.moodle.org/plugins/mod/NEWMODULE.zip&lt;br /&gt;
&lt;br /&gt;
Although you can download the newmodule package for moodle 1.8, such as 1.9 and head, this tutorial is intended for the newmodule development in Moodle 1.9 ONLY.&lt;br /&gt;
&lt;br /&gt;
Let&#039;s start by getting an idea about what you find in the newmodule folder taken from http://download.moodle.org/plugins19/mod/NEWMODULE.zip&lt;br /&gt;
# db/install.xml&lt;br /&gt;
# db/upgrade.php&lt;br /&gt;
# icon.gif&lt;br /&gt;
# index.php&lt;br /&gt;
# lang/en_utf8/help/newmodule/index.html&lt;br /&gt;
# lang/en_utf8/help/newmodule/mods.html&lt;br /&gt;
# lang/en_utf8/newmodule.php&lt;br /&gt;
# lib.php&lt;br /&gt;
# mod_form.php&lt;br /&gt;
# README.txt&lt;br /&gt;
# version.php&lt;br /&gt;
# view.php&lt;br /&gt;
&lt;br /&gt;
The path where you find each file is the correct one. So don&#039;t change the path of files and folders in this newmodule package.&lt;br /&gt;
&lt;br /&gt;
Inside the db folder, at the beginning, you can only find install.xml and upgrade.php but sooner you will start to always add the new file &amp;quot;access.php&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== db/install.xml === &lt;br /&gt;
&#039;&#039;db/install.xml&#039;&#039; is the file to write the xml describing the tables needed by the module.&lt;br /&gt;
Tables are at least two, first named with the same name of the module, second named &amp;quot;log_display&amp;quot;. &lt;br /&gt;
They follow a strict syntax that you can learn by editing one of the several example you can find inside moodle modules. &lt;br /&gt;
Ultimately the only thing to take care is the &amp;lt;&amp;lt;previous&amp;gt;&amp;gt; &amp;lt;&amp;lt;next&amp;gt;&amp;gt; connection between tables and fields.&lt;br /&gt;
This is the mandatory file where you MUST write the structure of the tables your module is going to use. &lt;br /&gt;
The table &amp;quot;log_display&amp;quot; is the tables where you are requested to list all the &amp;quot;actions&amp;quot; that you will add to the logs of your module.&lt;br /&gt;
&lt;br /&gt;
=== db/upgrade.php ===&lt;br /&gt;
&#039;&#039;db/upgrade.php&#039;&#039; is the file that you will write each time you need to change the structure of the tables of your module.&lt;br /&gt;
&lt;br /&gt;
To learn how to write this file, please refer to the examples you may find in the file itself.&lt;br /&gt;
&lt;br /&gt;
=== icon.gif ===&lt;br /&gt;
It is a 16px per 16px icon identifying each instance of your module in the frame of a course.&lt;br /&gt;
&lt;br /&gt;
=== index.php ===&lt;br /&gt;
&#039;&#039;index.php&#039;&#039; is a page to list all instances of the functionality the module provides in a course.&lt;br /&gt;
&lt;br /&gt;
=== lang ===&lt;br /&gt;
&#039;&#039;lang&#039;&#039; is the folder reserved to language packs. A module language pack is a folder named &amp;quot;xx_utf8&amp;quot; containing, in turn, a folder named &amp;quot;help&amp;quot; and a language file named with the same name of the module. xx is the two char long name of the language, i.e. en, de, es, it, fr and so forth.&lt;br /&gt;
&lt;br /&gt;
Each language file is dedicated to a specific language. The lang folder may contain as much language packs as provided by different translators. The lang/xx_utf8/newmodule/ folder contains all the help files you want to provide to your module. In order to link a help file from inside the code of your module pages try:&lt;br /&gt;
&amp;lt;code php&amp;gt; helpbutton(&#039;&amp;lt;&amp;lt;name of your help file saved in lang/xx_utf8/newmodule/&amp;gt;&amp;gt;&#039;, get_string(&#039;your_string&#039;,&#039;newmodule&#039;), &#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
:or, in mod_form.php,&lt;br /&gt;
&amp;lt;code php&amp;gt;$mform-&amp;gt;setHelpButton &amp;lt;/code&amp;gt; as stated in&lt;br /&gt;
&lt;br /&gt;
=== lib.php ===&lt;br /&gt;
&#039;&#039;[[lib.php]]&#039;&#039; is the pre-filled file with &amp;quot;core&amp;quot; functions needed by each module.&lt;br /&gt;
&lt;br /&gt;
Almost all newmodule functions go here. Each of them must have a name that starts with newmodule_&lt;br /&gt;
This file should have two well differenced parts:&lt;br /&gt;
* All the core Moodle functions, neeeded to allow the module to work integrated in Moodle.&lt;br /&gt;
* All the newmodule specific functions, needed to implement all the module logic. &lt;br /&gt;
&lt;br /&gt;
Please, note that, if the module become complex and this lib grows a lot, it&#039;s HIGHLY recommended to move all these module specific functions to a new php file, called &amp;quot;locallib.php&amp;quot; (see forum, quiz...). This will help to save some memory when Moodle is performing actions across all modules.&lt;br /&gt;
&lt;br /&gt;
There are convention to name functions into lib.php and locallib.php. See: &lt;br /&gt;
* [[Development:Coding_style#Functions_and_Methods]]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
&lt;br /&gt;
There are some details just above the each function in lib.php.&lt;br /&gt;
&lt;br /&gt;
Mandatory function are, at least:&lt;br /&gt;
&lt;br /&gt;
Module instance editing form handlers, that called from [http://xref.moodle.org/course/mod.php.source.html /course/mod.php] or [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php]:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_add_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is after an editing teacher &#039;&#039;create an instance&#039;&#039; of newmodule.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_update_instance($newmodule)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;update an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_delete_instance($id)&#039;&#039;&#039;&lt;br /&gt;
This function is executed after an editing teacher &#039;&#039;delete an instance&#039;&#039; of newmodule&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_outline()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_user_complete($course, $user, $mod, $newmodule)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_print_recent_activity($course, $isteacher, $timestart)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_cron()&#039;&#039;&#039;&lt;br /&gt;
Take care with this function. Differently by all the other functions, this function is not called by passing it the $newmodule record. This means that this function, called by moodle core cron has to look for each newmodule instance id before operating.&lt;br /&gt;
&lt;br /&gt;
Don&#039;t worry, even if you have more than a single instance of your module among moodle courses, this function will be executed just one time.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_participants($newmoduleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used($newmoduleid, $scaleid)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_scale_used_anywhere($scaleid)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_install()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_uninstall()&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some more functions should be added:&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_definition(&amp;amp;$mform)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_course_form_defaults($course)&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_reset_userdata($data)&#039;&#039;&#039;&lt;br /&gt;
These three functions are responsible for the newmodule reset process during the more general course reset process. Please, refer to [[mod/data/lib.php]] or to [[mod/feedback/lib.php]], for instance, to understand them better.&lt;br /&gt;
&lt;br /&gt;
Two more functions should be added to lib.php are:&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_view_actions()&#039;&#039;&#039;&lt;br /&gt;
*&#039;&#039;&#039;function newmodule_get_post_actions()&#039;&#039;&#039;&lt;br /&gt;
They distinguish between &amp;quot;read&amp;quot; and &amp;quot;post&amp;quot; log actions. These functions are used by moodle core during log gather.&lt;br /&gt;
The actions you list inside these two functions, must match the ones you listed in the table &amp;quot;log_display&amp;quot; in install.xml&lt;br /&gt;
&lt;br /&gt;
==== Connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039; ====&lt;br /&gt;
One important issue is about the connection between &#039;&#039;&#039;lib.php&#039;&#039;&#039; and &#039;&#039;&#039;locallib.php&#039;&#039;&#039;. Who has to call the other, how and why?&lt;br /&gt;
It has to be locallib.php to call lib.php through: &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  require_once(&amp;quot;$CFG-&amp;gt;dirroot/mod/newmodule/lib.php&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
as first line.&lt;br /&gt;
&lt;br /&gt;
In this way, if moodle core calls function inside mod/newmodule/lib.php no module specific function will be loaded in memory.&lt;br /&gt;
If it is your newmodule to call a function, it has to require_once(&#039;locallib.php&#039;); that, in turn, will require_once(&#039;lib.php&#039;) so that your module will &amp;quot;see&amp;quot; all its available functions.&lt;br /&gt;
&lt;br /&gt;
=== mod_form.php ===&lt;br /&gt;
&#039;&#039;mod_form.php&#039;&#039; is the file describing the form you get at the module instance creation or at the instance editing time.&lt;br /&gt;
The syntax is very simple and by reading the file it is simple to change it on your need.&lt;br /&gt;
&lt;br /&gt;
It uses the syntax you can learn in https://docs.moodle.org/en/Development:lib/formslib.php_Form_Definition. This file used only from [http://xref.moodle.org/course/modedit.php.source.html /course/modedit.php].&lt;br /&gt;
&lt;br /&gt;
At date, there is a missing detail by the end of the file.&lt;br /&gt;
:You can read:&lt;br /&gt;
&amp;lt;pre&amp;gt;//------------------------------------------------------------------------------&lt;br /&gt;
        // add standard elements, common to all modules&lt;br /&gt;
        $this-&amp;gt;standard_coursemodule_elements();&lt;br /&gt;
//------------------------------------------------------------------------------&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This part is responsible for the common modules section at the end of your newmodule editing instance page. (the section related to groups)&lt;br /&gt;
:This code can be customized by changing it as described below:&lt;br /&gt;
&amp;lt;pre&amp;gt;//------------------------------------------------------------------------------&lt;br /&gt;
        // add standard elements, common to all modules&lt;br /&gt;
        $features = new object();&lt;br /&gt;
        $features-&amp;gt;groups           = false;&lt;br /&gt;
        $features-&amp;gt;groupings        = false;&lt;br /&gt;
        $features-&amp;gt;groupmembersonly = true;&lt;br /&gt;
        $this-&amp;gt;standard_coursemodule_elements($features);&lt;br /&gt;
//------------------------------------------------------------------------------&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
One more tip about this file.&lt;br /&gt;
:Once you submit the form described by this file, your module executes the function: &#039;&#039;newmodule_add_instance&#039;&#039; or &#039;&#039;newmodule_update_instance&#039;&#039; both pre-written in &#039;&#039;lib.php&#039;&#039;.&lt;br /&gt;
:It seems that check boxes in the editing instance form don&#039;t work. To test this, please verify the passed parameter $newmodule inside your function &#039;&#039;newmodule_update_instance&#039;&#039; through a simple: &amp;lt;code php&amp;gt;print_object($newmodule);&amp;lt;/code&amp;gt;&lt;br /&gt;
:You will find that even by selecting or unselecting the check box in the newmodule instance editing form, the corresponding value in the array doesn&#039;t change. This is not an error, but at least a lack of code.&lt;br /&gt;
:By adding a simple code like:&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$checkboxes = array(&#039;myfirstcheckboxfield&#039;, &#039;mysecondcheckboxfield&#039;, and so fort with all your checkbox field);&lt;br /&gt;
foreach ($checkboxes as $checkbox) {&lt;br /&gt;
    if (empty($newmodule-&amp;gt;{$checkbox})) {&lt;br /&gt;
        $newmodule-&amp;gt;{$checkbox} = 0;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
:at the beginning of both functions, you will find that all works fine.&lt;br /&gt;
&lt;br /&gt;
=== README.txt ===&lt;br /&gt;
This is the file where you are welcome to write what your newmodule does.&lt;br /&gt;
&lt;br /&gt;
=== version.php ===&lt;br /&gt;
&#039;&#039;version.php&#039;&#039; is a really very simple file as simple as important.&lt;br /&gt;
&lt;br /&gt;
To understand why it is important, you need to know that there are a bunch of actions that moodle performs for your newmodule ONLY (with only one exception) at the newmodule installation. They are, at least, db tables editing and load of capability. If during the development of your module (that you already installed on your development environment or that you already shared with remote users) you need to change the structure of your newmodule tables or you need to change the capability used by your newmodule, you need to force moodle to edit tables and reload capability.&lt;br /&gt;
&lt;br /&gt;
This is done by:&lt;br /&gt;
* adding the proper code in newmodule/db/upgrade.php (to do this, use XMLDB as stated in this same page below)&lt;br /&gt;
* increasing the newmodule version in version.php&lt;br /&gt;
* visiting the notification page of your installation of Moodle&lt;br /&gt;
&lt;br /&gt;
=== view.php ===&lt;br /&gt;
This is the first executed code of your module. By selecting the link of the instance of your module, the code of newmodule/view.php is executed.&lt;br /&gt;
&lt;br /&gt;
== Some very important missing files ==&lt;br /&gt;
There are five files that are not present in the newmodule package that 90% of times you will go to add to your newmodule.&lt;br /&gt;
&lt;br /&gt;
1. The first one is locallib.php already described before.&lt;br /&gt;
&lt;br /&gt;
2. The second one is access.php that has to be saved inside newmodule/db/ folder.&lt;br /&gt;
:In this file you will add all the capability used by your newmodule and loaded at the installation time or upgrade time. To learn the syntax of the capability, please refer to the same file in other modules or to: https://docs.moodle.org/en/Development:NEWMODULE_Adding_capabilities&lt;br /&gt;
3. The third missing file must be added to newmodule/ folder. It is settings.php and describes the form that can be accessed from: Site Administration block -&amp;gt; Modules -&amp;gt; Activities -&amp;gt; &amp;lt;&amp;lt;your newmodule name&amp;gt;&amp;gt;&lt;br /&gt;
:This form stores general settings for your newmodule into the site wide $CFG object. Because of this, it is strongly recommended to give to your newmodule general settings with names starting with &amp;quot;newmodule_&amp;quot;. This file is useful when there is a setting that doesn&#039;t depend from the instance. I.e., if your newmodule simulates a telephone, you will probably save your telephone number in this newmodule setting site wide form instead of typing it each time you add a new instance of your newmodule into a course. In this case, to refer to you telephone number inside your newmodule you will use: $CFG-&amp;gt;newmodule_telephonenumber&lt;br /&gt;
4. Directly in the newmodule folder, you need to add backuplib.php that is responsible for the backup of each instance of your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
5. Again in the newmodule folder, you need to add restorelib.php that is responsible for the restore of each instance your module and of its log.&lt;br /&gt;
:To learn how to code it, start by stealing it from some other module and read it.&lt;br /&gt;
&lt;br /&gt;
==Let&#039;s start==&lt;br /&gt;
To start using a downloaded package, please perform the 7 actions described in [[Development:NEWMODULE_Tutorial]] in &#039;&#039;How to Begin the Creation of a New Module&#039;&#039; paragraph.&lt;br /&gt;
&lt;br /&gt;
Then, draw the structure of your tables on a sheet, edit the file db/install.xml according to your project, save, put your renamed newmodule folder in moodle/mod/ and visit the moodle notification page.&lt;br /&gt;
&lt;br /&gt;
To add code to db/upgrade.php never do it manually. I always make use of Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and I ask it to write the code for me. It never fails.&lt;br /&gt;
&lt;br /&gt;
Please remember: within your module, never use &amp;quot;embedded messages&amp;quot; like:&lt;br /&gt;
&amp;lt;pre&amp;gt;echo &#039;Welcome to this newmodule&#039;;&amp;lt;/pre&amp;gt;&lt;br /&gt;
but make use of get_string or print_string. In this way your module will be multilang with a really small effort.&lt;br /&gt;
Use, for instance:&lt;br /&gt;
&amp;lt;code php&amp;gt;print_string(&#039;welcomemessage&#039;,&#039;newmodule&#039;);&amp;lt;/code&amp;gt;&lt;br /&gt;
saving in newmodule/lang/en_utf8/newmodule.php&lt;br /&gt;
&amp;lt;code php&amp;gt;$string[&#039;welcomemessage&#039;] = &#039;Welcome to this newmodule&#039;;&amp;lt;/code&amp;gt;&lt;br /&gt;
==Some code snippets that I find useful==&lt;br /&gt;
&lt;br /&gt;
=== Check the capability of a user ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (newmodule_hascapabilitytodothis()) {&lt;br /&gt;
    //user is allowed&lt;br /&gt;
} else {&lt;br /&gt;
    // user is not allowed&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in locallib.php&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
function newmodule_hascapabilitytodothis($cm) {&lt;br /&gt;
    $context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id);&lt;br /&gt;
&lt;br /&gt;
    return (has_capability(&#039;mod/newmodule:candothis&#039;, $context));&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
typing in db/access.php&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$mod_newmodule_capabilities = array(&lt;br /&gt;
    &#039;mod/newmodule:candothis&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;captype&#039; =&amp;gt; &#039;read&#039;,&lt;br /&gt;
        &#039;contextlevel&#039; =&amp;gt; CONTEXT_MODULE,&lt;br /&gt;
        &#039;legacy&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;teacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;editingteacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;admin&#039; =&amp;gt; CAP_ALLOW&lt;br /&gt;
        )&lt;br /&gt;
    )&lt;br /&gt;
)&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Edit the tables in use by your newmodule ===&lt;br /&gt;
&lt;br /&gt;
* edit [[#db/install.xml|db/install.xml]] manually by editing fields and or tables in the xml structure.&lt;br /&gt;
* go to Site Administration block -&amp;gt; Miscellaneous -&amp;gt; XMLDB editor and load the tables of your module&lt;br /&gt;
* ask to the XMLDB editor the snippets of code you need to add to [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* copy and paste in [[#db/upgrade.php|db/upgrade.php]]&lt;br /&gt;
* in the line: &amp;lt;code php&amp;gt;if ($result &amp;amp;&amp;amp; $oldversion &amp;lt; xxxxxxxxxxxx)&amp;lt;/code&amp;gt; (replace xxxxxxxxxxxx with the version number you are going to give to your newmodule)&lt;br /&gt;
* change (increase) the version number&lt;br /&gt;
* visit the Moodle notification page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Add a single line to logs from your newmodule ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
add_to_log($course-&amp;gt;id, &#039;newmodule&#039;, &#039;&amp;lt;&amp;lt;action already listed in log_display&amp;gt;&amp;gt;&#039;, &amp;quot;view.php?id=$cm-&amp;gt;id&amp;quot;, &amp;quot;$newmodule-&amp;gt;id&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Ensure that remote user will not be able to contact your pages by typing their URL directly in the address bar ===&lt;br /&gt;
&lt;br /&gt;
as first line of each of your php script&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
if (!defined(&#039;MOODLE_INTERNAL&#039;)) {&lt;br /&gt;
    die(&#039;Direct access to this script is forbidden.&#039;); // It must be included from a Moodle page&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Some suggestion I find useful==&lt;br /&gt;
&#039;&#039;&#039;To include php scripts&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;myscript.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To include php library&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;locallib.php&#039;);&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;To periodically execute function newmodule_cron()&#039;&#039;&#039;, try:&lt;br /&gt;
&amp;lt;pre&amp;gt;$module-&amp;gt;cron = xxxx;&amp;lt;/pre&amp;gt;&lt;br /&gt;
providing some code in: &amp;lt;pre&amp;gt;function newmodule_cron()&amp;lt;/pre&amp;gt;&lt;br /&gt;
Your function newmodule_cron() will be executed about each xxxx seconds&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not include config when it is not needed&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;pre&amp;gt;require_once(&#039;config.php&#039;)&amp;lt;/pre&amp;gt;&lt;br /&gt;
is not needed in library scripts&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Do not use global $cm or $newmodule in your function&#039;&#039;&#039;&lt;br /&gt;
but use proper function parameters.&lt;br /&gt;
&lt;br /&gt;
So, never use:&lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky() {&lt;br /&gt;
    global $cm, $newmodule;&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
but use: &lt;br /&gt;
&amp;lt;pre&amp;gt;function newmodule_lookatthesky($cm, $newmodule) {&lt;br /&gt;
    &lt;br /&gt;
    // your stuff&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://dev.moodle.org/course/view.php?id=2 Moodle Developers&#039; Course]&lt;br /&gt;
* [[Development:Modules]]&lt;br /&gt;
* [[Development:Places to search for lang strings|Where to put language strings for your plugin]]&lt;br /&gt;
* [[Development:Installing and upgrading plugin database tables|Defining the database tables for your plugin]]&lt;br /&gt;
&lt;br /&gt;
{{CategoryDeveloper}}&lt;br /&gt;
[[Category:Developer|Modules]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:lib/formslib.php_Usage&amp;diff=76986</id>
		<title>Development:lib/formslib.php Usage</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:lib/formslib.php_Usage&amp;diff=76986"/>
		<updated>2010-10-22T20:50:54Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Usage of Formslib */ more readable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Formslib}}&lt;br /&gt;
==Usage of Formslib==&lt;br /&gt;
&lt;br /&gt;
There are many phpdoc style comments in lib/formslib.php&lt;br /&gt;
&lt;br /&gt;
course/edit.php and the included course/edit_form.php provide a good example of usage of this library.&lt;br /&gt;
&lt;br /&gt;
Also see the PEAR docs for [http://pear.php.net/package/HTML_QuickForm/ HTML_QuickForm docs] I found this [http://pear.php.net/manual/en/package.html.html-quickform.tutorial.php quick tutorial] and this [http://www.midnighthax.com/quickform.php slightly longer one] particularly useful.&lt;br /&gt;
&lt;br /&gt;
We created some special wrapper functions for moodle. Function $mform-&amp;gt;get_data() returns an object with the contents of the submitted data or returns null if no data has been submitted or validation fails.&lt;br /&gt;
&lt;br /&gt;
===Basic Usage in A Normal Page===&lt;br /&gt;
&lt;br /&gt;
Generally the structure of a page with a form on it looks like this :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
require_once(&#039;pathtoformdescription&#039;);&lt;br /&gt;
//you&#039;ll process some page parameters at the top here and get the info about&lt;br /&gt;
//what instance of your module and what course you&#039;re in etc. Make sure you&lt;br /&gt;
//include hidden variable in your forms which have their defaults set in set_data&lt;br /&gt;
//which pass these variables from page to page&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
$mform = new yourmod_formfunction_form();//name of the form you defined in file above.&lt;br /&gt;
//default &#039;action&#039; for form is strip_querystring(qualified_me())&lt;br /&gt;
if ($mform-&amp;gt;is_cancelled()){&lt;br /&gt;
    //you need this section if you have a cancel button on your form&lt;br /&gt;
    //here you tell php what to do if your user presses cancel&lt;br /&gt;
    //probably a redirect is called for!&lt;br /&gt;
} else if ($fromform=$mform-&amp;gt;get_data()){&lt;br /&gt;
//this branch is where you process validated data.&lt;br /&gt;
&lt;br /&gt;
} else {&lt;br /&gt;
// this branch is executed if the form is submitted but the data doesn&#039;t validate and the form should be redisplayed&lt;br /&gt;
// or on the first display of the form.&lt;br /&gt;
    //setup strings for heading&lt;br /&gt;
    print_header_simple($streditinga, &#039;&#039;,&lt;br /&gt;
     &amp;quot;&amp;lt;a href=\&amp;quot;$CFG-&amp;gt;wwwroot/mod/$module-&amp;gt;name/index.php?id=$course-&amp;gt;id\&amp;quot;&amp;gt;$strmodulenameplural&amp;lt;/a&amp;gt; -&amp;gt;&lt;br /&gt;
     $strnav $streditinga&amp;quot;, $mform-&amp;gt;focus(), &amp;quot;&amp;quot;, false);&lt;br /&gt;
    //notice use of $mform-&amp;gt;focus() above which puts the cursor &lt;br /&gt;
    //in the first form field or the first field with an error.&lt;br /&gt;
&lt;br /&gt;
    //call to print_heading_with_help or print_heading? then :&lt;br /&gt;
    &lt;br /&gt;
    //put data you want to fill out in the form into array $toform here then :&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;set_data($toform);&lt;br /&gt;
    $mform-&amp;gt;display();&lt;br /&gt;
    print_footer($course);&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Defining Your Form Class===&lt;br /&gt;
&lt;br /&gt;
The form class tells us about the structure of the form. You are encouraged to put this in a file called {function}_form.php probably in the same folder in which the page that uses it is located. The name of your class should be {modname}_{function}_form eg. forum_post_form or course_edit_form. These classes will extend class moodleform.&lt;br /&gt;
&lt;br /&gt;
Note the name you give the class is used as the id attribute of your form in html (any trailing &#039;_form&#039; is chopped off&#039;). Your form class name should be unique in order for it to be selectable in CSS by theme designers who may want to tweak the css just for that form.&lt;br /&gt;
&lt;br /&gt;
====definition()====&lt;br /&gt;
&lt;br /&gt;
[[Development:lib/formslib.php_Form_Definition|Help is here for defining your form]] by defining a function definition() in your form class that sets up your form structure.&lt;br /&gt;
&lt;br /&gt;
===Use in Activity Modules Add / Update Forms===&lt;br /&gt;
&lt;br /&gt;
Syntax is the same in activity modules to create your update / add page. We are still supporting mod.html but if you want to use the new formslib then you can in Moodle 1.8 just include in your module directory the file mod_form.php instead of mod.html and it will be automatically detected. Inside this file you define a class with class name &#039;{modname}__mod_form&#039; which extends the class &#039;moodleform_mod&#039;. See many examples of the core modules which have been converted to use formslib already.&lt;br /&gt;
&lt;br /&gt;
====defaults_preprocessing====&lt;br /&gt;
&lt;br /&gt;
For activity modules you use the same syntax to define your form. You may also want to override method defaults_preprocessing this can be used to take the data from the data base and tell the form how to fill out defaults in the form with this data. For example in the forum module in forum/mod_form.php we needed to tick an enable check box if a date had been selected in the date select. Normally data is loaded from the database and directly loaded into form fields with the same name as the database record you only need to use defaults_preprocessing if there isn&#039;t this one to one relationship. Another example is the lesson/mod_form.php which takes the data from the database and unserializes it. choice/mod_form.php shows an exampe of loading data from another db table referred to by a foreign key, to include in the form.&lt;br /&gt;
&lt;br /&gt;
====Post Processing Still Done in lib.php Functions====&lt;br /&gt;
&lt;br /&gt;
Post processing of data is done in lib.php functions modname_add_instance and modname_update_instance after the data has been validated. When migrating a form often little changes need to be made in the post processing. An exception is that date and date_time_selector fields automatically have their submitted data turned into timestamps so you don&#039;t need to do this in your add and update functions anymore.&lt;br /&gt;
&lt;br /&gt;
====Automatically Including Standard Activity Module Form Elements====&lt;br /&gt;
&lt;br /&gt;
Standard activity module form elements are automatically included using the moodleform_mod method standard_coursemodule_elements(). The default is to include a visibility and groupsmode select box and to include all necessary hidden fields. You can pass a parameter false to tell the method that your module doesn&#039;t support groups and so you don&#039;t want the groupsmode select button.&lt;br /&gt;
&lt;br /&gt;
[[Category:Formslib]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Notes&amp;diff=76337</id>
		<title>Notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Notes&amp;diff=76337"/>
		<updated>2010-09-30T21:24:48Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: miscopying&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.9}}From Moodle 1.9 onwards, teachers may add notes about their students.&lt;br /&gt;
&lt;br /&gt;
The notes page may be accessed via the Notes tab in a user&#039;s profile page or the Notes tab on the Participants page.&lt;br /&gt;
&lt;br /&gt;
==Note status==&lt;br /&gt;
&lt;br /&gt;
A note&#039;s status determines who can see the note.&lt;br /&gt;
&lt;br /&gt;
* Personal - The note will be visible only to you (as the teacher)&lt;br /&gt;
* Course - The note will be visible to other teachers in this course (users with [[Capabilities/moodle/notes:view|notes:view]] capability in this course)&lt;br /&gt;
* Site - The note will be visible to other teachers in all courses (users with [[Capabilities/moodle/notes:view|notes:view]] capability in any course)&lt;br /&gt;
&lt;br /&gt;
==Tips and tricks==&lt;br /&gt;
&lt;br /&gt;
* Enable/disable notes: iIn Moodle 1.9.4 onwards, notes may be disabled by unticking the &#039;&#039;enablenotes&#039;&#039; checkbox in &#039;&#039;Administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://www.youtube.com/watch?v=cS2tBi-ct5k Moodle 1.9 Notes Tutorial video]&lt;br /&gt;
&lt;br /&gt;
[[Category:Notes]]&lt;br /&gt;
&lt;br /&gt;
[[ca:notes/index|Anotacions]]&lt;br /&gt;
[[de:Anmerkungen]]&lt;br /&gt;
[[eu:Oharrak]]&lt;br /&gt;
[[fr:Annotations]]&lt;br /&gt;
[[ja:ノート]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Notes&amp;diff=76336</id>
		<title>Notes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Notes&amp;diff=76336"/>
		<updated>2010-09-30T21:23:39Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: is it right?&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 1.9}}From Moodle 1.9 onwards, teachers may add notes about their students.&lt;br /&gt;
&lt;br /&gt;
The notes page may be accessed via the Notes tab in a user&#039;s profile page or the Notes tab on the Participants page.&lt;br /&gt;
&lt;br /&gt;
==Note status==&lt;br /&gt;
&lt;br /&gt;
A note&#039;s status determines who can see the note.&lt;br /&gt;
&lt;br /&gt;
* Personal - The note will be visible only to you (as the teacher)&lt;br /&gt;
* Course - The note will be visible to other teachers in this course (users with [[Capabilities/moodle/notes:view|notes:view]] capability in this course)&lt;br /&gt;
* Site - The note will be visible to other teachers in all courses (&lt;br /&gt;
* Course - The note will be visible to other teachers in this course (users with [[Capabilities/moodle/notes:view|notes:view]] capability in any course)&lt;br /&gt;
&lt;br /&gt;
==Tips and tricks==&lt;br /&gt;
&lt;br /&gt;
* Enable/disable notes: iIn Moodle 1.9.4 onwards, notes may be disabled by unticking the &#039;&#039;enablenotes&#039;&#039; checkbox in &#039;&#039;Administration &amp;gt; Security &amp;gt; [[Site policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://www.youtube.com/watch?v=cS2tBi-ct5k Moodle 1.9 Notes Tutorial video]&lt;br /&gt;
&lt;br /&gt;
[[Category:Notes]]&lt;br /&gt;
&lt;br /&gt;
[[ca:notes/index|Anotacions]]&lt;br /&gt;
[[de:Anmerkungen]]&lt;br /&gt;
[[eu:Oharrak]]&lt;br /&gt;
[[fr:Annotations]]&lt;br /&gt;
[[ja:ノート]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Calendar&amp;diff=61723</id>
		<title>Calendar</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Calendar&amp;diff=61723"/>
		<updated>2009-08-18T09:20:19Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: grouping lines about groups and separating lines about activities&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Calendar}}&lt;br /&gt;
&lt;br /&gt;
The Calendar displays the following events:&lt;br /&gt;
&lt;br /&gt;
* Site (event viewable in all courses - created by admin users)&lt;br /&gt;
* Course (event viewable only to course members - created by teachers)&lt;br /&gt;
* Groups (event viewable only by members of a group - created by teachers)&lt;br /&gt;
* User (personal event a student user can create - viewable only by the user)&lt;br /&gt;
&lt;br /&gt;
Adding closing dates to [[course activities]] — [[assignment]]s, [[forum]]s, [[quizz]]es, etc. will cause them to show up in the [[Calendar block|calendar block]] as course events.&lt;br /&gt;
&lt;br /&gt;
You can view previous or future months on Calendar by clicking the left/right arrows next to the current month&#039;s name. The current date is outlined. &lt;br /&gt;
&lt;br /&gt;
Events are added to the calendar, and can be aimed at individual users, your defined groups, or your courses. You can hide or show various categories of events by clicking on the color key below the calendar. This can make the calendar easier to read (especially if there are many events on the calendar). For example, if you wanted to hide Group event dates (events assigned to learner Groups you create), click &amp;quot;Group events&amp;quot; on the bottom of the Calendar. This would hide all group events, and the color code would disappear from the link on the calendar. To show the events again, click the Group Events link again.&lt;br /&gt;
&lt;br /&gt;
Both the daily detail screen and the monthly detail screen have the Preferences button in the upper right. This button leads to a screen like this: The last two settings (&#039;Maximum upcoming events&#039; and &#039;Upcoming events look-ahead&#039;) affect how the Upcoming Events block displays information. You may change any of these settings to suit your class needs. When you have finished any changes, click Save changes. &lt;br /&gt;
&lt;br /&gt;
Both the daily and monthly detail screens have the New Event button. This allows you to manually add events for your classes (remember that the system will automatically add due dates for assignments, quizzes, etc. when you create those activities). &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Calendar FAQ]]&lt;br /&gt;
*[http://www.youtube.com/watch?v=Rwst4lSNniw Video on using the Moodle calendar]&lt;br /&gt;
*[[Calendar settings]] for administrators&lt;br /&gt;
&lt;br /&gt;
[[fr:Calendrier]]&lt;br /&gt;
[[ca:Calendari]]&lt;br /&gt;
[[de:Kalender]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=58445</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=58445"/>
		<updated>2009-06-19T16:30:34Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Troubleshooting */ eAccelerator&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Complete install packages are available from [http://download.moodle.org/ Moodle Downloads], located on a tab for each of the operating systems.  The packages are designed for new installations on a server or standalone computer. Please note the standard distributions only contain the Moodle code.&lt;br /&gt;
&lt;br /&gt;
This document provides instructions for using the Windows packages. Separate instructions are available for [[Complete Install Packages for Mac OS X|Mac OS X packages]].&lt;br /&gt;
&lt;br /&gt;
For installation on a Windows 2000 or Windows 2003 server it is good practice to perform a manual install (see the manual installation section in [[Windows_installation|Windows Installation]]). &lt;br /&gt;
&lt;br /&gt;
After installing the Windows package, note that there are other downloads (e.g. additional modules and plugins) that may involve more customization of configuration files.&lt;br /&gt;
&lt;br /&gt;
The complete install packages allow Moodle to be installed, along with the prerequisites that includes a web server, database and scripting language (Apache, MySQL and PHP in this case). Several versions of the complete install package are available. The instructions on the download page provide guidance on which version is likely to be most suitable.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; The latest complete install package version components, may not be backwardly compatible. Always check version compatibility of each component if you intend to develop materials on a later version of Moodle than the version installed on your &amp;quot;main&amp;quot; Moodle site.  In short, complete install packages are designed for first time install on a &amp;quot;clean&amp;quot; machine.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
:*256 MB RAM (minimum), 512 MB RAM (recommended)&lt;br /&gt;
:*160 MB free Fixed Disk (more space will be needed depending on user uploads)&lt;br /&gt;
:*Windows 98/ME (minimum)&lt;br /&gt;
:*Windows NT/2000/XP (recommended)&lt;br /&gt;
&lt;br /&gt;
==Install complete package process==&lt;br /&gt;
The complete install package is a zip file that contains a webserver called [[Apache]], plus Moodle and Moodle&#039;s required [[MySQL]] database and [[PHP]] program. &lt;br /&gt;
&lt;br /&gt;
There are three basic parts to the this install process.  &lt;br /&gt;
#Download and unpack the complete install package. &lt;br /&gt;
#Start the webserver. &lt;br /&gt;
#Install Moodle using a web browser.&lt;br /&gt;
&lt;br /&gt;
===First create file structure===&lt;br /&gt;
====Download the package====&lt;br /&gt;
[http://download.moodle.org/windows Download Windows] packed-zip file from Moodle.&lt;br /&gt;
[[Image:Moodle Setup zipfile.jpg|frame|center|A downloaded complete install package Windows 1.9 zip file in Windows Explorer]]&lt;br /&gt;
 &lt;br /&gt;
====Unpack the package====&lt;br /&gt;
Unpack (extract files by clicking on) the zip file you downloaded to a drive or partition of your choice. The extract process will create three files (&amp;quot;Start Moodle&amp;quot;, &amp;quot;Stop Moodle&amp;quot;, and &amp;quot;README&amp;quot;) and a subfolder called &amp;quot;server&amp;quot;. &lt;br /&gt;
*Do NOT rename the &amp;quot;server&amp;quot; subfolder  &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; There will also be a folder under this server subfolder, called \moodle that holds the Moodle program.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Create a folder and extract the files there.  For example, you might have one folder called Moodle193 and another one called Moodle187 for different versions or purposes.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Make path to &amp;quot;server&amp;quot; subfolder simple. Best way if it will be in drive root. Like &amp;quot;D:\moodle193\server&amp;quot;. Long path especially with any strange symbols can make XAMPP not working properly.&lt;br /&gt;
&lt;br /&gt;
===Second - start the webserver===&lt;br /&gt;
Now you are ready to start the webserver.  Use the &amp;quot;Start Moodle.exe&amp;quot; file which you should find in the top directory. Once the &amp;quot;Start Moodle.exe&amp;quot; program is open, don&#039;t close it, use &amp;quot;Stop Moodle.exe&amp;quot; for that purpose.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; These programs control both Apache and MySQL programs that operate the webserver.  Some sites will individually start and stop Apache and MySQL with the Xampp bat files found in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Alternatively, on a stand alone computer with several potential webservers that might be running, you can use the &amp;quot;xampp_restart.exe&amp;quot; file in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; You can also add shortcuts to the commands that start and stop the site in your Windows &amp;quot;start&amp;quot; menu.&lt;br /&gt;
 &lt;br /&gt;
Now you are ready to start the Moodle installation.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Warning:&#039;&#039; Windows XP requires the msvcr71.dll library file in order to run Xampp. Installing the [http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en .Net 1.1 framework] (not .Net 2.0 and upper) could resolve it. You can also search for the file on Google, download it and copy it into the server/apache/bin folder.&lt;br /&gt;
&lt;br /&gt;
===Third - start Moodle installation===&lt;br /&gt;
Start your web browser and type &amp;lt;nowiki&amp;gt; localhost, or  http://127.0.0.1 or http://localhost &amp;lt;/nowiki&amp;gt;in the address bar. You will either start your first time Moodle installation or if it is already installed you will enter the Moodle site&#039;s [[Front Page]] or Login screen.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
[[Image:Moodle_Setup_localhost_browser.jpg|frame|center|A browser&#039;s addressbar showing &amp;quot;localhost&amp;quot;. Click on  the green Goto arrow will go to the installed Moodle site.]]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
====Set language====&lt;br /&gt;
The initial install page will be displayed after you type &amp;quot;localhost&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:C Install Windows 1.png|thumb|center|600px|Set initial language]]&lt;br /&gt;
&lt;br /&gt;
*Choose your preferred language (English is used in this example) and click the “Next” button.&lt;br /&gt;
&lt;br /&gt;
====Diagnostic results====&lt;br /&gt;
A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.&lt;br /&gt;
[[Image:Complete Windows Install 2.png|thumb|center|546px|Moodle liked and gave a Pass ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
====Moodle paths====&lt;br /&gt;
The paths for your Moodle installation are shown – accept the ones that are shown on your screen.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 3.png|thumb|center|600px|Installation paths]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Database configuration====&lt;br /&gt;
What you enter in the &amp;quot;Host Server&amp;quot; field depends on what you intend to use the new Moodle installation for. &lt;br /&gt;
If you are just going to use it for local testing, then use &#039;localhost&#039;. &lt;br /&gt;
If you are going to test the new installation on a LAN, and will be accessing it from other machines on that LAN, then put the private IP address or network name of the serving machine, followed by a forward slash and moodle: Host Server - 192.168.1.1/moodle&lt;br /&gt;
If you are going to test the installation on the internet, then you will need to put the public ip address followed by a forward slash and moodle: your_ip_address/moodle or you can put your domain name here instead.&lt;br /&gt;
&lt;br /&gt;
*In the next fields, we enter the database settings. The fields are populated with some suggested values.&lt;br /&gt;
&lt;br /&gt;
*We strongly recommend you place a user name and password in this screen. (Don&#039;t forget them).&lt;br /&gt;
&lt;br /&gt;
*DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY&lt;br /&gt;
[[image:Complete install Windows 4.png|thumb|center|535px|Installation&#039;s database settings]]&lt;br /&gt;
&lt;br /&gt;
*When the fields have been populated, click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Check server====&lt;br /&gt;
The install process checks the server it installed.&lt;br /&gt;
[[image:Complete install Windows 5.png|thumb|center|535px|Check server environment screen]]&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Confirm initial language pack====&lt;br /&gt;
Moodle will now check to see if the language pack is available for the language you selected at the first step.  If it is not, Moodle will continue with the install in English.&lt;br /&gt;
[[image:Complete install Windows 6.png|thumb|center|535px|Language pack check]]&lt;br /&gt;
&lt;br /&gt;
====Confirm config.php====&lt;br /&gt;
Provided the Moodle folder is writable, a message confirming the configuration has been completed will be displayed.&lt;br /&gt;
[[image:Complete install Windows 7.png|thumb|center|549px|Confirmation that config.php has been created]]&lt;br /&gt;
&lt;br /&gt;
*Click the “ Continue” button to proceed.&lt;br /&gt;
&lt;br /&gt;
====Moodle copyright &amp;amp; agreement====&lt;br /&gt;
The Moodle copyright / license notices are displayed.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 8.png|thumb|center|400px|Copyright notice and agreement]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Yes” button to continue.  &lt;br /&gt;
&lt;br /&gt;
====Current release and unattended option====&lt;br /&gt;
The current release information is shown. &lt;br /&gt;
&#039;&#039;&#039;Check off the unattended operations box&#039;&#039;&#039;. This will automatically advance through many screens.  If you would like to watch the install screen by screen, do not check this box and be prepared to press the &amp;quot;continute button&amp;quot; many times.&lt;br /&gt;
 &lt;br /&gt;
*Click the &amp;quot;Continue&amp;quot; button and wait.&lt;br /&gt;
[[Image:Complete install Windows 9.png|thumb|center|600px|Current release and &amp;quot;unattended&amp;quot; check box]]&lt;br /&gt;
&lt;br /&gt;
====Installation modules and blocks screens====&lt;br /&gt;
In most cases this will be followed by a series of screens that have a continue button on the bottom.  This process stops with Admin user profile settings which needs to be filled out.&lt;br /&gt;
&lt;br /&gt;
====Administrator user profile====&lt;br /&gt;
[[Image:Complete install Windows 10.png|thumb|center|The administrator&#039;s users profile screen]]&lt;br /&gt;
&lt;br /&gt;
Fill out the required fields.&lt;br /&gt;
*Click on &amp;quot;Save&amp;quot; to continue&lt;br /&gt;
&lt;br /&gt;
====Front page settings====&lt;br /&gt;
The next screen is the Front Page settings page.  There are two parts to it.&lt;br /&gt;
The first part will ask for your Full site name and a short name for the navigation bar. There is also a place for a description. You can change these later.  &lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11a.png|thumb|center|The Moodle sites [[Front Page]] information]]&lt;br /&gt;
&lt;br /&gt;
The second part on the bottom instructs Moodle if you will disable the new user self [[authentication]] through email process.  The default is to disable.  This can be changed later in the [[Site administration block|site administration block]].&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11ba.png|thumb|center|500px|Determine if users can create their own profiles when they log onto the side via email self authentication]]&lt;br /&gt;
&lt;br /&gt;
*Click on &amp;quot;Save changes&amp;quot; button to go to Moodle sites home page.&lt;br /&gt;
&lt;br /&gt;
====Moodle on====&lt;br /&gt;
&#039;&#039;&#039;Now you are ready to Moodle !&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 12.png|thumb|center|Blank Front page of your new site]]&lt;br /&gt;
&lt;br /&gt;
The Site Administration block is on the left, the &amp;quot;Turn edit on&amp;quot; button in the upper right corner, withe the site description block just below it.&lt;br /&gt;
&lt;br /&gt;
===Congratulations - Moodle has been installed===&lt;br /&gt;
This finishes the installation of a complete package.   Type &amp;lt;nowiki&amp;gt;http://localhost&amp;lt;/nowiki&amp;gt; in your browser and Moodle will open. &lt;br /&gt;
&lt;br /&gt;
Your next task will be to configure Moodle to meet your needs.  Don&#039;t worry, it is easy to change any of the settings now that Moodle is up and running.&lt;br /&gt;
*The [[Site administration block]] is where most of the site configuration takes place. The&lt;br /&gt;
[[Administrator_documentation]]for links that help configure Moodle.  The Administrator documentation page has a [[Administrator_documentation#Configuration|configuration section]].&lt;br /&gt;
&lt;br /&gt;
== Security matters (A MUST READ!)==&lt;br /&gt;
&lt;br /&gt;
As mentioned before, XAMPP is not meant for production use but only for developers &lt;br /&gt;
in a development environment. The way XAMPP is configured is to be open as possible &lt;br /&gt;
and allowing the developer anything he/she wants. For development environments this &lt;br /&gt;
is great but in a production environment it could be fatal. Here a list of missing security &lt;br /&gt;
in XAMPP:&lt;br /&gt;
&lt;br /&gt;
The MySQL administrator (root) has no password.&lt;br /&gt;
The MySQL daemon is accessible via network.&lt;br /&gt;
phpMyAdmin is accessible via network.&lt;br /&gt;
Examples are accessible via network.&lt;br /&gt;
&lt;br /&gt;
To fix most of the security weaknesses simply call the following URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://localhost/security/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The root password for MySQL + phpMyAdmin and also a XAMPP directory protection can be established here.&lt;br /&gt;
&lt;br /&gt;
Note that on the Windows installer package, some (all?) of these issues have been fixed already by default and the above link does not work.&lt;br /&gt;
&lt;br /&gt;
If in doubt, more info is [http://www.apachefriends.org/en/faq-xampp-windows.html  here]&lt;br /&gt;
&lt;br /&gt;
== Apache and MySQL tweaks ==&lt;br /&gt;
Most of the time it is not necessary to tweak Apache or MySQL after completing the complete install package. Nor is it necessary to individually start and stop them because that is what the Xampp_start, Xampp_restart and Xammp_stop files are for.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache and MySQL as services===&lt;br /&gt;
(This is only for NT4 | Windows 2000 | Windows XP operating systems)&lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_installservice.bat =&lt;br /&gt;
==&amp;gt; Install Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_installservice.bat =&lt;br /&gt;
==&amp;gt; Install MySQL as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall MySQL as service   &lt;br /&gt;
&lt;br /&gt;
==&amp;gt; After all Service (un)installations, please restart your system!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apache Notes===&lt;br /&gt;
&lt;br /&gt;
You can use the apache_start and apache_stop bat files to start and stop apache from running. However the Xampp_start or Xampp_restart and Xampp_stop is recommended to turn on/off both Apache and MySQL.&lt;br /&gt;
&lt;br /&gt;
====Troubleshooting====&lt;br /&gt;
&lt;br /&gt;
If you find that Apache is very flaky, with the page often not loading properly or even at all (especially on localhost), try adding these lines to the end of C:\your_moodle_installer_directory\apache\conf\httpd.conf &lt;br /&gt;
&lt;br /&gt;
  EnableSendfile Off&lt;br /&gt;
  EnableMMAP Off&lt;br /&gt;
  Win32DisableAcceptEx&lt;br /&gt;
&lt;br /&gt;
If You edit some .php files but browser still show old state of them, try to disable eAccelerator extension in \server\php\php.ini&lt;br /&gt;
&lt;br /&gt;
 [eAccelerator]&lt;br /&gt;
 ;extension=eaccelerator.dll&lt;br /&gt;
&lt;br /&gt;
===MySQL notes===&lt;br /&gt;
Again, the recommendation to start and stop the entire webserver is to use the xampp_start or Xampp_restart and the Xampp_stop.  The following maybe useful if you wish to tweak the system further.  Please be careful.&lt;br /&gt;
&lt;br /&gt;
(1) The MySQL server can be started by double-clicking (executing) mysql_start.bat. This file can be found in the same folder you installed xampp in, most likely this will be C:\xampplite\.  The exact path to this file is X:\xampplite\mysql_start.bat, where &amp;quot;X&amp;quot; indicates the letter of the drive you unpacked xampp into.This batch file starts the MySQL server in console mode. The first intialization might take a few minutes.&lt;br /&gt;
    &lt;br /&gt;
Do not close the DOS window or you&#039;ll crash the server! To stop the server, please use mysql_shutdown.bat, which is located in the same directory.&lt;br /&gt;
&lt;br /&gt;
(2) To use the MySQL Daemon with &amp;quot;innodb&amp;quot; for better performance, &lt;br /&gt;
please edit the &amp;quot;my&amp;quot; (or &amp;quot;my.cnf&amp;quot;) file in the /xampplite/mysql/bin directory or for services the c:\my.cnf for windows NT/2000/XP. In that director, activate the&lt;br /&gt;
 &amp;quot;innodb_data_file_path=ibdata1:30M&amp;quot;&lt;br /&gt;
statement. Attention, &amp;quot;innodb&amp;quot; is not recommended for 95/98/ME.&lt;br /&gt;
    &lt;br /&gt;
:To use MySQL as Service for NT/2000/XP, simply copy the &amp;quot;my&amp;quot; / &amp;quot;my.cnf&amp;quot; file to C:\my, or C:\my.cnf. Please note that this file has to be placed in C:\ (root), other locations are not permitted. Then execute the &amp;quot;mysql_installservice.bat&amp;quot; in the mysql folder. 	&lt;br /&gt;
   	&lt;br /&gt;
&lt;br /&gt;
(3) MySQL starts with standard values for the user id and the password. The preset user id is &amp;quot;root&amp;quot;, the password is &amp;quot;&amp;quot; (= no password). To access MySQL via PHP with the preset values, you&#039;ll have to use the following syntax:&lt;br /&gt;
 mysql_connect(&amp;quot;localhost&amp;quot;,&amp;quot;root&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
If you want to set a password for MySQL access, please use of mysqladmin.&lt;br /&gt;
To set the password &amp;quot;secret&amp;quot; for the user &amp;quot;root&amp;quot;, type the following:&lt;br /&gt;
   &lt;br /&gt;
  \xampplite\mysql\bin\mysqladmin -u root password secret&lt;br /&gt;
    &lt;br /&gt;
After changing the password you&#039;ll have to reconfigure phpMyAdmin to use the new password, otherwise it won&#039;t be able to access the databases. To do that, open the file config.inc.php in \xampplite\phpmyadmin\ and edit the following lines:    &lt;br /&gt;
    &lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;user&#039;]            = &#039;root&#039;;   // MySQL user&lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;auth_type&#039;]       = &#039;http&#039;;   // HTTP authentificate&lt;br /&gt;
&lt;br /&gt;
So first the &#039;root&#039; password is queried by the MySQL server, before phpMyAdmin may access.&lt;br /&gt;
  	    	&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Have a lot of fun! Viel Spaß! Bonne Chance!&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Site administration block]] where most of the site configuration takes place&lt;br /&gt;
*[[Administrator_documentation]]for links that help configure Moodle.&lt;br /&gt;
**[[Administrator_documentation#Configuration|Administration configuration section]]&lt;br /&gt;
*[[Installation FAQ]]&lt;br /&gt;
*[[Installation guide - Moodle for Windows on a USB Memory Stick]]&lt;br /&gt;
*Return to [[Windows installation]]&lt;br /&gt;
*[[Windows 1 computer many servers |Multiple web servers, on 1 computer]] similar to windows installation page, with some tips&lt;br /&gt;
*[https://docs.moodle.org/en/Windows_installation_using_XAMPP#Troubleshooting Troubleshooting]if you are running Skype. &lt;br /&gt;
*[[Installing_AMP]] lots of XAMPP stuff.  XAMPP stands for X (cross platform), Apache, MySQL,PHP and Perl.  XAMPP used in Moodle does not include Perl. MAMP stands for Mac, Apache, MySQL and PHP.  &lt;br /&gt;
*[[Complete Install Packages for Mac OS X]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Paquetes_para_Instalaci%C3%B3n_Completa]]&lt;br /&gt;
[[pl:Kompletne pakiety instalacyjne]]&lt;br /&gt;
[[de:Vollständiges Installationspaket für Windows]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=58434</id>
		<title>Complete install packages for Windows</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Complete_install_packages_for_Windows&amp;diff=58434"/>
		<updated>2009-06-19T16:10:24Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Unpack the package */ keep path shorter&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Complete install packages are available from [http://download.moodle.org/ Moodle Downloads], located on a tab for each of the operating systems.  The packages are designed for new installations on a server or standalone computer. Please note the standard distributions only contain the Moodle code.&lt;br /&gt;
&lt;br /&gt;
This document provides instructions for using the Windows packages. Separate instructions are available for [[Complete Install Packages for Mac OS X|Mac OS X packages]].&lt;br /&gt;
&lt;br /&gt;
For installation on a Windows 2000 or Windows 2003 server it is good practice to perform a manual install (see the manual installation section in [[Windows_installation|Windows Installation]]). &lt;br /&gt;
&lt;br /&gt;
After installing the Windows package, note that there are other downloads (e.g. additional modules and plugins) that may involve more customization of configuration files.&lt;br /&gt;
&lt;br /&gt;
The complete install packages allow Moodle to be installed, along with the prerequisites that includes a web server, database and scripting language (Apache, MySQL and PHP in this case). Several versions of the complete install package are available. The instructions on the download page provide guidance on which version is likely to be most suitable.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; The latest complete install package version components, may not be backwardly compatible. Always check version compatibility of each component if you intend to develop materials on a later version of Moodle than the version installed on your &amp;quot;main&amp;quot; Moodle site.  In short, complete install packages are designed for first time install on a &amp;quot;clean&amp;quot; machine.   &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
:*256 MB RAM (minimum), 512 MB RAM (recommended)&lt;br /&gt;
:*160 MB free Fixed Disk (more space will be needed depending on user uploads)&lt;br /&gt;
:*Windows 98/ME (minimum)&lt;br /&gt;
:*Windows NT/2000/XP (recommended)&lt;br /&gt;
&lt;br /&gt;
==Install complete package process==&lt;br /&gt;
The complete install package is a zip file that contains a webserver called [[Apache]], plus Moodle and Moodle&#039;s required [[MySQL]] database and [[PHP]] program. &lt;br /&gt;
&lt;br /&gt;
There are three basic parts to the this install process.  &lt;br /&gt;
#Download and unpack the complete install package. &lt;br /&gt;
#Start the webserver. &lt;br /&gt;
#Install Moodle using a web browser.&lt;br /&gt;
&lt;br /&gt;
===First create file structure===&lt;br /&gt;
====Download the package====&lt;br /&gt;
[http://download.moodle.org/windows Download Windows] packed-zip file from Moodle.&lt;br /&gt;
[[Image:Moodle Setup zipfile.jpg|frame|center|A downloaded complete install package Windows 1.9 zip file in Windows Explorer]]&lt;br /&gt;
 &lt;br /&gt;
====Unpack the package====&lt;br /&gt;
Unpack (extract files by clicking on) the zip file you downloaded to a drive or partition of your choice. The extract process will create three files (&amp;quot;Start Moodle&amp;quot;, &amp;quot;Stop Moodle&amp;quot;, and &amp;quot;README&amp;quot;) and a subfolder called &amp;quot;server&amp;quot;. &lt;br /&gt;
*Do NOT rename the &amp;quot;server&amp;quot; subfolder  &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; There will also be a folder under this server subfolder, called \moodle that holds the Moodle program.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Create a folder and extract the files there.  For example, you might have one folder called Moodle193 and another one called Moodle187 for different versions or purposes.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;TIP:&#039;&#039; Make path to &amp;quot;server&amp;quot; subfolder simple. Best way if it will be in drive root. Like &amp;quot;D:\moodle193\server&amp;quot;. Long path especially with any strange symbols can make XAMPP not working properly.&lt;br /&gt;
&lt;br /&gt;
===Second - start the webserver===&lt;br /&gt;
Now you are ready to start the webserver.  Use the &amp;quot;Start Moodle.exe&amp;quot; file which you should find in the top directory. Once the &amp;quot;Start Moodle.exe&amp;quot; program is open, don&#039;t close it, use &amp;quot;Stop Moodle.exe&amp;quot; for that purpose.&lt;br /&gt;
 &lt;br /&gt;
:&#039;&#039;Note:&#039;&#039; These programs control both Apache and MySQL programs that operate the webserver.  Some sites will individually start and stop Apache and MySQL with the Xampp bat files found in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Alternatively, on a stand alone computer with several potential webservers that might be running, you can use the &amp;quot;xampp_restart.exe&amp;quot; file in the &amp;quot;server&amp;quot; subfolder.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; You can also add shortcuts to the commands that start and stop the site in your Windows &amp;quot;start&amp;quot; menu.&lt;br /&gt;
 &lt;br /&gt;
Now you are ready to start the Moodle installation.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Warning:&#039;&#039; Windows XP requires the msvcr71.dll library file in order to run Xampp. Installing the [http://www.microsoft.com/downloads/details.aspx?familyid=262D25E3-F589-4842-8157-034D1E7CF3A3&amp;amp;displaylang=en .Net 1.1 framework] (not .Net 2.0 and upper) could resolve it. You can also search for the file on Google, download it and copy it into the server/apache/bin folder.&lt;br /&gt;
&lt;br /&gt;
===Third - start Moodle installation===&lt;br /&gt;
Start your web browser and type &amp;lt;nowiki&amp;gt; localhost, or  http://127.0.0.1 or http://localhost &amp;lt;/nowiki&amp;gt;in the address bar. You will either start your first time Moodle installation or if it is already installed you will enter the Moodle site&#039;s [[Front Page]] or Login screen.&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
[[Image:Moodle_Setup_localhost_browser.jpg|frame|center|A browser&#039;s addressbar showing &amp;quot;localhost&amp;quot;. Click on  the green Goto arrow will go to the installed Moodle site.]]&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; After Moodle installs, put the site in your &amp;quot;favorites&amp;quot; or as a &amp;quot;bookmark&amp;quot; in you browser.&lt;br /&gt;
&lt;br /&gt;
====Set language====&lt;br /&gt;
The initial install page will be displayed after you type &amp;quot;localhost&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[Image:C Install Windows 1.png|thumb|center|600px|Set initial language]]&lt;br /&gt;
&lt;br /&gt;
*Choose your preferred language (English is used in this example) and click the “Next” button.&lt;br /&gt;
&lt;br /&gt;
====Diagnostic results====&lt;br /&gt;
A diagnostic report is displayed – hopefully it will look like this, if not you may need to address some issues.&lt;br /&gt;
[[Image:Complete Windows Install 2.png|thumb|center|546px|Moodle liked and gave a Pass ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
====Moodle paths====&lt;br /&gt;
The paths for your Moodle installation are shown – accept the ones that are shown on your screen.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 3.png|thumb|center|600px|Installation paths]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Database configuration====&lt;br /&gt;
What you enter in the &amp;quot;Host Server&amp;quot; field depends on what you intend to use the new Moodle installation for. &lt;br /&gt;
If you are just going to use it for local testing, then use &#039;localhost&#039;. &lt;br /&gt;
If you are going to test the new installation on a LAN, and will be accessing it from other machines on that LAN, then put the private IP address or network name of the serving machine, followed by a forward slash and moodle: Host Server - 192.168.1.1/moodle&lt;br /&gt;
If you are going to test the installation on the internet, then you will need to put the public ip address followed by a forward slash and moodle: your_ip_address/moodle or you can put your domain name here instead.&lt;br /&gt;
&lt;br /&gt;
*In the next fields, we enter the database settings. The fields are populated with some suggested values.&lt;br /&gt;
&lt;br /&gt;
*We strongly recommend you place a user name and password in this screen. (Don&#039;t forget them).&lt;br /&gt;
&lt;br /&gt;
*DO NOT USE THE “ROOT” USER WITHOUT A PASSWORD FOR PRODUCTION INSTALLATIONS AS THIS CREATES A SECURITY VULNERABILITY&lt;br /&gt;
[[image:Complete install Windows 4.png|thumb|center|535px|Installation&#039;s database settings]]&lt;br /&gt;
&lt;br /&gt;
*When the fields have been populated, click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Check server====&lt;br /&gt;
The install process checks the server it installed.&lt;br /&gt;
[[image:Complete install Windows 5.png|thumb|center|535px|Check server environment screen]]&lt;br /&gt;
*Click the “Next” button to continue.&lt;br /&gt;
&lt;br /&gt;
====Confirm initial language pack====&lt;br /&gt;
Moodle will now check to see if the language pack is available for the language you selected at the first step.  If it is not, Moodle will continue with the install in English.&lt;br /&gt;
[[image:Complete install Windows 6.png|thumb|center|535px|Language pack check]]&lt;br /&gt;
&lt;br /&gt;
====Confirm config.php====&lt;br /&gt;
Provided the Moodle folder is writable, a message confirming the configuration has been completed will be displayed.&lt;br /&gt;
[[image:Complete install Windows 7.png|thumb|center|549px|Confirmation that config.php has been created]]&lt;br /&gt;
&lt;br /&gt;
*Click the “ Continue” button to proceed.&lt;br /&gt;
&lt;br /&gt;
====Moodle copyright &amp;amp; agreement====&lt;br /&gt;
The Moodle copyright / license notices are displayed.&lt;br /&gt;
&lt;br /&gt;
[[image:Complete install Windows 8.png|thumb|center|400px|Copyright notice and agreement]]&lt;br /&gt;
&lt;br /&gt;
*Click the “Yes” button to continue.  &lt;br /&gt;
&lt;br /&gt;
====Current release and unattended option====&lt;br /&gt;
The current release information is shown. &lt;br /&gt;
&#039;&#039;&#039;Check off the unattended operations box&#039;&#039;&#039;. This will automatically advance through many screens.  If you would like to watch the install screen by screen, do not check this box and be prepared to press the &amp;quot;continute button&amp;quot; many times.&lt;br /&gt;
 &lt;br /&gt;
*Click the &amp;quot;Continue&amp;quot; button and wait.&lt;br /&gt;
[[Image:Complete install Windows 9.png|thumb|center|600px|Current release and &amp;quot;unattended&amp;quot; check box]]&lt;br /&gt;
&lt;br /&gt;
====Installation modules and blocks screens====&lt;br /&gt;
In most cases this will be followed by a series of screens that have a continue button on the bottom.  This process stops with Admin user profile settings which needs to be filled out.&lt;br /&gt;
&lt;br /&gt;
====Administrator user profile====&lt;br /&gt;
[[Image:Complete install Windows 10.png|thumb|center|The administrator&#039;s users profile screen]]&lt;br /&gt;
&lt;br /&gt;
Fill out the required fields.&lt;br /&gt;
*Click on &amp;quot;Save&amp;quot; to continue&lt;br /&gt;
&lt;br /&gt;
====Front page settings====&lt;br /&gt;
The next screen is the Front Page settings page.  There are two parts to it.&lt;br /&gt;
The first part will ask for your Full site name and a short name for the navigation bar. There is also a place for a description. You can change these later.  &lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11a.png|thumb|center|The Moodle sites [[Front Page]] information]]&lt;br /&gt;
&lt;br /&gt;
The second part on the bottom instructs Moodle if you will disable the new user self [[authentication]] through email process.  The default is to disable.  This can be changed later in the [[Site administration block|site administration block]].&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 11ba.png|thumb|center|500px|Determine if users can create their own profiles when they log onto the side via email self authentication]]&lt;br /&gt;
&lt;br /&gt;
*Click on &amp;quot;Save changes&amp;quot; button to go to Moodle sites home page.&lt;br /&gt;
&lt;br /&gt;
====Moodle on====&lt;br /&gt;
&#039;&#039;&#039;Now you are ready to Moodle !&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Complete install Windows 12.png|thumb|center|Blank Front page of your new site]]&lt;br /&gt;
&lt;br /&gt;
The Site Administration block is on the left, the &amp;quot;Turn edit on&amp;quot; button in the upper right corner, withe the site description block just below it.&lt;br /&gt;
&lt;br /&gt;
===Congratulations - Moodle has been installed===&lt;br /&gt;
This finishes the installation of a complete package.   Type &amp;lt;nowiki&amp;gt;http://localhost&amp;lt;/nowiki&amp;gt; in your browser and Moodle will open. &lt;br /&gt;
&lt;br /&gt;
Your next task will be to configure Moodle to meet your needs.  Don&#039;t worry, it is easy to change any of the settings now that Moodle is up and running.&lt;br /&gt;
*The [[Site administration block]] is where most of the site configuration takes place. The&lt;br /&gt;
[[Administrator_documentation]]for links that help configure Moodle.  The Administrator documentation page has a [[Administrator_documentation#Configuration|configuration section]].&lt;br /&gt;
&lt;br /&gt;
== Security matters (A MUST READ!)==&lt;br /&gt;
&lt;br /&gt;
As mentioned before, XAMPP is not meant for production use but only for developers &lt;br /&gt;
in a development environment. The way XAMPP is configured is to be open as possible &lt;br /&gt;
and allowing the developer anything he/she wants. For development environments this &lt;br /&gt;
is great but in a production environment it could be fatal. Here a list of missing security &lt;br /&gt;
in XAMPP:&lt;br /&gt;
&lt;br /&gt;
The MySQL administrator (root) has no password.&lt;br /&gt;
The MySQL daemon is accessible via network.&lt;br /&gt;
phpMyAdmin is accessible via network.&lt;br /&gt;
Examples are accessible via network.&lt;br /&gt;
&lt;br /&gt;
To fix most of the security weaknesses simply call the following URL:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;http://localhost/security/&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The root password for MySQL + phpMyAdmin and also a XAMPP directory protection can be established here.&lt;br /&gt;
&lt;br /&gt;
Note that on the Windows installer package, some (all?) of these issues have been fixed already by default and the above link does not work.&lt;br /&gt;
&lt;br /&gt;
If in doubt, more info is [http://www.apachefriends.org/en/faq-xampp-windows.html  here]&lt;br /&gt;
&lt;br /&gt;
== Apache and MySQL tweaks ==&lt;br /&gt;
Most of the time it is not necessary to tweak Apache or MySQL after completing the complete install package. Nor is it necessary to individually start and stop them because that is what the Xampp_start, Xampp_restart and Xammp_stop files are for.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Installing Apache and MySQL as services===&lt;br /&gt;
(This is only for NT4 | Windows 2000 | Windows XP operating systems)&lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_installservice.bat =&lt;br /&gt;
==&amp;gt; Install Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\apache\apache_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall Apache 2 as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_installservice.bat =&lt;br /&gt;
==&amp;gt; Install MySQL as service   &lt;br /&gt;
&lt;br /&gt;
\xampplite\mysql\mysql_uninstallservice.bat =&lt;br /&gt;
==&amp;gt; Uninstall MySQL as service   &lt;br /&gt;
&lt;br /&gt;
==&amp;gt; After all Service (un)installations, please restart your system!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Apache Notes===&lt;br /&gt;
&lt;br /&gt;
You can use the apache_start and apache_stop bat files to start and stop apache from running. However the Xampp_start or Xampp_restart and Xampp_stop is recommended to turn on/off both Apache and MySQL.&lt;br /&gt;
&lt;br /&gt;
===Troubleshooting===&lt;br /&gt;
&lt;br /&gt;
If you find that Apache is very flaky, with the page often not loading properly or even at all (especially on localhost), try adding these lines to the end of C:\your_moodle_installer_directory\apache\conf\httpd.conf &lt;br /&gt;
&lt;br /&gt;
  EnableSendfile Off&lt;br /&gt;
  EnableMMAP Off&lt;br /&gt;
  Win32DisableAcceptEx&lt;br /&gt;
&lt;br /&gt;
===MySQL notes===&lt;br /&gt;
Again, the recommendation to start and stop the entire webserver is to use the xampp_start or Xampp_restart and the Xampp_stop.  The following maybe useful if you wish to tweak the system further.  Please be careful.&lt;br /&gt;
&lt;br /&gt;
(1) The MySQL server can be started by double-clicking (executing) mysql_start.bat. This file can be found in the same folder you installed xampp in, most likely this will be C:\xampplite\.  The exact path to this file is X:\xampplite\mysql_start.bat, where &amp;quot;X&amp;quot; indicates the letter of the drive you unpacked xampp into.This batch file starts the MySQL server in console mode. The first intialization might take a few minutes.&lt;br /&gt;
    &lt;br /&gt;
Do not close the DOS window or you&#039;ll crash the server! To stop the server, please use mysql_shutdown.bat, which is located in the same directory.&lt;br /&gt;
&lt;br /&gt;
(2) To use the MySQL Daemon with &amp;quot;innodb&amp;quot; for better performance, &lt;br /&gt;
please edit the &amp;quot;my&amp;quot; (or &amp;quot;my.cnf&amp;quot;) file in the /xampplite/mysql/bin directory or for services the c:\my.cnf for windows NT/2000/XP. In that director, activate the&lt;br /&gt;
 &amp;quot;innodb_data_file_path=ibdata1:30M&amp;quot;&lt;br /&gt;
statement. Attention, &amp;quot;innodb&amp;quot; is not recommended for 95/98/ME.&lt;br /&gt;
    &lt;br /&gt;
:To use MySQL as Service for NT/2000/XP, simply copy the &amp;quot;my&amp;quot; / &amp;quot;my.cnf&amp;quot; file to C:\my, or C:\my.cnf. Please note that this file has to be placed in C:\ (root), other locations are not permitted. Then execute the &amp;quot;mysql_installservice.bat&amp;quot; in the mysql folder. 	&lt;br /&gt;
   	&lt;br /&gt;
&lt;br /&gt;
(3) MySQL starts with standard values for the user id and the password. The preset user id is &amp;quot;root&amp;quot;, the password is &amp;quot;&amp;quot; (= no password). To access MySQL via PHP with the preset values, you&#039;ll have to use the following syntax:&lt;br /&gt;
 mysql_connect(&amp;quot;localhost&amp;quot;,&amp;quot;root&amp;quot;,&amp;quot;&amp;quot;);&lt;br /&gt;
If you want to set a password for MySQL access, please use of mysqladmin.&lt;br /&gt;
To set the password &amp;quot;secret&amp;quot; for the user &amp;quot;root&amp;quot;, type the following:&lt;br /&gt;
   &lt;br /&gt;
  \xampplite\mysql\bin\mysqladmin -u root password secret&lt;br /&gt;
    &lt;br /&gt;
After changing the password you&#039;ll have to reconfigure phpMyAdmin to use the new password, otherwise it won&#039;t be able to access the databases. To do that, open the file config.inc.php in \xampplite\phpmyadmin\ and edit the following lines:    &lt;br /&gt;
    &lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;user&#039;]            = &#039;root&#039;;   // MySQL user&lt;br /&gt;
    $cfg[&#039;Servers&#039;][$i][&#039;auth_type&#039;]       = &#039;http&#039;;   // HTTP authentificate&lt;br /&gt;
&lt;br /&gt;
So first the &#039;root&#039; password is queried by the MySQL server, before phpMyAdmin may access.&lt;br /&gt;
  	    	&lt;br /&gt;
  &lt;br /&gt;
&lt;br /&gt;
Have a lot of fun! Viel Spaß! Bonne Chance!&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[Site administration block]] where most of the site configuration takes place&lt;br /&gt;
*[[Administrator_documentation]]for links that help configure Moodle.&lt;br /&gt;
**[[Administrator_documentation#Configuration|Administration configuration section]]&lt;br /&gt;
*[[Installation FAQ]]&lt;br /&gt;
*[[Installation guide - Moodle for Windows on a USB Memory Stick]]&lt;br /&gt;
*Return to [[Windows installation]]&lt;br /&gt;
*[[Windows 1 computer many servers |Multiple web servers, on 1 computer]] similar to windows installation page, with some tips&lt;br /&gt;
*[https://docs.moodle.org/en/Windows_installation_using_XAMPP#Troubleshooting Troubleshooting]if you are running Skype. &lt;br /&gt;
*[[Installing_AMP]] lots of XAMPP stuff.  XAMPP stands for X (cross platform), Apache, MySQL,PHP and Perl.  XAMPP used in Moodle does not include Perl. MAMP stands for Mac, Apache, MySQL and PHP.  &lt;br /&gt;
*[[Complete Install Packages for Mac OS X]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[es:Paquetes_para_Instalaci%C3%B3n_Completa]]&lt;br /&gt;
[[pl:Kompletne pakiety instalacyjne]]&lt;br /&gt;
[[de:Vollständiges Installationspaket für Windows]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=WebDAV_Setup&amp;diff=51775</id>
		<title>WebDAV Setup</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=WebDAV_Setup&amp;diff=51775"/>
		<updated>2009-03-01T12:11:43Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: Using Moodle: WebDAV extension for Moodle&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;WebDAV access allows users which can edit course files to do so from a convenient WebDAV &amp;quot;Web Folder&amp;quot;/Mountpoint which acts like a local drive.&lt;br /&gt;
&lt;br /&gt;
To set up WebDAV access in your Moodle installation:&lt;br /&gt;
&lt;br /&gt;
* In Admin-&amp;gt;Server-&amp;gt;WebDAV Set webdavenable to Yes.&lt;br /&gt;
* The &#039;moodle/site:webdav&#039; capability controls who can connect - by defauly the &amp;quot;Course Creator&amp;quot; role has it. Assign the role at the system level for users to be able to connect.&lt;br /&gt;
* If you want to restrict WebDAVaccess so it is only accessible from the local LAN, use the webdavsubnet setting.&lt;br /&gt;
&lt;br /&gt;
(This feature will be available after v1.9)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To use WebDAV your webserver must support this. There a 2 steps needed: &lt;br /&gt;
* Installing the DAV module in your webserver&lt;br /&gt;
In a commonly used server, apache, the module is called mod_dav. Using the Debian OS, &amp;quot;aptitude install libapache-mod-dav&amp;quot; does the trick. &lt;br /&gt;
* Disabling magic_quotes_gpc&lt;br /&gt;
When this module is installed, create an entry in your apache config file (under the &amp;lt;VirtualHost&amp;gt; entry for the applicable domain) like this: &amp;quot;php_value magic_quotes_gpc        0&amp;quot; to disable magic_quotes_gpc and your serevr should be setup correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
* [[WebDAV Connect]]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=41217 Using Moodle: WebDAV extension for Moodle] discussion from 2006&lt;br /&gt;
&lt;br /&gt;
[[Category: Administrator]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Guest_role&amp;diff=51771</id>
		<title>Guest role</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Guest_role&amp;diff=51771"/>
		<updated>2009-02-28T22:43:38Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: +/* Skip login page by URL */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Guest access==&lt;br /&gt;
&lt;br /&gt;
Moodle has a built-in &amp;quot;Guest account&amp;quot;. Visitors can log in as guests using the &amp;quot;Login as a guest&amp;quot; button on the login screen and enter any courses which allow guest access. In addition, logged-in users can enter any courses which allow guest access without being required to enrol.&lt;br /&gt;
&lt;br /&gt;
Guests ALWAYS have &amp;quot;read-only&amp;quot; access - meaning they can&#039;t leave any posts or otherwise mess up the course for real students.&lt;br /&gt;
&lt;br /&gt;
They &#039;&#039;cannot&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* Post in [[Forum module|forums]]&lt;br /&gt;
* Edit [[Wiki module|wiki]] pages&lt;br /&gt;
* Participate in a [[Chat module|chat]]&lt;br /&gt;
* Take [[Quiz|quizzes]]&lt;br /&gt;
* Submit [[Assignment|assignments]]&lt;br /&gt;
* Contribute [[Glossary|glossary]] entries or comments&lt;br /&gt;
* View [[SCORM]] content (because progress not tracked for a guest)&lt;br /&gt;
* Receive any scores or grades (because of the read-only access)&lt;br /&gt;
&lt;br /&gt;
This feature can be handy when you want to let a colleague in to look around at your work, or to let students see a course before they have decided to enrol.&lt;br /&gt;
&lt;br /&gt;
Note that you have a choice between two types of guest access: with an [[Enrolment key|enrolment key]] or without. If you choose to allow guests who have the key, then the guest will need to provide the current enrolment key EVERY TIME they log in (unlike students who only need to do it once). This lets you restrict which guests can get into a course. If you choose to allow guests to enter without a key, then anyone can get into your course.&lt;br /&gt;
&lt;br /&gt;
If you want guests to be able to take quizzes, or any of the other activities listed above, and have considered the security implications, you can create a visitor account, say with username = password = visitor, for everyone to share.&lt;br /&gt;
&lt;br /&gt;
==Enabling guest access==&lt;br /&gt;
&lt;br /&gt;
To enable guest access to a Moodle site, the guest login button should be set to &amp;quot;show&amp;quot; by an admin in &#039;&#039;Administration &amp;gt; Users &amp;gt; [[Authentication]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Teachers can then set whether their courses allow guest access in the [[Course settings|course settings]].&lt;br /&gt;
&lt;br /&gt;
To allow visitors to be logged in as guests automatically when entering courses with guest access, the &#039;&#039;autologinguests&#039;&#039; box should be checked by an admin in &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; [[User policies]]&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Disabling guest access==&lt;br /&gt;
&lt;br /&gt;
Guest access for visitors can be disabled by hiding the guest login button in &#039;&#039;Administration &amp;gt; Users &amp;gt; [[Authentication]]&#039;&#039;. If any courses allow guest access, then only logged-in users will be able to enter them.&lt;br /&gt;
&lt;br /&gt;
==Self-enrolment==&lt;br /&gt;
&lt;br /&gt;
Sometimes you may wish to allow people to have a more interactive engagement with a course without you having to enrol them in advance. In this case you can enable &amp;quot;self-enrolment&amp;quot; for your course. This allows anyone with a user account on your Moodle server to become a student on your course. As with guest access, you can use the [[enrolment key]] to limit this only to people to whom you have given the key.&lt;br /&gt;
&lt;br /&gt;
==Skip login page by URL==&lt;br /&gt;
&lt;br /&gt;
When you want get URL for external peoples to view You moodle pages witch allowed guest access, you can add to one simple URL parameter &#039;&#039;username=guest&#039;&#039; to skip login page and automatically login this users as Guests.&lt;br /&gt;
&lt;br /&gt;
For example, this URL will be ask user to login before display Welcome page of the &amp;quot;Using Moodle&amp;quot; cource:&lt;br /&gt;
* http://moodle.org/mod/resource/view.php?id=1361&lt;br /&gt;
But this URL make visitor logged in as Guest and display required page immediately:&lt;br /&gt;
* [http://moodle.org/mod/resource/view.php?id=1361&amp;amp;username=guest  http://moodle.org/mod/resource/view.php?id=1361&#039;&#039;&#039;&amp;amp;username=guest&#039;&#039;&#039;]&lt;br /&gt;
Note: if user try to go to login directly from page, opened by this URL, he can&#039;t do it because login page will be return him to that URL back and relogin to Guest again. It can be frustrating, and because this, use this method only in links for really external visitors. &amp;lt;!-- May be it is a BUG and login page must to cut this parameter from return URL? --&amp;gt;&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=56914 Change in self-enrolment procedure and status of course visitors]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=69674 Allowing guests to post in forum?]&lt;br /&gt;
&lt;br /&gt;
[[Category:Roles]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Accès invité]]&lt;br /&gt;
[[ja:ゲストアクセス]]&lt;br /&gt;
[[de:Gast-Rolle]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=29402</id>
		<title>Development:Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=29402"/>
		<updated>2007-11-27T10:20:23Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Documentation for core components */ phpXRef MUST be described  some where here&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; New developer documentation pages should be added to the &#039;&#039;Development namespace&#039;&#039; by typing &amp;lt;code&amp;gt;Development:&amp;lt;/code&amp;gt; before the new page name i.e. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Development:New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;If you are a developer, you probably want to change your [[Special:Preferences|preferences]] to include the Development namespace in searches.&amp;lt;br /&amp;gt;&amp;lt;br /&amp;gt;A page may be added to the Developer category by typing &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Category:Developer|New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; at the bottom of the page.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==How Moodle development works==&lt;br /&gt;
&lt;br /&gt;
This [[Development:Overview|overview of the Moodle development process]] may be handy in understanding how the development of Moodle occurs and how people become Moodle developers.&lt;br /&gt;
&lt;br /&gt;
==Guidelines==&lt;br /&gt;
&lt;br /&gt;
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:&lt;br /&gt;
*[[Development:Coding|Coding guidelines]] have to be followed by all Moodle developers&lt;br /&gt;
*[[Moodle design goals]] spells out the basic design goals behind Moodle&lt;br /&gt;
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface&lt;br /&gt;
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS&lt;br /&gt;
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc&lt;br /&gt;
*[[Development:Working with the Community|Working with the Community]] explains how to engage with the dev community and discuss changes&lt;br /&gt;
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.&lt;br /&gt;
&lt;br /&gt;
==Documentation for core components==&lt;br /&gt;
&lt;br /&gt;
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].&lt;br /&gt;
&lt;br /&gt;
The documents below give a general overview. For detailed function-by-function documentation, see the [http://phpdocs.moodle.org/ phpDocumentor] documentation that is automatically generated from the comments in the code. And don&#039;t forget that the most up-to-date and detailed description of how the code works is the code itself. Moodle code should be easy to read and understand. Use the source, Luke!&lt;br /&gt;
&lt;br /&gt;
Also You can use [http://xref.moodle.org/nav.html?index.html phpXRef] site, that provide interactive source browsing engine around all moodle sources.&lt;br /&gt;
&lt;br /&gt;
===Core components that affect everything===&lt;br /&gt;
&lt;br /&gt;
*[[Development:Database schema introduction|The database schema]]&lt;br /&gt;
*lib/moodlelib.php &lt;br /&gt;
*[[Development:lib/weblib.php|lib/weblib.php]] for outputting stuff.&lt;br /&gt;
*[[Development:XMLDB_Documentation|Database abstraction layer]] @ v[[1.7]]&lt;br /&gt;
*[[Development:Roles|Roles and Capabilities system]] @ v[[1.7]] for controlling who can do what.&lt;br /&gt;
*[[Development:lib/formslib.php|Forms library]] @ v[[1.8]] for creating accessible and secure HTML forms that let users edit things.&lt;br /&gt;
&lt;br /&gt;
===Core libraries with a more specific uses===&lt;br /&gt;
&lt;br /&gt;
*[[Authentication API]]&lt;br /&gt;
*[[Cookieless Sessions]]&lt;br /&gt;
*[[Development:Moodle Network|Moodle Network]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Development:Environment checking|Environment checking]] before install, check the user&#039;s server to ensure Moodle will work there.&lt;br /&gt;
*[[Question engine]]&lt;br /&gt;
*[[Stats package]]&lt;br /&gt;
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]&lt;br /&gt;
*[http://developer.yahoo.com/yui YUI JavaScript library] - YUI was selected as the official AJAX library for Moodle.&lt;br /&gt;
*[[Development:lib/graphlib|lib/graphlib]]&lt;br /&gt;
&lt;br /&gt;
===Modules included in the standard distribution===&lt;br /&gt;
&lt;br /&gt;
*[[Quiz developer docs|Quiz module]]&lt;br /&gt;
*[[SCORM schema|SCORM module 1.5 schema]]&lt;br /&gt;
&lt;br /&gt;
==How you can contribute==&lt;br /&gt;
&lt;br /&gt;
===Make a new plugin===&lt;br /&gt;
&lt;br /&gt;
The M in Moodle stands for modular, and the easiest, most maintainable way to add new functionality to Moodle is by using one of the many plugin APIs. There are many types of plugin you can write:&lt;br /&gt;
*[[Development:Modules|Activity modules]]&lt;br /&gt;
*[[Development:Admin reports|Admin reports]]&lt;br /&gt;
*[[Development:Assignment types|Assignment types]]&lt;br /&gt;
*[[Development:Authentication plugins|Authentication plugins]]&lt;br /&gt;
*[[Development:Blocks|Blocks]]&lt;br /&gt;
*[[Course formats]]&lt;br /&gt;
*[[Development:Course Report Plugins|Course reports]]&lt;br /&gt;
*[[Development:Database fields|Database fields]]&lt;br /&gt;
*[[Development:Database presets|Database presets]]&lt;br /&gt;
*[[Development:Enrolment plugins|Enrolment plugins]]&lt;br /&gt;
*[[Development:Filters|Filters]]&lt;br /&gt;
*[[Development:Grade export/import|Grade export/import]]&lt;br /&gt;
*[[Development:Grade report|Grade report]]&lt;br /&gt;
*[[Development:Question engine|Question engine]]&lt;br /&gt;
*[[Development:Question import/export formats|Question import/export formats]]&lt;br /&gt;
*[[Quiz reports]]&lt;br /&gt;
*[[Development:Resource types|Resource types]]&lt;br /&gt;
*[[Development:SSO plugins|SSO plugins]]&lt;br /&gt;
*[[Development:Search engine adapters|Search engine adapters]]&lt;br /&gt;
*[[Development:Course Report Plugins|Course Report Plugins]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 Moodle modules and plugins database].&lt;br /&gt;
&lt;br /&gt;
===Change core code===&lt;br /&gt;
&lt;br /&gt;
Some types of change can only be made by editing the core Moodle code. Such changes are much harder to maintain than plugins. If you want your core change to be considered for inclusion in the official Moodle release, you need to create an issue in the [[Tracker|tracker]], and attach your change as a [[Development:How_to_create_a_patch|patch]]. It is also a good idea to discuss your ideas in the forums first.&lt;br /&gt;
&lt;br /&gt;
===Ways to contribute that do not involve PHP programming===&lt;br /&gt;
&lt;br /&gt;
*[[Themes|Create Moodle themes]]&lt;br /&gt;
*[[Translation|Translate Moodle into other languages]]&lt;br /&gt;
*[[MoodleDocs:Guidelines for contributors|Help document Moodle]]&lt;br /&gt;
*[[Development:Database schemas|Database schemas]]&lt;br /&gt;
*[[Development:Tests|Join the testing effort]], which involves [[Tracker|participating in the bug tracker]]&lt;br /&gt;
&lt;br /&gt;
==Plans for the future==&lt;br /&gt;
&lt;br /&gt;
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.&lt;br /&gt;
&lt;br /&gt;
Once ideas begin to crystallize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.&lt;br /&gt;
&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
*[[Development:Developer notes|Developer notes]]&lt;br /&gt;
*[[Student projects]]&lt;br /&gt;
*[[Developer conferences]]&lt;br /&gt;
&lt;br /&gt;
== Resources and tools ==&lt;br /&gt;
&lt;br /&gt;
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle&lt;br /&gt;
*[[Development:Finding_your_way_into_the_Moodle_code|Finding your way into the Moodle code]] - also aimed at newcomers&lt;br /&gt;
*[http://tracker.moodle.org/ Moodle tracker] - bug reports, feature requests and other tracked issues&lt;br /&gt;
**[[Firefox tracker search]] - How to setup a firefox quicksearch to easily navigate to moodle bugs&lt;br /&gt;
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD&lt;br /&gt;
*Browse the code online:&lt;br /&gt;
**[http://moodle.cvs.sourceforge.net/moodle/moodle/ the code with a complete change history from CVS]&lt;br /&gt;
**[http://xref.moodle.org/index.html the code, with links generated by PHPXref]&lt;br /&gt;
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - compiled from the comment attached to each class and function in the code&lt;br /&gt;
*[[Development:Database Schema|Database Schema]] - for recent releases&lt;br /&gt;
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course&lt;br /&gt;
**especially the [http://moodle.org/mod/forum/view.php?id=55 General developer forum]&lt;br /&gt;
**[[Filters used on the Moodle.org forums|cool tricks you can use in the moodle.org forums]]&lt;br /&gt;
*Some tools people use when working on Moodle code:&lt;br /&gt;
**[[Development:Setting_up_Eclipse|Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.&lt;br /&gt;
**[[Development:vim|Setting up Vim for Moodle development]]&lt;br /&gt;
**[[Development:ctags|Ctags]] - Using a tags file to navigate code&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[http://security.moodle.org/ Moodle Security Centre]&lt;br /&gt;
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[es:Documentación para Desarrolladores]]&lt;br /&gt;
[[fr:Documentation développeur]]&lt;br /&gt;
[[zh:开发者文档]]&lt;br /&gt;
[[ja:開発者ドキュメント]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Roles_FAQ&amp;diff=25084</id>
		<title>Roles FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Roles_FAQ&amp;diff=25084"/>
		<updated>2007-07-16T10:28:28Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* How do I change the name for &amp;quot;teacher&amp;quot; in the course description? */ about dummy roles&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Roles}}&lt;br /&gt;
&lt;br /&gt;
==What is the definition of a...==&lt;br /&gt;
&lt;br /&gt;
;Role&lt;br /&gt;
:An identifier of the user&#039;s status in some context, for example Teacher, Student and Forum moderator&lt;br /&gt;
;Capability&lt;br /&gt;
:A description of a particular Moodle feature, for example [[Capabilities/moodle/blog:create|moodle/blog:create]]&lt;br /&gt;
;Permission&lt;br /&gt;
:A setting for a capability - inherit, allow, prevent or prohibit&lt;br /&gt;
;Context&lt;br /&gt;
:A &amp;quot;space&amp;quot; in Moodle, such as courses, activity modules or blocks&lt;br /&gt;
&lt;br /&gt;
==Why isn&#039;t my role change taking effect?==&lt;br /&gt;
&lt;br /&gt;
Role changes only take effect after the next login from that user. Regarding testing new roles, please refer to the information in [[Manage roles]].&lt;br /&gt;
&lt;br /&gt;
Also, please check the context in which the role is assigned. Certain capabilities e.g. [[Capabilities/moodle/user:update|moodle/user:update]] may only be applied in the system context, so assigning a role in the course context will result in the role change not taking effect.&lt;br /&gt;
&lt;br /&gt;
==Why are participants being added automatically when a new course is created?==&lt;br /&gt;
&lt;br /&gt;
If a user is assigned a global role or a role in the course category context then the user has this role in ALL courses in that context. Thus users who are students or teachers at the category level appear as course participants in all courses in that category.&lt;br /&gt;
&lt;br /&gt;
Please check &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Assign global roles&#039;&#039; and also the Assign roles link in course categories page and unassign users as necessary.&lt;br /&gt;
&lt;br /&gt;
==Why are all students enrolled in all courses?==&lt;br /&gt;
&lt;br /&gt;
Either&lt;br /&gt;
*Users are assigned the role of student in the site/system context rather than the course context (see FAQ above)&lt;br /&gt;
Or&lt;br /&gt;
*The default role for all users in &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; User policies&#039;&#039; is set to Student rather than Authenticated user (Moodle 1.8 onwards).&lt;br /&gt;
&lt;br /&gt;
==Why are there differences in the users listed as course participants and users assigned roles in a course?==&lt;br /&gt;
&lt;br /&gt;
Users assigned roles in a higher context, for example users assigned the role of teacher in a course category context, may appear as course participants. The discussion [http://moodle.org/mod/forum/discuss.php?d=59900 Discrepancies between Assign Roles lists and Participants list] contains a longer explanation. &lt;br /&gt;
&lt;br /&gt;
==How can I prevent administrators being listed as course participants?==&lt;br /&gt;
&lt;br /&gt;
Ensure that administrators are not assigned another role in addition to their admin role.&lt;br /&gt;
&lt;br /&gt;
==Why are hidden assignments still visible?==&lt;br /&gt;
&lt;br /&gt;
Hidden assignments are not hidden from admins or teachers i.e. users with the [[Capabilities/moodle/role:viewhiddenassigns|viewhiddenassigns capability]].&lt;br /&gt;
&lt;br /&gt;
==Where are permissions inherited from?==&lt;br /&gt;
&lt;br /&gt;
Permissions are inherited from a role assigned in a higher-level context which has permissions set to allow for particular capabilities. If permission is never allowed/not set in any context (in particular, if you are creating or editing a role at the site level), then a user will have no permission for that capability.&lt;br /&gt;
&lt;br /&gt;
For example, the Student role has permission not set for the change site configuration capability. The permission is never allowed in any context so users assigned the role of Student cannot change the site configuration.&lt;br /&gt;
&lt;br /&gt;
==What is a hierarchy of permissions?==&lt;br /&gt;
&lt;br /&gt;
This determines which permission wins or is going to be in effect if there is an apparent conflict. For example, the site allows all students the permission to to post in forums, but a teacher might prevent that right in a particular course. The hierarchy of permissions would allow a student to post in one course but not in another course.&lt;br /&gt;
&lt;br /&gt;
==Are there any differences in Roles in Moodle 1.7 and 1.8?==&lt;br /&gt;
&lt;br /&gt;
In addition to many Roles fixes and refinements (see the list of [http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&amp;amp;requestId=10221 Roles improvements] in the Tracker), in Moodle 1.8 the &#039;&#039;system&#039;&#039; context is separated from the &#039;&#039;site&#039;&#039; context.&lt;br /&gt;
&lt;br /&gt;
The site context in Moodle 1.8 is the &amp;quot;front page course&amp;quot; and its activities. Roles may be assigned in the  site context via &#039;&#039;Administration &amp;gt; Front Page &amp;gt; Front Page roles&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;Duplicate role&amp;quot; button has been added in Moodle 1.8, which makes creating new roles based on predefined roles much quicker.&lt;br /&gt;
&lt;br /&gt;
==How do I change the name for &amp;quot;teacher&amp;quot; in the course description?==&lt;br /&gt;
&lt;br /&gt;
Either&lt;br /&gt;
* Edit the role of Teacher via &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; and rename it. The new name will apply site-wide.&lt;br /&gt;
Or&lt;br /&gt;
* Create a duplicate teacher role with an alternative name and assign users the duplicate teacher role as appropriate in the course context. In &#039;&#039;Administration &amp;gt; Appearance &amp;gt; Course manager&#039;&#039; select the alternative name for teacher that you wish to be displayed in the course description.&lt;br /&gt;
Or&lt;br /&gt;
* One more way to do it in 1.8 is to create new &amp;quot;dummy&amp;quot; roles (no capabilities) with those names and assign them to teachers along with the real roles. In the course manager settings you can choose which roles display on the front page under each course. (The feature request [http://tracker.moodle.org/browse/MDL-9182 Ability to assign or display custom title for role of person in course] contains a this further method.)&lt;br /&gt;
&lt;br /&gt;
{{Moodle 1.9}}From Moodle 1.9 onwards, names for different roles in a course may be changed in the [[Course settings|course settings]].&lt;br /&gt;
&lt;br /&gt;
==How do I allow teachers to assign other teachers in a course==&lt;br /&gt;
&lt;br /&gt;
This is disabled by default but it can be switched on by modifying the teacher&#039;s role. At &#039;&#039;Administration &amp;gt; Users &amp;gt; Permissions &amp;gt; Define roles&#039;&#039; select the &amp;quot;Allow role assignments&amp;quot; tab and tick the checkbox where Teacher and Teacher intersect.&lt;br /&gt;
&lt;br /&gt;
==Why doesn&#039;t &amp;quot;Switch role to..&amp;quot; within a course seem to work properly for a Course Creator?==&lt;br /&gt;
&lt;br /&gt;
This feature is intended for Teachers assigned at the course level. Users assigned at &amp;quot;higher&amp;quot; contexts should not expect reliable results from this function.&lt;br /&gt;
&lt;br /&gt;
[[Category:Roles]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ_roles]]&lt;br /&gt;
[[fr:FAQ des rôles]]&lt;br /&gt;
[[ja:ロールFAQ]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Filters&amp;diff=22009</id>
		<title>Filters</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Filters&amp;diff=22009"/>
		<updated>2007-03-31T21:55:03Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: class for multilang&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Filters&#039;&#039;&#039; allow for the automatic transformation of entered text into different, often more complex forms. For example the titles of [[Resources|resources]] can automatically become hyperlinks that take you to the relevant resource, URLs pointing to [[mp3]] files can become [[Flash]] controls embedded in the webpage that let you pause and rewind the audio. The possibilities are endless and there are a number of standard filters included with Moodle and many more specialized filters contributed by the community.&lt;br /&gt;
&lt;br /&gt;
Filters are one of Moodle&#039;s pluggable resources and may be added or removed simply by using a file manager to add or remove them from the /filters directory.  Moodle detects those that are present and makes them available to use.  &lt;br /&gt;
&lt;br /&gt;
In versions prior to 1.7, the filters manager and individual filter settings may be found in the site administration block &amp;gt;&amp;gt; [[Configuration]] &amp;gt;&amp;gt; Filters.  In 1.7 it can be found in the administration block &amp;gt;&amp;gt; Modules &amp;gt;&amp;gt; Filters.&lt;br /&gt;
&lt;br /&gt;
[[Image:Filters_configuration_table.JPG|thumb|300px|left|Moodle 1.6 Filters administration]] &lt;br /&gt;
Prior to Moodle 1.6 the filters administration screen has two columns - &#039;&#039;&#039;active&#039;&#039;&#039; and &#039;&#039;&#039;inactive&#039;&#039;&#039;. The arrows are used to move filters from one column to the other. Only filters in the active column will be applied. Note that up and down arrows are provided to the left of the &#039;&#039;&#039;active&#039;&#039;&#039; column to enable the order in which filters are applied to be changed. In some cases this can be significant.&lt;br /&gt;
{{Moodle 1.6}}&lt;br /&gt;
Moodle 1.6 has a more unified administration screen (similar to the modules and blocks administration screens). &lt;br /&gt;
 &lt;br /&gt;
The filters administration screen enables individual filters to be shown (enabled) or hidden (disabled). Only enabled filters will be applied to displayed text. The order in which filters are applied to displayed text can be significant - you can change the order in which enabled filters are applied using the up and down buttons. The enabled filters are applied from the top of the list down. Some filters have their own settings screen. Please refer to the documentation for the individual filter for more information.&lt;br /&gt;
&lt;br /&gt;
Underneath the filter selection area, there are fields which control the cache.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Filters==&lt;br /&gt;
&lt;br /&gt;
*Activity Names Auto-linking - This scans text for activity titles that exist in the same course and creates a link.&lt;br /&gt;
*[[Algebra filter|Algebra]] - This filter will convert algebra code into GIF images. It requires the tex filter to be installed ([[#TeX notation|see below]]). Note also that your system must also include the following Perl module: HTML::Entities.pm&lt;br /&gt;
*Database auto-linking - As the name suggests, this filter enables automatic linking of [[Database module]] entries.&lt;br /&gt;
*Email Protection - This filter scans the text for any email addresses. Where found they are changed to reduce the chance of being added to a spammers list.&lt;br /&gt;
*Glossary auto-linking - As the name suggests, this filter enables automatic linking of [[Glossary module]] entries. In addition to this filter, individual glossary entries should have the &amp;quot;This entry should be automatically linked&amp;quot; box checked.&lt;br /&gt;
*[[Multi language content]] - This filter enables resources to be created in multiple languages. It looks for &amp;amp;lt;span&amp;amp;nbsp;lang=&amp;quot;xx&amp;quot; class=&amp;quot;multilang&amp;quot;&amp;amp;gt;...&amp;amp;lt;/span&amp;amp;gt; tags which indicate that a text contains multiple languages. Then it selects and outputs the best language for the current user. The language of the resource will change when the user changes their selected Moodle language. Please note: going to the past, the multilang filter supported the &amp;amp;lt;lang&amp;amp;gt; tag. Then, officially, we changed it to the standard HTML &amp;amp;lt;span&amp;amp;gt; tag and the &amp;amp;lt;lang&amp;amp;gt; solution is now deprecated.&lt;br /&gt;
*[[Multimedia plugins]]&lt;br /&gt;
*Resource Names Auto-linking - The titles of [[Resources]] can automatically become hyperlinks that take you to the relevant resource within the same course.&lt;br /&gt;
*[[TeX filter|TeX notation]]&lt;br /&gt;
*Tidy - This filter checks whether HTML code is XHTML compliant, tidying where necessary. To make this filter work you need to have PHP compiled with the libtidy option; see http://www.php.net/tidy. The Using Moodle discussion [http://moodle.org/mod/forum/discuss.php?d=28418 Tidy Filter for Moodle 1.5] contains more details.&lt;br /&gt;
*Wiki Page Auto-linking&lt;br /&gt;
*[[Word censorship]] - This filter &amp;quot;blacks out&amp;quot; words found on a list.&lt;br /&gt;
&lt;br /&gt;
==Cache Controls==&lt;br /&gt;
{{Moodle 1.6}}&lt;br /&gt;
*Text cache lifetime - To reduce load on the server and to speed display of pages, Moodle can store previously processed pages (that have not changed) for a period of time. This setting controls the time for which processed pages are stored. A longer setting may improve performance but has the effect that changes to pages may not become visible for a time. You can switch caching off completely here.&lt;br /&gt;
*Filter uploaded files - This setting enables uploaded files (HTML and text only) to be processed by the filters system. You can choose to have none, only HTML or all files filtered.&lt;br /&gt;
*Filter match once per page - This setting effects the glossary, activity and resource linking filters. If set to yes, only the first match on the complete page will be converted to a link. All others will be ignored.&lt;br /&gt;
*Filter match once per text - This setting effects the glossary, activity and resource linking filters. If set to yes, only the first match in a discrete block of text will be converted to a link. All others in that text block will be ignored.&lt;br /&gt;
*Filter all strings - When set to yes, almost all Moodle text will be filtered. This is probably only necessary when using the multi-language filter.&lt;br /&gt;
&lt;br /&gt;
==Config.php settings==&lt;br /&gt;
{{Moodle 1.5}}&lt;br /&gt;
*For Moodle 1.6 see the Cache Settings above. For earlier versions of Moodle, the filter/config.php file will need to be changed for the visual effects below.  The following two settings affect the glossary, activity and resource linking filters:&lt;br /&gt;
:To convert only the first matching title on a page, insert or uncomment the  following line in config.php: &amp;lt;code&amp;gt;$CFG-&amp;gt;filtermatchoneperpage = true;&amp;lt;/code&amp;gt;&lt;br /&gt;
:To convert only the first matching title in a discrete block of text, insert or uncomment the following line in config.php: &amp;lt;code&amp;gt;$CFG-&amp;gt;filtermatchonepertext = true;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Development:Filters]]&lt;br /&gt;
Non-standard filters:&lt;br /&gt;
&lt;br /&gt;
* [[Jmol filter|Jmol]] - for interactive 3D viewing of molecular structures&lt;br /&gt;
* [[Code Syntax Highlighting]] - for more readable excerpts of programming languages including [[PHP]], [[HTML]], [[CSS]], and XML amongst many others&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Filter]]&lt;br /&gt;
&lt;br /&gt;
[[es:Filtros (Administrador)]]&lt;br /&gt;
[[fr:Filtres (administrateur)]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=filter/multilang/config&amp;diff=22008</id>
		<title>filter/multilang/config</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=filter/multilang/config&amp;diff=22008"/>
		<updated>2007-03-31T21:51:23Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[Multi language content]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Roles_and_modules&amp;diff=19334</id>
		<title>Development:Roles and modules</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Roles_and_modules&amp;diff=19334"/>
		<updated>2007-01-17T08:42:12Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: link to Roles and Capabilities forum instead of General Developer&amp;#039;s one&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a page for &#039;&#039;&#039;developers&#039;&#039;&#039; that describes how to make Moodle modules work under 1.7 roles system. =) For more background information, please read  [[Development:Roles]]. For any clarifications please post to the [http://moodle.org/mod/forum/view.php?f=941 Roles and Capabilities forum].&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
&lt;br /&gt;
Moodle 1.6 and below uses 7 default roles, namely primary admin, admin, editing teachers, non-editing teachers, students and guests. The set of capabilities that users associated to these roles can perform is fixed. To check permissions, we normally use isteacheredit($courseid), isguest() etc. &lt;br /&gt;
&lt;br /&gt;
{{Moodle 1.7}}&lt;br /&gt;
Under the new 1.7 system, roles do not have a fixed set of capabilities anymore. We use a different function called has_capability() to check for specific capabilities, more on this later.&lt;br /&gt;
&lt;br /&gt;
==Context==&lt;br /&gt;
&lt;br /&gt;
Context is an important concept to make roles work. There are currently 8 levels&lt;br /&gt;
&lt;br /&gt;
 define(&#039;CONTEXT_SYSTEM&#039;, 10);&lt;br /&gt;
 define(&#039;CONTEXT_PERSONAL&#039;, 20);&lt;br /&gt;
 define(&#039;CONTEXT_USERID&#039;, 30);&lt;br /&gt;
 define(&#039;CONTEXT_COURSECAT&#039;, 40);&lt;br /&gt;
 define(&#039;CONTEXT_COURSE&#039;, 50);&lt;br /&gt;
 define(&#039;CONTEXT_GROUP&#039;, 60);&lt;br /&gt;
 define(&#039;CONTEXT_MODULE&#039;, 70);&lt;br /&gt;
 define(&#039;CONTEXT_BLOCK&#039;, 80);&lt;br /&gt;
&lt;br /&gt;
They are stored as a tuple [contextlevel][instanceid]. For example course with id =2 would be [50][2]. Module with id 495 would be [70][495].&lt;br /&gt;
&lt;br /&gt;
At module level, you only need to worry about CONTEXT_MODULE. Normally, foreach page accessible in your module you would need to load the module using get_context_instance(). The way to use it for modules is $context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id); where $cm is the course module object that you would normally have anyway. The contextid is needed for every permission check later on in all your pages.&lt;br /&gt;
&lt;br /&gt;
==The has_capability($capability, $contextid, $kill) function==&lt;br /&gt;
&lt;br /&gt;
inputs: &lt;br /&gt;
&lt;br /&gt;
$capability is the name of the capability&lt;br /&gt;
$contextid is normally $context-&amp;gt;id, the module context id&lt;br /&gt;
$kill set to 1 if you want to kill the page, it will throw an error and inform the user that required permission is missing. For example you place has_capability(&#039;forum_read&#039;, $context-&amp;gt;id, true) at the top of the page to prevent users from reading the whole page.&lt;br /&gt;
&lt;br /&gt;
This function looks up a capability for a given context and associated parents recursively. We are pretty much relying on this funciton alone to resolve all capability issues. Original isteacher(), isadmin(), isstudent() etc should all be changed accordingly. &lt;br /&gt;
&lt;br /&gt;
==Loading capabilities== - for now, this plan might change later&lt;br /&gt;
&lt;br /&gt;
Loading capabilities is done when a user first log in. Because it is quite an expensive call, we only load it once and stores everything in the session. So when has_capability() is called, it looks for the values stored in the session variable.&lt;br /&gt;
&lt;br /&gt;
==Code rewrite==&lt;br /&gt;
&lt;br /&gt;
Some modules might require some tiny rewrites because permission is only checked once at the top, for example some scripts only checks for isstudent() at the top. Now we are able to refine those capabilities, so we need to put the required code changes (add has_capability()) to where the specific capability is needed. For example, in a forum we check to see if user is a student before displaying a discussion page, now we need to check individual permissions for forum_read and forum_reply. &lt;br /&gt;
&lt;br /&gt;
==Sample code==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// somewhere at the top, after getting $cm, load context&lt;br /&gt;
&lt;br /&gt;
$context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id); &lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
has_capability(&#039;forum_read&#039;, $cm-&amp;gt;id, true); // kills this page if user is not allowed to read&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
if (has_capability(&#039;forum_reply&#039;, $cm-&amp;gt;id) {&lt;br /&gt;
    print_reply_link();&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Core API==&lt;br /&gt;
&lt;br /&gt;
The core API is located at libdir/accesslib, if you would like to read it =)&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Roles]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Roles&amp;diff=19333</id>
		<title>Development:Roles</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Roles&amp;diff=19333"/>
		<updated>2007-01-17T08:40:09Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* See also */ forum link&amp;#039;s&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Roles and permissions&#039;&#039;&#039; will be in Moodle 1.7 and are available in the developer version of Moodle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
&lt;br /&gt;
A role is an identifier of the user&#039;s status in some context. For example, teacher, student and fourm moderator are examples of roles.&lt;br /&gt;
&lt;br /&gt;
A capability is a description of some particular Moodle feature. Capabilities are associated with roles. For example, &#039;&#039;mod/forum:replypost&#039;&#039; is a capability.&lt;br /&gt;
&lt;br /&gt;
A permission is some value that is assigned for a capability for a particular role.  For example, allow or prevent.&lt;br /&gt;
&lt;br /&gt;
A context is a &amp;quot;space&amp;quot; in the Moodle, such as courses, activity modules, blocks etc.&lt;br /&gt;
&lt;br /&gt;
==The existing system==&lt;br /&gt;
&lt;br /&gt;
Currently in Moodle, we have a fixed set of roles i.e. primary admin, admins, course creators, editing teachers, non-editing teachers, students, and guests. For each role, the capability or actions that they can perform are fixed. For example, the role student allows the user to submit an assignment, but doesn&#039;t allow the user to browse/edit other users&#039; work. By using this setup we limit ourselves to a rather rigid set of capabilities for each role. If we want, say a particular student or group to be able to mark assignments in a particular course, we can&#039;t do that without giving these users teacher privileges.&lt;br /&gt;
&lt;br /&gt;
==The new roles and capability system==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Moodle 1.7}}Role has two primary functions:&lt;br /&gt;
# define list of permissions - role definition is global for all contexts, but can be changed by local context overrides&lt;br /&gt;
# replace old course erolments - role assignment in course context is simitar to the old enrolment process&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The new system will allow authorized users to define an arbitrary number of roles (eg a teacher) &lt;br /&gt;
&lt;br /&gt;
A role consists of a list of permissions for different possible actions within Moodle (eg delete discussions, add activities etc)&lt;br /&gt;
&lt;br /&gt;
Roles can be applied to users in a context (eg assign Fred as a teacher in a particular course)&lt;br /&gt;
&lt;br /&gt;
Here are the possible contexts, listed from the most general to the most specific. &lt;br /&gt;
&lt;br /&gt;
#CONTEXT_SYSTEM       -- the whole site&lt;br /&gt;
#CONTEXT_PERSONAL     -- yourself&lt;br /&gt;
#CONTEXT_USER         -- another user&lt;br /&gt;
#CONTEXT_COURSECAT    -- a course category&lt;br /&gt;
#CONTEXT_COURSE       -- a course&lt;br /&gt;
#CONTEXT_GROUP        -- a group&lt;br /&gt;
#CONTEXT_MODULE       -- an activity module&lt;br /&gt;
#CONTEXT_BLOCK        -- a block&lt;br /&gt;
&lt;br /&gt;
An authorized user will be able to assign an arbitrary number of roles to each user in any context.&lt;br /&gt;
&lt;br /&gt;
Capabilities can have the following permissions:&lt;br /&gt;
&lt;br /&gt;
#CAP_INHERIT&lt;br /&gt;
#CAP_ALLOW&lt;br /&gt;
#CAP_PREVENT&lt;br /&gt;
#CAP_PROHIBIT&lt;br /&gt;
&lt;br /&gt;
If no permission is defined, then the capability permission is inherited from a context that is more general than the current context. If we define different permission values for the same capability in different contexts, we say that we are overriding the capability in the more specific context.&lt;br /&gt;
&lt;br /&gt;
Since the capabilities in each role could be different, there could be conflict in capabilities. This is resolved by enforcing the rule that the capability defined for a more specific context will win, unless a prohibit is encountered in a less specific context.&lt;br /&gt;
&lt;br /&gt;
For example, Mark has a student role at course level, which allows him to write into a wiki. But Mark also got assigned a Visitor role at a module context level (for a particular wiki) which prevents him from writing to the wiki (read only). Therefore, for this particular wiki, Mark will not be able to write to the wiki since the more specific context wins.&lt;br /&gt;
&lt;br /&gt;
If we set a PROHIBIT on a capability, it means that the capability cannot be overridden and will ALWAYS  have a permission of prevent (deny). Prohibit always wins.   For example, Jeff has a naughty student role that prohibits him from postings in any forums (for the whole site), but he&#039;s also assigned a facilitator role in &amp;quot;Science forum&amp;quot; in the course Science and Math 101. Since prohibit always wins, Jeff is unable to post in &amp;quot;Science forum&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Allow and prevent will cancel each other out if set for the same capability at the same context level. If this happens, we refer to the previous context level to determine the permission for the capability.&lt;br /&gt;
&lt;br /&gt;
This may sound more complex than it really is in practice.  The upshot is that the system can be flexible enough to allow pretty much any combination of permissions.&lt;br /&gt;
&lt;br /&gt;
==Upgrading from 1.6==&lt;br /&gt;
&lt;br /&gt;
A smooth upgrade will be provided with 1.7. The existing roles (admin, teacher, student, etc), and the existing capabilities will be automatically retained.  This is done by creating default roles at site/course levels, and assigning the current users to these roles accordingly. The default roles will have default capabilities associated with them, mirroring what we have  in 1.6.   With no modifications, Moodle will operate exactly the same before and after the upgrade.&lt;br /&gt;
&lt;br /&gt;
===Admins===&lt;br /&gt;
&lt;br /&gt;
Admin users will be assigned the default legacy admin role in the system (site) context&lt;br /&gt;
&lt;br /&gt;
===Course Creators===&lt;br /&gt;
&lt;br /&gt;
Admin users will be assigned the default legacy course creator role in the system (site) context&lt;br /&gt;
&lt;br /&gt;
===Teachers===&lt;br /&gt;
&lt;br /&gt;
Users who were teachers will be assigned the default legacy teacher role (or non-editing teacher role) in all courses they were teacher.&lt;br /&gt;
&lt;br /&gt;
===Students===&lt;br /&gt;
&lt;br /&gt;
Users who were students will be assigned the default student role in all courses they were student.&lt;br /&gt;
&lt;br /&gt;
===Guests===&lt;br /&gt;
&lt;br /&gt;
There will still be a single guest user with no default role at site level.   For each course that allows guest access, the guest role will be assigned to the guest user for that course context.   The guest control for the course will be modified from three to two options (guests always need to enter enrolment key - on/off).  This setting is checked as now to force guests to enter key.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
This will be a comprehensive list of capabilities (it&#039;s not complete yet). It is important that capability names are unique.&lt;br /&gt;
&lt;br /&gt;
===Core-level Capabilities===&lt;br /&gt;
&lt;br /&gt;
Moodle core capability names start with &#039;moodle/&#039;.  The next word indicates what type of core capability it is, and the last word is the actual capability itself.  The capabilities for the Moodle core are defined in lib/db/access.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#moodle/legacy:guest - legacy capabilities are used to transition existing users to the new roles system during the upgrade to Moodle 1.7&lt;br /&gt;
#moodle/legacy:student&lt;br /&gt;
#moodle/legacy:teacher&lt;br /&gt;
#moodle/legacy:editingteacher&lt;br /&gt;
#moodle/legacy:coursecreator&lt;br /&gt;
#moodle/legacy:admin&lt;br /&gt;
#moodle/site:doanything - special capability, meant for admins, if is set, overrides all other capability settings&lt;br /&gt;
#moodle/site:config - applicable in admin/index.php and config.php (might break down later) : 1)admin/config.php 2)admin/configure.php 3)blocks/admin/block_admin.php load_content_for_site()&lt;br /&gt;
#moodle/site:readallmessages - reads all messages and history&lt;br /&gt;
#moodle/site:approvecourse - approves a pending course&lt;br /&gt;
#moodle/site:manageblocks - adding/removing/editing blocks (site, course contexts only for now) : 1)_add_edit_controls moodleblock.class.php &lt;br /&gt;
#moodle/site:backup - can create a course backup : 1)course/category.php 2)block_admin.php&lt;br /&gt;
#moodle/site:restore - can restore into this context : 1)course/category.php 2)block_admin.php&lt;br /&gt;
#moodle/site:import - can import other courses into this context : 1)block_admin.php&lt;br /&gt;
#moodle/site:accessallgroups - able to access all groups irrespective of what group the user is in&lt;br /&gt;
#moodle/site:accessdb - directly accessing db (phpmyadmin)&lt;br /&gt;
#moodle/site:viewfullnames - able to see fullnames of other users&lt;br /&gt;
#moodle/site:viewparticipants - able to view participants&lt;br /&gt;
#moodle/site:viewreports - able to view site/course reports&lt;br /&gt;
#moodle/site:trustcontent - ability to use trusttext feature and bypass cleaning in specific areas&lt;br /&gt;
#moodle/site:uploadusers - ability to upload/update users from text file; moodle/role:assign capability is needed for course enrolling&lt;br /&gt;
#moodle/blog:view - read blogs (usable in system or course context)&lt;br /&gt;
#moodle/blog:create - write new blog posts (usable in system context only)&lt;br /&gt;
#moodle/blog:manageofficialtags - create/delete official blog tags that others can use (usable in system context only)&lt;br /&gt;
#moodle/blog:managepersonaltags - delete personal blog tags that others can use (usable in system context only) Note: users can always add own personal tags. This setting should be off for students by default.&lt;br /&gt;
#moodle/blog:manageentries - edit/delete all blog entries (usable in system context only)&lt;br /&gt;
#moodle/course:setcurrentsection - mark course section&lt;br /&gt;
#moodle/course:create - create courses : 1)course/edit.php 2)course/category.php 3)course/index.php&lt;br /&gt;
#moodle/course:delete - create courses : 1)course/category.php&lt;br /&gt;
#moodle/course:update - update course settings&lt;br /&gt;
#moodle/course:view - can use this to find participants&lt;br /&gt;
#moodle/course:viewparticipants - allows a user to view participant list&lt;br /&gt;
#moodle/course:viewscales - view scales (i.e. in a help window?) : 1)course/scales.php&lt;br /&gt;
#moodle/course:manageactivities - adding/removing/editing activities and resources (don&#039;t think it makes any sense to split these)&lt;br /&gt;
#moodle/course:managescales - add, delete, edit scales, move scales up and down : 1)blocks/block_admin.php 2)course/scales.php&lt;br /&gt;
#moodle/course:managegroups - managing groups, add, edit, delete : 1)course/groups.php 2)course/group.php&lt;br /&gt;
#moodle/course:managefiles - manage course files and folders&lt;br /&gt;
#moodle/course:managequestions - manage course questions&lt;br /&gt;
#moodle/course:managemetacourse - manage child courses in metacourse&lt;br /&gt;
#moodle/course:reset - able to reset the course&lt;br /&gt;
#moodle/course:useremail - Can use the enable/disable email stuff&lt;br /&gt;
#moodle/course:visibility - hide/show courses : 1)course/category.php&lt;br /&gt;
#moodle/course:viewhiddencourses - see hidden courses&lt;br /&gt;
#moodle/course:activityvisibility - hide/show activities within a course&lt;br /&gt;
#moodle/course:viewhiddenactivities - able to see activities that have been hidden&lt;br /&gt;
#moodle/course:sectionvisibility - hide/show sections&lt;br /&gt;
#moodle/course:viewhiddensections - view hidden sections&lt;br /&gt;
#moodle/course:viewcoursegrades - views all grades in course&lt;br /&gt;
#moodle/course:viewhiddenuserfields - view all hidden user fields&lt;br /&gt;
#moodle/course:managegrades - manages grades settings in course&lt;br /&gt;
#moodle/category:create - create category : 1)course/index.php&lt;br /&gt;
#moodle/category:delete - delete category : 1)course/index.php&lt;br /&gt;
#moodle/category:update - update category settings (sort and rename) this is currently an admin capability : 1)course/category.php&lt;br /&gt;
#moodle/category:visibility - hide/show categories : 1)course/index.php&lt;br /&gt;
#moodle/user:viewusergrades - view your own, or other user&#039;s grades (with specified context)&lt;br /&gt;
#moodle/user:create - create user : 1) user/edit.php&lt;br /&gt;
#moodle/user:delete - delete user : 1) admin/user.php&lt;br /&gt;
moodle/user:readuserblogs - read blog entries&lt;br /&gt;
#moodle/user:update - update user settings : 1) user/edit.php&lt;br /&gt;
#moodle/user:viewdetails - view personally-identifying user details (e.g. name, photo).&lt;br /&gt;
#moodle/user:viewhiddendetails - view user details marked as &amp;quot;hidden&amp;quot;&lt;br /&gt;
#moodle/calendar:manageownentries - create/edit/delete &lt;br /&gt;
#moodle/calendar:manageentries - create/edit/delete&lt;br /&gt;
#moodle/role:assign - assign roles to users&lt;br /&gt;
#moodle/role:override - can override role capabilities (depending on context)&lt;br /&gt;
#moodle/role:manage - create/edit/delete roles, set capability permissions for each role&lt;br /&gt;
#moodle/role:unassignself - unassign yourself from your own roles&lt;br /&gt;
#moodle/role:viewhiddenassigns - view role assignments that have been marked as hidden&lt;br /&gt;
#moodle/question:import - imports questions (course level?) - Yes, question permissions currently need to be course-level.--[[User:Tim Hunt|Tim Hunt]]&lt;br /&gt;
#moodle/question:export - exports questions (course level?)&lt;br /&gt;
#moodle/question:managecateory - add/delete/edit question categories (course level?)&lt;br /&gt;
#moodle/question:manage - add/edit/delete a question (course level)&lt;br /&gt;
&lt;br /&gt;
===User-level Capabilities===&lt;br /&gt;
# moodle/user:readuserposts -read individual user posts on profile page (parent?)&lt;br /&gt;
# moodle/user:readuserblogs -read individual user blogs on profile page (parent?)&lt;br /&gt;
# moodle/user:viewuseractivitiesreport-read individual activity report on profile page (parent?)&lt;br /&gt;
# moodle/user:editprofile - edit profile (normally used in CONTEXT_USERID and CONTEXT_SYSTEM)&lt;br /&gt;
&lt;br /&gt;
===Module-level Capabilities===&lt;br /&gt;
The capabilities are cached into a database table when a module is installed or updated. Whenever the capability definitions are updated, the module version number should be bumped up so that the database table can be updated.&lt;br /&gt;
&lt;br /&gt;
The naming convention for capabilities that are specific to modules and blocks is &#039;mod/mod_name:capability&#039;.  The part before the colon is the full path to the module in the Moodle code.  The module capabilities are defined in mod/mod_name/db/access.php.&lt;br /&gt;
&lt;br /&gt;
#Assignment&lt;br /&gt;
##mod/assignment:view- reading the assignment description&lt;br /&gt;
##mod/assignment:submit - turn assignment in&lt;br /&gt;
##mod/assignment:grade - grading, viewing of list of submitted assignments&lt;br /&gt;
#Chat&lt;br /&gt;
##mod/chat:chat - allows a user to participate in this chat&lt;br /&gt;
##mod/chat:readlog - allows a user to read past chat session logs&lt;br /&gt;
##mod/chat:deletelog - allows a user to delete past chat logs&lt;br /&gt;
#Choice&lt;br /&gt;
##mod/choice:choose - make a choice&lt;br /&gt;
##mod/choice:readresponses - read all responses&lt;br /&gt;
##mod/choice:deleteresponses - deletes all responses&lt;br /&gt;
##mod/choice:downloadresponses - download responses&lt;br /&gt;
#Database&lt;br /&gt;
##mod/data:viewentry - reads other people&#039;s entry&lt;br /&gt;
##mod/data:writeentry - add / edit and delete (own) entries&lt;br /&gt;
##mod/data:managetemplates - add, delete, edit fields and templates&lt;br /&gt;
##mod/data:manageentries - edit/delete all entries&lt;br /&gt;
##mod/data:comment - comment&lt;br /&gt;
##mod/data:managecomments - edit/delete all comments&lt;br /&gt;
##mod/data:rate - rate an entry&lt;br /&gt;
##mod/data:viewrating&lt;br /&gt;
##mod/data:approve - approves an entry&lt;br /&gt;
##mod/data:uploadentries - batch upload of entries&lt;br /&gt;
#Exercise&lt;br /&gt;
##mod/exercise:assess&lt;br /&gt;
#Forum&lt;br /&gt;
##mod/forum:viewdiscussion&lt;br /&gt;
##mod/forum:viewdiscussionsfromallgroups&lt;br /&gt;
##mod/forum:viewhiddentimedposts&lt;br /&gt;
##mod/forum:startdiscussion&lt;br /&gt;
##mod/forum:replypost&lt;br /&gt;
##mod/forum:viewrating&lt;br /&gt;
##mod/forum:viewanyrating&lt;br /&gt;
##mod/forum:rate&lt;br /&gt;
##mod/forum:createattachment&lt;br /&gt;
##mod/forum:deleteownpost&lt;br /&gt;
##mod/forum:deleteanypost&lt;br /&gt;
##mod/forum:splitdiscussions&lt;br /&gt;
##mod/forum:movediscussions&lt;br /&gt;
##mod/forum:editanypost&lt;br /&gt;
##mod/forum:viewqandawithoutposting&lt;br /&gt;
##mod/forum:viewsubscribers&lt;br /&gt;
##mod/forum:managesubscriptions&lt;br /&gt;
##mod/forum:throttlingapplies&lt;br /&gt;
#Glossary&lt;br /&gt;
##mod/glossary:write - add entries&lt;br /&gt;
##mod/glossary:manageentries - add, edit, delete entries&lt;br /&gt;
##mod/glossary:managecategories - create, delete, edit categories&lt;br /&gt;
##mod/glossary:comment - comment on an entry&lt;br /&gt;
##mod/glossary:managecomments - edit, delete comments&lt;br /&gt;
##mod/glossary:import - import glossaries&lt;br /&gt;
##mod/glossary:export - export glossaries&lt;br /&gt;
##mod/glossary:approve - approve glossaries&lt;br /&gt;
##mod/glossary:rate - rates glossary&lt;br /&gt;
##mod/glossary:viewrating - view ratings&lt;br /&gt;
#Hotpot&lt;br /&gt;
##mod/hotpot:attempt - attempt a hotpot&lt;br /&gt;
##mod/hotpot:viewreport - review and view reports&lt;br /&gt;
##mod/hotpot:grade - (grade? and) regrade&lt;br /&gt;
##mod/hotpot:deleteattempt - deletes attempts&lt;br /&gt;
#Label&lt;br /&gt;
##none&lt;br /&gt;
#Lams&lt;br /&gt;
##mod/lams:participate - original student&lt;br /&gt;
##mod/lams:manage - original teacher&lt;br /&gt;
#Lesson&lt;br /&gt;
##mod/lesson:edit - add and edit pages&lt;br /&gt;
##mod/lesson:manage - view student attempts&lt;br /&gt;
#Quiz&lt;br /&gt;
##mod/quiz:grade - comment, override grade, manual grade&lt;br /&gt;
##mod/quiz:preview - previews the quiz&lt;br /&gt;
##mod/quiz:viewreports - view quiz result reports&lt;br /&gt;
##mod/quiz:manage - add/delete/move (up or down) questions for a quiz&lt;br /&gt;
##mod/quiz:attempt - attempt the quiz--[[User:Tim Hunt|Tim Hunt]]&lt;br /&gt;
#Resource&lt;br /&gt;
#Scorm&lt;br /&gt;
##mod/scorm:viewgrades&lt;br /&gt;
#Survey&lt;br /&gt;
##mod/survey:download - downloads survery result&lt;br /&gt;
##mod/survey:participate - participate/ do survey&lt;br /&gt;
##mod/survey:readresponses - read all user&#039;s responese&lt;br /&gt;
#Wiki&lt;br /&gt;
##mod/wiki:participate - original student, meaning depends of type and course setting&lt;br /&gt;
##mod/wiki:manage - original teacher, manages assigned group; moodle/site:accessallgroups is needed to manage all groups &lt;br /&gt;
##(Waiting on new wiki)&lt;br /&gt;
#Workshop&lt;br /&gt;
##mod/workshop:participate - original student, allows user to submit and assess&lt;br /&gt;
##mod/workshop:manage - original teacher, user can manage others&lt;br /&gt;
##(Waiting on new Workshop)&lt;br /&gt;
&lt;br /&gt;
===Enrolment-level Capabilities===&lt;br /&gt;
&lt;br /&gt;
The naming convention for capabilities that are specific to enrolment is &#039;enrol/enrol_name:capability&#039;. The enrolment capabilities are defined in enrol/enrol_name/db/access.php.&lt;br /&gt;
&lt;br /&gt;
#Authorize.net Payment Gateway &lt;br /&gt;
##enrol/authorize:managepayments - manage user payments, capture, void, refund, delete etc.&lt;br /&gt;
&lt;br /&gt;
===Blocks===&lt;br /&gt;
#activity_modules&lt;br /&gt;
##None&lt;br /&gt;
#admin&lt;br /&gt;
#admin_2&lt;br /&gt;
#admin_bookmarks&lt;br /&gt;
#blog_menu&lt;br /&gt;
#blog_tags&lt;br /&gt;
#calendar_month&lt;br /&gt;
#calendar_upcoming&lt;br /&gt;
#course_list&lt;br /&gt;
#course_summary&lt;br /&gt;
#glossary_random&lt;br /&gt;
#html&lt;br /&gt;
#loancalc&lt;br /&gt;
#login&lt;br /&gt;
#messages&lt;br /&gt;
#news_items&lt;br /&gt;
#online_users&lt;br /&gt;
#participants&lt;br /&gt;
#quiz_results&lt;br /&gt;
#recent_activity&lt;br /&gt;
#rss_client&lt;br /&gt;
##block/rss_client:createprivatefeeds&lt;br /&gt;
##block/rss_client:createsharedfeeds&lt;br /&gt;
##block/rss_client:manageownfeeds&lt;br /&gt;
##block/rss_client:manageanyfeeds&lt;br /&gt;
#search&lt;br /&gt;
#search_forums&lt;br /&gt;
#section_links&lt;br /&gt;
#site_main_menu&lt;br /&gt;
#social_activities&lt;br /&gt;
&lt;br /&gt;
===Questions===&lt;br /&gt;
I am adding question categories here because they seem to have been forgotten in the whole scheme of things since having been removed from the quiz module itself. I&#039;ve made a suggestion on how these could be handled in [http://www.moodle.org/bugs/bug.php?op=show&amp;amp;bugid=6118&amp;amp;pos= bug 6118].&lt;br /&gt;
&lt;br /&gt;
See [http://moodle.org/mod/forum/discuss.php?d=51143 this forum thread] for a discussion about the current problems wth publishing question categories.[[User:Tim Hunt|Tim Hunt]] 18:50, 8 August 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Programming Interface==&lt;br /&gt;
&lt;br /&gt;
Although the Roles system may look complicated at first glance, implementing it in Moodle code is fairly simple.&lt;br /&gt;
&lt;br /&gt;
* You need to define each capability once, so that Moodle can upgrade existing roles to take advantage of it.  You do this in an access.php inside the db folder of any module (eg see mod/forum/db/access.php).  The array contains entries like this (note the descriptions for the legacy roles which provides forward compatibility):&lt;br /&gt;
    &#039;mod/forum:viewforum&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;captype&#039; =&amp;gt; &#039;read&#039;,&lt;br /&gt;
        &#039;contextlevel&#039; =&amp;gt; CONTEXT_MODULE,&lt;br /&gt;
        &#039;legacy&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;guest&#039; =&amp;gt; CAP_PREVENT,&lt;br /&gt;
            &#039;student&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;teacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;editingteacher&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;coursecreator&#039; =&amp;gt; CAP_ALLOW,&lt;br /&gt;
            &#039;admin&#039; =&amp;gt; CAP_ALLOW&lt;br /&gt;
        )&lt;br /&gt;
    ),&lt;br /&gt;
* To load/change these capabilities you need to bump the module version.   There&#039;s no need to provide changes or differences as Moodle will scan the whole array and sort it out.&lt;br /&gt;
* On each page you need to find the context the user is working in, using the get_context_instance() function.  For example, in the forum module:&lt;br /&gt;
&lt;br /&gt;
  $context = get_context_instance(CONTEXT_MODULE, $cm-&amp;gt;id);&lt;br /&gt;
* Then, whenever you want to check that the current user has rights to do something, call has_capability() like this:&lt;br /&gt;
    if (!has_capability(&#039;mod/forum:viewforum&#039;, $context)) {&lt;br /&gt;
        print_error(&#039;nopermissiontoviewforum&#039;);&lt;br /&gt;
    }&lt;br /&gt;
* If you just want to assert a capability and then finish with an error message if it&#039;s not met (as we did above), then a shorter way it to use require_capability() like this:&lt;br /&gt;
&lt;br /&gt;
    require_capability(&#039;mod/forum:viewforum&#039;, $context);&lt;br /&gt;
&lt;br /&gt;
* Note that there are extra parameters you can specify to get a custom error message, otherwise users get an automated &amp;quot;No permissions&amp;quot; message that lists the permission they were missing.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
As a result of the new Roles System, all calls to isadmin(), iscoursecreator, isteacheredit(), isteacher(), isstudent(), and isguest() will have to be replaced with calls to has_capability() or require_capability().   However, these functions will be retained for some backward compatibility with old code, using the legacy capabilities to try and work out what to do.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Metacourses==&lt;br /&gt;
&lt;br /&gt;
The behaviour of metacourses in Moodle 1.7 changed slightly, in that where it used to just synch students from child courses to the parent course, it will now synch ALL roles. Teachers etc of the child courses will have the same role in the meta course. Technically metacourse synchronises all role assignments in CONTEXT_COURSE with its child courses; the only exception are users with moodle/course:managemetacourse capability, these users are synchronized only upwards, they are not unenrolled from metacourse when unenroling from child course or when removing the child from metacourse.&lt;br /&gt;
&lt;br /&gt;
In order to import/enrol other courses into metacoure you need to have moodle/course:managemetacourse capability. You can add manually only participants with moodle/course:managemetacourse, all other participants are automatically synced with child courses - if you try to manually enrol user without this capability error is displayed. Similar error is shown also when you try to manually unenrol participant from meta course while still being enrolled in child course.&lt;br /&gt;
&lt;br /&gt;
Sample setup:&lt;br /&gt;
* metacourse manager has been assigned role with moodle/course:managemetacourse capability in system or course category context&lt;br /&gt;
* students are enrolled in several child courses&lt;br /&gt;
* teachers are enrolled in separate child course(s)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Problem areas we are working on ==&lt;br /&gt;
&lt;br /&gt;
===Student view===&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Student view&amp;quot; button has been removed completely.&lt;br /&gt;
&lt;br /&gt;
If there is time and a secure way can be found, it will be replaced by a menu to let the user assume a temporary role in the context of that course.&lt;br /&gt;
&lt;br /&gt;
===Teacher forum===&lt;br /&gt;
&lt;br /&gt;
Teacher forums were always a curious exception to normal forums, as they were not part of a course as such, and were not backed up.&lt;br /&gt;
&lt;br /&gt;
We&#039;re taking the opportunity to rectify this.   The upgrade converts teacher forums with content to normal forums in section 0 of the course, and ensures that only teachers can access them.  If the teacher forum had not been used in the course then it&#039;s not converted and will just dissappear.&lt;br /&gt;
&lt;br /&gt;
===Enrolment plugins===&lt;br /&gt;
&lt;br /&gt;
====Process of logging in====&lt;br /&gt;
&lt;br /&gt;
# load_user_capability() is called to load all the capabilities&lt;br /&gt;
# check_enrolment_plugins() is called at the top of load_user_capability() to check all the enrolment plugins.&lt;br /&gt;
# For each active plugin:&lt;br /&gt;
##Check for setup_enrolments($user) and run it.  This function will do all the processing needed to assign or unassign roles from the current user.&lt;br /&gt;
# load_user_capability() continues and loads up all the roles&lt;br /&gt;
# load_defaultuser_role() is called to add default site permissions (all users)&lt;br /&gt;
&lt;br /&gt;
====Process of checking access to a course====&lt;br /&gt;
&lt;br /&gt;
require_login($course-&amp;gt;id) is called by the script and has logic like this:&lt;br /&gt;
&lt;br /&gt;
# Is the user a guest at site level?&lt;br /&gt;
## Yes: Does the course allow guests?&lt;br /&gt;
### Yes: return true (and further capabilities are checked by the script)&lt;br /&gt;
### No:  send the user to course/enrol.php for enrolment&lt;br /&gt;
## No: continue below&lt;br /&gt;
&lt;br /&gt;
# Does the user have moodle/course:view in that (course) context?&lt;br /&gt;
## Yes: then they can enter (and further capabilities are checked by the script)&lt;br /&gt;
##  No: is guest access allowed on the course?&lt;br /&gt;
### Yes: assign temporary guest role to that user for that context (in session cache).&lt;br /&gt;
### No: send the user to course/enrol.php for enrolment.&lt;br /&gt;
&lt;br /&gt;
====Process of enrolling====&lt;br /&gt;
&lt;br /&gt;
(more soon)&lt;br /&gt;
&lt;br /&gt;
==Scenario brainstorming==&lt;br /&gt;
&lt;br /&gt;
This section is for brainstorming some example roles that we would like to support.  Note some of these *may* not be possible in 1.7.&lt;br /&gt;
&lt;br /&gt;
===Student===&lt;br /&gt;
Obviously.&lt;br /&gt;
&lt;br /&gt;
===Site Designers===&lt;br /&gt;
Is there a role for people involved in how the site looks but not full administrators? Thinking here of online control of themes rather than FTP theme uploading. But in either case they caneditlogos, caneditcss, candeditlevelatwhichthemeapplies.&lt;br /&gt;
&lt;br /&gt;
===Educational Authority Adviser===&lt;br /&gt;
Someone who would want to browse the site and may be asked to comment or contribute to particular discussions or developments in school. Access for this role would be controlled by the school in the case of school level moodles but may be different if there were to be a Local Authority wide Moodle.&lt;br /&gt;
&lt;br /&gt;
===Educational Inspector===&lt;br /&gt;
Someone who will visit the site to verify the school&#039;s self review that comments on home school relationships, extending the classroom etc. They may want to see summaries of usage and reports from surveys garnering parent and pupil views.&lt;br /&gt;
&lt;br /&gt;
===Second Marker / Moderator===&lt;br /&gt;
A teacher within ths site that has access to assignments and quizzes from another teacher&#039;s course for second marking purposes. This may need additional functionality adding to the assignment module so that two sets of grades/feedback can be given to one set of assignments.&lt;br /&gt;
&lt;br /&gt;
===Peer observer of teaching===&lt;br /&gt;
Many institutions encourage peer observation of teaching, to encourage reflection on practice. In online environments this will be similar to moderation or inspection. The peer observer would need to be able to experience the course &amp;quot;as a student&amp;quot;, but also to be able to view summaries of usage, transcripts of interactions (forums/surveys/polls etc), grades assigned (e.g. in assignments).&lt;br /&gt;
&lt;br /&gt;
===External Examiner===&lt;br /&gt;
Has all the rights of inspectors, but would also need to be able to review assignments and feedback, view forums, glossaries etc. However, would not want to post, feedback onto the site at all.&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
A parent will have one or more children in one or more institutions which could be using one or more moodle instances or a mixture of Learning Platforms. A parent&#039;s role will vary depending on the age of their children and whether they are contributing as a parent or a school supporter.&lt;br /&gt;
&lt;br /&gt;
In Early Years (EY=3+4 yr olds) and Key Stage 1 (KS1=5+6 yr olds) they may play/learn on an activity or write for the child. Parents often interpret homework tasks and read to their children perhaps filling in a joint reading diary. In Key Stage 2 (KS2=7-11 yr olds) parents would be more monitoring but may join in as well.&lt;br /&gt;
&lt;br /&gt;
In Key stages 3 (KS3=12-14 yr olds) and 4 (KS4=15+16 yr olds) this changes to more of a monitoring/awareness role where a parent would expect to have a summary report of attendance, attainment and general achievement on a weekly/monthly/termly or annual basis. Parents will often be asked to sign and write back comments about this review report.&lt;br /&gt;
&lt;br /&gt;
In all Key Stages there is a great need for parents to receive communication from the school which they can confirm they have received by signing a form. In some cases this may also involve making choices from a list. It may also involve payment for a trip or disco being returned so there could be the possibility of electronic payments. Also in all Key Satges there may be a home-school agreement which may be signed up to. Could this form part of a site policy system that incorporates a tickable list of activities the parent agrees to the child using (blogs/wikis/forums etc.)?&lt;br /&gt;
&lt;br /&gt;
Parent&#039;s evenings often involve complex booking systems that attempt to get parent&#039;s and teachers together. Easy for EY/KS1/KS2 very difficult for KS3/KS4. Wow would this help if it was built into the Learning Platform.&lt;br /&gt;
&lt;br /&gt;
In some cases there needs to be confidential communication between the parent and the teacher without the child being party to this. It may involve teaching and learning but could also involve a behaviour or medical issue. Often this may be done via a sealed letter or face to face. &lt;br /&gt;
&lt;br /&gt;
The latest incarnation of OfSTED with the Self Review Framework (SEF) there is a greater emphasis on schools gathering parent voice via surveys and discussion. There is a clear match here with parents have access to parental votes, questionnaires and discussions and for schools to be able to publish news, results and reports back to parents.&lt;br /&gt;
&lt;br /&gt;
In the UK the LP framework and agenda as being pushed by the DfES via Becta emphasises that within the mandatory groups and roles functionality the parent role is likely to be required to meet the LP Framework procurement standard.&lt;br /&gt;
&lt;br /&gt;
Again in the UK, parents have their own independent right of access to a child&#039;s educational records. Obviously, children&#039;s records must not be made available to other parties, including the parents of other children in the same class. Thus it would be necessary to associate parent accounts with their own child&#039;s accounts in such a way that they could, if so desired, have read access to their child&#039;s grades, answers and contributions, but generally not those of other children - this may be problematic in the case of wiki activities or forum posts.&lt;br /&gt;
&lt;br /&gt;
There is some concern that children&#039;s forum contributions etc may be constrained if their parents are able to read all that they write; this may be particularly problematic in areas such as Personal, Social and Health Education (PSHE), where some schools may choose to use obfuscated usernames.&lt;br /&gt;
&lt;br /&gt;
===Manager===&lt;br /&gt;
&#039;&#039;Please add text here...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Weekly Seminar Leader===&lt;br /&gt;
&#039;&#039;In a university seminar, typically 8-15 students in their 3rd/4th year, each student is responsible for leading one topic in a study series.  I ask each student to research 5-10 resources, then give a powerpoint presentation to the other students.  This is followed by an in-class discussion and then online homework.  The homework involves some fun quiz questions and then some reflective journal questions.  I ask each seminar leader to prepare the quiz questions and journal questions as well as their presentation.  To do that, I would like to assign activity-making/authoring roles to the student--either for a short period, or for duration of the whole course.  Thus &amp;quot;Allow Quiz Authoring Role&amp;quot; or &amp;quot;Allow Assignment Authoring Role&amp;quot; at the course level or, if possible, even the Topic level (in a topic or week format course) would be important.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mentor/Mentee===&lt;br /&gt;
&#039;&#039;Please add text here...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Community-Designed Rating Criteria===&lt;br /&gt;
&#039;&#039;The gradebook tends to be the domain of the teacher.  What if community/peer ratings/marks could also be entered there? What if peer assessment criteria could be designed by the students, not just the teacher?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visitor===&lt;br /&gt;
&lt;br /&gt;
This would be a role whereby one could allow a visitor to visit one&#039;s classroom. This might be a colleague interested in seeing your course, or a journalist who might be writing an article about one&#039;s site. They should not be able to see the names of any students anywhere (eg recent activity, forum posts) for privacy reasons. They should be able to try out things like quizzes, and lessons but no grades would be recorded (like in teacher preview mode). They would not be able to participate in choices and forums but could view them. It would be read only in a way like former-student role below but without access to a particular student&#039;s records that former student role would grant.&lt;br /&gt;
&lt;br /&gt;
===Guest Speaker===&lt;br /&gt;
&lt;br /&gt;
This role would be similar to the Visitor role above, but would allow seeing student names, and also allow both reading and posting to a specific forum or forums. We often have &amp;quot;guest speakers&amp;quot; who read and respond to student forum posts. Right now we have to add them as students, which isn&#039;t ideal.&lt;br /&gt;
&lt;br /&gt;
===Former Student===&lt;br /&gt;
This role would be of particular use for courses with rolling enrollments. This role would be one where a student had completed all of the requirements of a course (ie assignments, quizzes etc.) but wished to have continued access to the course material for review or consultation. The key factor is that one would give access to the completed student to the notes he read, his work and the teacher&#039;s comments on it, but he would not be allowed to do anything that would take up the teacher&#039;s time. In other words, a sort-of read-only access to the course. How forums, which might contain pertinent information and would continue to grow, would be handled is a question. Perhaps the student would be shown only what was in the forums at the time he completed the course. He would not be allowed to see any new posts or add any himself. Same thing for database and glossary entries. In other words, a snapshot of the course at the time his regular enrollment ended. He shouldn&#039;t be able to see the names or profiles of any newly enrolled students for privacy reasons-hence the restrictions on forum access. One issue that would have to be dealt with would be changes to existing modules-such as resources. Does the student get access to the module as it was or as it is? We have no versioning of resources in Moodle so this would be a problem. What about a teacher changing a quiz question so that the answer is different? What would a former student see?&lt;br /&gt;
&lt;br /&gt;
===Alumnus=== An ALUMNUS should be able to search for all other ALUMNI of the school, interact with them and be enrolled in a seperate course - which is like a META course with all the content of his learning and interaction - as well as capabilities to be a part of this ALUMNI only course.  All the teachers of courses during school years should automatically be a part of the ALUMNI course .. which means when an ALUMNUS is enrolled in a course, the original teachers of all his courses get enrolled ?  --[[User:Anil Sharma|Anil Sharma]] 20:54, 15 July 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
===Librarian===&lt;br /&gt;
&lt;br /&gt;
Reference Librarians have an active role in most of the courses taught at some schools such as Earlham College (with Bibliographic Instruction). The Librarian role within Moodle could encompass default read access to all courses (unless prohibited by course teacher) and read access to all components of the course unless access is barred (again by teacher). The Librarians would also perhaps have a block called perhaps Reference Services or Reference Desk with write access where they could deposit resources. Also this block might have a chat applet whereby enrolled students could chat to the Reference Librarian on duty about their bibliographic research needs.&lt;br /&gt;
&lt;br /&gt;
In schools there is often a book review system. This may be covered by the lending system database but may not in which case a librarian may neeed to have a course area they can create a database template to handle the reviews in which case they may have a normal teacher style role? Off topic but course an integration with common schools database systems would be great.&lt;br /&gt;
&lt;br /&gt;
===Teacher===&lt;br /&gt;
&lt;br /&gt;
Teachers should have read access to other Teacher&#039;s courses unless explictly prohibited. They should be able to set parts of their own course to be totally private (perhaps even to admin?). Just as each activity can currently be set to have group access, each activity could have a permissions field. Teachers could set default permissions for all activities on their course (eg they might disallow Librarian access for example) and then change the access permission for an individual activity. &lt;br /&gt;
&lt;br /&gt;
I think that what is needed is a simple heirarchy of permissions and levels of granularity.&lt;br /&gt;
&lt;br /&gt;
I would take issue with &amp;quot;teachers should have read access to other teacher&#039;s courses unless explicitly prohibited.&amp;quot; This is a violation of the students&#039; privacy as how they perform and what they do in one class isn&#039;t the business of another teacher. Moreover, in the real world a teacher wouldn&#039;t suddenly go sit in on a colleague&#039;s class without asking permission first. I would not have appreciated such an invasion of privacy as either a teacher or a student. It could be an option, but shouldn&#039;t be default.--[[User:N Hansen|N Hansen]] 19:54, 12 June 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
===Community Education Tutors/Trainers===&lt;br /&gt;
Teachers may be community adult education trainers making use of a school moodle so must only have access to their courses unless given access elsewhere. They would not necessarily get the default teacher privileges.&lt;br /&gt;
&lt;br /&gt;
===Secretary/Student Worker===&lt;br /&gt;
&lt;br /&gt;
We often have faculty who want their departmental secretary or student worker to scan and upload files and perhaps create resources. Currently they have to be given teacher access to the course. This is dangerous from a FERPA standpoint since they could easily get access to grades.&lt;br /&gt;
&lt;br /&gt;
===Teaching Assistant===&lt;br /&gt;
&lt;br /&gt;
Our Faculty frequently have undergraduate students acting as Teaching Assistants. These students need to be able to add resources, create assignments, and possibly grade assignments. However, due to FERPA they cannot have access to other students&#039; overall grade information. I think the requirements here are slightly different than those of Secretary/Student Worker&lt;br /&gt;
&lt;br /&gt;
===Student - FERPA rights===&lt;br /&gt;
&lt;br /&gt;
A student that has asserted their FERPA rights to non-disclosure.  Typically includes not publishing their name&lt;br /&gt;
in any public place.  Could include this student only being seen with an &amp;quot;alias&amp;quot; within course spaces.  Is this an attribute rather&lt;br /&gt;
than a role?&lt;br /&gt;
&lt;br /&gt;
===Help Desk===&lt;br /&gt;
&lt;br /&gt;
Help desk agents that have read access for the purposes of trouble shooting.  Some care in placing this role within a hierarchy&lt;br /&gt;
of inheritance is needed, full access will be problematic with FERPA.&lt;br /&gt;
&lt;br /&gt;
===Admin - Catgory based===&lt;br /&gt;
&lt;br /&gt;
Basically a person in between full Admin and Creator that has the permissions of an Admin but only with respect to courses and students. Currently a Creator has permissions site-wide which does not always meet the requirements of a given organisation (e.g. Department A may not be happy that a person from Department B can create/modify courses within Department A&#039;s area). The ability to designate a Creator within a specific category would allow areas to be set up for a faculty/department/organisation and allow the Admin for that area to create/delete courses, upload users, add site-wide entries to the calendar etc.&lt;br /&gt;
&lt;br /&gt;
===Process Roles===&lt;br /&gt;
&lt;br /&gt;
organising the learning process for a group you wish to have the choice to place students in differnt roles: examples of this are:&lt;br /&gt;
* Give a student the role of forum-moderator with edit and chunk-rights&lt;br /&gt;
* Give students different roles &amp;amp; rights in a Webquest design (and change these roles next week&lt;br /&gt;
* Give students different resources, depending of their roles in a rolegame/simulation&lt;br /&gt;
* Give a student the rights to create the section content of next week (and only that week..)&lt;br /&gt;
&lt;br /&gt;
==Things to finish for 1.7 Beta==&lt;br /&gt;
&#039;&#039;&#039;18 Sept 2006&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
#Remove core references to user_student, user_teacher, user_admin, user_coursecreator tables.  [Yu]&lt;br /&gt;
#Address function: isteacher, isadmin, isstudent [Yu]&lt;br /&gt;
#Remove &amp;quot;view&amp;quot; capabilities from all modules unless required [Vy]&lt;br /&gt;
#Remove all old references from remaining Blocks [Vy]&lt;br /&gt;
#Metacourses [Skodak]&lt;br /&gt;
#Add risks to GUI[Skodak]&lt;br /&gt;
#Enrolment plugins  [Martin and Alastair]&lt;br /&gt;
#[[Development:Stats_roles_1.7|Statistics]] [Penny]&lt;br /&gt;
#Fix Loginas&lt;br /&gt;
#Add category-level assigns [Yu]&lt;br /&gt;
#[[Development:Backup_roles_1.7|Backups]] [Eloy?]&lt;br /&gt;
&lt;br /&gt;
===Proposal for interface enhancement===&lt;br /&gt;
Martin asked some questions, here are my answers. The sketches below are not worked out proposals. Their task is to visualize the idea. The exact colours and functionality may be defined after possible agreement about the proposals. The Green, orange and red columns support the meaning of the options from &amp;quot;allow&amp;quot; to &amp;quot;prohibit&amp;quot; (If you may want to see larger images please click onto the image or the &amp;quot;Enlarge&amp;quot; icon below the image.)&lt;br /&gt;
&lt;br /&gt;
The list of possible settings is very long and &#039;&#039; &amp;quot;... the problem is not to overwhelm people with information&amp;quot; &#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
[[Image:01_moodle_define_roles_structured.png|thumb=01_moodle_define_roles_structured_pre.png]]&lt;br /&gt;
&lt;br /&gt;
1) One proposal is to use colour to structure the sections and the columns. Picture 1 shows that the user can keep a much better overview when the list is divided into meaningful different coloured columns and clear sections.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:02_moodle_define_roles_collapsed.png|thumb=02_moodle_define_roles_collapsed_pre.png]]&lt;br /&gt;
&lt;br /&gt;
2) A second proposal is to reduce the amount of information the user is shown at the same time. The YUI interface library offers great support to show/hide sections of the page by clicking on specific elements. &lt;br /&gt;
&lt;br /&gt;
For example click on an icon beside the sub heading &amp;quot;Course categories&amp;quot; and show/hide all table rows with the CLASS &amp;quot;course-category&amp;quot;.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Image:03_moodle_define_roles_tooltip.png|thumb=03_moodle_define_roles_tooltip_pre.png]]&lt;br /&gt;
&lt;br /&gt;
3) &#039;&#039; &amp;quot;The main problem is the last column for risk ... we were thinking of putting little icons in there ...&amp;quot; &#039;&#039;&lt;br /&gt;
Icons are good when they tell the user more about possible actions/meanings then the letters. I am not sure if this is the case here. For both - icons or letters - the YUI tool-tip function would be able to give the user valuable information about the meaning.&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear:both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Hardening new Roles system]]&lt;br /&gt;
*Using Moodle course:&lt;br /&gt;
**[http://moodle.org/mod/forum/view.php?f=941 Roles and Capabilities forum]&lt;br /&gt;
**Key discussions at Using Moodle forums:&lt;br /&gt;
***[http://moodle.org/mod/forum/discuss.php?d=38788 Roles and Permissions architecture]&lt;br /&gt;
***[http://moodle.org/mod/forum/discuss.php?d=56302#256313 An example of admin roles as set in the database]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Future]]&lt;br /&gt;
[[Category:Roles]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=mod/data&amp;diff=16672</id>
		<title>mod/data</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=mod/data&amp;diff=16672"/>
		<updated>2006-10-06T08:21:40Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;see [[Database module]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16389</id>
		<title>Development:Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16389"/>
		<updated>2006-09-27T09:51:04Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Documentation for core components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; New developer documentation pages should be added to the &#039;&#039;Development namespace&#039;&#039; by typing &amp;lt;code&amp;gt;Development:&amp;lt;/code&amp;gt; before the new page name i.e. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Development:New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Guidelines==&lt;br /&gt;
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:&lt;br /&gt;
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers&lt;br /&gt;
*[[Moodle architecture]] spells out the basic design goals behind Moodle&lt;br /&gt;
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface&lt;br /&gt;
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS&lt;br /&gt;
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.&lt;br /&gt;
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc &lt;br /&gt;
&lt;br /&gt;
== Resources and tools ==&lt;br /&gt;
&lt;br /&gt;
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle&lt;br /&gt;
*[http://tracker.moodle.org/ Moodle bug tracker] - bug reports, feature requests and other tracked issues&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=55 General developer forum]&lt;br /&gt;
*[http://moodle.cvs.sourceforge.net/moodle/moodle/ CVS code] - browse the Moodle code via the web&lt;br /&gt;
*[http://moodle.org/xref/nav.html?index.html Cross reference] - phpxref output for browsing Moodle source code&lt;br /&gt;
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - automatically generated documentation&lt;br /&gt;
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course&lt;br /&gt;
*[http://developer.yahoo.com/yui YUI documentation] - YUI is the official AJAX library in moodle.&lt;br /&gt;
*[[Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.&lt;br /&gt;
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD&lt;br /&gt;
&lt;br /&gt;
==How you can contribute==&lt;br /&gt;
&lt;br /&gt;
The M in Moodle stands for &#039;Modular&#039;. There are many different types of components that you can contribute that can be plugged into Moodle to provide additional functionality. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. The following types of plugins currently exist (in alphabetical order):&lt;br /&gt;
*[[Modules (developer)|Activity modules]]&lt;br /&gt;
*[[Assignment types]]&lt;br /&gt;
*[[Authentication|Authentication methods]]&lt;br /&gt;
*[[Blocks Howto|Blocks]]&lt;br /&gt;
*[[Course formats]]&lt;br /&gt;
*[[Database fields (developer)|Database fields]]&lt;br /&gt;
*[[Database presets]]&lt;br /&gt;
*[[Enrolment plugins (developer)|Enrolment plugins]]&lt;br /&gt;
*[[Filters (developer)|Filters]]&lt;br /&gt;
*[[Question_engine]]&lt;br /&gt;
*[[Question import/export formats]]&lt;br /&gt;
*[[Question bank|Question bank teacher docs]]&lt;br /&gt;
*[[Question_engine#Question_types|Question types developper docs]]&lt;br /&gt;
*[[Quiz reports]]&lt;br /&gt;
*[[Resource types]]&lt;br /&gt;
*[[SSO plugins]]&lt;br /&gt;
&lt;br /&gt;
There are also ways you can contribute that don&#039;t involve PHP programming:&lt;br /&gt;
*[[Themes]]&lt;br /&gt;
*[[Translation]]&lt;br /&gt;
*[[Database Schemas|Database schemas]]&lt;br /&gt;
&lt;br /&gt;
You can also help a lot by&lt;br /&gt;
*[[Tests|Testing]]&lt;br /&gt;
*[[Tracker|Participating in the bug tracker]]&lt;br /&gt;
&lt;br /&gt;
==Plans for the future==&lt;br /&gt;
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.&lt;br /&gt;
&lt;br /&gt;
Once ideas begin to crystalize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
*[[Developer notes]]&lt;br /&gt;
*[[Student projects]]&lt;br /&gt;
*[[Developer conference|Developer conferences]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for core components==&lt;br /&gt;
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].&lt;br /&gt;
&lt;br /&gt;
*[[Development:Migration to Role-driven model|Migration to Role-driven model]] @ v[[1.7]]&lt;br /&gt;
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]&lt;br /&gt;
*[[Question engine]]&lt;br /&gt;
*[[Quiz developer docs|Quiz module]]&lt;br /&gt;
*[[SCORM schema|SCORM module 1.5 schema]]&lt;br /&gt;
*[[Authentication API]]&lt;br /&gt;
*[[Stats package]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Cookieless Sessions]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for contributed code==&lt;br /&gt;
Many Moodle users contribute code for the benefit of other Moodle users. This can take the form of new activity modules, blocks, themes, resource plug-ins, assignment plug-ins, question type plug-ins, question import/export formats, quiz report plug-ins, course formats, ... This code is initially posted on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course and then often go into the [http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/ contrib area] of the Moodle [[CVS]] repository. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. Developer documentation for these components should be listed here.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://security.moodle.org/ Moodle Security Centre]&lt;br /&gt;
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[es:Documentación para Desarrolladores]]&lt;br /&gt;
[[fr:Documentation développeur]]&lt;br /&gt;
[[zh:开发者文档]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16388</id>
		<title>Development:Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16388"/>
		<updated>2006-09-27T09:50:33Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Documentation for core components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; New developer documentation pages should be added to the &#039;&#039;Development namespace&#039;&#039; by typing &amp;lt;code&amp;gt;Development:&amp;lt;/code&amp;gt; before the new page name i.e. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Development:New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Guidelines==&lt;br /&gt;
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:&lt;br /&gt;
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers&lt;br /&gt;
*[[Moodle architecture]] spells out the basic design goals behind Moodle&lt;br /&gt;
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface&lt;br /&gt;
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS&lt;br /&gt;
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.&lt;br /&gt;
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc &lt;br /&gt;
&lt;br /&gt;
== Resources and tools ==&lt;br /&gt;
&lt;br /&gt;
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle&lt;br /&gt;
*[http://tracker.moodle.org/ Moodle bug tracker] - bug reports, feature requests and other tracked issues&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=55 General developer forum]&lt;br /&gt;
*[http://moodle.cvs.sourceforge.net/moodle/moodle/ CVS code] - browse the Moodle code via the web&lt;br /&gt;
*[http://moodle.org/xref/nav.html?index.html Cross reference] - phpxref output for browsing Moodle source code&lt;br /&gt;
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - automatically generated documentation&lt;br /&gt;
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course&lt;br /&gt;
*[http://developer.yahoo.com/yui YUI documentation] - YUI is the official AJAX library in moodle.&lt;br /&gt;
*[[Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.&lt;br /&gt;
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD&lt;br /&gt;
&lt;br /&gt;
==How you can contribute==&lt;br /&gt;
&lt;br /&gt;
The M in Moodle stands for &#039;Modular&#039;. There are many different types of components that you can contribute that can be plugged into Moodle to provide additional functionality. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. The following types of plugins currently exist (in alphabetical order):&lt;br /&gt;
*[[Modules (developer)|Activity modules]]&lt;br /&gt;
*[[Assignment types]]&lt;br /&gt;
*[[Authentication|Authentication methods]]&lt;br /&gt;
*[[Blocks Howto|Blocks]]&lt;br /&gt;
*[[Course formats]]&lt;br /&gt;
*[[Database fields (developer)|Database fields]]&lt;br /&gt;
*[[Database presets]]&lt;br /&gt;
*[[Enrolment plugins (developer)|Enrolment plugins]]&lt;br /&gt;
*[[Filters (developer)|Filters]]&lt;br /&gt;
*[[Question_engine]]&lt;br /&gt;
*[[Question import/export formats]]&lt;br /&gt;
*[[Question bank|Question bank teacher docs]]&lt;br /&gt;
*[[Question_engine#Question_types|Question types developper docs]]&lt;br /&gt;
*[[Quiz reports]]&lt;br /&gt;
*[[Resource types]]&lt;br /&gt;
*[[SSO plugins]]&lt;br /&gt;
&lt;br /&gt;
There are also ways you can contribute that don&#039;t involve PHP programming:&lt;br /&gt;
*[[Themes]]&lt;br /&gt;
*[[Translation]]&lt;br /&gt;
*[[Database Schemas|Database schemas]]&lt;br /&gt;
&lt;br /&gt;
You can also help a lot by&lt;br /&gt;
*[[Tests|Testing]]&lt;br /&gt;
*[[Tracker|Participating in the bug tracker]]&lt;br /&gt;
&lt;br /&gt;
==Plans for the future==&lt;br /&gt;
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.&lt;br /&gt;
&lt;br /&gt;
Once ideas begin to crystalize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
*[[Developer notes]]&lt;br /&gt;
*[[Student projects]]&lt;br /&gt;
*[[Developer conference|Developer conferences]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for core components==&lt;br /&gt;
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].&lt;br /&gt;
&lt;br /&gt;
*[[Development:Migration to Role-driven model]] @ v[[1.7]]&lt;br /&gt;
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]&lt;br /&gt;
*[[Question engine]]&lt;br /&gt;
*[[Quiz developer docs|Quiz module]]&lt;br /&gt;
*[[SCORM schema|SCORM module 1.5 schema]]&lt;br /&gt;
*[[Authentication API]]&lt;br /&gt;
*[[Stats package]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Cookieless Sessions]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for contributed code==&lt;br /&gt;
Many Moodle users contribute code for the benefit of other Moodle users. This can take the form of new activity modules, blocks, themes, resource plug-ins, assignment plug-ins, question type plug-ins, question import/export formats, quiz report plug-ins, course formats, ... This code is initially posted on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course and then often go into the [http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/ contrib area] of the Moodle [[CVS]] repository. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. Developer documentation for these components should be listed here.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://security.moodle.org/ Moodle Security Centre]&lt;br /&gt;
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[es:Documentación para Desarrolladores]]&lt;br /&gt;
[[fr:Documentation développeur]]&lt;br /&gt;
[[zh:开发者文档]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16387</id>
		<title>Development:Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16387"/>
		<updated>2006-09-27T09:48:29Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Documentation for core components */ version tip&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; New developer documentation pages should be added to the &#039;&#039;Development namespace&#039;&#039; by typing &amp;lt;code&amp;gt;Development:&amp;lt;/code&amp;gt; before the new page name i.e. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Development:New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Guidelines==&lt;br /&gt;
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:&lt;br /&gt;
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers&lt;br /&gt;
*[[Moodle architecture]] spells out the basic design goals behind Moodle&lt;br /&gt;
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface&lt;br /&gt;
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS&lt;br /&gt;
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.&lt;br /&gt;
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc &lt;br /&gt;
&lt;br /&gt;
== Resources and tools ==&lt;br /&gt;
&lt;br /&gt;
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle&lt;br /&gt;
*[http://tracker.moodle.org/ Moodle bug tracker] - bug reports, feature requests and other tracked issues&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=55 General developer forum]&lt;br /&gt;
*[http://moodle.cvs.sourceforge.net/moodle/moodle/ CVS code] - browse the Moodle code via the web&lt;br /&gt;
*[http://moodle.org/xref/nav.html?index.html Cross reference] - phpxref output for browsing Moodle source code&lt;br /&gt;
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - automatically generated documentation&lt;br /&gt;
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course&lt;br /&gt;
*[http://developer.yahoo.com/yui YUI documentation] - YUI is the official AJAX library in moodle.&lt;br /&gt;
*[[Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.&lt;br /&gt;
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD&lt;br /&gt;
&lt;br /&gt;
==How you can contribute==&lt;br /&gt;
&lt;br /&gt;
The M in Moodle stands for &#039;Modular&#039;. There are many different types of components that you can contribute that can be plugged into Moodle to provide additional functionality. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. The following types of plugins currently exist (in alphabetical order):&lt;br /&gt;
*[[Modules (developer)|Activity modules]]&lt;br /&gt;
*[[Assignment types]]&lt;br /&gt;
*[[Authentication|Authentication methods]]&lt;br /&gt;
*[[Blocks Howto|Blocks]]&lt;br /&gt;
*[[Course formats]]&lt;br /&gt;
*[[Database fields (developer)|Database fields]]&lt;br /&gt;
*[[Database presets]]&lt;br /&gt;
*[[Enrolment plugins (developer)|Enrolment plugins]]&lt;br /&gt;
*[[Filters (developer)|Filters]]&lt;br /&gt;
*[[Question_engine]]&lt;br /&gt;
*[[Question import/export formats]]&lt;br /&gt;
*[[Question bank|Question bank teacher docs]]&lt;br /&gt;
*[[Question_engine#Question_types|Question types developper docs]]&lt;br /&gt;
*[[Quiz reports]]&lt;br /&gt;
*[[Resource types]]&lt;br /&gt;
*[[SSO plugins]]&lt;br /&gt;
&lt;br /&gt;
There are also ways you can contribute that don&#039;t involve PHP programming:&lt;br /&gt;
*[[Themes]]&lt;br /&gt;
*[[Translation]]&lt;br /&gt;
*[[Database Schemas|Database schemas]]&lt;br /&gt;
&lt;br /&gt;
You can also help a lot by&lt;br /&gt;
*[[Tests|Testing]]&lt;br /&gt;
*[[Tracker|Participating in the bug tracker]]&lt;br /&gt;
&lt;br /&gt;
==Plans for the future==&lt;br /&gt;
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.&lt;br /&gt;
&lt;br /&gt;
Once ideas begin to crystalize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
*[[Developer notes]]&lt;br /&gt;
*[[Student projects]]&lt;br /&gt;
*[[Developer conference|Developer conferences]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for core components==&lt;br /&gt;
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].&lt;br /&gt;
&lt;br /&gt;
*[[Migration to Role-driven model]] @ v[[1.7]]&lt;br /&gt;
*[[UTF-8 migration|Migration to UTF-8]] @ v[[:Category:Moodle 1.6|1.6]]&lt;br /&gt;
*[[Question engine]]&lt;br /&gt;
*[[Quiz developer docs|Quiz module]]&lt;br /&gt;
*[[SCORM schema|SCORM module 1.5 schema]]&lt;br /&gt;
*[[Authentication API]]&lt;br /&gt;
*[[Stats package]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Cookieless Sessions]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for contributed code==&lt;br /&gt;
Many Moodle users contribute code for the benefit of other Moodle users. This can take the form of new activity modules, blocks, themes, resource plug-ins, assignment plug-ins, question type plug-ins, question import/export formats, quiz report plug-ins, course formats, ... This code is initially posted on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course and then often go into the [http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/ contrib area] of the Moodle [[CVS]] repository. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. Developer documentation for these components should be listed here.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://security.moodle.org/ Moodle Security Centre]&lt;br /&gt;
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[es:Documentación para Desarrolladores]]&lt;br /&gt;
[[fr:Documentation développeur]]&lt;br /&gt;
[[zh:开发者文档]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16383</id>
		<title>Development:Developer documentation</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Developer_documentation&amp;diff=16383"/>
		<updated>2006-09-27T09:41:23Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* Documentation for core components */ migration to role-driven model need to be described&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; New developer documentation pages should be added to the &#039;&#039;Development namespace&#039;&#039; by typing &amp;lt;code&amp;gt;Development:&amp;lt;/code&amp;gt; before the new page name i.e. &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;[[Development:New page name]]&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Guidelines==&lt;br /&gt;
The following guidelines are crucial reading for anyone wanting to contribute to the Moodle code base:&lt;br /&gt;
*[[Coding|Coding guidelines]] have to be followed by all Moodle developers&lt;br /&gt;
*[[Moodle architecture]] spells out the basic design goals behind Moodle&lt;br /&gt;
*[[Interface guidelines]] aim to provide a common feel to the Moodle user interface&lt;br /&gt;
*[[CVS (developer)|Moodle CVS for developers]] explains how to work with the Moodle code in CVS&lt;br /&gt;
*[[Unit tests]] explains how to run the unit tests, and how to write new test cases.&lt;br /&gt;
*[[Tracker]] explains the Moodle Tracker for keeping track of bugs, issues, feature requests etc &lt;br /&gt;
&lt;br /&gt;
== Resources and tools ==&lt;br /&gt;
&lt;br /&gt;
*[[Developer FAQ]] - frequently asked questions, especially useful for newcomers to Moodle&lt;br /&gt;
*[http://tracker.moodle.org/ Moodle bug tracker] - bug reports, feature requests and other tracked issues&lt;br /&gt;
*[http://moodle.org/mod/forum/view.php?id=55 General developer forum]&lt;br /&gt;
*[http://moodle.cvs.sourceforge.net/moodle/moodle/ CVS code] - browse the Moodle code via the web&lt;br /&gt;
*[http://moodle.org/xref/nav.html?index.html Cross reference] - phpxref output for browsing Moodle source code&lt;br /&gt;
*[http://phpdocs.moodle.org/ Moodle PHP doc reference] - automatically generated documentation&lt;br /&gt;
*[http://moodle.org/course/view.php?id=5#4 Development news and discussion] section of Using Moodle course&lt;br /&gt;
*[http://developer.yahoo.com/yui YUI documentation] - YUI is the official AJAX library in moodle.&lt;br /&gt;
*[[Setting up Eclipse for Moodle development]] - Eclipse is a great editor to use for php development, if you can work out how to set it up.&lt;br /&gt;
*[[Unmerged files]] - changes on the stable branch in CVS that have not been merged to HEAD&lt;br /&gt;
&lt;br /&gt;
==How you can contribute==&lt;br /&gt;
&lt;br /&gt;
The M in Moodle stands for &#039;Modular&#039;. There are many different types of components that you can contribute that can be plugged into Moodle to provide additional functionality. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. The following types of plugins currently exist (in alphabetical order):&lt;br /&gt;
*[[Modules (developer)|Activity modules]]&lt;br /&gt;
*[[Assignment types]]&lt;br /&gt;
*[[Authentication|Authentication methods]]&lt;br /&gt;
*[[Blocks Howto|Blocks]]&lt;br /&gt;
*[[Course formats]]&lt;br /&gt;
*[[Database fields (developer)|Database fields]]&lt;br /&gt;
*[[Database presets]]&lt;br /&gt;
*[[Enrolment plugins (developer)|Enrolment plugins]]&lt;br /&gt;
*[[Filters (developer)|Filters]]&lt;br /&gt;
*[[Question_engine]]&lt;br /&gt;
*[[Question import/export formats]]&lt;br /&gt;
*[[Question bank|Question bank teacher docs]]&lt;br /&gt;
*[[Question_engine#Question_types|Question types developper docs]]&lt;br /&gt;
*[[Quiz reports]]&lt;br /&gt;
*[[Resource types]]&lt;br /&gt;
*[[SSO plugins]]&lt;br /&gt;
&lt;br /&gt;
There are also ways you can contribute that don&#039;t involve PHP programming:&lt;br /&gt;
*[[Themes]]&lt;br /&gt;
*[[Translation]]&lt;br /&gt;
*[[Database Schemas|Database schemas]]&lt;br /&gt;
&lt;br /&gt;
You can also help a lot by&lt;br /&gt;
*[[Tests|Testing]]&lt;br /&gt;
*[[Tracker|Participating in the bug tracker]]&lt;br /&gt;
&lt;br /&gt;
==Plans for the future==&lt;br /&gt;
Ideas for and details of planned future features of Moodle are initially discussed on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course at moodle.org. That developer discussions are intermixed with user discussions in the same forums may seem strange at first but is one of the reasons for the success of Moodle. It is important that both end-users and developers discuss the future features together.&lt;br /&gt;
&lt;br /&gt;
Once ideas begin to crystalize on the forums they can be summarized in this wiki, either as part of the [[Roadmap]] or in the form of [[Developer notes]]. These pages then form the basis for further discussion in the forums.&lt;br /&gt;
*[[Roadmap]]&lt;br /&gt;
*[[Developer notes]]&lt;br /&gt;
*[[Student projects]]&lt;br /&gt;
*[[Developer conference|Developer conferences]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for core components==&lt;br /&gt;
This section is for documentation of specific components of the existing core Moodle code. Discussion of components that are under discussion or in development can be found in the [[Developer notes]] or on the [[Roadmap]].&lt;br /&gt;
&lt;br /&gt;
*[[Role-driven model migration|Migration to Role-driven model]] @ v[[1.7]]&lt;br /&gt;
*[[UTF-8 migration|Migration to UTF-8]]&lt;br /&gt;
*[[Question engine]]&lt;br /&gt;
*[[Quiz developer docs|Quiz module]]&lt;br /&gt;
*[[SCORM schema|SCORM module 1.5 schema]]&lt;br /&gt;
*[[Authentication API]]&lt;br /&gt;
*[[Stats package]]&lt;br /&gt;
*[[Email processing]]&lt;br /&gt;
*[[Cookieless Sessions]]&lt;br /&gt;
&lt;br /&gt;
==Documentation for contributed code==&lt;br /&gt;
Many Moodle users contribute code for the benefit of other Moodle users. This can take the form of new activity modules, blocks, themes, resource plug-ins, assignment plug-ins, question type plug-ins, question import/export formats, quiz report plug-ins, course formats, ... This code is initially posted on the forums in the [http://moodle.org/course/view.php?id=5 Using Moodle] course and then often go into the [http://cvs.sourceforge.net/viewcvs.py/moodle/contrib/ contrib area] of the Moodle [[CVS]] repository. When you have developed a new component please publish it in the [http://moodle.org/mod/data/view.php?id=6009 database of Moodle modules and plugins]. Developer documentation for these components should be listed here.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[http://security.moodle.org/ Moodle Security Centre]&lt;br /&gt;
*[http://moodle.com/partners/ Moodle Partners] - providers of custom Moodle development services&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[es:Documentación para Desarrolladores]]&lt;br /&gt;
[[fr:Documentation développeur]]&lt;br /&gt;
[[zh:开发者文档]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=LDAP_enrolment&amp;diff=15815</id>
		<title>LDAP enrolment</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=LDAP_enrolment&amp;diff=15815"/>
		<updated>2006-09-13T09:03:15Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: /* LDAP Enrollment HOWTO (by Lars Jensen) */ ++ link to LDAP authentication&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== LDAP Enrollment HOWTO (by Lars Jensen) ==&lt;br /&gt;
&lt;br /&gt;
This howto describes how to set up LDAP enrollment in Moodle. [[LDAP enrolment]] works best in moodle when used in conjunction with [[LDAP authentication]], and we&#039;re going to assume that you have already set moodle up for LDAP authentication.&lt;br /&gt;
&lt;br /&gt;
=== Assumptions ===&lt;br /&gt;
&lt;br /&gt;
# You are running a recent version of moodle. We have tested the setup presented here on versions 1.5.2+ and 1.6dev. It is likely to work on moodle 1.4.5 as well.&lt;br /&gt;
# You are using LDAP authentication as your primary authentication method.&lt;br /&gt;
# Each user in has a uid attribute in the users LDAP record, that matches the ID number in the same users moodle profile (this can easily be arranged with a mapping on the moodle LDAP Authentication setup page).&lt;br /&gt;
&lt;br /&gt;
=== The Course Setup ===&lt;br /&gt;
&lt;br /&gt;
Our setup involves the following course and user definitions:&lt;br /&gt;
&lt;br /&gt;
* Two courses, &#039;&#039;&#039;Math101&#039;&#039;&#039; and &#039;&#039;&#039;Eng201&#039;&#039;&#039;.&lt;br /&gt;
* Two teachers, &#039;&#039;&#039;teachera&#039;&#039;&#039; and &#039;&#039;&#039;teacherb&#039;&#039;&#039;.&lt;br /&gt;
* Three students, &#039;&#039;&#039;studentd&#039;&#039;&#039;, &#039;&#039;&#039;studente&#039;&#039;&#039;, and &#039;&#039;&#039;studentf&#039;&#039;&#039;.&lt;br /&gt;
* studentd and studente are enrolled as students in Math101, and teachera is enrolled as teacher of Math101. studente and studentf are enrolled as students in Eng201, and teachera and teacherb are both enrolled as teachers of Eng201.&lt;br /&gt;
&lt;br /&gt;
=== The LDAP Container Setup ===&lt;br /&gt;
&lt;br /&gt;
# Define two LDAP containers ou=StudentEnrollment and ou=TeacherEnrollment&lt;br /&gt;
# For each course we define an LDAP group entry (e.g a posixGroup entry) in the StudentEnrollment and TeacherEnrollment containers. Thus, we define a Math101 posixGroup under StudentEnrollment, and we define a Math101 posixGroup under TeacherEnrollment. We define the two Eng201 groups in a similar way.&lt;br /&gt;
# Enroll students and teachers as members of in the LDAP-groups we just defined. This is done by entering the users uid attribute in the memberUid attribute of the relevant group:&lt;br /&gt;
#* teachera is a member of the Math101 group under TeacherEnrollment.&lt;br /&gt;
#* studentd and studente are a members of the Math101 group under StudentEnrollment.&lt;br /&gt;
#* teachera and teacherb are members of the Eng201 group under TeacherEnrollment&lt;br /&gt;
#* studente and studentf are a members of the Eng201 group under StudentEnrollment.&lt;br /&gt;
&lt;br /&gt;
=== The LDAP Enrollment Configuration in Moodle ===&lt;br /&gt;
&lt;br /&gt;
The LDAP enrollment settings in moodle corresponding to the above setup are as follows:&lt;br /&gt;
&lt;br /&gt;
{| cellspacing=&amp;quot;0&amp;quot;  cellpadding=&amp;quot;5&amp;quot;  border=&amp;quot;1&amp;quot;&lt;br /&gt;
! LDAP Enrollment Variable:&lt;br /&gt;
! Value:&lt;br /&gt;
|- &lt;br /&gt;
| enrol_ldap_student_contexts:&lt;br /&gt;
| ou=StudentEnrollment,dc=ldapserver,dc=tmcc,dc=edu&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_student_memberattribute:&lt;br /&gt;
| memberUid&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_contexts:&lt;br /&gt;
| ou=TeacherEnrollment,dc=ldapserver,dc=tmcc,dc=edu&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_teacher_memberattribute:&lt;br /&gt;
| memberUid&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_objectclass:&lt;br /&gt;
| posixGroup&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_idnumber:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_shortname:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_course_fullname:&lt;br /&gt;
| cn&lt;br /&gt;
|-&lt;br /&gt;
| enrol_ldap_autocreate:&lt;br /&gt;
| Yes&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additionally, since you are using LDAP authentication, you should also map the moodle &amp;quot;ID number&amp;quot; of users to the &amp;quot;uid&amp;quot; in the ldap entry of the user. This is done on the moodle LDAP Authentication page (not the LDAP Enrollment page).&lt;br /&gt;
&lt;br /&gt;
=== Notes: ===&lt;br /&gt;
&lt;br /&gt;
# You do not need to create the courses manually in moodle. If they don&#039;t exist, they will be created when the first enrolled user login.&lt;br /&gt;
# We are using the same string cn and uid in a users LDAP record. This is not necessary, I believe. However, if you use different values, you will need to define the ldap_user_attribute to uid in the LDAP authentication setup.&lt;br /&gt;
# The value of the group id number (gidNumber) defined for the groups in step 2 of the LDAP Container Setup above is not critical. It is not used in this setup.&lt;br /&gt;
# The attached .ldif file assumes that users are in the ou=People container in LDAP. You will need to configure your LDAP Authentication setup to reflect this (ldap_contexts variable).&lt;br /&gt;
# User passwords for this setup are defined in the attached .ldif file.&lt;br /&gt;
# If you use the attached .ldif file, you&#039;ll need to edit the ldap server information (the &amp;quot;dn=&amp;quot; lines).&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=31761 LDAP Enrollment HOWTO] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=39549 LDAP Auto enrollment] forum discussion&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41829 LDAP nightmare Part II] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Enrolment]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=LDAP_enrollment&amp;diff=15814</id>
		<title>LDAP enrollment</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=LDAP_enrollment&amp;diff=15814"/>
		<updated>2006-09-13T09:02:20Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#redirect [[LDAP enrolment]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=LDAP_authentication&amp;diff=15813</id>
		<title>LDAP authentication</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=LDAP_authentication&amp;diff=15813"/>
		<updated>2006-09-13T08:50:47Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: ++ see also LDAP enrolment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document describes how to set up LDAP authentication in Moodle. You can find a [[#Basic Scenario|Basic Scenario]], where everything is simple and straightforward, and that should be enough for most installations. If your installation is a little bigger and you are using multiple LDAP servers, or multiple locations (contexts) for your users in your LDAP tree, then have a look at the [[#Advanced Scenarios|Advanced Scenarios]].&lt;br /&gt;
&lt;br /&gt;
==Basic Scenario==&lt;br /&gt;
&lt;br /&gt;
===Assumptions===&lt;br /&gt;
&lt;br /&gt;
# Your Moodle site is located at &#039;&#039;&#039;http://your.moodle.site/&#039;&#039;&#039;&lt;br /&gt;
# You have configured your PHP installation with the LDAP extension. It is loaded and activated, and it shows when you go to &#039;&#039;&#039;http://your.moodle.site/admin/phpinfo.php&#039;&#039;&#039; (logged in as user &#039;admin&#039;).&lt;br /&gt;
# Your LDAP server has &#039;&#039;&#039;192.168.1.100&#039;&#039;&#039; as its IP address.&lt;br /&gt;
# You are not using LDAP with SSL (also known as LDAPS) in your settings. This might prevent certain operations from working (e.g., you cannot update data if you are using MS Active Directory -- MS-AD from here on --), but should be OK if you just want to authenticate your users.&lt;br /&gt;
# You don&#039;t want your users to change their passwords the first time they log in into Moodle.&lt;br /&gt;
# You are using a single domain as the source of your authentication data in case you are using MS-AD (more on this in the Appendices).&lt;br /&gt;
# You are using a top level distinguished name (DN) of &#039;&#039;&#039;dc=my,dc=organization,dc=domain&#039;&#039;&#039; as the root of your LDAP tree. &lt;br /&gt;
# You have a non-privileged LDAP user account you will use to bind to the LDAP server. This is not necessary with certain LDAP servers, but MS-AD requires this and it won&#039;t hurt if you use it even if your LDAP server doesn&#039;t need it. Make sure &#039;&#039;&#039;this account and its password don&#039;t expire&#039;&#039;&#039;, and make this password as strong as possible. Remember you only need to type this password once, when configuring Moodle, so don&#039;t be afraid of making it as hard to guess as possible. Let&#039;s say this user account has a DN of &#039;&#039;&#039;cn=ldap-user,dc=my,dc=organization,dc=domain&#039;&#039;&#039;, and password &#039;&#039;&#039;hardtoguesspassword&#039;&#039;&#039;.&lt;br /&gt;
# All of your Moodle users are in an organizational unit (OU) called &#039;&#039;&#039;moodleusers&#039;&#039;&#039;, which is right under your LDAP root. That OU has a DN of &#039;&#039;&#039;ou=moodleusers,dc=my,dc=organization,dc=domain&#039;&#039;&#039;.&lt;br /&gt;
# You &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want your LDAP users&#039; passwords to be stored in Moodle at all.&lt;br /&gt;
&lt;br /&gt;
===Configuring Moodle authentication===&lt;br /&gt;
&lt;br /&gt;
Log in as an admin user and go to Administration &amp;gt;&amp;gt; Users &amp;gt;&amp;gt; Authentication. In the drop down listbox titled  &amp;quot;Choose an authentication method&amp;quot; select &amp;quot;Use an LDAP Server&amp;quot;. You will get a page similar to this one:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
::: [[Image:auth_ldap_config_screenshot.jpg]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now, you just have to fill in the values. Let&#039;s go step by step.&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellspacing=&amp;quot;0&amp;quot; cellpadding=&amp;quot;5&amp;quot;&lt;br /&gt;
! Field name&lt;br /&gt;
! Value to fill in&lt;br /&gt;
|-&lt;br /&gt;
| ldap_host_url&lt;br /&gt;
| As the IP of your LDAP server is 192.168.1.100, type &amp;quot;&#039;&#039;&#039;ldap://192.168.1.100&#039;&#039;&#039;&amp;quot; (without the quotes).&lt;br /&gt;
|-&lt;br /&gt;
| ldap_version&lt;br /&gt;
| Unless you are using a really old LDAP server, &#039;&#039;&#039;version 3&#039;&#039;&#039; is the one you should choose.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_preventpassindb&lt;br /&gt;
| As you &#039;&#039;&#039;don&#039;t&#039;&#039;&#039; want to store the users&#039;s password in Moodle&#039;s database, choose &#039;&#039;&#039;Yes&#039;&#039;&#039; here.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_bind_dn&lt;br /&gt;
| This is the distinguished name of the bind user defined above. Just type &amp;quot;&#039;&#039;&#039;cn=ldap-user,dc=my,dc=organization,dc=domain&#039;&#039;&#039;&amp;quot; (without the quotes).&lt;br /&gt;
|-&lt;br /&gt;
| ldap_bind_pw&lt;br /&gt;
| This is the bind user password defined above. Type &amp;quot;&#039;&#039;&#039;hardtoguesspassword&#039;&#039;&#039;&amp;quot; (without the quotes).&lt;br /&gt;
|-&lt;br /&gt;
| ldap_user_type&lt;br /&gt;
| Choose: &lt;br /&gt;
* &#039;&#039;&#039;Novel Edirectory&#039;&#039;&#039; if your LDAP server is running Novell&#039;s eDdirectory.&lt;br /&gt;
* &#039;&#039;&#039;posixAccount (rfc2307)&#039;&#039;&#039; if your LDAP server is running a RFC-2307 compatible LDAP server (choose this is your server is running OpenLDAP).&lt;br /&gt;
* &#039;&#039;&#039;posixAccount (rfc2307bis)&#039;&#039;&#039; if your LDAP server is running a RFC-2307bis compatible LDAP server.&lt;br /&gt;
* &#039;&#039;&#039;sambaSamAccount (v.3.0.7)&#039;&#039;&#039; if your LDAP server is running with SAMBA&#039;s 3.x LDAP schema extension and you want to use it.&lt;br /&gt;
* &#039;&#039;&#039;MS ActiveDirectory&#039;&#039;&#039; if your LDAP server is running Microsoft&#039;s Active Directory (MS-AD)&lt;br /&gt;
|-&lt;br /&gt;
| ldap_contexts&lt;br /&gt;
| The DN of the context (container) where all of your Moodle users are found. Type &#039;&#039;&#039;ou=moodleusers,dc=my,dc=organization,dc=domain&#039;&#039;&#039; here.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_search_sub&lt;br /&gt;
| If you have any sub organizational units (subcontexts) hanging from &#039;&#039;&#039;ou=moodleusers,dc=my,dc=organization,dc=domain&#039;&#039;&#039; and you want Moodle to search there too, set this to &#039;&#039;&#039;yes&#039;&#039;&#039;. Otherwise, set this to &#039;&#039;&#039;no&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_opt_deref&lt;br /&gt;
| Sometimes your LDAP server will tell you that the real value you are searching for is in fact in another part of the LDAP tree (this is called an alias). If you want Moodle to &#039;dereference&#039; the alias and fetch the real value from the original location, set this to &#039;&#039;&#039;yes&#039;&#039;&#039;. If you don&#039;t want Moodle to dereference it, set this to &#039;&#039;&#039;no&#039;&#039;&#039;. If you are using MS-AD, set this to &#039;&#039;&#039;no&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_user_attribute&lt;br /&gt;
| The attribute used to name/search users in your LDAP tree. This option takes a default value based on the &#039;&#039;ldap_user_type&#039;&#039; value you choosed above. &amp;lt;u&amp;gt;So unless you need something special, you don&#039;t need to fill this in&amp;lt;/u&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By the way, it&#039;s usually &#039;&#039;&#039;cn&#039;&#039;&#039; (Novell eDirectory and MS-AD) or &#039;&#039;&#039;uid&#039;&#039;&#039; (RFC-2037, RFC-2037bis and SAMBA 3.x LDAP extension), but if you are using MS-AD you could use &#039;&#039;&#039;sAMAccountName&#039;&#039;&#039; (the pre-Windows 2000 logon account name) if you need too.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_memberattribute&lt;br /&gt;
| The attribute used to list the members of a given group. This option takes a default value based on the &#039;&#039;ldap_user_type&#039;&#039; value you choosed above. &amp;lt;u&amp;gt;So unless you need something special, you don&#039;t need to fill this in.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
By the way, the usual values are &#039;&#039;&#039;member&#039;&#039;&#039; and &#039;&#039;&#039;memberUid&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_objectclass&lt;br /&gt;
| The type of LDAP object used to search for users. This option takes a default value based on the &#039;&#039;ldap_user_type&#039;&#039; value you choosed above. &amp;lt;u&amp;gt;So unless you need something special, you don&#039;t need to fill this in.&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here are the default values for each of the &#039;&#039;ldap_user_type&#039;&#039; values:&lt;br /&gt;
* &#039;&#039;&#039;User&#039;&#039;&#039; for Novel eDirectory&lt;br /&gt;
* &#039;&#039;&#039;posixAccount&#039;&#039;&#039; for RFC-2037 and RFC-2037bis&lt;br /&gt;
* &#039;&#039;&#039;sambaSamAccount&#039;&#039;&#039; for SAMBA 3.0.x LDAP extension&lt;br /&gt;
* &#039;&#039;&#039;user&#039;&#039;&#039; for MS-AD&lt;br /&gt;
|-&lt;br /&gt;
| Force change password&lt;br /&gt;
| Set this to &#039;&#039;Yes&#039;&#039; if you want to force your users to change their password on the first login into Moodle. Otherwise, set this to &#039;&#039;no&#039;&#039;. Bear in mind the password they are forced to change is the one stored in your LDAP server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;As you don&#039;t want your users to change their passwords in their first login, leave this set to &#039;&#039;No&#039;&#039;&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Use standard Change Password Page&lt;br /&gt;
|&lt;br /&gt;
* Setting this to &#039;&#039;Yes&#039;&#039; makes Moodle use it&#039;s own standard password change page, everytime users want to change their passwords.&lt;br /&gt;
* Setting this to &#039;&#039;No&#039;&#039; makes Moodle use the the page specified in the field called &amp;quot;Change password URL&amp;quot; (at the bottom of the configuration page).&lt;br /&gt;
&lt;br /&gt;
Bear in mind that changing your LDAP passwords from Moodle might require a LDAPS connection (this is true at least for MS-AD).&lt;br /&gt;
&lt;br /&gt;
Also, code for changing passwords from Moodle for anything but Novell eDirectory is almost not tested, so this may or may not work for other LDAP servers.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_expiration&lt;br /&gt;
| &lt;br /&gt;
* Setting this to &#039;&#039;No&#039;&#039; will make Moodle not to check if the password of the user has expired or not.&lt;br /&gt;
* Setting this to &#039;&#039;LDAP&#039;&#039; will make Moodle check if the LDAP password of the user has expired or not, and warn her a number of days before the password expires.&lt;br /&gt;
&lt;br /&gt;
Current code only deals with Novell eDirectory LDAP server, but there is a patch floating around to make it work with MS-AD too (search in the authentication forum).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;So unless you have Novell eDirectory server (or use the patch), choose &#039;&#039;No&#039;&#039; here.&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ldap_expiration_warning&lt;br /&gt;
| This value sets how many days in advance of password expiration the user is warned that her password is about to expire.&lt;br /&gt;
|-&lt;br /&gt;
| ldap_exprireattr&lt;br /&gt;
| The LDAP user attribute used to check password expiration. This option takes a default value based on the &#039;&#039;ldap_user_type&#039;&#039; value you choosed above. &amp;lt;u&amp;gt;So unless you need something special, you don&#039;t need to fill this in.&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ldap_gracelogins&lt;br /&gt;
| This setting is specific to Novell eDirectory. If set to &#039;&#039;Yes&#039;&#039;, enable LDAP gracelogin support. After password has expired the user can login until gracelogin count is 0.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;So unless you have Novell eDirectory server and want to allow gracelogin support, choose &#039;&#039;No&#039;&#039; here.&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ldap_graceattr&lt;br /&gt;
| This setting is currently not used in the code (and is specific to Novell eDirectory). &lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;So you don&#039;t need to fill this in.&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ldap_create_context&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| ldap_creators&lt;br /&gt;
| The DN of the group that contains all of your Moodle creators. This is typically a posixGroup with a &amp;quot;memberUid&amp;quot; attribute for each user you want to be a creator.  If your group is called &#039;&#039;creators&#039;&#039;, type &#039;&#039;&#039;cn=creators,ou=moodleusers,dc=my,dc=organization,dc=domain&#039;&#039;&#039; here.  Each memberUid attribute contains the CN of a user who is authorized to be a creator.  Do not use the user&#039;s full DN (e.g.,  not &#039;&#039;&#039;memberUid: cn=JoeTeacher,ou=moodleusers,dc-my,dc=organizations,dc=domain&#039;&#039;&#039;, but rather &#039;&#039;&#039;memberUid: JoeTeacher&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
In eDirectory, the objectClass for a group is (by default) not &#039;&#039;&#039;posixGroup&#039;&#039;&#039; but &#039;&#039;&#039;groupOfNames,&#039;&#039;&#039; whose member attribute is &#039;&#039;&#039;member,&#039;&#039;&#039; not &#039;&#039;&#039;memberUid,&#039;&#039;&#039; and whose value is the full DN of the user in question.  Although you can probably modify Moodle&#039;s code to use this field, a better solution is just to add a new &#039;&#039;&#039;objectClass&#039;&#039;&#039; attribute of &#039;&#039;&#039;posixGroup&#039;&#039;&#039; to your creators group and put the CNs for each creator in a &#039;&#039;&#039;memberUid&#039;&#039;&#039; attribute.&lt;br /&gt;
&lt;br /&gt;
In MS Active Directory, you will need to create a security group for your creators to be part of and then add them all. If your ldap context above is &#039;ou=staff,dc=my,dc=org&#039; then your group should then be &#039;cn=creators,ou=staff,dc=my,dc=org&#039;. If some of the users are from other contexts and have been added to the same security group, you&#039;ll have to add these as separate contexts after the first one using the same format.&lt;br /&gt;
|-&lt;br /&gt;
| First name&lt;br /&gt;
| The name of the attribute that holds the first name of your users in your LDAP server. This is usually &#039;&#039;&#039;givenName&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Surname&lt;br /&gt;
| The name of the attribute that holds the surname of your users in your LDAP server. This is usually &#039;&#039;&#039;sn&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Email address&lt;br /&gt;
| The name of the attribute that holds the email address of your users in your LDAP server. This is usually &#039;&#039;&#039;mail&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Phone 1&lt;br /&gt;
| The name of the attribute that holds the telephone number of your users in your LDAP server. This is usually &#039;&#039;&#039;telephoneNumber&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Phone 2&lt;br /&gt;
|  The name of the attribute that holds an additional telephone number of your users in your LDAP server. This can be &#039;&#039;&#039;homePhone&#039;&#039;&#039;, &#039;&#039;&#039;mobile&#039;&#039;&#039;, &#039;&#039;&#039;pager&#039;&#039;&#039;, &#039;&#039;&#039;facsimileTelephoneNumber&#039;&#039;&#039; or even others.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Department&lt;br /&gt;
| The name of the attribute that holds the department name of your users in your LDAP server. This is usully &#039;&#039;&#039;departmentNumber&#039;&#039;&#039; (for posixAccount and maybe eDirectory) or &#039;&#039;&#039;department&#039;&#039;&#039; (for MS-AD).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Address&lt;br /&gt;
| The name of the attribute that holds the street address of your users in your LDAP server. This is usully &#039;&#039;&#039;streetAddress&#039;&#039;&#039; or &#039;&#039;&#039;street&#039;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| City/town&lt;br /&gt;
| The name of the attribute that holds the city/town of your users in your LDAP server. This is usully &#039;&#039;&#039;l&#039;&#039;&#039; (lowercase L) or &#039;&#039;&#039;localityName&#039;&#039;&#039; (not valid in MS-AD).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt; &lt;br /&gt;
|-&lt;br /&gt;
| Country&lt;br /&gt;
| The name of the attribute that holds the couuntry of your users in your LDAP server. This is usully &#039;&#039;&#039;c&#039;&#039;&#039; or &#039;&#039;&#039;countryName&#039;&#039;&#039; (not valid in MS-AD).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| &#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| ID Number&lt;br /&gt;
| &lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Language&lt;br /&gt;
| &#039;&#039;&#039;preferredLanguage&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;This setting is optional&amp;lt;/u&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| Instructions&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The rest of the fields are common to all authentication methods and will not be discussed here.&lt;br /&gt;
&lt;br /&gt;
==Advanced Scenarios==&lt;br /&gt;
&lt;br /&gt;
===Using multiple LDAP Servers===&lt;br /&gt;
Entering more than one name in the ldap_host_url field can provide some sort of resilience to your system. Simply use the syntax :&lt;br /&gt;
ldap://my.first.server ; ldap//my.second.server ; ...&lt;br /&gt;
&lt;br /&gt;
Of course, this will only work if all the servers share the same directory information, using a replication or synchronization mecanism once introduced in eDirectory and now generalized to the main LDAP-compatible directories.&lt;br /&gt;
&lt;br /&gt;
There is one drawback in Moodle 1.5 - 1.6 implementation of LDAP authentication : the auth_ldap_connect() function processes the servers sequentially, not in a round robin mode. Thus, if the primary server fails, you will have to wait for the connection to time out before switching to the following one.&lt;br /&gt;
&lt;br /&gt;
===Using multiple user locations (contexts) in your LDAP tree===&lt;br /&gt;
There is no need to use multiple user locations if your directory tree is flat, i.e. if all user accounts reside in a &#039;&#039;&#039;ou=people,dc=my,dc=organization,dc=domain&#039;&#039;&#039; or &#039;&#039;&#039;ou=people,o=myorg&#039;&#039;&#039; container. &lt;br /&gt;
&lt;br /&gt;
At the opposite, if you use the ACL mecanism to delegate user management, there are chances that your users will be stored in containers like &#039;&#039;&#039;ou=students,ou=dept1,o=myorg&#039;&#039;&#039; and &#039;&#039;&#039;ou=students,ou=dept2,o=myorg&#039;&#039;&#039; ...&lt;br /&gt;
&lt;br /&gt;
Then there is an alternative :&lt;br /&gt;
* Look at the &#039;&#039;&#039;o=myorg&#039;&#039;&#039; level with the ldap_search_sub attribute set to &#039;&#039;&#039;yes&#039;&#039;&#039;.&lt;br /&gt;
* Set the ldap_context to &#039;&#039;&#039;ou=students,ou=dept1,o=myorg ; ou=students,ou=dept2,o=myorg&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Choosing between these two solutions supposes some sort of benchmarking, as the result depends heavily on the structure of your directory tree &#039;&#039;&#039;and&#039;&#039;&#039; on your LDAP software indexing capabilities. Simply note that there is a probability in such deep trees that two users share the same &#039;&#039;common name&#039;&#039; (cn), while having different &#039;&#039;distinguished names&#039;&#039;. Then only the second solution will have a deterministic result (returning allways the same user).&lt;br /&gt;
&lt;br /&gt;
===Using LDAPS (LDAP + SSL)===&lt;br /&gt;
====MS Active Directory + SSL ====&lt;br /&gt;
&lt;br /&gt;
If the Certificate Authority is not installed you&#039;ll have to install it first as follows:&lt;br /&gt;
# Click &#039;&#039;&#039;Start&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Control Panel&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Add or Remove programs.&#039;&#039;&#039;&lt;br /&gt;
# Click &#039;&#039;&#039;Add/Remove Windows Components&#039;&#039;&#039; and select &#039;&#039;&#039;Certificate Services.&#039;&#039;&#039;&lt;br /&gt;
# Follow the prosedure provided to install the &#039;&#039;&#039;Certificate Authority&#039;&#039;&#039;. Enterprise level is a good choice.&lt;br /&gt;
&lt;br /&gt;
Verify that SSL has been enabled on the server by installing suptools.msi from Windows installation cd&#039;s \Support\tools directory. After support tools installation:&lt;br /&gt;
# Select &#039;&#039;&#039;Start&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Run&#039;&#039;&#039;, write &#039;&#039;&#039;ldp&#039;&#039;&#039; in the Open field.&lt;br /&gt;
# From the ldp window select &#039;&#039;&#039;Connection&#039;&#039;&#039; -&amp;gt; &#039;&#039;&#039;Connect&#039;&#039;&#039; and supply valid hostname and port number &#039;&#039;&#039;636&#039;&#039;&#039;. Also select the SSL check box.&lt;br /&gt;
&lt;br /&gt;
If successful, you should get information about the connection.&lt;br /&gt;
&lt;br /&gt;
Next step is to tell PHP&#039;s OpenLDAP extension to disable SSL certificate checking. On Windows servers you&#039;re most likely using pre-compiled PHP version, where you must create a path &#039;&#039;C:\OpenLDAP\sysconf&#039;&#039;. In this path create a file called &amp;quot;ldap.conf&amp;quot; with content:&lt;br /&gt;
&lt;br /&gt;
 TLS_REQCERT never.&lt;br /&gt;
&lt;br /&gt;
Now you should be able to use &#039;&#039;&#039;ldaps://&#039;&#039;&#039; when connecting to MS-AD.&lt;br /&gt;
&lt;br /&gt;
==Appendices==&lt;br /&gt;
&lt;br /&gt;
===Child Domains and the Global Catalog in MS Active Directory===&lt;br /&gt;
&lt;br /&gt;
Moodle currently only has limited support for multiple domain controllers; specifically it expects each of the LDAP servers listed to contain identical sets of information. If you have users in multiple domains this presents an issue. One solution when working with MS-AD is to use the Global Catalog. The Global Catalog is designed to be a read-only, partial representation of an entire MS-AD forest, designed for searching the entire directory when the domain of the required object is not known.&lt;br /&gt;
&lt;br /&gt;
For example your organisation has a main domain example.org, staff and students are contained in two child domains staff.example.org and students.example.org. The 3 domains (example.org, staff.example.org and students.example.org) each have a domain controller (dc01, dc02 and dc03 respectively.) Each domain controller contains a full, writable, representation of only the objects that belong to its domain. However, assuming that the Global Catalog has been enabled (see below) on one of the domain controllers (for example dc01) a query to the Global Catalog would reveal matching objects from all three domains. The Global Catalog is automatically maintained through replication across the active directory forest, it can also be enabled on multiple servers (if, for example, you need redundancy / load balancing.)&lt;br /&gt;
&lt;br /&gt;
To make use of this in Moodle to allow logins from multiple domains is simple. The Global Catalog runs on port 3268 as opposed to 389 for standard LDAP queries. As a result, still assuming the Global Catalog is running on dc01, the &#039;&#039;&#039;&#039;ldap_host_url&#039;&#039;&#039;&#039; would be &#039;&#039;ldap://dc01.example.org:3268&#039;&#039;. The rest of the settings are the same as for other MS-AS Auth setups.&lt;br /&gt;
&lt;br /&gt;
You should use the &#039;&#039;&#039;&#039;ldap_contexts&#039;&#039;&#039;&#039; setting to indicate the locations of individuals you wish to grant access. To extend the example above a little: In the example.org domain users are all in the&#039;&#039; &#039;Users&#039; &#039;&#039;OU, in the staff.example.org domain users are in two OUs at the root of the domain,&#039;&#039; &#039;Support Staff&#039; &#039;&#039;and&#039;&#039; &#039;Teaching Staff&#039; &#039;&#039;, and in the students.example.org domain students are in an OU indicating the year that they enrolled, all of which are under the&#039;&#039; &#039;Students&#039; &#039;&#039;OU. As a result our &#039;&#039;&#039;&#039;ldap_contexts&#039;&#039;&#039;&#039; setting may look a little like this:&#039;&#039; &#039;OU=Users,DC=example,DC=org; OU=Support Staff,DC=staff,DC=example,DC=org; OU=Teaching Staff,DC=staff,DC=example,DC=org; OU=Students,DC=students,DC=example,DC=org&#039;&#039;.&#039; The &#039;&#039;&#039;&#039;ldap_search_sub&#039;&#039;&#039;&#039; option should be set to&#039;&#039; &#039;Yes&#039; &#039;&#039;to allow moodle to search within the child OUs.&lt;br /&gt;
&lt;br /&gt;
Its worth noting that the Global Catalog only contains a partial representation of the attributes of each object, as defined in the Partial Attribute Set supplied by Microsoft. However common information likely to be of use to a general Moodle installation (Forename, Surname, Email Address, sAMAccountName etc) is included in the set. For specific needs the schema can be altered to remove or add various attributes.&lt;br /&gt;
&lt;br /&gt;
In most cases the Global Catalog is read-only, update queries must be made over the standard LDAP ports to the domain controller that holds the object in question (in our example, updating a student&#039;s details would require an LDAP query to the students.example.org domain controller - dc03, it would not be possible to update details by querying the Global Catalog.) The exception to this would be in an environment where there is only a single domain in the active directory forest; in this case the Global Catalog holds a writable full set of attributes for each object in the domain. However, for the purposes of Moodle authorisation, there would be no need to use the Global Catalog in this case.&lt;br /&gt;
&lt;br /&gt;
====Enabling the Global Catalog====&lt;br /&gt;
&lt;br /&gt;
The Global Catalog is available on Windows 2000 and Windows 2003 Active Directory servers. To enable, open the ‘Active Directory Sites and Services’ MMC (Microsoft Management Console) snap-in. Extend ‘Sites’ and then the name of the Site containing the active directory forest you wish to use. Expand the server you wish to enable the Global Catalog on, right click ‘NTDS settings’ and select the ‘Properties’ tab. To enable, simply click the ‘Global Catalog’ checkbox. Under a Windows 2000 server it is necessary to restart the server (although it won’t prompt you to); under Windows 2003 server it is not necessary to restart the server. In either case you will generally have to wait for the AD forest to replicate before the Global Catalog offers a representation of the entire AD forest. Changes made in Active Directory will also be subject to a short delay due to the latency involved with replication. If your AD servers are firewalled port 3268 will need to be opened for Global Catalog servers.&lt;br /&gt;
If your organisation uses Microsoft Exchange then it its highly likely that at least one Domain Controller will already have Global Catalog enabled – Exchange 2000 and 2003 rely on the Global Catalog for address information, users also access the Global Catalog when using the GAL (Global Address List)&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&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=32168 PHP LDAP module does not seem to be present] forum discussion&lt;br /&gt;
* [[LDAP enrolment]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Authentication]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Category:Administrator&amp;diff=12639</id>
		<title>Category:Administrator</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Category:Administrator&amp;diff=12639"/>
		<updated>2006-06-29T20:22:01Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;An index of documentation pages for &#039;&#039;&#039;administrators&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
[[es:Categoría:Administrador]]&lt;br /&gt;
[[ru:Категория:Администратору]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:Roles&amp;diff=12623</id>
		<title>Development:Roles</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:Roles&amp;diff=12623"/>
		<updated>2006-06-29T08:53:57Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Roles and capabilities&#039;&#039;&#039; are planned to be included in Moodle 1.7. For now, we have some basic ideas of how to implement such a structure in Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Please note that none of the following is finalised.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
&lt;br /&gt;
By roles, we mean an identifier of the user&#039;s status, for example, teacher, student and forum moderator are examples of roles.&lt;br /&gt;
&lt;br /&gt;
A capability is a permission to access some particular Moodle feature. Capabilities are associated with roles. For example, &#039;&#039;forum_canreadpost&#039;&#039; is a capability.&lt;br /&gt;
&lt;br /&gt;
==The existing system==&lt;br /&gt;
&lt;br /&gt;
Currently in Moodle, we have a fixed set of roles i.e. primary admin, admins, course creators, editing teachers, non-editing teachers, students, and guests. For each role, the capability or actions that they can performed are fixed. For example, the role student allows the user to submit an assignment, but doesn&#039;t allow the user to browse/edit other users&#039; work. By using this setup we limit ourselves to a rather rigid set of capabilities for each role. If we want, say a particular student or group to be able to mark assignments in a particular course, we can&#039;t do that without giving these users teacher privileges.&lt;br /&gt;
&lt;br /&gt;
==The new roles and capability system==&lt;br /&gt;
&lt;br /&gt;
The new system will allow authorized users to define an arbitrary number of roles. Each role can have a customizable set of capabilities in every context. A context can be the whole Moodle site, a course, or a module instance, e.g. quiz 5 in &#039;Introduction to Photography&#039;. An authorized user will be able to assign an arbitrary number of roles to each user. Since the capabilities in each role could be different, there could be conflict in capabilities. This is resolved by giving roles different &#039;priorities&#039;. For example, to prevent a naughty student from posting, one could assign him a &#039;naughty student&#039; role that does not allow him to post. This role should have a priority higher than that of a normal &#039;student&#039; role. &lt;br /&gt;
&lt;br /&gt;
To facilitate exceptional cases in roles and capabilities, we can use exception rules. For example, we can specify a rule saying that all students are able to mark/read other students&#039; assignment in this particular course. Note that such rules need to have a priority as well. The capability of a user, in any context is then resolved by finding the highest priority role/rule.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;A smooth upgrade will be provided with 1.7. The existing roles (admin, teacher, student, etc), and the exisiting capabilities will be retained. This is done by creating default roles at site/course levels, and assigning the current users to these roles accordingly. The default roles will have default capabilities associated with them, which pretty much is what we have  in 1.6. The whole process is automatic so there&#039;s nothing to worry about =). With no modifications, Moodle will operate exactly the same before and after the upgrade.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==The plan==&lt;br /&gt;
&lt;br /&gt;
There are a few major things that need to be done. Here&#039;s a list (in no particular order):&lt;br /&gt;
&lt;br /&gt;
#Identify permissions required for site/course/each module.&lt;br /&gt;
#Define the database structure for storing roles and capabilities.&lt;br /&gt;
#Recode the whole of Moodle, including all modules to support the new structure. Instead of using &amp;lt;code&amp;gt;isteacher()&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;isstudent()&amp;lt;/code&amp;gt; we should be using &amp;lt;code&amp;gt;has_capabity($capability, $instanceid)&amp;lt;/code&amp;gt; etc. A new API for handling roles and capabilities will be implemented (accesslib.php).&lt;br /&gt;
#Add storage of capabilities for each module. Can be done either in a file, e.g. db/capability.xml, or as a sql file that gets installed to a central db whenever this module is installed. Either way, what do we do when we need to upgrade these capabilities? Some capabilities might needs refining/splitting later on. How do we control the &#039;version&#039; of a capability?&lt;br /&gt;
#Consider interface issues, especially how to manage conflicting role/exception rules.&lt;br /&gt;
#Upon logging in, we should use a cache to store capability, down to module level. How should that be structured?&lt;br /&gt;
#Consider the impact on backup/restore.&lt;br /&gt;
#Upgrade path for current users. The user information in table user_coursecreators, user_admins, user_teachers, and user_students will most likely be migrated to the new roles and capabilities tables. The users will most likely be assigned default roles that comes with default capabilities (e.g. teachers, admins, students, etc). The old tables themselves could possibly be dropped at the end of the upgrade.&lt;br /&gt;
&lt;br /&gt;
==Capabilities==&lt;br /&gt;
&lt;br /&gt;
This is a comprehensive list of capabilities, well, in the making. Please edit. Should we distinguish canedit and candelete?&lt;br /&gt;
&lt;br /&gt;
What about a canview capability? Like for choice, where a person is allowed to see the choice question but not participate in it? --[[User:N Hansen|N Hansen]] 19:29, 16 May 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
Certainly need a canview or cansee capability for parents as linked to their childs data/contributions.&lt;br /&gt;
&lt;br /&gt;
Do we need to add canview and cansearch logs at site/course/user/group level?&lt;br /&gt;
&lt;br /&gt;
I could use a canview at a course level, if I understand what that means exactly.--[[User:N Hansen|N Hansen]] 19:43, 12 June 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
===Site-level Capabilities===&lt;br /&gt;
&lt;br /&gt;
#canconfigsitevariables - applcialbe in admin/config.php&lt;br /&gt;
#canreadblogs&lt;br /&gt;
#canpostblogs&lt;br /&gt;
#candeleteallblogs&lt;br /&gt;
#canbrowseuser&lt;br /&gt;
#canviewhiddenactivity&lt;br /&gt;
#cancreatecourse&lt;br /&gt;
#caneditownprofile&lt;br /&gt;
#caneditallprofiles&lt;br /&gt;
&lt;br /&gt;
===Course-level Capabilities===&lt;br /&gt;
&lt;br /&gt;
#viewcoursecontent&lt;br /&gt;
#caneditcourse&lt;br /&gt;
#cancreatebackups&lt;br /&gt;
#canrestorebackups&lt;br /&gt;
#cancreateblocks&lt;br /&gt;
#caneditblocks&lt;br /&gt;
#candeleteblocks&lt;br /&gt;
&lt;br /&gt;
===Module-level Capabilities===&lt;br /&gt;
&lt;br /&gt;
#Assignment&lt;br /&gt;
##assignment_read - reading the assignment description&lt;br /&gt;
##assignment_mark - marking, viewing of list of submitted assignments&lt;br /&gt;
#Chat&lt;br /&gt;
##chat_chat - allows a user to participate in this chat&lt;br /&gt;
##chat_readlog - allows a user to read past chat session logs&lt;br /&gt;
##chat_deletelog - allows a user to delete past chat logs&lt;br /&gt;
#Choice&lt;br /&gt;
##choice_choose - make a choice&lt;br /&gt;
##choice_readresponses - read all responses&lt;br /&gt;
##choice_deleteresponses - deletes all responses&lt;br /&gt;
#Database&lt;br /&gt;
##data_readentry - reads other people&#039;s entry&lt;br /&gt;
##data_writeentry - add / edit and delete (own) entries&lt;br /&gt;
##data_managetemplates - add, delete, edit fields and templates&lt;br /&gt;
##data_manageentries - edit/delete all entry &lt;br /&gt;
##data_comment - comment&lt;br /&gt;
##data_managecomment - edit/delete all comments&lt;br /&gt;
##data_rate - rate an entry&lt;br /&gt;
##data_approve - approves an entry&lt;br /&gt;
##data_uploadentries - batch upload of entries&lt;br /&gt;
#Exercise&lt;br /&gt;
##exercise_canadd&lt;br /&gt;
##exercise_canedit&lt;br /&gt;
##exercise_candelete&lt;br /&gt;
##exercise_canassess&lt;br /&gt;
#Forum&lt;br /&gt;
##forum_canadd&lt;br /&gt;
##forum_canedit&lt;br /&gt;
##forum_candelete&lt;br /&gt;
##forum_canreadpost&lt;br /&gt;
##forum_canstartnewdiscussion&lt;br /&gt;
##forum_canreply&lt;br /&gt;
##forum_caneditallpost&lt;br /&gt;
##forum_candeleteallpost&lt;br /&gt;
##forum_canrate&lt;br /&gt;
#Glossary&lt;br /&gt;
##glossary_read - view entries&lt;br /&gt;
##glossary_write - add entries&lt;br /&gt;
##glossary_manageentries - add, edit, delete entries&lt;br /&gt;
##glossary_managecat - create, delete, edit categories&lt;br /&gt;
##glossary_comment - comment on an entry&lt;br /&gt;
##glossary_managecomments - edit, delete comments&lt;br /&gt;
##glossary_import - import glossaries&lt;br /&gt;
##glossary_export - export glossaries&lt;br /&gt;
##glossary_approve - approve glossaries&lt;br /&gt;
##glossary_rate - rates glossary&lt;br /&gt;
##glossary_readrate - view rating?&lt;br /&gt;
#Hotpot&lt;br /&gt;
##hotpot_candd&lt;br /&gt;
##hotpot_canedit&lt;br /&gt;
##hotpot_candelete&lt;br /&gt;
##hotpot_canparticipate&lt;br /&gt;
#Label&lt;br /&gt;
#Lams&lt;br /&gt;
##lams_canadd&lt;br /&gt;
##lams_canedit&lt;br /&gt;
##lams_candelete&lt;br /&gt;
#Lesson&lt;br /&gt;
##lesson_canadd&lt;br /&gt;
##lesson_canedit&lt;br /&gt;
##lesson_candelete&lt;br /&gt;
##lesson_canparticipate&lt;br /&gt;
#Quiz&lt;br /&gt;
##quiz_canadd&lt;br /&gt;
##quiz_canedit&lt;br /&gt;
##quiz_candelete&lt;br /&gt;
##quiz_canaddquestion&lt;br /&gt;
##quiz_caneditquestion&lt;br /&gt;
##quiz_candeletequestion&lt;br /&gt;
##quiz_canparticipate&lt;br /&gt;
##quiz_cangrade&lt;br /&gt;
#Resource&lt;br /&gt;
##resource_canadd&lt;br /&gt;
##resource_canedit&lt;br /&gt;
##resource_candelete&lt;br /&gt;
#Scorm&lt;br /&gt;
##scorm_canadd&lt;br /&gt;
##scorm_canedit&lt;br /&gt;
##socrm_candelete&lt;br /&gt;
#Survey&lt;br /&gt;
##survey_canadd&lt;br /&gt;
##survey_canedit&lt;br /&gt;
##survey_candelete&lt;br /&gt;
##survey_canviewresponses&lt;br /&gt;
#Wiki&lt;br /&gt;
##wiki_canadd&lt;br /&gt;
##wiki_canedit&lt;br /&gt;
##wiki_candelete&lt;br /&gt;
##wiki_canstartnewwiki&lt;br /&gt;
##wiki_canparticipate&lt;br /&gt;
#Workshop&lt;br /&gt;
##workshop_canadd&lt;br /&gt;
##workshop_canedit&lt;br /&gt;
##workshop_candelete&lt;br /&gt;
##workshop_cangrade&lt;br /&gt;
##workshop_canparticipate&lt;br /&gt;
&lt;br /&gt;
==Scenarios==&lt;br /&gt;
&lt;br /&gt;
This section is for brainstorming some example roles that we would like to support:&lt;br /&gt;
&lt;br /&gt;
===Student===&lt;br /&gt;
Has this one been missed?&lt;br /&gt;
&lt;br /&gt;
===Site Designers===&lt;br /&gt;
Is there a role for peole involved in how the site looks but not full administrators? Thinking here of online control of themes rather than FTP theme uploading. But in either case they caneditlogos, caneditcss, candeditlevelatwhichthemeapplies.&lt;br /&gt;
&lt;br /&gt;
===Educational Authority Adviser===&lt;br /&gt;
Someone who would want to browse the site and may be asked to comment or contribute to particular discussions or developments in school. Access for this role would be controlled by the school in the case of school level moodles but may be different if there were to be a Local Authority wide Moodle.&lt;br /&gt;
&lt;br /&gt;
===Educational Inspector===&lt;br /&gt;
Someone who will visit the site to verify the school&#039;s self review that comments on home school relationships, extending the classroom etc. They may want to see summaries of usage and reports from surveys garnering parent and pupil views.&lt;br /&gt;
&lt;br /&gt;
===Second Marker / Moderator===&lt;br /&gt;
A teacher within ths site that has access to assignments and quizzes from another teacher&#039;s course for second marking purposes. This may need additional functionality adding to the assignment module so that two sets of grades/feedback can be given to one set of assignments.&lt;br /&gt;
&lt;br /&gt;
===External Examiner===&lt;br /&gt;
Has all the rights of inpectors, but would also need to be able to review assignments and feedback, view forums, glossaries etc. However, would not want to post, feedback onto the site at all.&lt;br /&gt;
&lt;br /&gt;
===Parent===&lt;br /&gt;
A parent will have one or more children in one or more institutions which could be using one or more moodle instances or a mixture of Learning Platforms. A parent&#039;s role will vary depending on the age of their children and whether they are contributing as a parent or a school supporter.&lt;br /&gt;
&lt;br /&gt;
In Early Years (EY) and Key Stage 1 (KS1) they may play/learn on an activity or write for the child. Parents often interpret homework tasks and read to their children perhaps filling in a joint reading diary.&lt;br /&gt;
&lt;br /&gt;
In Key stages 3 and 4 this changes to more of a monitoring/awareness role where a parent would expect to have a summary report of attendance, attainment and general achievement on a weekly/monthly/termly or annual basis. Parents will often be asked to sign and write back comments about this review report.&lt;br /&gt;
&lt;br /&gt;
In all Key Stages there is a great need for parents to receive communication from the school which they can confirm they have received by signing a form. In some cases this may also involve making choices from a list. It may also involve payment for a trip or disco being returned so there could be the possibility of electronic payments.&lt;br /&gt;
&lt;br /&gt;
Parent&#039;s evening often involve complex booking systems that attempt to get parent&#039;s and teachers together. Easy for EY/KS1/KS2 very difficult for KS3/KS4. Wow would this help if it was built into the Learning Platform.&lt;br /&gt;
&lt;br /&gt;
In some cases there needs to be confidential communication between the parent and the teacher without the child being party to this. It may involve teaching and learning but could also involve a behaviour or medical issue. Often this may be done via a sealed letter or face to face. &lt;br /&gt;
&lt;br /&gt;
The latest incarnation of OfSTED with the Self Review Framework (SEF) there is a greater emphasis on schools gathering parent voice via surveys and discussion. There is a clear match here with parents have access to parental votes, questionnaires and discussions and for schools to be able to publish news, results and reports back to parents.&lt;br /&gt;
&lt;br /&gt;
In the UK the LP framework and agenda as being pushed by the DfES via Becta emphasises that within the mandatory groups and roles functionality the parent role is likely to be required to meet the LP Framework procurement standard.&lt;br /&gt;
&lt;br /&gt;
===Manager===&lt;br /&gt;
&#039;&#039;Please add text here...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Weekly Seminar Leader===&lt;br /&gt;
&#039;&#039;In a university seminar, typically 8-15 students in their 3rd/4th year, each student is responsible for leading one topic in a study series.  I ask each student to research 5-10 resources, then give a powerpoint presentation to the other students.  This is followed by an in-class discussion and then online homework.  The homework involves some fun quiz questions and then some reflective journal questions.  I ask each seminar leader to prepare the quiz questions and journal questions as well as their presentation.  To do that, I would like to assign activity-making/authoring roles to the student--either for a short period, or for duration of the whole course.  Thus &amp;quot;Allow Quiz Authoring Role&amp;quot; or &amp;quot;Allow Assignment Authoring Role&amp;quot; at the course level or, if possible, even the Topic level (in a topic or week format course) would be important.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Mentor/Mentee===&lt;br /&gt;
&#039;&#039;Please add text here...&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Community-Designed Rating Criteria===&lt;br /&gt;
&#039;&#039;The gradebook tends to be the domain of the teacher.  What if community/peer ratings/marks could also be entered there? What if peer assessment criteria could be designed by the students, not just the teacher?&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Visitor===&lt;br /&gt;
&lt;br /&gt;
This would be a role whereby one could allow a visitor to visit one&#039;s classroom. This might be a colleague interested in seeing your course, or a journalist who might be writing an article about one&#039;s site. They should not be able to see the names of any students anywhere (eg recent activity, forum posts) for privacy reasons. They should be able to try out things like quizzes, and lessons but no grades would be recorded (like in teacher preview mode). They would not be able to participate in choices and forums but could view them. It would be read only in a way like former-student role below but without access to a particular student&#039;s records that former student role would grant. &lt;br /&gt;
&lt;br /&gt;
===Former Student===&lt;br /&gt;
This role would be of particular use for courses with rolling enrollments. This role would be one where a student had completed all of the requirements of a course (ie assignments, quizzes etc.) but wished to have continued access to the course material for review or consultation. The key factor is that one would give access to the completed student to the notes he read, his work and the teacher&#039;s comments on it, but he would not be allowed to do anything that would take up the teacher&#039;s time. In other words, a sort-of read-only access to the course. How forums, which might contain pertinent information and would continue to grow, would be handled is a question. Perhaps the student would be shown only what was in the forums at the time he completed the course. He would not be allowed to see any new posts or add any himself. Same thing for database and glossary entries. In other words, a snapshot of the course at the time his regular enrollment ended. He shouldn&#039;t be able to see the names or profiles of any newly enrolled students for privacy reasons-hence the restrictions on forum access. One issue that would have to be dealt with would be changes to existing modules-such as resources. Does the student get access to the module as it was or as it is? We have no versioning of resources in Moodle so this would be a problem. What about a teacher changing a quiz question so that the answer is different? What would a former student see?&lt;br /&gt;
&lt;br /&gt;
===Librarian===&lt;br /&gt;
&lt;br /&gt;
Reference Librarians have an active role in most of the courses taught at Earlham College (with Bibliographic Instruction). The Librarian role within Moodle could encompass default read access to all courses (unless prohibited by course teacher) and read access to all components of the course unless access is barred (again by teacher). The Librarians would also perhaps have a block called perhaps Reference Services or Reference Desk with write access where they could deposit resources. Also this block might have a chat applet whereby enrolled students could chat to the Reference Librarian on duty about their bibliographic research needs.&lt;br /&gt;
&lt;br /&gt;
===Teacher===&lt;br /&gt;
&lt;br /&gt;
Teachers should have read access to other Teacher&#039;s courses unless explictly prohibited. They should be able to set parts of their own course to be totally private (perhaps even to admin?). Just as each activity can currently be set to have group access, each activity could have a permissions field. Teachers could set default permissions for all activities on their course (eg they might disallow Librarian access for example) and then change the access permission for an individual activity. &lt;br /&gt;
&lt;br /&gt;
I think that what is needed is a simple heirarchy of permissions and levels of granularity.&lt;br /&gt;
&lt;br /&gt;
I would take issue with &amp;quot;teachers should have read access to other teacher&#039;s courses unless explicitly prohibited.&amp;quot; This is a violation of the students&#039; privacy as how they perform and what they do in one class isn&#039;t the business of another teacher. Moreover, in the real world a teacher wouldn&#039;t suddenly go sit in on a colleague&#039;s class without asking permission first. I would not have appreciated such an invasion of privacy as either a teacher or a student. It could be an option, but shouldn&#039;t be default.--[[User:N Hansen|N Hansen]] 19:54, 12 June 2006 (WST)&lt;br /&gt;
&lt;br /&gt;
===Community Education Tutors/Trainers===&lt;br /&gt;
Teachers may be community adult education trainers making use of a school moodle so must only have access to their courses unless given access elsewhere. They would not necessarily get the default teacher privileges.&lt;br /&gt;
&lt;br /&gt;
===Secretary/Student Worker===&lt;br /&gt;
&lt;br /&gt;
We often have faculty who want their departmental secretary or student worker to scan and upload files and perhaps create resources. Currently they have to be given teacher access to the course. This is dangerous from a FERPA standpoint since they could easily get access to grades.&lt;br /&gt;
&lt;br /&gt;
===Teaching Assistant===&lt;br /&gt;
&lt;br /&gt;
Our Faculty frequently have undergraduate students acting as Teaching Assistants. These students need to be able to add resources, create assignments, and possibly grade assignments. However, due to FERPA they cannot have access to other students&#039; overall grade information. I think the requirements here are slightly different than those of Secretary/Student Worker&lt;br /&gt;
&lt;br /&gt;
===Admin - Catgory based===&lt;br /&gt;
&lt;br /&gt;
Basically a person in between full Admin and Creator that has the permissions of an Admin but only with respect to courses and students. Currently a Creator has permissions site-wide which does not always meet the requirements of a given organisation (e.g. Department A may not be happy that a person from Department B can create/modify courses within Department A&#039;s area). The ability to designate a Creator within a specific category would allow areas to be set up for a faculty/department/organisation and allow the Admin for that area to create/delete courses, upload users, add site-wide entries to the calendar etc.&lt;br /&gt;
&lt;br /&gt;
===PROCESS ROLES===&lt;br /&gt;
&lt;br /&gt;
organising the learning process for a group you wish to have the choice to place students in differnt roles: examples of this are:&lt;br /&gt;
&amp;lt;li&amp;gt;1. Give a student the role of forum-moderator with edit and chunk-rights&lt;br /&gt;
&amp;lt;li&amp;gt;2. Give students different roles &amp;amp; rights in a Webquest design (and change these roles next week&lt;br /&gt;
&amp;lt;li&amp;gt;3. Give students different resources, depending of their roles in a rolegame/simulation&lt;br /&gt;
&amp;lt;li&amp;gt;4. Give a student the rights to create the section content of next week (and only that week..)&lt;br /&gt;
&amp;lt;li&amp;gt;5. ..&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=38788 Roles and Permissions architecture] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Future]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ru:Роли]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=User:Nashev&amp;diff=12187</id>
		<title>User:Nashev</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=User:Nashev&amp;diff=12187"/>
		<updated>2006-06-20T22:27:59Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Russian developer&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/user/view.php?id=26945&amp;amp;course=1 Nashev @ moodle site]&lt;br /&gt;
&lt;br /&gt;
[[ru:User:Ne Nashev]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:UTF-8_scripts&amp;diff=7702</id>
		<title>Development:UTF-8 scripts</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:UTF-8_scripts&amp;diff=7702"/>
		<updated>2006-03-29T05:53:11Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: possible solution for glossary letter-index&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[UTF-8 migration]] &amp;gt; Recoding PHP scripts&lt;br /&gt;
&lt;br /&gt;
==Recoding PHP scripts==&lt;br /&gt;
&lt;br /&gt;
=== Introduction ===&lt;br /&gt;
&lt;br /&gt;
This page will show a list of well known UTF-8 related modifications to be applied to 1.6 in order to work better under Unicode. Some of the changes can be applied always while others would break compatibility with non UTF-8 sites so they have to be executed conditionally, i.e:&lt;br /&gt;
      if (!empty($CFG-&amp;gt;unicodedb)) {&lt;br /&gt;
          //Code to be executed in UTF8 mode&lt;br /&gt;
      } else {&lt;br /&gt;
          //Old code&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
For each modification we&#039;ll show if it&#039;s executed always or conditionally, using the &amp;quot;&#039;&#039;&#039;A&#039;&#039;&#039;&amp;quot; and &amp;quot;&#039;&#039;&#039;C&#039;&#039;&#039;&amp;quot; abbreviation. Also, the current status will be maintained with &amp;quot;&#039;&#039;&#039;N&#039;&#039;&#039;&amp;quot;ot implemented, &amp;quot;&#039;&#039;&#039;W&#039;&#039;&#039;&amp;quot;ork in progress and &amp;quot;&#039;&#039;&#039;D&#039;&#039;&#039;&amp;quot;one. Obviously, &amp;quot;&#039;&#039;&#039;D&#039;&#039;&#039;&amp;quot; is the desired final status for all the modifications.&lt;br /&gt;
&lt;br /&gt;
Finally, please, you are welcome to add new items to the list, thanks!, but do it at the end (to maintain its current numeration).&lt;br /&gt;
&lt;br /&gt;
=== The List ===&lt;br /&gt;
&lt;br /&gt;
# (D,A) Build one &amp;quot;check for 1.6 upgrade&amp;quot; utility under 1.5. Now it&#039;s present in the admin page. It&#039;s able to check for BD, PHP and PHP libraries, allowing function execution and built over the new [http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lib/environmentlib.php?rev=1.11&amp;amp;view=log environmentlib.php] script. All the checks are defined under one simple XML file and one mechanism to update it from http://download.moodle.org has been provided (using the new [http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lib/componentlib.class.php?rev=1.4&amp;amp;view=log componentlib.class.php] library.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N, C)&amp;lt;/span&amp;gt; datalib.php to support collations under MySQL. This will allow to control language specific ordering from Moodle but 1.6.0 won&#039;t offer support for it. Instead, MySQL table/filed collation can be altered &amp;quot;manually&amp;quot; if the default unicode collation isn&#039;t enough.&lt;br /&gt;
# (D,A) textlib.class to handle all those utf-compliant functions. It&#039;s working since 1.5.3. Based (wrapper) on [http://typo3.org/ Typo3] text handling libraries it offers support for conversion between charsets and a buch of functions like (substr, strtoupper, strpos...).&lt;br /&gt;
# (D,C) XML import/export (scorm, ims, backup/restore, glossary, quizzes...). Under UTF-8 mode, both utf8_encode() and utf8_decode() won&#039;t be needed anymore.&lt;br /&gt;
# (D,A) Excel Export: A new [http://cvs.sourceforge.net/viewcvs.py/moodle/moodle/lib/excellib.class.php?rev=1.2&amp;amp;view=log excellib.class.php] class wrapper has been built. It works with some [http://pear.php.net/ PEAR] libraries to be able to create UTF-16LE Excel files properly.&lt;br /&gt;
# (D,A) Modify every Excel generator to use the new library. This includes: grade/lib.php, course/grades.php, choice/report.php hotpot/report/default.php, quiz/report/analysis.php, quiz/report/overview.php, quiz/report/responses.ph and survey/download.php&lt;br /&gt;
# (D,A) Fixed the break_up_long_words() to work using the textlib functions.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,A)&amp;lt;/span&amp;gt; Fixed the glossary to find properly the pivot (initial letter) under UTF8 (Skodak has some ideas here about the alphabet for each lang.)&lt;br /&gt;
# (D,A) Modify the rss_title() function to support UTF8 chars.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,A)&amp;lt;/span&amp;gt; htmlentities() to s() migration everywhere.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,A)&amp;lt;/span&amp;gt; uses of substr, strlen, strpos, strtoupper... to use the new textlib class that offers utf8 savvy string manipulation functions.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N,A)&amp;lt;/span&amp;gt; Modify documentation to let users know how they MUST create their DB before installing Moodle 1.6 explaining all the benefits for being UTF-8 enabled sice the beginning.&lt;br /&gt;
# (D,A) Modify the central installation script to:&lt;br /&gt;
#* Check DB encoding, warning if unicode hasn&#039;t been detected.&lt;br /&gt;
#* Execute the environmental checks.&lt;br /&gt;
# (D,A) Modify the Windows32 Complete Package installation script to:&lt;br /&gt;
#* Force DB creation under UTF-8.&lt;br /&gt;
#* Execute the environmental checks.&lt;br /&gt;
# (D,A) The wiki module - this is due to the use of htmlentities() without specifying the character set. DFWiki does not have any known problems apparently.&lt;br /&gt;
# (D,A) UTF-8 national chars could not be used in paths/foldernames. Unicode characters in filenames can now be enabled by setting $CFG-&amp;gt;unicodecleanfilename=true in config.php, though this option is not recommended. Please note that unicode characters in filenames may be broken during zip/unzip process, native info-zip binaries do not work at all on Windows; please use internal zipping/unzipping.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt; (N,A)&amp;lt;/span&amp;gt; GD support for UTF-8 strings. Perhaps it&#039;ll require some hacking + new fonts to be added (centrally or inside each lang pack).&lt;br /&gt;
# (D,C) RSS block. Working fine now with the new texlib.class.php library.&lt;br /&gt;
# (D,A) Languages list issues, not showing properly lang names. Not action required because now all those names are UTF-8 and they should work properly. I think it&#039;s an browser/font issue.&lt;br /&gt;
# (D,C) The Assingment module says that 0 words under some languages without word separators. A new configuration option has been added to count letters instead of words.&lt;br /&gt;
# (D,C) Modify the email_to_user() function to enable encoding of mails based on site setting and/or user preference. This is a must because a lot of mail clients/widgets don&#039;t support UTF-8 encodings. Done (email encoding now can be specified at site and user level plus support any charset (header + body).&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N,C)&amp;lt;/span&amp;gt; Look for all the occurrences of &amp;quot;en&amp;quot; or &#039;en&#039; is source code and change them to &#039;en_utf8&#039; is necessary.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,A)&amp;lt;/span&amp;gt; New lang edition interface for utf_8 lang packs. It should support dataroot lang packs, use &#039;en_utf8&#039; as master language and &amp;quot;lock&amp;quot; the new langconfig.php file.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,C)&amp;lt;/span&amp;gt; DB Migration with this functionalities:&lt;br /&gt;
#* Convert all the users/courses/site languages to their new alternative.&lt;br /&gt;
#* Recover from crash smoothly.&lt;br /&gt;
#* Handle and central tables and official modules. Contrib modules should implement their own script. See [[UTF-8 contrib]] for more info.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N,C)&amp;lt;/span&amp;gt; Modify the document_file() function to work properly (links to docs.moodle.org)&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N,C)&amp;lt;/span&amp;gt; Modify the footer output to allow it to go to the proper (en, es...) wiki page in https://docs.moodle.org. A list of available languages can be harcoded, defaulting to en.&lt;br /&gt;
# (D,C) Review the RSS feeds creator to detect if conversion to UTF-8 is needed.&lt;br /&gt;
# (D,C) Analyse if we need the $SESSION-&amp;gt;encoding. Removed from main CVS, 3rd party plugins must be updated anyway to use curent_curset() and $CFG-&amp;gt;unicodedb to be fully utf8 and 1.6 compatible.&lt;br /&gt;
# (D,A) Delete all the get/print_string(&#039;thisencoding&#039;) and change them to the new current_charset() function.Seems finished.&lt;br /&gt;
# (D,C) Analyse and, if possible, implement a bit improved moodle_setlocale() function because of [[Table of locales|differences between Unix locales and Win32 locales]]. They should go to a new string inside each langconfig.php file and, after OS detection use the correct one. Done, 95% of Windows langs will work.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(W,C)&amp;lt;/span&amp;gt; Implement one PEAR download utility if finally we cannot add it to standard distro (it&#039;s ready since some time ago under http://download.moodle.org/pear). Needed to generate Excel files and, potentially, it&#039;ll grow. Add it to credits.&lt;br /&gt;
# (D,C) Handling of passwords. After DB conversion, password hashes are updated to utf8 during next user login. First is tried hash of unicode plain text password, then the plain text is converted into &#039;oldcharset&#039; defined in the new language pack and its hash is checked again.&lt;br /&gt;
# (D,A) Modify (and potentially upgrade) the MyPHPAdmin module in order to recognise new lang pack names. Done: just support to utf8 langs added.&lt;br /&gt;
# &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(N,C)&amp;lt;/span&amp;gt; Add one new parameter (xxx_original_encoding) to authentication methods in order to be able to convert from external sources (ldap, db...) encoding to utf8 if Moodle is running in that mode avoiding the current utf8_decode() implemented.&lt;br /&gt;
# (D,A) Modify the install.php script to be able to detect DB encoding and warn about it plus use the new environment stuff to perform tests.&lt;br /&gt;
# (D,A) Create a collection of &#039;&#039;&#039;installer.php&#039;&#039;&#039; (to avoid conflicts with old install.php) files to be stored under the install/lang directory and to be used exclusively in the installation process. Hack get_string() to support this files ONLY in installation and make a script to be able to build them daily from contents existing in other language files (i.e, no manual handling of them!). Also, perhaps, add the possibility of language download at the end of the installation script.&lt;br /&gt;
&lt;br /&gt;
== Patches reference ==&lt;br /&gt;
&lt;br /&gt;
Post here all the solutions you know if you consider that they&#039;ll be interesting to solve some of the pending items in the list above.&lt;br /&gt;
----&lt;br /&gt;
Patches to allow Japanese Language Moodles that function without garbling have been prepared and are available at at the following sites.&lt;br /&gt;
&lt;br /&gt;
These patches are explained here&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=13558&lt;br /&gt;
&lt;br /&gt;
Mr. Kashiwagi&#039;s &amp;quot;Supertak&amp;quot; Patch (described in the thread above)&lt;br /&gt;
http://www.supertak.com/down/sample.htm&lt;br /&gt;
&lt;br /&gt;
Prof Kita&#039;s patches and rpms (based in part on Mr. Kashiwagi&#039;s)&lt;br /&gt;
http://t-kita.net/rpm/FC/moodle/&amp;lt;br/&amp;gt; A read me file in English describing the rpm&lt;br /&gt;
http://t-kita.net/rpm/moodle/README-rpm-en.txt&lt;br /&gt;
A patch describing all the things that need to be done&lt;br /&gt;
http://t-kita.net/rpm/FC/moodle/patches/moodle-t-kita.patch&lt;br /&gt;
Many, or even most end-users (including myself = Tim) are not sufficiently confident making extensive patches, so our Moodles have been garbling in important areas (email/excel).&lt;br /&gt;
&lt;br /&gt;
One interesting PHP-UTF8 reference: http://www.phpwact.org/php/i18n/utf-8#mail_functions&lt;br /&gt;
&lt;br /&gt;
For item #8: may be for letter-index use &amp;quot;distinct&amp;quot; first letters from existing data, and not lang alphabet? it can help in multilanguage glossary... --[[User:Ne Nashev|Ne Nashev]] 13:53, 29 March 2006 (WST)  &lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:UTF-8|Scripts]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Development:UTF-8_problems&amp;diff=7572</id>
		<title>Development:UTF-8 problems</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Development:UTF-8_problems&amp;diff=7572"/>
		<updated>2006-03-25T23:41:10Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: added one possible solution for password convertation problem&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[UTF-8 migration]] &amp;gt; Problems&lt;br /&gt;
&lt;br /&gt;
==Problems (and solutions!)==&lt;br /&gt;
&lt;br /&gt;
* Password field(s) can be encoded in anything, and it is encrypted using a one way md5 hash. This means that we can not reverse the md5, thus if a string was encoded in an arbitrary language, we can not do the proper DB migration for that. Possible solutions: &lt;br /&gt;
**auto generate new password and send to all users?&lt;br /&gt;
**add to passwords one more field - like &amp;quot;original password encoding&amp;quot;, fill it while upgrading, and then at user loging in, before compare with hash make translation of entered password to login&#039;s original password encoding (by engine like iconv). Upgrade system may time to time perform check, and when all &amp;quot;original encoding&amp;quot; become to UTF-8 - can remove this column and related code. This will be long but soft convertation life...--[[User:Ne Nashev|Ne Nashev]] 07:41, 26 March 2006 (WST)&lt;br /&gt;
* Exercise - password - md5&lt;br /&gt;
* Lesson, lesson_default - password - md5&lt;br /&gt;
* Workshop - password - md5&lt;br /&gt;
* Quiz module, the use of field &amp;quot;uniqueid&amp;quot; in attempts - uniqueid is used to link to quiz_states table which is in turn linked to many quiz tables. dev - linked using uniqueid? stable - linked using id?? &lt;br /&gt;
* Locales: What happens with locales once we have converted lang packs. Currently the process is adding the .UTF-8 suffix to them, but is this the best solution. Would be better to add support for one windows locale and other unix locale? Uhm...&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:UTF-8|Problems]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=Forum_activity&amp;diff=7571</id>
		<title>Forum activity</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=Forum_activity&amp;diff=7571"/>
		<updated>2006-03-25T23:28:58Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: added link to Forum_development into see also section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Forums}}&lt;br /&gt;
&lt;br /&gt;
This activity can be the most important – it is here that most discussion takes place. Forums may be structured in different ways, and can include peer rating of each posting. Generally, forum postings may be edited up to 30 minutes after posting. The postings can be viewed in a variety for formats, and can include attachments. By subscribing to a forum, participants will receive copies of each new posting in their email. A teacher can impose subscription on everyone if they want to.&lt;br /&gt;
&lt;br /&gt;
Forums are divided into two main categories:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;General forums&#039;&#039;&#039; (found in section 0 of the course)&lt;br /&gt;
# &#039;&#039;&#039;Learning forums&#039;&#039;&#039; (the forums of the specific parts of the course: they are organized and numbered according to the course sections they appear in).&lt;br /&gt;
&lt;br /&gt;
Forums are organised under following headings:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Forum&#039;&#039;&#039; (the name of the forum)&lt;br /&gt;
# &#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
# &#039;&#039;&#039;Discussions&#039;&#039;&#039; (the number of discussions started)&lt;br /&gt;
# &#039;&#039;&#039;Unread posts&#039;&#039;&#039; (the number of posts you have not read yet)&lt;br /&gt;
# &#039;&#039;&#039;Track&#039;&#039;&#039; (the &#039;yes/no&#039; information about your choice whether or not track the unread posts - if your choice is negative, you will find an &#039;-&#039; sign instead of the number of the posts unread)&lt;br /&gt;
# &#039;&#039;&#039;Subscribed&#039;&#039;&#039; (the &#039;yes/no&#039; information about your choice whether or not get the posts transferred to your mail box)&lt;br /&gt;
# &#039;&#039;&#039;RSS&#039;&#039;&#039; (the &#039;RSS&#039; (Really Simple Syndication) button - please refer to [[RSS in Forums|RSS in forums]] for additional information&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
*[http://download.moodle.org/docs/using_moodle/ch4_forums.pdf Using Moodle Chapter 4: Using Forums, Chats and Dialogues]&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=5367 The philosophy underlying &amp;quot;no editing after 30 minutes&amp;quot;] forum discussion&lt;br /&gt;
*[[Forum development]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Forum]]&lt;br /&gt;
&lt;br /&gt;
[[es:Foros]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/310/en/index.php?title=User:Ne_Nashev&amp;diff=7121</id>
		<title>User:Ne Nashev</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/310/en/index.php?title=User:Ne_Nashev&amp;diff=7121"/>
		<updated>2006-03-15T10:41:42Z</updated>

		<summary type="html">&lt;p&gt;Nenashev: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[user:Nashev]]&lt;/div&gt;</summary>
		<author><name>Nenashev</name></author>
	</entry>
</feed>