<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rubenback26</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Rubenback26"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/Special:Contributions/Rubenback26"/>
	<updated>2026-04-22T07:12:19Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Interface_guidelines&amp;diff=36802</id>
		<title>Development:Interface guidelines</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Interface_guidelines&amp;diff=36802"/>
		<updated>2008-05-26T17:39:41Z</updated>

		<summary type="html">&lt;p&gt;Rubenback26: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is not authoritative, it is a collection of ideas and under construction.&lt;br /&gt;
&lt;br /&gt;
==Keeping it simple==&lt;br /&gt;
&lt;br /&gt;
Use the minimum interface required to get the job done&lt;br /&gt;
&lt;br /&gt;
==Standard pages==&lt;br /&gt;
&lt;br /&gt;
===Activity modules===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;index.php&#039;&#039; - lists all instances for that module in a course&lt;br /&gt;
*&#039;&#039;view.php&#039;&#039; - displays a particular instance&lt;br /&gt;
*&#039;&#039;config.html&#039;&#039; - configure an instance of the module&lt;br /&gt;
&lt;br /&gt;
===Blocks===&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;config.html&#039;&#039; - configure an instance of the block&lt;br /&gt;
&lt;br /&gt;
==One script per major function/page==&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
==Page layout==&lt;br /&gt;
&lt;br /&gt;
# Print headings with print_heading, use the CSS hooks for IDs and Classes&lt;br /&gt;
# Print boxes around text using print_simple_box, use the CSS hooks for IDs and Classes&lt;br /&gt;
&lt;br /&gt;
===Tabs===&lt;br /&gt;
&lt;br /&gt;
.userinfobox {&lt;br /&gt;
  border-top:0 none;&lt;br /&gt;
  padding-top:0;&lt;br /&gt;
  margin-top:0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#mod-forum-user .forumpost,&lt;br /&gt;
#course-user .section .content {&lt;br /&gt;
  border-top:0 none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#course-user .section {&lt;br /&gt;
  background-color:#fff;&lt;br /&gt;
  padding:1em;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#course-user .section h2 {&lt;br /&gt;
  margin-top:0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#user-view .tabs td,&lt;br /&gt;
#user-edit .tabs td,&lt;br /&gt;
#mod-forum-user .tabs td {&lt;br /&gt;
  padding-bottom:0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#user-edit .generalbox {&lt;br /&gt;
  width:100%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mod-glossary .glossarydisplay tr,&lt;br /&gt;
.mod-glossary .glossarydisplay td {&lt;br /&gt;
  border:0 none !important;&lt;br /&gt;
  padding-bottom:0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mod-glossary td.entryboxheader {&lt;br /&gt;
  height:0 !important;&lt;br /&gt;
  background-color:#fff;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.mod-glossary .entrybox {&lt;br /&gt;
  padding:0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs {&lt;br /&gt;
  width:auto;&lt;br /&gt;
  margin-left:auto;&lt;br /&gt;
  margin-right:auto;&lt;br /&gt;
  margin-bottom:0;&lt;br /&gt;
  padding-bottom:0;&lt;br /&gt;
  border-bottom:0 none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#user-view .tabs {&lt;br /&gt;
  width:80%;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs tr,&lt;br /&gt;
.tabs .left,&lt;br /&gt;
.tabs .right {&lt;br /&gt;
  background:url(pix/tab/tabsbg_x2.gif) bottom left repeat-x&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .side {&lt;br /&gt;
  border-bottom:0 none&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs td {&lt;br /&gt;
  padding:0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .left {&lt;br /&gt;
  width:0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .right {&lt;br /&gt;
  width:75%&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow {&lt;br /&gt;
  width:100%;&lt;br /&gt;
  margin:0;&lt;br /&gt;
  border-collapse:collapse&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow td {&lt;br /&gt;
  padding:0 0 0 14px;&lt;br /&gt;
  height:34px;&lt;br /&gt;
  border-width:0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 {&lt;br /&gt;
  margin-bottom:1px&lt;br /&gt;
}&lt;br /&gt;
.tabrow td.selected {&lt;br /&gt;
  border-width: 0px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .active {&lt;br /&gt;
  background:url(pix/tab/left.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .active {&lt;br /&gt;
  background:url(pix/tab/left2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .inactive {&lt;br /&gt;
  background:url(pix/tab/left_inactive.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .inactive {&lt;br /&gt;
  background:url(pix/tab/left_inactive2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .activetwo {&lt;br /&gt;
  background:url(pix/tab/left_active2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .activetwo {&lt;br /&gt;
  background:url(pix/tab/left_active2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs,&lt;br /&gt;
.tabs tr,&lt;br /&gt;
.tabs .td,&lt;br /&gt;
.tabrow,&lt;br /&gt;
.tabrow tbody,&lt;br /&gt;
.tabrow tr,&lt;br /&gt;
.tabrow td {&lt;br /&gt;
  background-color:transparent&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow th {&lt;br /&gt;
  display:none&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow td .tablink {&lt;br /&gt;
  padding:0 14px 0 0;&lt;br /&gt;
  /*display:block;*/&lt;br /&gt;
  white-space:nowrap;&lt;br /&gt;
  line-height:32px;&lt;br /&gt;
  text-align:center;&lt;br /&gt;
  text-decoration:none;&lt;br /&gt;
  height:34px;&lt;br /&gt;
  width:auto&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .active .tablink {&lt;br /&gt;
  background:url(pix/tab/right.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .active .tablink {&lt;br /&gt;
  background:url(pix/tab/right2.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .inactive .tablink {&lt;br /&gt;
  background:url(pix/tab/right_inactive.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .inactive .tablink {&lt;br /&gt;
  background:url(pix/tab/right_inactive2.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .activetwo .tablink {&lt;br /&gt;
  background:url(pix/tab/right_active2.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .activetwo .tablink {&lt;br /&gt;
  background:url(pix/tab/right_active2.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow td .tablink a {&lt;br /&gt;
  width:auto;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .active:hover {&lt;br /&gt;
  background:url(pix/tab/left_hover.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .active:hover .tablink {&lt;br /&gt;
  background:url(pix/tab/right_hover.gif) bottom right no-repeat;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .inactive:hover {&lt;br /&gt;
  background:url(pix/tab/left_inactive.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .inactive:hover .tablink {&lt;br /&gt;
  background:url(pix/tab/right_inactive.gif) bottom right no-repeat;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .active:hover {&lt;br /&gt;
  background:url(pix/tab/left_hover2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .active:hover .tablink {&lt;br /&gt;
  background:url(pix/tab/right_hover2.gif) bottom right no-repeat;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow .last span {&lt;br /&gt;
  padding:0 1px 0 0;&lt;br /&gt;
  display:block;&lt;br /&gt;
  background:url(pix/tab/right_end.gif) bottom right no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .selected {&lt;br /&gt;
  background:url(pix/tab/left_active.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .selected {&lt;br /&gt;
  background:url(pix/tab/left_active2.gif) bottom left no-repeat&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r0 .selected .tablink {&lt;br /&gt;
  background:url(pix/tab/right_active.gif) bottom right no-repeat;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabs .r1 .selected .tablink {&lt;br /&gt;
  background:url(pix/tab/right_active2.gif) bottom right no-repeat;&lt;br /&gt;
  line-height:32px&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/*.tabrow td.selected:hover  {&lt;br /&gt;
  background:url(pix/tab/left_active.gif) bottom left no-repeat;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tabrow td.selected .tablink:hover {&lt;br /&gt;
  background:url(pix/tab/right_active.gif) bottom right no-repeat;&lt;br /&gt;
}*/&lt;br /&gt;
&lt;br /&gt;
.user-content h2 {&lt;br /&gt;
  margin:0;&lt;br /&gt;
  padding:0 1em&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.user-content {&lt;br /&gt;
  background-color:#FFFFFF;&lt;br /&gt;
  border:1px solid #D1D7DC;&lt;br /&gt;
  border-top-width:0;&lt;br /&gt;
  padding:0.5em&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tabs===&lt;br /&gt;
&lt;br /&gt;
.tabs {&lt;br /&gt;
  font-size:0.8em&lt;br /&gt;
}&lt;br /&gt;
.tablink a:link,&lt;br /&gt;
.tablink a:visited {&lt;br /&gt;
    color:#000066;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.tablink a:hover {&lt;br /&gt;
    text-decoration: none;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
.selected .tablink a:link,&lt;br /&gt;
.selected .tablink a:visited {&lt;br /&gt;
    color:#000000;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
==Dealing with tables==&lt;br /&gt;
&lt;br /&gt;
Use the print_table function whenever possible.&lt;br /&gt;
&lt;br /&gt;
==Standard navigation tools==&lt;br /&gt;
&lt;br /&gt;
# All pages should call print_header, and supply a standard navigation path to be displayed in it. Where possible, it should look like: COURSE &amp;gt;&amp;gt; INDEX &amp;gt;&amp;gt; INSTANCE &amp;gt;&amp;gt; SUBPAGES...&lt;br /&gt;
# Pages within activity modules should call navmenu() to generate the appropriate navigation menu.&lt;br /&gt;
&lt;br /&gt;
==URLs==&lt;br /&gt;
&lt;br /&gt;
# URLs should be as short as possible.&lt;br /&gt;
# No underscores in parameter names or files names&lt;br /&gt;
# Never use two words when one would do.&lt;br /&gt;
&lt;br /&gt;
==Buttons vs links==&lt;br /&gt;
&lt;br /&gt;
This is a hard one to define ...&lt;br /&gt;
&lt;br /&gt;
The Google Web Accelerator issue definitely provides some pointers here:&lt;br /&gt;
&lt;br /&gt;
# Actions which can modify the state of Moodle (data files, database, session information) should be performed through buttons&lt;br /&gt;
# At the very least, such actions which are implemented as links should forward to a confirmation page which *does* use buttons&lt;br /&gt;
&lt;br /&gt;
==CSS naming==&lt;br /&gt;
&lt;br /&gt;
* See [[Standards|theme standards]]&lt;br /&gt;
&lt;br /&gt;
==Linking to help==&lt;br /&gt;
&lt;br /&gt;
* Help buttons should be on the right of the thing (as an exception it can be left, if the thing is right-aligned)&lt;br /&gt;
&lt;br /&gt;
==Related topics==&lt;br /&gt;
&lt;br /&gt;
Robin Good&#039;s Latest News. &amp;quot;Interaction Design Meets Online Real Estate&amp;quot; 1 Mar. 2005 http://www.masternewmedia.org/news/2005/03/01/interaction_design_meets_online_real.htm&lt;br /&gt;
&lt;br /&gt;
The article presents a view of virtual spaces with the focus on human actions. It reminded me of communicative approaches like Moodle. The interface serves as the handle of all the communication tools.&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
&lt;br /&gt;
[[pt:Guia para interface]]&lt;br /&gt;
[[es:Manual de estilo de la interfaz]]&lt;br /&gt;
[[ja:インターフェースガイドライン]]&lt;/div&gt;</summary>
		<author><name>Rubenback26</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Tracker&amp;diff=36550</id>
		<title>Tracker</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Tracker&amp;diff=36550"/>
		<updated>2008-05-22T11:24:12Z</updated>

		<summary type="html">&lt;p&gt;Rubenback26: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:Tracker.jpg]] &#039;&#039;&#039;is Moodle&#039;s&#039;&#039;&#039; [[Image:Issue Tracker MoodleOrg link.JPG]]&lt;br /&gt;
&lt;br /&gt;
Issue tracking is an important part of a continuous quality control process.  It involves the reporting of problems (bugs), ideas for improvement and new features. Unlike most proprietary software programs, Moodle issue reporting and tracking information is open to everyone.  Moodle&#039;s issue tracking system  is called &#039;&#039;&#039;[http://tracker.moodle.org Moodle Tracker]&#039;&#039;&#039;.  We welcome your requests for new features, improvements, or even constructive criticism of existing features.&lt;br /&gt;
&lt;br /&gt;
The beauty of open source is that anyone can participate and help to create a better product for all of us to enjoy. Please help us by using [http://tracker.moodle.org Moodle Tracker]!&lt;br /&gt;
&lt;br /&gt;
==Basics==&lt;br /&gt;
===Logging in to Tracker===&lt;br /&gt;
*If you&#039;re a new Tracker user, create a user account [http://tracker.moodle.org here].  It is strongly suggested your Tracker username is the same name you use at Moodle.org.  &lt;br /&gt;
*If you&#039;ve forgotten your password, go [http://tracker.moodle.org here] and select &#039;&amp;lt;u&amp;gt;forgot password&amp;lt;/u&amp;gt;&#039; which is just under the &#039;log in&#039; button.  Follow the prompts.&lt;br /&gt;
&lt;br /&gt;
=== Summary: How to report a bug, improvement, or new feature request ===&lt;br /&gt;
NB See the section &#039;Tracker fields&#039; below for a full description of every field.&lt;br /&gt;
*Login to [http://tracker.moodle.org Tracker]&lt;br /&gt;
*Select &amp;quot;Create New Issue&amp;quot; from the menu under the Moodle Tracker logo&lt;br /&gt;
*From the dropdown menu select the &amp;quot;Issue type&amp;quot;: Bug, New Feature, Task or Improvement&lt;br /&gt;
*You will see a series of dropdown and free text fields.  Complete as many as you can.  Some fields are required while others are optional.&lt;br /&gt;
*Press the &#039;Create&#039; button at the bottom of the page to create the bug.&lt;br /&gt;
&lt;br /&gt;
=== How to write a good Tracker entry===&lt;br /&gt;
A good report will include:&lt;br /&gt;
*Summary (describe the issue in 1 or 2 sentences)&lt;br /&gt;
*Description (a concise yet complete summary of the problem or improvement)&lt;br /&gt;
*Steps to Reproduce: A detailed, easy-to-follow sequence of steps a developer can follow to reproduce the problem.  If possible, provide a URL so a developer can see the problem with one click.&lt;br /&gt;
*Actual Results: What the application did after performing the above steps.    &lt;br /&gt;
*Expected Results: What the application should have done, were the bug not present.  Provide as much detail as possible. Your expectation might mean that help instructions need to be improved or interface changed.&lt;br /&gt;
&lt;br /&gt;
If possible, include additional information that may be helpful to the developer:&lt;br /&gt;
*Moodle version (there is a dropdown menu on the top of the form, if that does not have what you want, add it in the description)&lt;br /&gt;
* If you have an error message, or information in your PHP or web server logs, copy and paste it into the bug report. If you can, turn on &amp;quot;debug&amp;quot; in your Admin configuration page and reproduce the problem to get the best possible error message.&lt;br /&gt;
* Screen shots are very helpful for some bugs, but please write a textual description of the problem too.&lt;br /&gt;
* Provide details about your setup including operating system, database, etc. If you run out of room in the environment section, add more detail in the description. The full set of information that might be relevant is:&lt;br /&gt;
**Server operating system type and version number&lt;br /&gt;
**Web server type and version number&lt;br /&gt;
**PHP version number (and whether you are using an accelerator)&lt;br /&gt;
**Database type and version number&lt;br /&gt;
**Client-side operating system type and version number&lt;br /&gt;
**Web browser type and version number &lt;br /&gt;
&lt;br /&gt;
* You don&#039;t need to provide details all the time. For example, for a layout rendering problem, you need to give only the client-side OS and browser info, and if it is a server-side problem you only need to describe the setup there. Use your judgment. Here are some examples:&lt;br /&gt;
**I see this bug with the latest Moodle HEAD running on PHP5.1.2/Apache 2.2.3 on Linux. My database is Postgres 8.1. &lt;br /&gt;
**This rendering problem happens using Internet Explorer 6.0 on Windows XP. &lt;br /&gt;
&lt;br /&gt;
In summary stick with facts and present enough facts so someone else can duplicate the problem.&lt;br /&gt;
&lt;br /&gt;
Here are some examples of good bug reports: MDL-6030, MDL-5688, MDL-12505&lt;br /&gt;
&lt;br /&gt;
*A good external reference to help write a tracker entry can be found at [http://developer.mozilla.org/en/docs/Bug_writing_guidelines mozilla bug writing guidelines].&lt;br /&gt;
&lt;br /&gt;
&amp;quot;What’s the hardest thing about a bug report?&amp;quot;  Most of the time fixing the problem is the easy part, the hard part is reproducing the bug.  The developer needs to see how it is broke to be able to fix it.   If they can&#039;t reproduce the error you can be sure they won&#039;t be able to fix it!&lt;br /&gt;
&lt;br /&gt;
Good bug reports contain as much detail as possible and are specific.  Don&#039;t generalise or leap to conclusions.&lt;br /&gt;
&lt;br /&gt;
For example, a bug report that only says &amp;quot;The RSS feed doesn’t support UTF-8&amp;quot; is not helpful. The developer knows that UTF-8 and RSS feeds are compatible.  The developer has no idea of what the person sees and why they reported this bug.  In this case more time and effort needs to be expended to determine the problem.&lt;br /&gt;
&lt;br /&gt;
Consider a bug report which says that the descriptions for the specific RSS feed XYZ@abc shows unrecognisable characters rather than expected characters.&lt;br /&gt;
&lt;br /&gt;
==Tracker process==&lt;br /&gt;
===Logging new issues or improvements===&lt;br /&gt;
Anyone with a Tracker account can log issues.  See instructions above for writing good quality bug reports.  It is important that you search Tracker to determine if your problem or suggestion for improvement has already been reported.  If it has you are encouraged to add more information (use the &amp;quot;comment&amp;quot; function), vote for the issue, or watch it (more on this later).&lt;br /&gt;
&lt;br /&gt;
You will receive an email when you log a new bug or make updates to bugs you&#039;ve reported.  You&#039;ll also receive notification when updates are made to bugs you&#039;re watching.&lt;br /&gt;
&lt;br /&gt;
You can monitor, or &#039;&#039;&#039;watch&#039;&#039;&#039; issues reported by others. To do this, open the issue, then select &amp;quot;Watch it&amp;quot; from the left hand navigation panel. To add others to the watchlist for your issue, open the issue, select the option &amp;quot;Watching&amp;quot; from the left hand navigation panel. These people will receive email notification when the issue is updated.&lt;br /&gt;
&lt;br /&gt;
Tracker provides a facility to &#039;&#039;&#039;Link&#039;&#039;&#039; issues.  Any user logged onto Tracker may link issues.   Multiple link types are defined in the system; you will be required to select one when linking bugs.  See [insert section name] for detailed list of link types.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vote&#039;&#039;&#039; for bugs you want to see addressed in Moodle.  Any user can vote.  To vote for a specific bug, browse to the bug, then select &amp;quot;Vote for it&amp;quot; from the left-hand navigation panel.  Developers may consider the number of votes a bug has when weighing the merits of two or more bugs. &lt;br /&gt;
&lt;br /&gt;
The Tracker &#039;&#039;&#039;Dashboard&#039;&#039;&#039; is flexible and customisable depending on your area of interest.  For instructions on configuring the Tracker dashboard click  [http://www.atlassian.com/software/jira/docs/v3.6.3/dashboard.html here].&lt;br /&gt;
&lt;br /&gt;
The Tracker &#039;&#039;&#039;Issue Navigator&#039;&#039;&#039; is used to find and filter bugs.  For instructions on configuring the Issue Navigator click [http://www.atlassian.com/software/jira/docs/v3.6.4/navigatorcolumns.html here].&lt;br /&gt;
&lt;br /&gt;
Tracker&#039;s &#039;&#039;&#039;Quick Search&#039;&#039;&#039; function is explained [http://www.atlassian.com/software/jira/docs/v3.6.4/quicksearch.html here]&lt;br /&gt;
&lt;br /&gt;
===Resolving issues=== (this section should be reviewed)&lt;br /&gt;
Issues are resolved in Tracker to show that they&#039;ve been actioned.  Only Moodle core developers and testers are permitted to change the status of bugs in Tracker to &amp;quot;resolved&amp;quot; or &amp;quot;closed&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This is the general process a developer will follow when actioning a Tracker issue:&lt;br /&gt;
&lt;br /&gt;
# Issues are automatically assigned at the time they&#039;re created based on component type; they may be reassigned by developers or Component Leads.&lt;br /&gt;
# Developers fix, modify or add code and check into CVS.  The Tracker issue number is included which automatically links the CVS change to Tracker.&lt;br /&gt;
# Patches are attached to Tracker issues so that they may be verified and possibly included in CVS.&lt;br /&gt;
# Appropriate comments should be added in Tracker describing the fix.  The bug&#039;s status is changed to &#039;&#039;&#039;Resolved&#039;&#039;&#039;. &lt;br /&gt;
# The developer should indicate which version of Moodle the change will be included in using the &#039;&#039;&#039;Fix Version/s&#039;&#039;&#039;. You should use this to indicate which branch(es) you checked the fix into (example below).&lt;br /&gt;
# The only exception to not moving a bug to Resolved is if a developer believes there is no value in testing the resolved issue, in which case the bug status can be changed to Closed.&lt;br /&gt;
&lt;br /&gt;
===Testing issues===&lt;br /&gt;
All users are encouraged to be active participants when it comes to testing Moodle.  Anyone with a Tracker user account can log, view, comment on, vote, and watch bugs.  If you find bugs or problems, have ideas for improvements, or want additional functionality added to Moodle, please log a bug in Tracker.  &lt;br /&gt;
&lt;br /&gt;
We&#039;ve formalised a group of testers in Tracker who are responsible for verifying the accuracy of changes made by developers.  These testers have responsibilities and authority in Tracker beyond that of standard users. Testers normally have a good understanding of Moodle, and are active in the Moodle community.  Obviously testers should have the skills and knowledge to sufficiently test the issue - experience is important - but don&#039;t forget there are others in the Moodle community who may be willing to lend a hand. If you are interested in becoming a member of the Moodle Testing team, make yourself known by logging a request through Tracker.  We&#039;d love to have you join the team!  Log your request at the [http://tracker.moodle.org/secure/project/ViewProject.jspa?pid=10020 Moodle.org Sites] Tracker project.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Testing a bug in Tracker&amp;lt;/u&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB This is the process members of the moodle-testers group should follow to move bugs from &#039;resolved&#039; to &#039;closed&#039;. &lt;br /&gt;
*Testers test bugs with Status=Resolved.  Global filters have been created based on upcoming releases (eg 1.7 Resolved) to make identification simple.  &lt;br /&gt;
*Use the &#039;&#039;&#039;QA Assignee&#039;&#039;&#039; field to identify yourself as the tester of a particular bug.  &lt;br /&gt;
 &lt;br /&gt;
*It&#039;s a good idea to add your name to the watch list for all bugs you test. (see &amp;quot;Tracker watch list&amp;quot;, below.)  &lt;br /&gt;
*If the bug passes testing, close the bug using the &amp;quot;Close Issue&amp;quot; button.  You must add appropriate &#039;&#039;&#039;comments&#039;&#039;&#039; describing your testing methods, any issues that were found, etc.&lt;br /&gt;
*If the bug fails testing or if you feel the fix is incomplete, &#039;&#039;&#039;reopen&#039;&#039;&#039; the bug using the &amp;quot;Reopen Issue&amp;quot; button.  Ensure the bug is assigned to the correct developer.  Work with the developer to find a mutually agreeable resolution to the bug. &lt;br /&gt;
*A release will be deemed ready when all bugs fixed for a particular version have been closed.&lt;br /&gt;
*All resolved bugs should be tested.  Bugs with a resolution code of &amp;quot;fixed&amp;quot; represent bugs where code has been updated, and probably represent more of a challenge than bugs with resoluton codes of  duplicate, won&#039;t fix, and not a bug, and can&#039;t reproduce.  Please ensure bugs have been closed with a proper resolution code.  Unfortunately it&#039;s not easy to change a resolution code in Tracker once the bug has been resolved (the only way is to reopen, then re-resolve).  &lt;br /&gt;
*Don&#039;t be afraid to discuss your testing with the developer assigned to the bug.  Simply adding a comment should get the attention of the developer as they are notified of all changes.&lt;br /&gt;
&lt;br /&gt;
==Detailed description of Tracker fields and groups ==&lt;br /&gt;
===Tracker fields===&lt;br /&gt;
NB A short explanation appears under each field in Tracker.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Project&#039;&#039;&#039; - Required field.  Tracker is a collection of multiple projects.  At present there are 3: &#039;moodle&#039;, &#039;moodle.org sites&#039; and &#039;Non-core contributed modules&#039;.  Specify &#039;moodle&#039; for issues/bugs related to moodle software; specify &#039;moodle.org sites&#039; for issues/bugs related to tracker.moodle.org, docs.moodle.org, demo.moodle.org, download.moodle.org, or moodle.org; specify &#039;Non-core contributed modules&#039; for issues/bugs related to contributed modules.  &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Issue Type&#039;&#039;&#039; - Required field.  Bugs are classified as 1 of the following:&lt;br /&gt;
:&#039;&#039;Bug&#039;&#039; - A problem which impairs or prevents Moodle from functioning correctly.&lt;br /&gt;
:&#039;&#039;Improvement&#039;&#039; - An enhancement to an existing Moodle feature.&lt;br /&gt;
:&#039;&#039;New Feature&#039;&#039; - A new Moodle feature which has yet to be developed.&lt;br /&gt;
:&#039;&#039;Task&#039;&#039; - A task that needs to be completed. Tasks usually refer to work that must be done outside the product.&lt;br /&gt;
:&#039;&#039;Sub-Task&#039;&#039; - Issues are sometimes broken into multiple sub-tasks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Summary&#039;&#039;&#039; - Required field.  A brief, concise description of the problem.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Security Level&#039;&#039;&#039; - Optional field. Specify if this bug or change has security implications for Moodle. Bugs with serious security implications are restricted so that only members of the moodle-security group can see them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Priority&#039;&#039;&#039; - Bugs are prioritised using one of the following:&lt;br /&gt;
:&#039;&#039;Blocker&#039;&#039; - Blocks development and/or testing work, production could not run.&lt;br /&gt;
:&#039;&#039;Critical&#039;&#039; - Crashes, loss of data, severe memory leak.&lt;br /&gt;
:&#039;&#039;Major&#039;&#039; - Major loss of function.&lt;br /&gt;
:&#039;&#039;Minor&#039;&#039; - Minor loss of function, or other problem where easy workaround is available.&lt;br /&gt;
:&#039;&#039;Trivial&#039;&#039; - Cosmetic problem like misspelled words or misaligned text.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Component/s&#039;&#039;&#039; - Required field.  Select the area in Moodle which is affected by this bug.  Select &#039;Unknown&#039; if you are unsure.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Affects Version/s&#039;&#039;&#039; - Required field.  This is the Moodle version in which the bug has been found.  It is entered by the person logging the bug, and typically only 1 version is specified.  Enter your current version when logging an &#039;improvement&#039;, &#039;task&#039;, or &#039;new feature&#039; as this will help assess the state of the product when the request was made.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Assigned To&#039;&#039;&#039; - This is the person who will fix (code) the issue.  Tracker automatically assigns issues to Component Leads.  Developers or QA Testers can reassign issues.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reporter&#039;&#039;&#039; - The person who logs the bug.  This field is automatically filled by Tracker.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Environment&#039;&#039;&#039; - Specify the operating system, software platform and/or hardware specifications if applicable to this bug.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Description&#039;&#039;&#039; - A full and complete yet concise description of the problem or improvement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database&#039;&#039;&#039; - Optional field.  If applicable to the bug, identify the database type.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;URL&#039;&#039;&#039; - Optional field.  If possible, provide a URL address that demonstrates an example of this bug.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;QA Assignee&#039;&#039;&#039; - Used to designate the person who will test this issue.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Fixed Version/s&#039;&#039;&#039; - This is the Moodle version the bug was or will be fixed in.  Basically you should think &#039;&#039;&#039;Which release notes should this appear in?&#039;&#039;&#039; This field is normally completed by the developer when the bug has been resolved or by lead developers allocating bugs for a specific release.  Normally only one version is specified in this field.  It symbolises the &#039;&#039;first&#039;&#039; version of Moodle where the change will be seen.&lt;br /&gt;
:Example: after Moodle 1.9 has been released, if you fix a bug on the MOODLE_19_STABLE and HEAD branches, mark it as fixed in 1.9.1.  If you also backported to MOODLE_18_STABLE, then add the version of the next 1.8.x release too.&lt;br /&gt;
&lt;br /&gt;
:If you resolve the bug as anything but &amp;quot;Fixed&amp;quot; (Cannot Reproduce, Won&#039;t Fix, etc.) leave Fix Version/s blank.&lt;br /&gt;
:If you resolve the bug as Duplicate, then create a link to the duplicate issue.&lt;br /&gt;
:These Fix version/s are used to automatically build release notes (see the tabs on http://tracker.moodle.org/browse/MDL).&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Attachment&#039;&#039;&#039; - Optional.  Attach a file that will help developers and testers better understand the bug.  Maximum attachement size is 512Kb.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Comment&#039;&#039;&#039; - The comment field is a detailed register of all changes that relate to this bug.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Resolution&#039;&#039;&#039; - This field is only displayed when resolving or closing a bug.  Specify a code that best describes how this bug was resolved.&lt;br /&gt;
:&#039;&#039;Fixed&#039;&#039; - Bug has been fixed; a code change will be checked into CVS.  Use this resolution code only when actual changes were made to Moodle code.&lt;br /&gt;
:&#039;&#039;Won&#039;t Fix&#039;&#039; - The problem described is an issue which will never be fixed. 	&lt;br /&gt;
:&#039;&#039;Not a bug&#039;&#039; - This issue is not a bug; was logged in error.  Use this code if the bug was fixed by another bug report or in some earlier Moodle version.&lt;br /&gt;
:&#039;&#039;Duplicate&#039;&#039; - The problem is a duplicate of an existing issue.&lt;br /&gt;
:&#039;&#039;Incomplete&#039;&#039; - More information is needed to understand this bug.&lt;br /&gt;
:&#039;&#039;Can&#039;t Reproduce&#039;&#039; - All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue.  Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.&lt;br /&gt;
:&#039;&#039;Deferred&#039;&#039; - The resolution to this bug will be deferred to a later release.&lt;br /&gt;
&lt;br /&gt;
=== Tracker groups and permissions ===&lt;br /&gt;
&#039;&#039;&#039;Standard Users&#039;&#039;&#039; [groupname=jira-user] - This is the default group.  New user accounts are placed in this group at the time of creation, and users must be a member of this group in order to log into Tracker.  Members of this group can browse bugs, create new bugs, comment on bugs, create attachments, create sub-tasks, create filters, watch bugs, and vote for bugs.  Members of this group can also resolve bugs, which is primarily a way of closing bugs that are no longer relevant (eg duplicates, or logged in error).  Standard Users can configure their Tracker workspace by using the &amp;quot;Configure your Issue Navigator&amp;quot; button.  This feature allows users to view watch and voting lists and to manage preferences, profile, and password.&lt;br /&gt;
 &lt;br /&gt;
&#039;&#039;&#039;Developers&#039;&#039;&#039; [groupname=jira-developer] - Developers can do everything Standard Users can do.  In addition they can clone bugs, close bugs, edit bugs, link bugs, and assign bugs.  Members of this group can also use the Bulk Edit function which allows bulk updated to multiple bugs. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Testers&#039;&#039;&#039; [groupname=moodle-testers] - Testers can do everything a Developer can do.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Moodle Security groups&#039;&#039;&#039; [groupname=moodle-security] - Trusted developers and administrators who need to work on and learn about security issues.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Nobody&amp;quot; is a Tracker user created to alert users to the fact that an issue hasn&#039;t been assigned to a developer.  These issues are regularly reviewed by the team at Moodle HQ.  &lt;br /&gt;
&lt;br /&gt;
NB You can browse a project while not logged in to Tracker, however you will be unable change/edit/comment on bugs.&lt;br /&gt;
&lt;br /&gt;
=== Link types ===&lt;br /&gt;
The following link types are available:&lt;br /&gt;
::duplicates - duplicates are inevitable in a project the size of Moodle.  They occur when a logger is unaware of an existing bug that describes the same problem.  Use &#039;&#039;duplicates&#039;&#039; to link to the first or most comprehensively described instance of the problem.  All duplicates should be linked together.&lt;br /&gt;
::blockers - use this to identify bugs that block others from being fixed.&lt;br /&gt;
::cloners - in some instances a duplicate bug is intentionally created in order to track the fix in another branch of the code - this almost never is used in the Moodle project.&lt;br /&gt;
::dependency - often a fix is dependent on another bug being resolved first, on in a specific order.&lt;br /&gt;
::relates - used to identify a bug that is somehow related to another bug.&lt;br /&gt;
&#039;&#039;&#039;Don&#039;t be afraid to link bugs. &#039;&#039;&#039;  Links are bi-directional meaning that there&#039;s a concept of &#039;inward&#039; and &#039;outward&#039; - it affects how linked bugs are displayed.  This is why you&#039;ll see &amp;quot;blocks/is blocked by&amp;quot; or &amp;quot;duplicates/is duplicated by&amp;quot; in the drop down list of the &#039;&#039;Link Issue&#039;&#039; dialog.  Don&#039;t become too concerned about using the &amp;quot;correct&amp;quot; link type - all link types work similarly.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[Development:Weekly Code Review]]&lt;br /&gt;
*[http://www.atlassian.com/software/jira/ Jira] Tracker is a slightly customised version of Atlassian&#039;s product  &lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=43952 How to manipulate Moodle developers] forum discussion&lt;br /&gt;
*Wikipedia [http://en.wikipedia.org/wiki/Software_bug Definition of a bug]&lt;br /&gt;
&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Developer tools]]&lt;br /&gt;
&lt;br /&gt;
[[pt:Tracker]]&lt;br /&gt;
[[es:Sistema de bugs]]&lt;br /&gt;
[[fr:Traqueur de bogues]]&lt;/div&gt;</summary>
		<author><name>Rubenback26</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Coding&amp;diff=36325</id>
		<title>Development:Coding</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Coding&amp;diff=36325"/>
		<updated>2008-05-17T17:59:37Z</updated>

		<summary type="html">&lt;p&gt;Rubenback26: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Any collaborative project needs consistency and stability to stay strong.&lt;br /&gt;
&lt;br /&gt;
These &#039;&#039;&#039;coding guidelines&#039;&#039;&#039; are to provide a goal for all Moodle code to strive to. It&#039;s true that some of the older existing code falls short in a few areas, but it will all be fixed eventually. All new code definitely must adhere to these standards as closely as possible.&lt;br /&gt;
&lt;br /&gt;
==General rules==&lt;br /&gt;
&lt;br /&gt;
# All code files should use the .php extension.&lt;br /&gt;
# All template files should use the .html extension.&lt;br /&gt;
# All text files should use Unix-style text format (most text editors have this as an option).&lt;br /&gt;
# All php tags must be &#039;full&#039; tags like &amp;lt;?php ?&amp;gt; ... not &#039;short&#039; tags like &amp;lt;? ?&amp;gt;.&lt;br /&gt;
# All existing copyright notices must be retained. You can add your own if necessary.&lt;br /&gt;
# Each file should include (require_once) the main config.php file.&lt;br /&gt;
# Any other include/require should use an absolute path beginning with $CFG-&amp;gt;dirroot or  $CFG-&amp;gt;libdir, not relative includes, which [http://uk.php.net/manual/en/function.include.php sometimes behave strangely under PHP].&lt;br /&gt;
# Each file should check that the user is authenticated correctly, using require_login() and has_capability() or require_capability().&lt;br /&gt;
# All access to databases should use the functions in &#039;&#039;lib/dmllib.php&#039;&#039; whenever possible - this allows compatibility across a wide range of databases. You should find that almost anything is possible using these functions. If you must write SQL code then make sure it is: cross-platform; restricted to specific functions within your code (usually a lib.php file); and clearly marked.&lt;br /&gt;
# Don&#039;t create or use global variables except for the standard $CFG, $SESSION, $THEME, $SITE, $COURSE and $USER.&lt;br /&gt;
# All variables should be initialised or at least tested for existence using isset() or empty() before they are used.&lt;br /&gt;
# All strings should be translatable - create new texts in the &amp;quot;lang/en_utf8&amp;quot; files with concise English lowercase names and retrieve them from your code using get_string() or print_string(). Never delete strings to ensure backwards compatibility of the language packs is maintained.&lt;br /&gt;
# Don&#039;t use p() and s() functions to print language strings. Those functions are not designed to print html with tags. Use echo() instead.&lt;br /&gt;
# All errors should be printed using print_error() to maximise translation and help for users (it automatically links to the docs wiki).&lt;br /&gt;
# All help files should be translatable - create new texts in the &amp;quot;lang/en_utf8/help&amp;quot; directory and call them using helpbutton(). If you need to update a help file:&lt;br /&gt;
#* with a minor change, where an old translation of the file would still make sense, then it&#039;s OK to make the change but you should notify translation AT moodle DOT org.&lt;br /&gt;
#* for a major change you should create a new file by adding an incrementing number (eg filename2.html) so that translators can easily see it&#039;s a new version of the file. Obviously the new code and the help index files should also be modified to point to the newest versions.&lt;br /&gt;
# Incoming data from the browser (sent via GET or POST) automatically has magic_quotes applied (regardless of the PHP settings) so that you can safely insert it straight into the database. All other raw data (from files, or from databases) must be escaped with addslashes() before inserting it into the database. Because this is so often done incorrectly, there is more explanation on this issue of adding and stripping slashes on a [[Developer:Slashes|separate page]].&lt;br /&gt;
# VERY IMPORTANT: All texts within Moodle, especially those that have come from users, should be printed using the format_text() function. This ensures that text is filtered and cleaned correctly. More information can be found on the page about [[Development:Output_functions|output functions]].&lt;br /&gt;
# User actions should be logged using the [[Development:Logs|add_to_log()]] function. These logs are used for [[Settings#Show_activity_reports|activity reports]] and [[Logs]].&lt;br /&gt;
# When generating a HTML link, always make it relative to the full site root, i.e. link to  &#039;&#039;$CFG-&amp;gt;wwwroot/mod/blonk/view.php?id=99&#039;&#039; rather than just &#039;&#039;view.php?id=99&#039;&#039;. This means that your code will work if called by a script in another folder, among other things.&lt;br /&gt;
# Modules should store their config variables using &#039;&#039;set_config(&#039;varname&#039;, $value, &#039;mod/modulename&#039;)&#039;&#039; where the last parameter is the path to the module directory.&lt;br /&gt;
&lt;br /&gt;
==Coding style==&lt;br /&gt;
&lt;br /&gt;
I know it can be a little annoying to change your style if you&#039;re used to something else, but balance that annoyance against the annoyance of all the people trying later on to make sense of Moodle code with mixed styles. There are obviously many good points for and against any style that people use, but the current style just is, so please stick to it.&lt;br /&gt;
&lt;br /&gt;
1. Indenting should be consistently 4 spaces. Don&#039;t use tabs AT ALL.&lt;br /&gt;
&lt;br /&gt;
2. Variable names should always be easy-to-read, meaningful lowercase English words. If you really need more than one word then run them together, but keep them short as possible. Use plural names for arrays of objects.&lt;br /&gt;
&lt;br /&gt;
      GOOD: $quiz&lt;br /&gt;
      GOOD: $errorstring&lt;br /&gt;
      GOOD: $assignments (for an array of objects)&lt;br /&gt;
      GOOD: $i (but only in little loops)&lt;br /&gt;
&lt;br /&gt;
      BAD: $Quiz&lt;br /&gt;
      BAD: $aReallyLongVariableNameWithoutAGoodReason&lt;br /&gt;
      BAD: $error_string&lt;br /&gt;
&lt;br /&gt;
3. Constants should always be in upper case, and always start with the name of the module. They should have words separated by underscores.&lt;br /&gt;
&lt;br /&gt;
      define(&amp;quot;FORUM_MODE_FLATOLDEST&amp;quot;, 1);&lt;br /&gt;
4. Function names should be simple English lowercase words, and start with the name of the module to avoid conflicts between modules. Words should be separated by underscores. Parameters should always have sensible defaults if possible. Note there is no space between the function name and the following (brackets).&lt;br /&gt;
&lt;br /&gt;
      function forum_set_display_mode($mode=0) {&lt;br /&gt;
          global $USER, $CFG;&lt;br /&gt;
          &lt;br /&gt;
          if ($mode) {&lt;br /&gt;
              $USER-&amp;gt;mode = $mode;&lt;br /&gt;
          } else if (empty($USER-&amp;gt;mode)) {&lt;br /&gt;
              $USER-&amp;gt;mode = $CFG-&amp;gt;forum_displaymode;&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
The same applies to naming classes and their methods. Use lowercase words separated by underscores.&lt;br /&gt;
&lt;br /&gt;
      class some_custom_class {&lt;br /&gt;
          function class_method() {&lt;br /&gt;
              ...&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
Note there are some exceptions in the code using camelcase: class SomeCustomClass {function classMethod(){...}}, but these are usually there because of compatibility with thirds party libraries (e.g. formslib).&lt;br /&gt;
&lt;br /&gt;
5. Blocks must always be enclosed in curly braces (even if there is only one line). Moodle uses this style:&lt;br /&gt;
&lt;br /&gt;
      if ($quiz-&amp;gt;attempts) {&lt;br /&gt;
          if ($numattempts &amp;gt; $quiz-&amp;gt;attempts) {&lt;br /&gt;
              error($strtoomanyattempts, &amp;quot;view.php?id=$cm-&amp;gt;id&amp;quot;);&lt;br /&gt;
          }&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
6. Strings should be defined using single quotes where possible, so that [http://php.net/types.string less memory is used].&lt;br /&gt;
&lt;br /&gt;
      $var = &#039;some text without any variables&#039;;&lt;br /&gt;
      $var = &#039;with special characters like a new line &#039;.&amp;quot;\n&amp;quot;;&lt;br /&gt;
      $var = &#039;a very, very long string with a &#039;.$single.&#039; variable in it&#039;;&lt;br /&gt;
      $var = &amp;quot;some $text with $many variables $within it&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
7. Comments should be added as much as is practical, to explain the code flow and the purpose of functions and variables.&lt;br /&gt;
&lt;br /&gt;
* Every function (and class) should use the popular [http://www.phpdoc.org/ phpDoc format]. This allows code documentation to be generated automatically.&lt;br /&gt;
* Inline comments should use the // style, laid out neatly so that it fits among the code and lines up with it.&lt;br /&gt;
&lt;br /&gt;
      /**&lt;br /&gt;
      * The description should be first, with asterisks laid out exactly&lt;br /&gt;
      * like this example. If you want to refer to a another function,&lt;br /&gt;
      * do it like this: {@link clean_param()}. Then, add descriptions&lt;br /&gt;
      * for each parameter as follows.&lt;br /&gt;
      *&lt;br /&gt;
      * @param int $postid The PHP type is followed by the variable name&lt;br /&gt;
      * @param array $scale The PHP type is followed by the variable name&lt;br /&gt;
      * @param array $ratings The PHP type is followed by the variable name&lt;br /&gt;
      * @return mixed&lt;br /&gt;
      */&lt;br /&gt;
      function forum_get_ratings_mean($postid, $scale, $ratings=NULL) {&lt;br /&gt;
          if (!$ratings) {&lt;br /&gt;
              $ratings = array();     // Initialize the empty array&lt;br /&gt;
              if ($rates = get_records(&amp;quot;forum_ratings&amp;quot;, &amp;quot;post&amp;quot;, $postid)) {&lt;br /&gt;
                  // Process each rating in turn&lt;br /&gt;
                  foreach ($rates as $rate) {&lt;br /&gt;
      ....etc&lt;br /&gt;
&lt;br /&gt;
8. Space should be used liberally - don&#039;t be afraid to spread things out a little to gain some clarity. Generally, there should be one space between brackets and normal statements, but no space between brackets and variables or functions:&lt;br /&gt;
&lt;br /&gt;
      foreach ($objects as $key =&amp;gt; $thing) {&lt;br /&gt;
          process($thing);&lt;br /&gt;
      }&lt;br /&gt;
      &lt;br /&gt;
      if ($x == $y) {&lt;br /&gt;
          $a = $b;&lt;br /&gt;
      } else if ($x == $z) {&lt;br /&gt;
          $a = $c;&lt;br /&gt;
      } else {&lt;br /&gt;
          $a = $d;&lt;br /&gt;
      }&lt;br /&gt;
&lt;br /&gt;
9. When making a COPY of an object, always use the php5 clone() function (otherwise you may end up with just a reference to the first object).  Moodle will make sure this works consistently on php4 too.&lt;br /&gt;
&lt;br /&gt;
      BAD:   $b = $a;&lt;br /&gt;
      GOOD:  $b = clone($a);&lt;br /&gt;
&lt;br /&gt;
If the thing you want to copy is not an object, but may contain objects (eg an array of objects) then use fullclone() instead.&lt;br /&gt;
&lt;br /&gt;
==Database structures==&lt;br /&gt;
&lt;br /&gt;
To help you create tables that meet these guidelines, we recommend you use the built in [[Development:XMLDB_defining_an_XML_structure#The_XMLDB_editor|database definition (XMLDB) editor]].&lt;br /&gt;
&lt;br /&gt;
# Every table must have an auto-incrementing id field (INT10) as primary index. (see [[IdColumnReasons]])&lt;br /&gt;
# The main table containing instances of each module must have the same name as the module (eg widget) and contain the following minimum fields:&lt;br /&gt;
#* id - as described above&lt;br /&gt;
#* course - the id of the course that each instance belongs to&lt;br /&gt;
#* name - the full name of each instance of the module&lt;br /&gt;
# Other tables associated with a module that contain information about &#039;things&#039; should be named widget_things (note the plural).&lt;br /&gt;
# Table and column names should avoid using [[Database reserved words|reserved words in any database]]. Please check them before creation.&lt;br /&gt;
# Column names should be always lowercase, simple and short, following the same rules as for variable names.&lt;br /&gt;
# Where possible, columns that contain a reference to the id field of another table (eg widget) should be called widgetid. (Note that this convention is newish and not followed in some older tables)&lt;br /&gt;
# Boolean fields should be implemented as small integer fields (eg INT4) containing 0 or 1, to allow for later expansion of values if necessary.&lt;br /&gt;
# Most tables should have a timemodified field (INT10) which is updated with a current timestamp obtained with the PHP time() function.&lt;br /&gt;
# Always define a default value for each field (and make it sensible)&lt;br /&gt;
# Each table name should start with the database prefix ($CFG-&amp;gt;prefix). In a lot of cases, this is taken care of for you automatically. Also, under Postgres, the name of every index must start with the prefix too.&lt;br /&gt;
# In order to guarantee [[Development:XMLDB problems#Table and column aliases - the AS keyword|cross-db compatibility]] follow these simple rules about the use of the &#039;&#039;&#039;AS&#039;&#039;&#039; keyword (only if you need table/colum aliases, of course):&lt;br /&gt;
#* &#039;&#039;&#039;Don&#039;t use&#039;&#039;&#039; the &#039;&#039;&#039;AS&#039;&#039;&#039; keyword for &#039;&#039;&#039;table aliases&#039;&#039;&#039;.&lt;br /&gt;
#* &#039;&#039;&#039;Do use&#039;&#039;&#039; the &#039;&#039;&#039;AS&#039;&#039;&#039; keyword for &#039;&#039;&#039;column aliases&#039;&#039;&#039;.&lt;br /&gt;
# &#039;&#039;&#039;Never&#039;&#039;&#039; create UNIQUE KEYs (constraints) at all. Instead use UNIQUE INDEXes. In the future, if we decide to add referential integrity to Moodle and we need UNIQUE KEYs they will be used, but not now. Please note that the XMLDB editor allows you to specify both XMLDB-only UNIQUE and FOREIGN constraints (and that&#039;s good, in order to have the XML well defined) but only underlying INDEXes will be generated. &lt;br /&gt;
# Those XMLDB-only UNIQUE KEYs (read previous point) only must be defined if such field/fields &#039;&#039;&#039;are going to be the target&#039;&#039;&#039; for some (XMLDB-only too) FOREIGN KEY. Else, create them as simple UNIQUE INDEXes.&lt;br /&gt;
# Tables associated &#039;&#039;&#039;with one block&#039;&#039;&#039; must follow this convention with their names: &#039;&#039;&#039;$CFG-&amp;gt;prefix + &amp;quot;block_&amp;quot; + name_of_the_block + anything_else&#039;&#039;&#039;. For example, assuming that $CFG-&amp;gt;prefix is &#039;mdl_&#039;, all the tables for the block &amp;quot;rss_client&amp;quot; must start by &#039;mdl_block_rss_client&#039; (being possible to add more words at the end, i.e. &#039;mdl_block_rss_client_anothertable&#039;...). This rule will be 100% enforced with Moodle 2.0, giving time to developers until then. See [http://tracker.moodle.org/browse/MDL-6786 Task 6786] for more info about this.&lt;br /&gt;
# &#039;&#039;&#039;Never&#039;&#039;&#039; make database changes in the STABLE branches.  If we did, then users upgrading from one stable version to the next would have duplicate changes occurring, which may cause serious errors.&lt;br /&gt;
# When refering to integer variable in SQL queries, do not surround the value in quotes. For example, get_records_select(&#039;question&#039;, &amp;quot;category=$catid&amp;quot;) is right. get_records_select(&#039;question&#039;, &amp;quot;category=&#039;$catid&#039;&amp;quot;) is wrong. It hides bugs where $catid is undefined. ([http://moodle.org/mod/forum/discuss.php?d=80629 This thread explains].)&lt;br /&gt;
&lt;br /&gt;
==Security issues (and handling form and URL data)==&lt;br /&gt;
&lt;br /&gt;
# Do not rely on &#039;register_globals&#039;. Every variable must be properly initialised in every code file. It must be obvious where the variable came from.&lt;br /&gt;
# Initialise all arrays and objects, even if empty. $a = array() or $obj = new stdClass();.&lt;br /&gt;
# Do not use the optional_variable() function (this function is now deprecated). Use the optional_param() function instead. Pick the correct PARAM_XXXX value for the data type you expect.&lt;br /&gt;
# Do not use the require_variable() function (this function is now deprecated). Use the required_param() function instead. Pick the correct PARAM_XXXX value for the data type you expect.&lt;br /&gt;
# Use data_submitted(), with care. Data must still be cleaned before use.&lt;br /&gt;
# Do not use $_GET, $_POST or $_REQUEST. Use the appropriate required_param() or optional_param() appropriate to your need.&lt;br /&gt;
# Do not check for an action using something like if (isset($_GET[&#039;something&#039;])). Use, e.g., $something = optional_param( &#039;something&#039;,-1,PARAM_INT ) and then perform proper test for it being in its expected range of values e.g., if ($something&amp;gt;=0) {....&lt;br /&gt;
# Wherever possible group all your required_param(), optional_param() and other variables initialisation at the beginning of each file to make them easy to find.&lt;br /&gt;
# Use &#039;sesskey&#039; mechanism to protect form handling routines from attack. Basic example of use: when form is generated, include &amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;sesskey&amp;quot; value=&amp;quot;&amp;lt;?php echo sesskey(); ?&amp;gt;&amp;quot; /&amp;gt;. When you process the form check with if (!confirm_sesskey()) { print_error(&#039;confirmsesskeybad&#039;);}.&lt;br /&gt;
# All filenames must be &#039;cleaned&#039; using the clean_filename() function, if this has not been done already by appropriate use of required_param() or optional_param()&lt;br /&gt;
# Any data read from the database must have [[Developer:Slashes|addslashes()]] applied to it before it can be written back. A whole object of data can be hit at once with addslashes_object().&lt;br /&gt;
# Wherever possible, data to be stored in the database must come from POST data (from a form with method=&amp;quot;POST&amp;quot;) as opposed to GET data (ie, data from the URL line).&lt;br /&gt;
# Do not use data from $_SERVER if you can avoid it. This has portability issues.&lt;br /&gt;
# If it hasn&#039;t been done somewhere else, make sure all data written to the database has been through the clean_param() function using the appropriate PARAM_XXXX for the datatype.&lt;br /&gt;
# If you write custom SQL code, make very sure it is correct. In particular watch out for missing quotes around values. Possible SQL &#039;injection&#039; exploit.&lt;br /&gt;
# Check all data (particularly that written to the database) in every file it is used. Do not expect or rely on it being done somewhere else.&lt;br /&gt;
# Blocks of code to be included should contain a definite PHP structure (e.g, a class declaration, function definition(s) etc.) - straight blocks of code promote uninitialised variable usage.&lt;br /&gt;
# If you need to use shell_exec() (or any other shell invoking function), make sure you clean parameters first with escapeshellcmd()/escapeshellarg (otherwise, we open up for shell injection attacks).&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer|Coding]]&lt;br /&gt;
&lt;br /&gt;
[[es:Manual de Estilo de Código]]&lt;br /&gt;
[[ja:コーディング]]&lt;br /&gt;
[[zh:代码指南]]&lt;br /&gt;
[[pl:Kodowanie]]&lt;br /&gt;
[[pt:manual_de_codigo]]&lt;/div&gt;</summary>
		<author><name>Rubenback26</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:CVS_for_developers&amp;diff=36206</id>
		<title>Development:CVS for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:CVS_for_developers&amp;diff=36206"/>
		<updated>2008-05-15T19:25:54Z</updated>

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