<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mudrd8mz</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/21/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mudrd8mz"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/Special:Contributions/Mudrd8mz"/>
	<updated>2026-04-22T23:33:18Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Course_contents_block&amp;diff=94879</id>
		<title>Course contents block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Course_contents_block&amp;diff=94879"/>
		<updated>2012-01-06T22:17:09Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Course contents block&#039;&#039;&#039; produces a table of contents for the course - ie a list of all visible topics/weeks in your course. Clicking at one of these links will display that particular section (topic or week).&lt;br /&gt;
&lt;br /&gt;
If the section has its name defined, the block uses it as the title for that section.&lt;br /&gt;
&lt;br /&gt;
If the section name is not defined but there is the section summary (description) available, the block automatically extracts a suitable title from that summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used.  Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title.&lt;br /&gt;
&lt;br /&gt;
If the summary is empty, a customizable text &amp;quot;Unit X&amp;quot; (where X is the number) is displayed.&lt;br /&gt;
&lt;br /&gt;
You can combine this feature with the multi-language filter to generate course contents in the user&#039;s language.&lt;br /&gt;
&lt;br /&gt;
The block was written and is currently maintained by [[User:David Mudrak|David Mudrak]]&lt;br /&gt;
&lt;br /&gt;
[[Image:course-contents-block-screenshot.png|thumb|The topic title is automatically extracted from the section summary|400px|left]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
There is a public source code repository for the block at [https://github.com/mudrd8mz/moodle-block_course_contents github.com]. You can either clone that repository or just download the latest package there. Follow the instructions provided by Github or see [[Git for Administrators]] for details. This may be what you want:&lt;br /&gt;
&lt;br /&gt;
 # cd /var/www/moodlesite/htdocs/blocks&lt;br /&gt;
 # git clone git://github.com/mudrd8mz/moodle-block_course_contents.git course_contents&lt;br /&gt;
 # cd course_contents&lt;br /&gt;
 # git checkout -b local_21_STABLE origin/MOODLE_21_STABLE&lt;br /&gt;
&lt;br /&gt;
If your Moodle dirroot is git checkout too, you may want to add the block directory into the list of ignored files:&lt;br /&gt;
&lt;br /&gt;
 # cd /var/www/moodlesite/htdocs&lt;br /&gt;
 # echo /blocks/course_contents/ &amp;gt;&amp;gt; .git/info/exclude&lt;br /&gt;
&lt;br /&gt;
To download the block in ZIP or TAR.GZ packages, follow [https://github.com/mudrd8mz/moodle-block_course_contents/tags this page]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Start of the section summary HTML&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Automatic course contents line&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;Welcome!&amp;lt;br /&amp;gt;In this course, you will ...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Welcome!&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;Introduction&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;In this course ...&amp;lt;/p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Introduction&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;span&amp;gt;Lesson 1&amp;lt;/span&amp;gt;: Introduction&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Lesson 1&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/plugins/pluginversions.php?plugin=block_course_contents Plugins database record]&lt;br /&gt;
&lt;br /&gt;
[[Category:Block]]&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradingfrom-rubric-usage.png&amp;diff=93681</id>
		<title>File:gradingfrom-rubric-usage.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradingfrom-rubric-usage.png&amp;diff=93681"/>
		<updated>2011-11-10T21:36:40Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradingfrom-rubric-editor.png&amp;diff=93680</id>
		<title>File:gradingfrom-rubric-editor.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradingfrom-rubric-editor.png&amp;diff=93680"/>
		<updated>2011-11-10T21:36:23Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Workshop_grading_strategies&amp;diff=93674</id>
		<title>Workshop grading strategies</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Workshop_grading_strategies&amp;diff=93674"/>
		<updated>2011-11-10T17:08:22Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Rubric */ Improved example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Workshop}}&lt;br /&gt;
Simply said, selected grading strategy determines how the assessment form may look like And how the grade for a submission given by a certain assessment is calculated based on the assessment form. Workshop ships with four standard grading strategies. More strategies can be developed as pluggable extensions.&lt;br /&gt;
&lt;br /&gt;
== Accumulative grading strategy ==&lt;br /&gt;
[[Image:Accumulative assessment form.png|200px|thumb|Assessment form using accumulative grading]]&lt;br /&gt;
In this case, the assessment form consists of a set of criteria. Each criterion is graded separately using either a number grade (eg out of 100) or a scale (using either one of site-wide scale or a scale defined in a course). Each criterion can have its weight set. Reviewers can put comments to all assessed criteria.&lt;br /&gt;
&lt;br /&gt;
When calculating the total grade for the submission, the grades for particular criteria are firstly normalized to a range from 0% to 100%. Then the total grade by a given assessment is calculated as weighted mean of normalized grades. Scales are considered as grades from 0 to M-1, where M is the number of scale items.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;G_s = \frac{\sum_{i=1}^N \frac{g_i}{max_i} w_i }{\sum_{i=1}^N w_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
: where &amp;lt;math&amp;gt;g_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the grade given to the i-th criterion, &amp;lt;math&amp;gt;max_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the maximal possible grade of the i-th criterion, &amp;lt;math&amp;gt;w_i \in \mathbb{N} &amp;lt;/math&amp;gt; is the weight of the i-th criterion and &amp;lt;math&amp;gt;N \in \mathbb{N} &amp;lt;/math&amp;gt; is the number of criteria in the assessment form.&lt;br /&gt;
&lt;br /&gt;
It is important to realize that the influence of a particular criterion is determined by its weight only, not the grade type or range used. Let us have three criteria in the form, first using 0-100 grade, the second 0-20 grade and the third using a three items scale. If they all have the same weight, then giving grade 50 in the first criteria has the same impact as giving grade 10 for the second criteria.&lt;br /&gt;
&lt;br /&gt;
Take the case above as an example. Suppose that the third criterion uses &#039;&#039;scale: 6 levels&#039;&#039;. An assessor gives grade 90 for the first criterion (or aspect 1), grade 16 for the second criterion and grade 9 &#039;&#039;very good&#039;&#039; for the last criterion. And the weights of the three criteria are 1, 2, and 3, respectively. Because for the third criterion, the scale has 6 items and grade 9 &#039;&#039;very good&#039;&#039; is the second one of the grade sequence ordered from highest to lowest, grade 9 will be mapped to 4. That is, in the formula above, g3 = 4 and max3 = 5.Then the final grade given by this assessment will be:&lt;br /&gt;
[[Image: Accumulative formula.png|left]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
[[Image:Comments assessment form.png|200px|thumb|right|Assessment form using comments]]&lt;br /&gt;
The assessment form is similar to the one used in accumulative grading strategy but no grades can be given, just comments. The total grade for the assessed submission is always set to 100%. This strategy can be effective in repetitive workflows when the submissions are firstly just commented by reviewers to provide initial feedback to the authors. Then Workshop is switched back to the submission phase and the authors can improve it according the comments. Then the grading strategy can be changed to another one using proper grading and submissions are assessed again using a different assessment form.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Number of errors ==&lt;br /&gt;
[[Image:Numoferror assessment form.png|200px|thumb|right|Assessment form using Number of Errors]]&lt;br /&gt;
In Moodle 1.x, this was called Error banded strategy. The assessment form consists of several assertions, each of them can be marked as passed or failed by the reviewer. Various words can be set to express the pass or failure state - eg Yes/No, Present/Missing, Good/Poor, etc.&lt;br /&gt;
&lt;br /&gt;
The grade given by a particular assessment is calculated from the weighted count of negative assessment responses (failed assertions). Here, the &#039;&#039;weighted count&#039;&#039; means that a response with weight &amp;lt;math&amp;gt;w_i&amp;lt;/math&amp;gt; is counted &amp;lt;math&amp;gt;w_i&amp;lt;/math&amp;gt;-times. Course facilitators define a mapping table that converts the number of failed assertions to a percent grade for the given submission. Zero failed assertion is always mapped to 100% grade.&lt;br /&gt;
&lt;br /&gt;
This strategy may be used to make sure that certain criteria were addressed in the submission. Examples of such assessment assertions are: &#039;&#039;Has less than 3 spelling errors&#039;&#039;, &#039;&#039;Has no formatting issues&#039;&#039;, &#039;&#039;Has creative ideas&#039;&#039;, &#039;&#039;Meets length requirements&#039;&#039; etc. This assessment method is considered as easier for reviewers to understand and deal with. Therefore it is suitable even for younger participants or those just starting with peer assessment, while still producing quite objective results.&lt;br /&gt;
&lt;br /&gt;
You can edit the original assessment form by following the steps below:&lt;br /&gt;
# Write down the corresponding description for each assertion in the blank. Then fill in the blanks of &#039;&#039;word for the error&#039;&#039; and &#039;&#039;word for the success&#039;&#039;. Set the weight for each assertion. As you can see, the grade mapping table is still blank now.&lt;br /&gt;
# Click the ‘save and close’ button at the end of this page.&lt;br /&gt;
# Click the ‘Edit assessment form’ link at the shade area titled &#039;&#039;setup phase&#039;&#039; in the upper part of this page and view the assessment form again. At this time, you can see that the grade mapping table has already been set. (&#039;&#039;Note&#039;&#039;: Initially all the field are blank. You need to choose the right value from each list to make this grading strategy work properly.)&lt;br /&gt;
[[Image:Numberoferrors grade mapping table.png|300px|thumb|none|grade mapping table]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, if an assessment form contains three assertions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Assertion No.&lt;br /&gt;
! Content&lt;br /&gt;
! Pass or failure state&lt;br /&gt;
! Weight&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Has the suitable title&lt;br /&gt;
| Yes/No&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Has creative ideas&lt;br /&gt;
| Present/Miss&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| The abstract is well-written&lt;br /&gt;
| Yes/No&lt;br /&gt;
| 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the example above, suppose that a reviewer gives one certain work &#039;&#039;Yes/Miss/Yes&#039;&#039; as the assessment. Since the submission only fails to meet the second criterion and the weight of the second criterion is 2, the total number of errors will be 2. Thus the grade for submission given by this assessment is 66%. Suppose that the maximum grade for submission set in &#039;&#039;grade settings&#039;&#039; is 100, therefore the final grade for this submission given by this assessment is grade 66.&lt;br /&gt;
&lt;br /&gt;
== Rubric ==&lt;br /&gt;
[[Image:Rubric assessmentform list.png|200px|thumb|right|Assessment form in list mode]]&lt;br /&gt;
See [http://en.wikipedia.org/wiki/Rubric_(academic) the description] of this scoring tool at Wikipedia. The rubric assessment form consists of a set of criteria. For each criterion, several ordered descriptive levels is provided. A number grade is assigned to each of these levels.  The reviewer chooses which level answers/describes the given criterion best.&lt;br /&gt;
&lt;br /&gt;
The final grade is aggregated as&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;G_s = \frac{\sum_{i=1}^N (g_i - min_i) }{\sum_{i=1}^N (max_i - min_i)}&amp;lt;/math&amp;gt;&lt;br /&gt;
: where &amp;lt;math&amp;gt;g_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the grade given to the i-th criterion, &amp;lt;math&amp;gt;min_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the minimal possible grade of the i-th criterion, &amp;lt;math&amp;gt;max_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the maximal possible grade of the i-th criterion and &amp;lt;math&amp;gt;N \in \mathbb{N} &amp;lt;/math&amp;gt; is the number of criteria in the rubric.&lt;br /&gt;
[[Image:Rubric assessmentform grid.png|200px|thumb|right|Assessment Form in grid mode]]&lt;br /&gt;
Example of a single criterion can be: &#039;&#039;Overall quality of the paper&#039;&#039; with the levels &#039;&#039;5 - An excellent paper&#039;&#039;, &#039;&#039;3 - A mediocre paper&#039;&#039;, &#039;&#039;0 - A weak paper&#039;&#039; (the number represent the grade).&lt;br /&gt;
&lt;br /&gt;
There are two modes how the assessment form can be rendered - either in common grid form or in a list form. It is safe to switch the representation of the rubric any time.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example of calculation:&#039;&#039; let us have a rubric with two criteria, which both have four levels 1, 2, 3, 4. The reviewer chooses level with the grade 2 for the first criterion and the grade 3 for the second criterion. Then the final grade is:&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;G_s = \frac{(2 - 1) + (3 - 1)}{(4 - 1) + (4 - 1)} = \frac{3}{6} = 50 %&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that this calculation may be different from how you intuitively use rubric. For example, when the reviewer in the previous example chose both levels with the grade 1, the plain sum would be 2 points. But that is actually the lowest possible score so it maps to the grade 0. To avoid confusion, it is recommended to always include a level with the grade 0 in the rubric definition.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note on backwards compatibility:&#039;&#039;&#039; This strategy merges the legacy Rubric and Criterion strategies from Moodle 1.x into a single one. Conceptually, legacy Criterion was just one dimension of Rubric. In Workshop 1.x, Rubric could have several criteria (categories) but were limited to a fixed scale with 0-4 points. On the other hand, Criterion strategy in Workshop 1.9 could use custom scale, but was limited to a single aspect of assessment. The new Rubric strategy combines the old two. To mimic the legacy behaviour, the old Workshop are automatically upgraded so that:&lt;br /&gt;
&lt;br /&gt;
* Criterion strategy from 1.9 are replaced with Rubric 2.0 using just one dimension&lt;br /&gt;
* Rubric from 1.9 are by Rubric 2.0 by using point scale 0-4 for every criterion.&lt;br /&gt;
&lt;br /&gt;
In Moodle 1.9, reviewer could suggest an optional adjustment to a final grade. This is not supported any more. Eventually this may be supported in the future versions again as a standard feature for all grading strategies, not only rubric.&lt;br /&gt;
&lt;br /&gt;
==Experiencing Real Workshop==&lt;br /&gt;
Please visit demo website to know more about how to set assessment form [http://demo.moodle.net/mod/workshop/editform.php?cmid=1770]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: You need to login to view the assessment form.&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
User name: teacher &amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
Password: demo&lt;br /&gt;
&lt;br /&gt;
This web page is an original assessment form using rubric grading strategy. You can view assessment forms using other grading strategies by following the steps below:&lt;br /&gt;
&lt;br /&gt;
#Visit [http://demo.moodle.net/course/modedit.php?update=1770&amp;amp;return=1](You also need to login to view these settings.)&lt;br /&gt;
#Choose the specific grading strategy in the drop down menu of &#039;&#039;grading strategy&#039;&#039; in &#039;&#039;grading settings&#039;&#039;.[[Image:Grading settings.png|upright 2.5|thumb|none|grading_settings]]&lt;br /&gt;
#Click ‘save and display’ button at the end of this page.&lt;br /&gt;
#Click ‘Edit assessment form’ link at the shaded area titled ‘setup phase’ in the upper part of this page.&lt;br /&gt;
&lt;br /&gt;
You will be able to see an original assessment form using the grading strategy you just chose.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradingform-rubric-icon.png&amp;diff=93669</id>
		<title>File:gradingform-rubric-icon.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradingform-rubric-icon.png&amp;diff=93669"/>
		<updated>2011-11-10T16:42:54Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Workshop_grading_strategies&amp;diff=93668</id>
		<title>Workshop grading strategies</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Workshop_grading_strategies&amp;diff=93668"/>
		<updated>2011-11-10T16:40:27Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Rubric */ Fixed the formula and example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Workshop}}&lt;br /&gt;
Simply said, selected grading strategy determines how the assessment form may look like And how the grade for a submission given by a certain assessment is calculated based on the assessment form. Workshop ships with four standard grading strategies. More strategies can be developed as pluggable extensions.&lt;br /&gt;
&lt;br /&gt;
== Accumulative grading strategy ==&lt;br /&gt;
[[Image:Accumulative assessment form.png|200px|thumb|Assessment form using accumulative grading]]&lt;br /&gt;
In this case, the assessment form consists of a set of criteria. Each criterion is graded separately using either a number grade (eg out of 100) or a scale (using either one of site-wide scale or a scale defined in a course). Each criterion can have its weight set. Reviewers can put comments to all assessed criteria.&lt;br /&gt;
&lt;br /&gt;
When calculating the total grade for the submission, the grades for particular criteria are firstly normalized to a range from 0% to 100%. Then the total grade by a given assessment is calculated as weighted mean of normalized grades. Scales are considered as grades from 0 to M-1, where M is the number of scale items.&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;G_s = \frac{\sum_{i=1}^N \frac{g_i}{max_i} w_i }{\sum_{i=1}^N w_i}&amp;lt;/math&amp;gt;&lt;br /&gt;
: where &amp;lt;math&amp;gt;g_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the grade given to the i-th criterion, &amp;lt;math&amp;gt;max_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the maximal possible grade of the i-th criterion, &amp;lt;math&amp;gt;w_i \in \mathbb{N} &amp;lt;/math&amp;gt; is the weight of the i-th criterion and &amp;lt;math&amp;gt;N \in \mathbb{N} &amp;lt;/math&amp;gt; is the number of criteria in the assessment form.&lt;br /&gt;
&lt;br /&gt;
It is important to realize that the influence of a particular criterion is determined by its weight only, not the grade type or range used. Let us have three criteria in the form, first using 0-100 grade, the second 0-20 grade and the third using a three items scale. If they all have the same weight, then giving grade 50 in the first criteria has the same impact as giving grade 10 for the second criteria.&lt;br /&gt;
&lt;br /&gt;
Take the case above as an example. Suppose that the third criterion uses &#039;&#039;scale: 6 levels&#039;&#039;. An assessor gives grade 90 for the first criterion (or aspect 1), grade 16 for the second criterion and grade 9 &#039;&#039;very good&#039;&#039; for the last criterion. And the weights of the three criteria are 1, 2, and 3, respectively. Because for the third criterion, the scale has 6 items and grade 9 &#039;&#039;very good&#039;&#039; is the second one of the grade sequence ordered from highest to lowest, grade 9 will be mapped to 4. That is, in the formula above, g3 = 4 and max3 = 5.Then the final grade given by this assessment will be:&lt;br /&gt;
[[Image: Accumulative formula.png|left]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Comments ==&lt;br /&gt;
[[Image:Comments assessment form.png|200px|thumb|right|Assessment form using comments]]&lt;br /&gt;
The assessment form is similar to the one used in accumulative grading strategy but no grades can be given, just comments. The total grade for the assessed submission is always set to 100%. This strategy can be effective in repetitive workflows when the submissions are firstly just commented by reviewers to provide initial feedback to the authors. Then Workshop is switched back to the submission phase and the authors can improve it according the comments. Then the grading strategy can be changed to another one using proper grading and submissions are assessed again using a different assessment form.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Number of errors ==&lt;br /&gt;
[[Image:Numoferror assessment form.png|200px|thumb|right|Assessment form using Number of Errors]]&lt;br /&gt;
In Moodle 1.x, this was called Error banded strategy. The assessment form consists of several assertions, each of them can be marked as passed or failed by the reviewer. Various words can be set to express the pass or failure state - eg Yes/No, Present/Missing, Good/Poor, etc.&lt;br /&gt;
&lt;br /&gt;
The grade given by a particular assessment is calculated from the weighted count of negative assessment responses (failed assertions). Here, the &#039;&#039;weighted count&#039;&#039; means that a response with weight &amp;lt;math&amp;gt;w_i&amp;lt;/math&amp;gt; is counted &amp;lt;math&amp;gt;w_i&amp;lt;/math&amp;gt;-times. Course facilitators define a mapping table that converts the number of failed assertions to a percent grade for the given submission. Zero failed assertion is always mapped to 100% grade.&lt;br /&gt;
&lt;br /&gt;
This strategy may be used to make sure that certain criteria were addressed in the submission. Examples of such assessment assertions are: &#039;&#039;Has less than 3 spelling errors&#039;&#039;, &#039;&#039;Has no formatting issues&#039;&#039;, &#039;&#039;Has creative ideas&#039;&#039;, &#039;&#039;Meets length requirements&#039;&#039; etc. This assessment method is considered as easier for reviewers to understand and deal with. Therefore it is suitable even for younger participants or those just starting with peer assessment, while still producing quite objective results.&lt;br /&gt;
&lt;br /&gt;
You can edit the original assessment form by following the steps below:&lt;br /&gt;
# Write down the corresponding description for each assertion in the blank. Then fill in the blanks of &#039;&#039;word for the error&#039;&#039; and &#039;&#039;word for the success&#039;&#039;. Set the weight for each assertion. As you can see, the grade mapping table is still blank now.&lt;br /&gt;
# Click the ‘save and close’ button at the end of this page.&lt;br /&gt;
# Click the ‘Edit assessment form’ link at the shade area titled &#039;&#039;setup phase&#039;&#039; in the upper part of this page and view the assessment form again. At this time, you can see that the grade mapping table has already been set. (&#039;&#039;Note&#039;&#039;: Initially all the field are blank. You need to choose the right value from each list to make this grading strategy work properly.)&lt;br /&gt;
[[Image:Numberoferrors grade mapping table.png|300px|thumb|none|grade mapping table]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, if an assessment form contains three assertions:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Assertion No.&lt;br /&gt;
! Content&lt;br /&gt;
! Pass or failure state&lt;br /&gt;
! Weight&lt;br /&gt;
|-&lt;br /&gt;
| 1&lt;br /&gt;
| Has the suitable title&lt;br /&gt;
| Yes/No&lt;br /&gt;
| 1&lt;br /&gt;
|-&lt;br /&gt;
| 2&lt;br /&gt;
| Has creative ideas&lt;br /&gt;
| Present/Miss&lt;br /&gt;
| 2&lt;br /&gt;
|-&lt;br /&gt;
| 3&lt;br /&gt;
| The abstract is well-written&lt;br /&gt;
| Yes/No&lt;br /&gt;
| 3&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the example above, suppose that a reviewer gives one certain work &#039;&#039;Yes/Miss/Yes&#039;&#039; as the assessment. Since the submission only fails to meet the second criterion and the weight of the second criterion is 2, the total number of errors will be 2. Thus the grade for submission given by this assessment is 66%. Suppose that the maximum grade for submission set in &#039;&#039;grade settings&#039;&#039; is 100, therefore the final grade for this submission given by this assessment is grade 66.&lt;br /&gt;
&lt;br /&gt;
== Rubric ==&lt;br /&gt;
[[Image:Rubric assessmentform list.png|200px|thumb|right|Assessment form in list mode]]&lt;br /&gt;
See [http://en.wikipedia.org/wiki/Rubric_(academic) the description] of this scoring tool at Wikipedia. The rubric assessment form consists of a set of criteria. For each criterion, several ordered descriptive levels is provided. A number grade is assigned to each of these levels.  The reviewer chooses which level answers/describes the given criterion best.&lt;br /&gt;
&lt;br /&gt;
The final grade is aggregated as&lt;br /&gt;
&lt;br /&gt;
: &amp;lt;math&amp;gt;G_s = \frac{\sum_{i=1}^N (g_i - min_i) }{\sum_{i=1}^N (max_i - min_i)}&amp;lt;/math&amp;gt;&lt;br /&gt;
: where &amp;lt;math&amp;gt;g_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the grade given to the i-th criterion, &amp;lt;math&amp;gt;min_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the minimal possible grade of the i-th criterion, &amp;lt;math&amp;gt;max_i \in \mathbb{N}&amp;lt;/math&amp;gt; is the maximal possible grade of the i-th criterion and &amp;lt;math&amp;gt;N \in \mathbb{N} &amp;lt;/math&amp;gt; is the number of criteria in the rubric.&lt;br /&gt;
[[Image:Rubric assessmentform grid.png|200px|thumb|right|Assessment Form in grid mode]]&lt;br /&gt;
Example of a single criterion can be: &#039;&#039;Overall quality of the paper&#039;&#039; with the levels &#039;&#039;5 - An excellent paper&#039;&#039;, &#039;&#039;3 - A mediocre paper&#039;&#039;, &#039;&#039;0 - A weak paper&#039;&#039; (the number represent the grade).&lt;br /&gt;
&lt;br /&gt;
There are two modes how the assessment form can be rendered - either in common grid form or in a list form. It is safe to switch the representation of the rubric any time.&lt;br /&gt;
&lt;br /&gt;
For example, let us have an assessment form with two criteria, which both have four levels 0, 1, 2, 3. A reviewer gives level 2 to the first criterion and level 3 to the second criterion. Then the final grade for submission given by this assessment is:&lt;br /&gt;
[[Image:Rubric formula.png|left]]&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note on backwards compatibility:&#039;&#039;&#039; This strategy merges the legacy Rubric and Criterion strategies from Moodle 1.x into a single one. Conceptually, legacy Criterion was just one dimension of Rubric. In Workshop 1.x, Rubric could have several criteria (categories) but were limited to a fixed scale with 0-4 points. On the other hand, Criterion strategy in Workshop 1.9 could use custom scale, but was limited to a single aspect of assessment. The new Rubric strategy combines the old two. To mimic the legacy behaviour, the old Workshop are automatically upgraded so that:&lt;br /&gt;
&lt;br /&gt;
* Criterion strategy from 1.9 are replaced with Rubric 2.0 using just one dimension&lt;br /&gt;
* Rubric from 1.9 are by Rubric 2.0 by using point scale 0-4 for every criterion.&lt;br /&gt;
&lt;br /&gt;
In Moodle 1.9, reviewer could suggest an optional adjustment to a final grade. This is not supported any more. Eventually this may be supported in the future versions again as a standard feature for all grading strategies, not only rubric.&lt;br /&gt;
&lt;br /&gt;
==Experiencing Real Workshop==&lt;br /&gt;
Please visit demo website to know more about how to set assessment form [http://demo.moodle.net/mod/workshop/editform.php?cmid=1770]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note&#039;&#039;: You need to login to view the assessment form.&amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
User name: teacher &amp;lt;br clear=&amp;quot;all&amp;quot;/&amp;gt;&lt;br /&gt;
Password: demo&lt;br /&gt;
&lt;br /&gt;
This web page is an original assessment form using rubric grading strategy. You can view assessment forms using other grading strategies by following the steps below:&lt;br /&gt;
&lt;br /&gt;
#Visit [http://demo.moodle.net/course/modedit.php?update=1770&amp;amp;return=1](You also need to login to view these settings.)&lt;br /&gt;
#Choose the specific grading strategy in the drop down menu of &#039;&#039;grading strategy&#039;&#039; in &#039;&#039;grading settings&#039;&#039;.[[Image:Grading settings.png|upright 2.5|thumb|none|grading_settings]]&lt;br /&gt;
#Click ‘save and display’ button at the end of this page.&lt;br /&gt;
#Click ‘Edit assessment form’ link at the shaded area titled ‘setup phase’ in the upper part of this page.&lt;br /&gt;
&lt;br /&gt;
You will be able to see an original assessment form using the grading strategy you just chose.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:grading-pick-search.png&amp;diff=93660</id>
		<title>File:grading-pick-search.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:grading-pick-search.png&amp;diff=93660"/>
		<updated>2011-11-10T16:08:07Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:grading-pick-ownform.png&amp;diff=93658</id>
		<title>File:grading-pick-ownform.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:grading-pick-ownform.png&amp;diff=93658"/>
		<updated>2011-11-10T15:57:05Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:grading-manage-initial.png&amp;diff=93652</id>
		<title>File:grading-manage-initial.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:grading-manage-initial.png&amp;diff=93652"/>
		<updated>2011-11-10T15:00:39Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:grading-method-selection-modform.png&amp;diff=93648</id>
		<title>File:grading-method-selection-modform.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:grading-method-selection-modform.png&amp;diff=93648"/>
		<updated>2011-11-10T14:44:41Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Screenshot of the modform grade section with the advanced grading method selector (single gradable area case)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Screenshot of the modform grade section with the advanced grading method selector (single gradable area case)&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:comicstrip-rubrics.png&amp;diff=93602</id>
		<title>File:comicstrip-rubrics.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:comicstrip-rubrics.png&amp;diff=93602"/>
		<updated>2011-11-10T10:26:01Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: A short comic strip about rubrics in Moodle 2.2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A short comic strip about rubrics in Moodle 2.2&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Course_contents_block&amp;diff=92952</id>
		<title>Course contents block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Course_contents_block&amp;diff=92952"/>
		<updated>2011-10-28T23:24:30Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Updating the page for 2.x versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Course contents block&#039;&#039;&#039; produces a table of contents for the course - ie a list of all visible topics/weeks in your course. Clicking at one of these links will display that particular section (topic or week).&lt;br /&gt;
&lt;br /&gt;
If the section has its name defined, the block uses it as the title for that section.&lt;br /&gt;
&lt;br /&gt;
If the section name is not defined but there is the section summary (description) available, the block automatically extracts a suitable title from that summary. If you start summary with a heading (H1, H2, H3, etc), it will use such heading text. If your summary starts with a bold text, it will be used as a section title. If the summary consists of several paragraphs, the first one will be used.  Technically spoken, the plain text content of the first non-empty HTML DOM node from the section summary is used as the summary title.&lt;br /&gt;
&lt;br /&gt;
If the summary is empty, a customizable text &amp;quot;Unit X&amp;quot; (where X is the number) is displayed.&lt;br /&gt;
&lt;br /&gt;
You can combine this feature with the multi-language filter to generate course contents in the user&#039;s language.&lt;br /&gt;
&lt;br /&gt;
The block was written and is currently maintained by [[User:David Mudrak|David Mudrak]]&lt;br /&gt;
&lt;br /&gt;
[[Image:course-contents-block-screenshot.png|thumb|The topic title is automatically extracted from the section summary|400px|left]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Installation==&lt;br /&gt;
&lt;br /&gt;
There is a public source code repository for the block at [https://github.com/mudrd8mz/moodle-block_course_contents github.com]. You can either clone that repository or just download the latest package there. Follow the instructions provided by Github or see [[Git for Administrators]] for details. This may be what you want:&lt;br /&gt;
&lt;br /&gt;
 # cd /var/www/moodlesite/htdocs/blocks&lt;br /&gt;
 # git clone git://github.com/mudrd8mz/moodle-block_course_contents.git course_contents&lt;br /&gt;
 # cd course_contents&lt;br /&gt;
 # git checkout -b local_21_STABLE origin/MOODLE_21_STABLE&lt;br /&gt;
&lt;br /&gt;
If your Moodle dirroot is git checkout too, you may want to add the block directory into the list of ignored files:&lt;br /&gt;
&lt;br /&gt;
 # cd /var/www/moodlesite/htdocs&lt;br /&gt;
 # echo /blocks/course_contents/ &amp;gt;&amp;gt; .git/info/exclude&lt;br /&gt;
&lt;br /&gt;
To download the block in ZIP or TAR.GZ packages, follow [https://github.com/mudrd8mz/moodle-block_course_contents/tags this page]&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
! &amp;lt;center&amp;gt;Start of the section summary HTML&amp;lt;/center&amp;gt;&lt;br /&gt;
! &amp;lt;center&amp;gt;Automatic course contents line&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;Welcome!&amp;lt;br /&amp;gt;In this course, you will ...&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Welcome!&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;Introduction&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;In this course ...&amp;lt;/p&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Introduction&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;nowiki&amp;gt;&amp;lt;h1&amp;gt;&amp;lt;span&amp;gt;Lesson 1&amp;lt;/span&amp;gt;: Introduction&amp;lt;/h1&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
| Lesson 1&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=2156 Modules and plugins database record]&lt;br /&gt;
&lt;br /&gt;
[[Category:Block]]&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Custom_menu_items&amp;diff=89964</id>
		<title>Custom menu items</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Custom_menu_items&amp;diff=89964"/>
		<updated>2011-09-20T09:31:08Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Documented multilanguage support as promised in MDL-27073&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Navigation}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Please refer to [[TOC_with_notes#Navigation|these notes]] before editing this page.&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can configure a custom menu to be shown by themes. Each line consists of some menu text, a link URL (optional) and a tooltip title (optional), separated by pipe characters. You can specify a structure using hyphens. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 Moodle community|http://moodle.org&lt;br /&gt;
 -Moodle free support|http://moodle.org/support&lt;br /&gt;
 -Moodle development|http://moodle.org/development&lt;br /&gt;
 --Moodle Tracker|http://tracker.moodle.org&lt;br /&gt;
 --Moodle Docs|https://docs.moodle.org&lt;br /&gt;
 -Moodle News|http://moodle.org/news&lt;br /&gt;
 Moodle company&lt;br /&gt;
 -Moodle commercial hosting|http://moodle.com/hosting&lt;br /&gt;
 -Moodle commercial support|http://moodle.com/support&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Multilanguage support ===&lt;br /&gt;
{{Moodle 2.1}}&lt;br /&gt;
&lt;br /&gt;
Since Moodle 2.1, you can add a language code (or a comma separated list of codes) as the 4th item of the line. The line will be then printed if and only if the user has currently selected the listed language. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
 English only|http://moodle.com|English only item|en&lt;br /&gt;
 German only|http://moodle.de|Deutsch|de,de_du,de_kids&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Upload_users&amp;diff=86134</id>
		<title>Upload users</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Upload_users&amp;diff=86134"/>
		<updated>2011-07-19T06:36:37Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: The emailstop field not supported any more - see MDL-27804&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Accounts}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Please refer to [[TOC_with_notes#Accounts|these notes]] before editing this page.&#039;&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
Location: &#039;&#039;Administration &amp;gt; Users &amp;gt; Accounts &amp;gt; Upload users&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Upload users preview.png|thumb|Upload users preview in Moodle 1.9]]&lt;br /&gt;
Firstly, note that it is usually not necessary to import users in bulk - to keep maintenance work down you should first explore forms of authentication that do not require manual maintenance, such as [[External database authentication|connecting to existing external databases]] or letting the [[Internal enrolment|users create their own accounts]]. See [[Manage authentication]] for more information.&lt;br /&gt;
&lt;br /&gt;
If you are sure you want to import multiple user accounts from a text file, then you need to format your text file as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Upload users file format==&lt;br /&gt;
&lt;br /&gt;
* Each line contains fields &#039;&#039;&#039;separated&#039;&#039;&#039; by commas (or other delimiters) without quotes (&amp;quot;) and no trailing delimiter&lt;br /&gt;
* The first line is special, and contains fieldnames defining the format for the rest of the file.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Required fields&#039;&#039;&#039;:  In any order&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;username, firstname, lastname, email&amp;lt;/code&amp;gt;&lt;br /&gt;
:Validity checks are performed for:&lt;br /&gt;
#&amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; can only contain alphabetical &#039;&#039;&#039;lowercase&#039;&#039;&#039; letters , numbers, hypen &#039;-&#039;, underscore &#039;_&#039;, period &#039;.&#039;, or at-sign &#039;@&#039; &lt;br /&gt;
#&amp;lt;code&amp;gt;email&amp;lt;/code&amp;gt; is in the form: &#039;&#039;name@example.com&#039;&#039; .&amp;lt;/p&amp;gt; &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Password field&#039;&#039;&#039;: &amp;quot;password&amp;quot; field is optional if &amp;quot;Create password if needed&amp;quot; setting is chosen (default). &lt;br /&gt;
**If included, values should meet the requirements for the site&#039;s [[Site_policies#Password_policy|Password policy]]. To force password change for a particular user, set the password field to &amp;lt;code&amp;gt;changeme&amp;lt;/code&amp;gt;. &lt;br /&gt;
**If omitted, a password will be generated for each user (during the next Cron job) and welcome e-mails sent out (not working in v2.0.2?).&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Optional fields&#039;&#039;&#039;: To provide values other than the default include one or more of these&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;institution, department, city, country, lang, auth, ajax, timezone, idnumber, icq, phone1, phone2, address, url, description, mailformat, maildisplay, htmleditor, autosubscribe&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Custom profile field names&#039;&#039;&#039;: (Optional). xxxxx is the real custom user profile field name (i.e. the unique shortname)&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;profile_field_xxxxx&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
: Create the custom fields BEFORE importing. Use the standard header. The &amp;quot;shortname&amp;quot; for your custom field is xxxxx (NB: as at v2.0.2, the shortname must be all lowercase, otherwise won&#039;t be recognised). The first record must include &amp;quot;profile_field_xxxxx&amp;quot;.&lt;br /&gt;
:&#039;&#039;&#039;Example&#039;&#039;&#039;: To create a custom field &amp;quot;genre&amp;quot;, you must write a shortname &amp;quot;genre&amp;quot; in the new field, and write &amp;quot;profile_field_genre&amp;quot; in the header of the .csv file.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;&#039;Special fields&#039;&#039;&#039;: Used for changing of usernames or deleting of users&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
*&#039;&#039;&#039;Enrolment fields&#039;&#039;&#039;: (Optional):&lt;br /&gt;
:&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;course1, type1, role1, group1, enrolperiod1, course2, type2, role2, group2, enrolperiod2&amp;lt;/code&amp;gt; etc.&lt;br /&gt;
**&amp;lt;code&amp;gt;course&amp;lt;/code&amp;gt; is the &amp;quot;shortname&amp;quot;  if present the user will be enrolled in those courses.&lt;br /&gt;
** &amp;lt;code&amp;gt;type&amp;lt;/code&amp;gt; refers to the role to be used for associated course enrolment. Value 1 is default course role, 2 is legacy Teacher role and 3 is legacy Non-editing Teacher.&lt;br /&gt;
** You can use role field instead to specify roles directly - use either role short name or id (numeric names of roles are not supported).&lt;br /&gt;
** Users may be also assigned to groups in course (group1 in course1, group2 in course2, etc.).&lt;br /&gt;
*** A group is identified by name or id (numeric group names are not supported).&lt;br /&gt;
** From Moodle 2.0, you can set the enrolment duration, in days, for each course (&amp;lt;code&amp;gt;enrolperiod1&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;course1&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;enrolperiod2&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;course2&amp;lt;/code&amp;gt;, etc.).&lt;br /&gt;
&lt;br /&gt;
Commas within  a field must be encoded as &amp;amp;#44 - the script will decode these back to commas.&lt;br /&gt;
&lt;br /&gt;
For Boolean fields, use &amp;lt;code&amp;gt;0&amp;lt;/code&amp;gt; for false and &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; for true.&lt;br /&gt;
&lt;br /&gt;
To prevent users from receiving a large number of emails from courses or forced subscription forums use the &#039;&#039;&#039;maildigest&#039;&#039;&#039;.  The options for this field are 0 = No digest, 1 = Complete digest and 2 = Digest with just subjects.&lt;br /&gt;
&lt;br /&gt;
Here is an example of a valid upload file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;username, password, firstname, lastname, email, course1, group1&amp;lt;br /&amp;gt;&lt;br /&gt;
jonest, verysecret, Tom, Jones, jonest@someplace.edu, math102, Section 1&amp;lt;br /&amp;gt;&lt;br /&gt;
reznort, somesecret, Trent, Reznor, reznort@someplace.edu,math102, Section 3&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Updating existing accounts==&lt;br /&gt;
By default Moodle  creates new user accounts, and skips lines where the &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; matches an existing account. Set &amp;quot;Upload Type&amp;quot; to &#039;&#039;&#039;Add  new and update existing accounts&#039;&#039;&#039;, and existing user account will be updated.&lt;br /&gt;
&lt;br /&gt;
Include  fieldname &amp;lt;code&amp;gt;oldusername&amp;lt;/code&amp;gt; to updating existing accounts and change usernames.  In the preview options, Set &amp;quot;Allow renames&amp;quot; to &#039;&#039;&#039;Yes&#039;&#039;. &lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: errors updating existing accounts can affect your users badly. Be careful when using the options to update.&lt;br /&gt;
&lt;br /&gt;
==After preview==&lt;br /&gt;
After the preprocessing, depending on the contents of the upload, the following may be available before final user creation&lt;br /&gt;
*Settings&lt;br /&gt;
** New user password &lt;br /&gt;
** Existing user details&lt;br /&gt;
** Existing user password&lt;br /&gt;
** Allow renames&lt;br /&gt;
** Allow deletes&lt;br /&gt;
** Prevent email addess duplicates&lt;br /&gt;
** Select for bulk operations&lt;br /&gt;
&lt;br /&gt;
* Default values&lt;br /&gt;
** Authentication method: Manual account |no login | EMail-based self-registration&lt;br /&gt;
** Email display: Allow only other course members to see my email address | hide .. from everyone | allow anyone ...&lt;br /&gt;
** Email format Pretty HTML | plain text&lt;br /&gt;
** Email digest type: none|complete subjects&lt;br /&gt;
** Forum auto-subscribe: no |yes when  I post&lt;br /&gt;
** When editing text: use HTML| standard web forms&lt;br /&gt;
** AJAX and Javascript: yes|no&lt;br /&gt;
** city/town&lt;br /&gt;
** country&lt;br /&gt;
** timezone&lt;br /&gt;
** Preferred language&lt;br /&gt;
** Description&lt;br /&gt;
** Web page&lt;br /&gt;
** ID number&lt;br /&gt;
** Institution&lt;br /&gt;
** Department&lt;br /&gt;
** Phone&lt;br /&gt;
** Mobile Phone&lt;br /&gt;
** Address&lt;br /&gt;
&lt;br /&gt;
==After results ==&lt;br /&gt;
Users which were not added, will NOT be auto-enrolled in courses&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Open another moodle browser and &lt;br /&gt;
* Site administration&lt;br /&gt;
** Courses&lt;br /&gt;
*** Add/edit courses; select the category, and the course&lt;br /&gt;
* Course administration&lt;br /&gt;
** Users&lt;br /&gt;
*** Enrolled Users&lt;br /&gt;
**** Enrol users and select the users flagged from other window&lt;br /&gt;
&lt;br /&gt;
==Templates==&lt;br /&gt;
&lt;br /&gt;
The default values are processed as templates in which the following codes are allowed:&lt;br /&gt;
&lt;br /&gt;
* %l - will be replaced by the lastname&lt;br /&gt;
* %f - will be replaced by the firstname&lt;br /&gt;
* %u - will be replaced by the username&lt;br /&gt;
* %% - will be replaced by the %&lt;br /&gt;
&lt;br /&gt;
Between the percent sign (%) and any code letter (l, f or u) the following modifiers are allowed:&lt;br /&gt;
&lt;br /&gt;
* (-) minus sign - the information specified by the code letter will be converted to lowercase&lt;br /&gt;
* (+) plus sign - the information specified by the code letter will be converted to UPPERCASE&lt;br /&gt;
* (~) tilde sign - the information specified by the code letter will be converted to Title Case&lt;br /&gt;
* a decimal number - the information specified by the code letter will be truncated to that many characters&lt;br /&gt;
&lt;br /&gt;
For example, if the firstname is John and the lastname is Doe, the following values will be obtained with the specified templates:&lt;br /&gt;
&lt;br /&gt;
* %l%f = DoeJohn&lt;br /&gt;
* %l%1f = DoeJ&lt;br /&gt;
* %-l%+f = doeJOHN&lt;br /&gt;
* %-f_%-l = john_doe&lt;br /&gt;
* http://www.example.com/~%u/ = http://www.example.com/~jdoe/ (if the username is jdoe or %-1f%-l)&lt;br /&gt;
&lt;br /&gt;
Template processing is done only on default values, and not on the values retrieved from the CSV file.&lt;br /&gt;
&lt;br /&gt;
In order to create correct Moodle usernames, the username is always converted to lowercase. Moreover, if the &amp;quot;Allow extended characters in usernames&amp;quot; option in the Site policies page is off, characters different to letters, digits, dash (-) and dot (.) are removed. For example if the firstname is John Jr. and the lastname is Doe, the username %-f_%-l will produce john jr._doe when Allow extended characters in usernames is on, and johnjr.doe when off.&lt;br /&gt;
&lt;br /&gt;
When the &amp;quot;New username duplicate handling&amp;quot; setting is set to Append counter, an auto-increment counter will be append to duplicate usernames produced by the template. For example, if the CSV file contains the users named John Doe, Jane Doe and Jenny Doe without explicit usernames, the default username is %-1f%-l and New username duplicate handling is set to Append counter, then the usernames produced will be jdoe, jdoe2 and jdoe3. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Deleting accounts==&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;deleted&amp;lt;/code&amp;gt; field is present, users with value 1 for it will be deleted. In this case, all the fields may be omitted, except for &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt;. After uploading the file, be sure to change the &amp;quot;Upload type&amp;quot; to &amp;quot;Update existing users only&amp;quot; and the &amp;quot;Allow deletes&amp;quot; option to &amp;quot;Yes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Deleting and uploading accounts could be done with a single CSV file. For example, the following file will add the user Tom Jones and delete the user reznort:&lt;br /&gt;
&lt;br /&gt;
 username, firstname, lastname, deleted&lt;br /&gt;
 jonest, Tom, Jones, 0&lt;br /&gt;
 reznort, , , 1 &lt;br /&gt;
&lt;br /&gt;
==Encoding==&lt;br /&gt;
&lt;br /&gt;
In Moodle 1.8 the file must be UTF-8. In Moodle 1.9 onwards, the encoding may be selected from a large list, including ISO-8859-1.&lt;br /&gt;
&lt;br /&gt;
==Hints==&lt;br /&gt;
&lt;br /&gt;
===Spreadsheet===&lt;br /&gt;
&lt;br /&gt;
If you use a spreadsheet program such as Excel to create your .csv file, check the resulting output in a text editor before you upload it.  It is possible to get trailing commas on each line from an empty field if you have added and deleted columns of information prior to saving the final file. Also check the character encoding. A csv file is a simple text file (ASCII or Unicode) that can be used to upload user accounts.&lt;br /&gt;
&lt;br /&gt;
Excel translates passwords that begin with - (minus) or + (plus) as zero. Even when saving as .csv and saying &amp;quot;Yes&amp;quot; to &amp;quot;Keep this format, and leave out any incompatible features.&amp;quot; Check for this before uploading, as a zero halts the upload process.&lt;br /&gt;
&lt;br /&gt;
If you use a formula in Excel to create fields (for example, the concatenate function to create a user name), then remember to copy the cells with the formula and use special paste with values checked to make them into an acceptable data for a csv file.&lt;br /&gt;
&lt;br /&gt;
===Country===&lt;br /&gt;
The country should be written as a two letter code, in capitals. For example, use BE for Belgium or NL for the Netherlands.  Using &amp;quot;be&amp;quot; or &amp;quot;nl&amp;quot; as a country code will result in a database error.&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039;  If you are having trouble working out the two-letter code for a country, you can consult this Moodle source code file /moodle/lang/en_utf8/countries.php [http://cvs.moodle.org/moodle/lang/en_utf8/countries.php?view=markup&amp;amp;pathrev=MOODLE_19_STABLE or click here for a 1.9 STABLE list].&lt;br /&gt;
ISO Website: [http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
Moodle Docs:&lt;br /&gt;
*[[Flat file]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=36851 Can I auto enroll from Excel?]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=58215 Making Email Optional]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=97903 Uploading users to custom roles]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=181259 User upload option: standardise usernames]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=144569 Matriculacion con flat file csv] - discussion in Spanish&lt;br /&gt;
&lt;br /&gt;
[[Category:Authentication]]&lt;br /&gt;
[[Category:Enrolment]]&lt;br /&gt;
[[Category:Groups]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Importer des utilisateurs]]&lt;br /&gt;
[[ja:ユーザのアップロード]]&lt;br /&gt;
[[zh:上传用户]]&lt;br /&gt;
[[ru:Загрузка пользователей]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Upgrading_to_Moodle_2.1&amp;diff=85577</id>
		<title>Upgrading to Moodle 2.1</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Upgrading_to_Moodle_2.1&amp;diff=85577"/>
		<updated>2011-07-01T11:06:10Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Now upgrade */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.1}}When upgrading to Moodle 2.1, you must have Moodle 2.0 or later. if you are using an earlier version of Moodle (for example 1.9.x) then you need to upgrade to Moodle 2.0.x first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
&lt;br /&gt;
* Moodle must be &#039;&#039;&#039;1.9&#039;&#039;&#039; or later&lt;br /&gt;
* PHP must be &#039;&#039;&#039;5.3.2&#039;&#039;&#039; or later&lt;br /&gt;
** Required PHP extensions: iconv, curl, ctype, zip, simplexml, spl, pcre, dom, xml, json&lt;br /&gt;
** Required PHP memory_limit at least 40MB (64MB or more recommended if you have a choice)&lt;br /&gt;
* Databases should be one of the following:&lt;br /&gt;
** MySQL 5.0.25 or later  (InnoDB storage engine highly recommended)&lt;br /&gt;
** PostgreSQL 8.3 or later&lt;br /&gt;
** Oracle 10.2 or later&lt;br /&gt;
** MS SQL 2005 or later&lt;br /&gt;
* Any standards-supporting browser from the past few years, for example:&lt;br /&gt;
** Firefox 3 or later &lt;br /&gt;
** Safari 3 or later &lt;br /&gt;
** Google Chrome 4 or later&lt;br /&gt;
** Opera 9 or later&lt;br /&gt;
** MS Internet Explorer 7 or later (Even [http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html Google does not support IE6 any more])&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.1 planning==&lt;br /&gt;
&lt;br /&gt;
The biggest change in Moodle 2.1 that affects the upgrade is the new question engine. If you have lots of quiz attempts, you need to plan this upgrade carefully. If you don&#039;t have lots of quiz attempts, you don&#039;t have to worry.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Planning the question engine upgrade===&lt;br /&gt;
&lt;br /&gt;
The upgrade from Moodle 2.0 to 2.1 needs to do a major transformation of all the quiz attempt data. This is something you need to plan for if you have a lot of quiz attempts.&lt;br /&gt;
&lt;br /&gt;
To gauge whether this will be a problem for you, count the number of rows in the &amp;lt;tt&amp;gt;question_sessions&amp;lt;/tt&amp;gt; table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(1) FROM mdl_question_sessions;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If this number is less than something like 10,000 then you have nothing to worry about.&lt;br /&gt;
* If this number is greater than something like 1,000,000 then you have to plan.&lt;br /&gt;
&lt;br /&gt;
====A helpful plugin====&lt;br /&gt;
&lt;br /&gt;
There is a useful plugin you can install to help you plan the upgrade which you can install from https://github.com/timhunt/moodle-local_qeupgradehelper. If you have a significant number of you are strongly advised to install it.&lt;br /&gt;
&lt;br /&gt;
Once installed, you can access it using the &#039;&#039;&#039;Question engine upgrade helper&#039;&#039;&#039; link in the Site administration menu. This plugin has various features.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;List quizzes and attempts&#039;&#039;&#039; option will count the number of quiz attempts and question sessions (like the query above) but giving more detail. Again, this is a way to get an idea of the scope of the upgrade for you.&lt;br /&gt;
&lt;br /&gt;
====What to do if you have a lot of attempts====&lt;br /&gt;
&lt;br /&gt;
Here are some options to consider:&lt;br /&gt;
&lt;br /&gt;
; Think about whether you really need to keep them all&lt;br /&gt;
: If you have not thought about your archiving strategy for old quiz attempts before, then this would be a really good time to do so. Do you really need to keep all the old data around? If not, deleting it before you upgrade to 2.1 would be a good idea.&lt;br /&gt;
: If you just need access to the old attempts for archival purposes, perhaps you could achieve that by keeping a copy of your old site from before the upgrade, and then only keeping and upgrading the current quiz attempts on your live system.&lt;br /&gt;
; Upgrade some of the attempts later&lt;br /&gt;
: The technical details for how to do this are in the script &amp;lt;tt&amp;gt;partialupgrade-example.php&amp;lt;/tt&amp;gt; which you will need to edit.&lt;br /&gt;
: After the upgrade, you can complete the upgrade in one of two ways:&lt;br /&gt;
:# You can manually use the &#039;&#039;&#039;Question engine upgrade helper&#039;&#039;&#039; to upgrade the attempt data for any quiz that has not already been done. Use the &#039;&#039;&#039;List quizzes still to upgrade&#039;&#039;&#039; option.&lt;br /&gt;
:# You can set up cron to automatically complete the upgrade using the &#039;&#039;&#039;Configure cron&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
====How to check that the upgrade was successful====&lt;br /&gt;
&lt;br /&gt;
If you want to verify that the upgrade worked successfully, here are some things to check:&lt;br /&gt;
&lt;br /&gt;
* Obviously, look out for any error messages output, or written to the logs, during the upgrade.&lt;br /&gt;
* The upgrade also writes a file into &amp;lt;tt&amp;gt;moodledata/upgradelogs/qe_&#039;&#039;{timestamp}&#039;&#039;.html&amp;lt;/tt&amp;gt;. This lists any places where there were problems with the data in your database, and the upgrade code had to make an assumption about how to proceed. This log file should be self-explanatory, if a bit technical, and it most cases each problem report will include a link to the quiz review page, so you can easily see the result of the upgrade.&lt;br /&gt;
* Finally, if you are testing the upgrade on a copy of your site, you can pick some example quizzes, and open the quiz reports or review pages from before, and after, the upgrade in separate browser windows, and compare to make sure the data is the same. Of course, there will be some differences (we hope the new system is better!) but this does let you check the data.&lt;br /&gt;
&lt;br /&gt;
====What to do if something goes wrong during the upgrade====&lt;br /&gt;
&lt;br /&gt;
I am sure you started by testing the upgrade on a copy of your live site, so if anything goes wrong, you can report the bug, wait for it to be fixed, and then try again.&lt;br /&gt;
&lt;br /&gt;
If you wish to report a bug in the upgrade you may want to look at the instructions on [[Development:Question_Engine_2:Testing]] about how to make the bug report as useful as possible.&lt;br /&gt;
&lt;br /&gt;
After the upgrade, you can use the Question engine upgrade helper plugin to re-do the upgrade of the attempts at any particular quiz. This should let you fix problems, even if you only discover them later. You can do this by using the &#039;&#039;&#039;List already upgrade quizzes that can be reset&#039;&#039;&#039; and &#039;&#039;&#039;List quizzes still to upgrade&#039;&#039;&#039; options.&lt;br /&gt;
&lt;br /&gt;
==Before upgrading please... ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: The upgrade process will irreversibly modify the contents of your database &#039;&#039;&#039;and&#039;&#039;&#039; your moodledata file storage area. If something goes wrong you &#039;&#039;&#039;cannot&#039;&#039;&#039; go back. It is vital that you take good backups of both moodledata and the database in case you have problems with the upgrade. If you are not sure how see [[Site backup]] or ask in the moodle.org forums (explaining what your operating system is).  &lt;br /&gt;
&lt;br /&gt;
* It&#039;s a good idea to read the [[Latest release notes]] and the [[Moodle 2.1 release notes]]&lt;br /&gt;
* Always check your site to make sure it meets all system requirements for 2.1 in &#039;&#039;Administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Do a full database backup!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Do a full moodledata backup&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Check your backups carefully&#039;&#039;&#039;&lt;br /&gt;
* Remember to purge PHP cache if using any PHP accelerator&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==A word about optional plugins and themes==&lt;br /&gt;
&lt;br /&gt;
If you have added optional or customised plugins (whether your own custom developments or from the modules and plugins database) or are using a non-core theme then these will probably work in Moodle 2.1+ if they worked in Moodle 2.0 with the following exceptions:&lt;br /&gt;
* Question types.&lt;br /&gt;
* Activity modules that use the question bank. (There a hardly any of these.)&lt;br /&gt;
&lt;br /&gt;
Again, you are advice to test the upgrade on a copy of your Moodle site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Checking database schema - old sites==&lt;br /&gt;
&lt;br /&gt;
If your 2.0 Moodle site has been upgraded through many prior versions it is possible that there will be some problems with the database schema (compared to a fresh 2.0 installation). This may cause the upgrade to fail. If your site started life prior to Moodle 2.0 it is a very good idea to check and correct the database schema before upgrading. See [[Verify Database Schema]]. You should also run the database integrity checks in the XMLDB editor, see the &#039;See also&#039; for a link to extra scripts to check for other discrepancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Now upgrade==&lt;br /&gt;
&lt;br /&gt;
Once you have satisfied the requirements for Moodle 2.1, follow the instructions on the [[Upgrading|upgrading]] page.&lt;br /&gt;
&lt;br /&gt;
On Linux servers, Moodle 2.1 supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
==After upgrade==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your 2.0 installation should work fine but if you take a look at config-dist.php that came with Moodle 2.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 2.1 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known and Discovered Issues ==&lt;br /&gt;
&lt;br /&gt;
* If you get an error about &#039;handling of PHP float numbers&#039;, please see [[Installation_FAQ#Moodle_claims_PHP_float_handling_is_not_compatible|this FAQ entry]].&lt;br /&gt;
* You now need some additional PHP modules installed (e.g. intl and the zip extension). If you do not have these, installation them depends entirely on how your PHP was first installed and your operating system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Moodle 2.1 release notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Mise à jour à Moodle 2.1]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Upgrading_to_Moodle_2.1&amp;diff=85576</id>
		<title>Upgrading to Moodle 2.1</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Upgrading_to_Moodle_2.1&amp;diff=85576"/>
		<updated>2011-07-01T10:57:47Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* System requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.1}}When upgrading to Moodle 2.1, you must have Moodle 2.0 or later. if you are using an earlier version of Moodle (for example 1.9.x) then you need to upgrade to Moodle 2.0.x first.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;We advise that you test the upgrade first on a COPY of your production site, to make sure it works as you expect.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==System requirements==&lt;br /&gt;
&lt;br /&gt;
* Moodle must be &#039;&#039;&#039;1.9&#039;&#039;&#039; or later&lt;br /&gt;
* PHP must be &#039;&#039;&#039;5.3.2&#039;&#039;&#039; or later&lt;br /&gt;
** Required PHP extensions: iconv, curl, ctype, zip, simplexml, spl, pcre, dom, xml, json&lt;br /&gt;
** Required PHP memory_limit at least 40MB (64MB or more recommended if you have a choice)&lt;br /&gt;
* Databases should be one of the following:&lt;br /&gt;
** MySQL 5.0.25 or later  (InnoDB storage engine highly recommended)&lt;br /&gt;
** PostgreSQL 8.3 or later&lt;br /&gt;
** Oracle 10.2 or later&lt;br /&gt;
** MS SQL 2005 or later&lt;br /&gt;
* Any standards-supporting browser from the past few years, for example:&lt;br /&gt;
** Firefox 3 or later &lt;br /&gt;
** Safari 3 or later &lt;br /&gt;
** Google Chrome 4 or later&lt;br /&gt;
** Opera 9 or later&lt;br /&gt;
** MS Internet Explorer 7 or later (Even [http://googleenterprise.blogspot.com/2010/01/modern-browsers-for-modern-applications.html Google does not support IE6 any more])&lt;br /&gt;
&lt;br /&gt;
==Moodle 2.1 planning==&lt;br /&gt;
&lt;br /&gt;
The biggest change in Moodle 2.1 that affects the upgrade is the new question engine. If you have lots of quiz attempts, you need to plan this upgrade carefully. If you don&#039;t have lots of quiz attempts, you don&#039;t have to worry.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Planning the question engine upgrade===&lt;br /&gt;
&lt;br /&gt;
The upgrade from Moodle 2.0 to 2.1 needs to do a major transformation of all the quiz attempt data. This is something you need to plan for if you have a lot of quiz attempts.&lt;br /&gt;
&lt;br /&gt;
To gauge whether this will be a problem for you, count the number of rows in the &amp;lt;tt&amp;gt;question_sessions&amp;lt;/tt&amp;gt; table:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code sql&amp;gt;&lt;br /&gt;
SELECT COUNT(1) FROM mdl_question_sessions;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If this number is less than something like 10,000 then you have nothing to worry about.&lt;br /&gt;
* If this number is greater than something like 1,000,000 then you have to plan.&lt;br /&gt;
&lt;br /&gt;
====A helpful plugin====&lt;br /&gt;
&lt;br /&gt;
There is a useful plugin you can install to help you plan the upgrade which you can install from https://github.com/timhunt/moodle-local_qeupgradehelper. If you have a significant number of you are strongly advised to install it.&lt;br /&gt;
&lt;br /&gt;
Once installed, you can access it using the &#039;&#039;&#039;Question engine upgrade helper&#039;&#039;&#039; link in the Site administration menu. This plugin has various features.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;List quizzes and attempts&#039;&#039;&#039; option will count the number of quiz attempts and question sessions (like the query above) but giving more detail. Again, this is a way to get an idea of the scope of the upgrade for you.&lt;br /&gt;
&lt;br /&gt;
====What to do if you have a lot of attempts====&lt;br /&gt;
&lt;br /&gt;
Here are some options to consider:&lt;br /&gt;
&lt;br /&gt;
; Think about whether you really need to keep them all&lt;br /&gt;
: If you have not thought about your archiving strategy for old quiz attempts before, then this would be a really good time to do so. Do you really need to keep all the old data around? If not, deleting it before you upgrade to 2.1 would be a good idea.&lt;br /&gt;
: If you just need access to the old attempts for archival purposes, perhaps you could achieve that by keeping a copy of your old site from before the upgrade, and then only keeping and upgrading the current quiz attempts on your live system.&lt;br /&gt;
; Upgrade some of the attempts later&lt;br /&gt;
: The technical details for how to do this are in the script &amp;lt;tt&amp;gt;partialupgrade-example.php&amp;lt;/tt&amp;gt; which you will need to edit.&lt;br /&gt;
: After the upgrade, you can complete the upgrade in one of two ways:&lt;br /&gt;
:# You can manually use the &#039;&#039;&#039;Question engine upgrade helper&#039;&#039;&#039; to upgrade the attempt data for any quiz that has not already been done. Use the &#039;&#039;&#039;List quizzes still to upgrade&#039;&#039;&#039; option.&lt;br /&gt;
:# You can set up cron to automatically complete the upgrade using the &#039;&#039;&#039;Configure cron&#039;&#039;&#039; option.&lt;br /&gt;
&lt;br /&gt;
====How to check that the upgrade was successful====&lt;br /&gt;
&lt;br /&gt;
If you want to verify that the upgrade worked successfully, here are some things to check:&lt;br /&gt;
&lt;br /&gt;
* Obviously, look out for any error messages output, or written to the logs, during the upgrade.&lt;br /&gt;
* The upgrade also writes a file into &amp;lt;tt&amp;gt;moodledata/upgradelogs/qe_&#039;&#039;{timestamp}&#039;&#039;.html&amp;lt;/tt&amp;gt;. This lists any places where there were problems with the data in your database, and the upgrade code had to make an assumption about how to proceed. This log file should be self-explanatory, if a bit technical, and it most cases each problem report will include a link to the quiz review page, so you can easily see the result of the upgrade.&lt;br /&gt;
* Finally, if you are testing the upgrade on a copy of your site, you can pick some example quizzes, and open the quiz reports or review pages from before, and after, the upgrade in separate browser windows, and compare to make sure the data is the same. Of course, there will be some differences (we hope the new system is better!) but this does let you check the data.&lt;br /&gt;
&lt;br /&gt;
====What to do if something goes wrong during the upgrade====&lt;br /&gt;
&lt;br /&gt;
I am sure you started by testing the upgrade on a copy of your live site, so if anything goes wrong, you can report the bug, wait for it to be fixed, and then try again.&lt;br /&gt;
&lt;br /&gt;
If you wish to report a bug in the upgrade you may want to look at the instructions on [[Development:Question_Engine_2:Testing]] about how to make the bug report as useful as possible.&lt;br /&gt;
&lt;br /&gt;
After the upgrade, you can use the Question engine upgrade helper plugin to re-do the upgrade of the attempts at any particular quiz. This should let you fix problems, even if you only discover them later. You can do this by using the &#039;&#039;&#039;List already upgrade quizzes that can be reset&#039;&#039;&#039; and &#039;&#039;&#039;List quizzes still to upgrade&#039;&#039;&#039; options.&lt;br /&gt;
&lt;br /&gt;
==Before upgrading please... ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE&#039;&#039;&#039;: The upgrade process will irreversibly modify the contents of your database &#039;&#039;&#039;and&#039;&#039;&#039; your moodledata file storage area. If something goes wrong you &#039;&#039;&#039;cannot&#039;&#039;&#039; go back. It is vital that you take good backups of both moodledata and the database in case you have problems with the upgrade. If you are not sure how see [[Site backup]] or ask in the moodle.org forums (explaining what your operating system is).  &lt;br /&gt;
&lt;br /&gt;
* It&#039;s a good idea to read the [[Latest release notes]] and the [[Moodle 2.1 release notes]]&lt;br /&gt;
* Always check your site to make sure it meets all system requirements for 2.1 in &#039;&#039;Administration &amp;gt; Server &amp;gt; [[Environment]]&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Do a full database backup!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Do a full moodledata backup&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;Check your backups carefully&#039;&#039;&#039;&lt;br /&gt;
* Remember to purge PHP cache if using any PHP accelerator&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==A word about optional plugins and themes==&lt;br /&gt;
&lt;br /&gt;
If you have added optional or customised plugins (whether your own custom developments or from the modules and plugins database) or are using a non-core theme then these will probably work in Moodle 2.1+ if they worked in Moodle 2.0 with the following exceptions:&lt;br /&gt;
* Question types.&lt;br /&gt;
* Activity modules that use the question bank. (There a hardly any of these.)&lt;br /&gt;
&lt;br /&gt;
Again, you are advice to test the upgrade on a copy of your Moodle site.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Checking database schema - old sites==&lt;br /&gt;
&lt;br /&gt;
If your 2.0 Moodle site has been upgraded through many prior versions it is possible that there will be some problems with the database schema (compared to a fresh 2.0 installation). This may cause the upgrade to fail. If your site started life prior to Moodle 2.0 it is a very good idea to check and correct the database schema before upgrading. See [[Verify Database Schema]]. You should also run the database integrity checks in the XMLDB editor, see the &#039;See also&#039; for a link to extra scripts to check for other discrepancies.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Now upgrade==&lt;br /&gt;
&lt;br /&gt;
Once you have satisfied the requirements for Moodle 2.1, follow the instructions on the [[Upgrading|upgrading]] page.&lt;br /&gt;
&lt;br /&gt;
Moodle 2.1 supports running the [[CLI|upgrade from the command line]], rather than through a web browser. This is likely to be more reliable, particularly for large sites.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==After upgrade==&lt;br /&gt;
&lt;br /&gt;
The config.php file from your 2.0 installation should work fine but if you take a look at config-dist.php that came with Moodle 2.0 there are more/different options available (e.g. database drivers and settings). It&#039;s a good idea to map your old config.php settings to a new one based on the 2.1 config-dist.php.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Known and Discovered Issues ==&lt;br /&gt;
&lt;br /&gt;
* If you get an error about &#039;handling of PHP float numbers&#039;, please see [[Installation_FAQ#Moodle_claims_PHP_float_handling_is_not_compatible|this FAQ entry]].&lt;br /&gt;
* You now need some additional PHP modules installed (e.g. intl and the zip extension). If you do not have these, installation them depends entirely on how your PHP was first installed and your operating system.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Moodle 2.1 release notes]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Mise à jour à Moodle 2.1]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=85220</id>
		<title>User:David Mudrak</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=85220"/>
		<updated>2011-06-15T09:13:08Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Redirected page to dev:User:David Mudrak&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT[[dev:User:David_Mudrak]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Moodle_2.1_release_notes/New_question_engine&amp;diff=84735</id>
		<title>Moodle 2.1 release notes/New question engine</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Moodle_2.1_release_notes/New_question_engine&amp;diff=84735"/>
		<updated>2011-06-09T14:38:29Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Initial copy from the 2.1 Release notes page with links to dev pages fixed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a major rewrite of the Moodle question system to make it much more robust and to support lots of new possible functionality. It was implemented by developers at the [http://www.open.ac.uk/ Open University], primarily Tim Hunt. There is a site on OpenLearn that is running the new question engine (back-ported into Moodle 1.9) at http://labspace.open.ac.uk/course/view.php?id=3484. We recommend you start with &#039;A Moudle Quiz&#039; (not a misspelling: M+OU+DLE). You&#039;ll need to register on the site and join the module to interact.&lt;br /&gt;
&lt;br /&gt;
Details at [[dev:Question_Engine_2]] and in MDL-20636.&lt;br /&gt;
&lt;br /&gt;
The main user-visible change is that the old Quiz setting &#039;&#039;&#039;Adaptive mode: yes/no&#039;&#039;&#039; has been replaced by a new option &#039;&#039;&#039;How questions behave&#039;&#039;&#039;. This provides a range of possible behaviours:&lt;br /&gt;
; Deferred feedback : what used to be called Adaptive mode: no, but with an important addition. With deferred feedback behaviour, it is finally the case that &#039;&#039;&#039;wrong answers to questions can give negative score&#039;&#039;&#039; - one of the oldest outstanding feature requests MDL-1647.&lt;br /&gt;
; Adaptive mode &amp;amp; Adaptive mode (no penalties): what used to be called Adaptive mode: yes&lt;br /&gt;
; Manual grading : used for essay questions (irrespective of what the quiz is set to) but you can now choose to have every question in the quiz manually graded, if you wish.&lt;br /&gt;
; Interactive mode : This is a new behaviour created by the OU. It is similar to the old adaptive mode, but with a few changes:&lt;br /&gt;
:* After submitting one answer, and reading the feedback, the student has to click a &#039;Try again&#039; button before they can try a new response.&lt;br /&gt;
:* Once the student has got the question right, they can no longer change their response.&lt;br /&gt;
:* Once the student has got the question wrong too many times, they are just graded wrong (or partially correct) and get shown the feedback and can no longer change their answer.&lt;br /&gt;
:* There can be different feedback after each try the student makes.&lt;br /&gt;
; Immediate feedback : this is a bit like Adaptive/Interactive mode, in that the student can submit their response immediately during the quiz attempt, and get it graded. However, they can only submit one response, they cannot change it later.&lt;br /&gt;
; Deferred feedback or Immediate feedback with Certainty-based marking : with Certainty-based marking, the student does not only answer the question, but they also indicate how sure they are they got the question right. The grading is adjusted by the choice of certainty, so that students have to reflect honestly on their own level of knowledge in order to get the best mark.&lt;br /&gt;
&lt;br /&gt;
There are corresponding changes in places that use questions, like the quiz and question preview. In particular the &#039;&#039;&#039;quiz manual grading report has been greatly improved&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The question types themselves have not changed very much in this release. The main change is &#039;&#039;&#039;students can attach files to essay question responses&#039;&#039;&#039; if the teacher allows it. Also, the teacher can choose whether the HTML editor is used.&lt;br /&gt;
&lt;br /&gt;
The new system has extensive automated tests, which should ensure that bugs are much rarer in future.&lt;br /&gt;
&lt;br /&gt;
== Warning! ==&lt;br /&gt;
&lt;br /&gt;
* This change requires a major database upgrade. Currently the best information about preparing for this is on [[dev:Question_Engine_2:Testing#Testing_the_upgrade]].&lt;br /&gt;
* The one existing feature is its not possible to support in the new system is the Random short-answer matching question type. Therefore, we propose to move this question type out of the main Moodle release, and make it a optional plugin (which will not be compatible with Moodle 2.1 unless someone works out how to fix it). If this change will cause you problems, please explain in [http://moodle.org/mod/forum/discuss.php?d=176097 this Quiz forum thread].&lt;br /&gt;
&lt;br /&gt;
== Note for question-type developers ==&lt;br /&gt;
&lt;br /&gt;
Unfortunately, the extent of this change means that question types that are compatible with Moodle 2.0 will not work with Moodle 2.1 until they have been updated. Brief instructions for updating your question type are at [[dev:Developing_a_Question_Type#Converting_a_Moodle_2.0_question_type]]. If you need more help than this, please ask in the [http://moodle.org/mod/forum/view.php?id=737 Quiz forum]. I (Tim) will respond, and update the documentation. As a rough guide, I was able to upgrade most of the standard and OU-specific question types in about two days each. Of course, I know exactly how the new system works.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83227</id>
		<title>Development:Backup 2.0 - Converters review 2011-04</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83227"/>
		<updated>2011-05-04T20:12:54Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Related to integration with restore_controller &amp;amp; general behavior */ linking R0402&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]] &amp;gt; Review 2011-04&lt;br /&gt;
{{Template:Development:Backup 2.0}}{{Moodle_2.1}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the results of the review performed (on April 2011) over the code available at https://github.com/mrmark/moodle related to the implementation of a general solution for the creation and support of moodle restore converters and its first implementation as one Moodle 1.9 =&amp;gt; 2.x converter.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
* MDL-22414 - the main tracker issue for this task.&lt;br /&gt;
* [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x article]] in Moodle Docs.&lt;br /&gt;
* [http://tracker.moodle.org/secure/attachment/23241/Moodle1.9to2.0Restore.pdf PDF with initial implementation plan].&lt;br /&gt;
* [https://github.com/mrmark/moodle/compare/master...converters_wip Development branch changes] &lt;br /&gt;
&lt;br /&gt;
=== Nomenclature ===&lt;br /&gt;
&lt;br /&gt;
* The review results are shown below as one list of numbered points, briefly explained, with link to corresponding MDL-xxxx (subtask of MDL-22414), where any discussion / agreement / coding should happen.&lt;br /&gt;
* All the MDL-xxxx issue created will begin with R04xx to note they have been ignited as part of this review process and the point they correspond to.&lt;br /&gt;
* Each point below includes one short &amp;quot;status&amp;quot; message in order to know the immediate actions that must be performed on it.&lt;br /&gt;
* New points can be added to the review as long as discussion / agreement happens, if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Global summary ===&lt;br /&gt;
&lt;br /&gt;
* Overall, all code seems to be in correct places and be correct code.&lt;br /&gt;
* The main infrastructure parts (base/plan/moodle1 converters and plan/task/step architectures) are ok, though their APIs would need some improvements detailed below.&lt;br /&gt;
* There are a lot of stuff missing / todo. Files, users, enrolments, plugins, tricky activities, comments, grades...&lt;br /&gt;
* We need to push-push-push (4 weeks to freeze!).&lt;br /&gt;
&lt;br /&gt;
=== The list ===&lt;br /&gt;
&lt;br /&gt;
==== Related to integration with restore_controller &amp;amp; general behavior ====&lt;br /&gt;
&lt;br /&gt;
* R0401: status: to code (MDL-27376) Right now, the to_moodle2_format() performs instantiation of all available converters + simple loop to get the conversions to perform. Instead, it should be possible to use exclusively static methods, returning origin format, target format and cost of the conversion, and then finding the best path or so. Note this is trivial right now but can be a useful general approach if new converters arrive (core and 3rd part).&lt;br /&gt;
&lt;br /&gt;
* R0402: status: to code (MDL-27377) The can_convert() function can be static too, passing tempdir as param. Also, the same function (or another one, mandatory) should check if all the PHP/server requirements are satisfied or no (some converters can need extra stuff available in order to be able to perform conversions).&lt;br /&gt;
&lt;br /&gt;
* R0403: status: to discuss. After each conversion, the original source directory is deleted and replaced by the converted one. This makes things complex to trace or perform repeated conversions and also, doesn&#039;t observe the $CFG-&amp;gt;keeptempdirectoriesonbackup completely. We should be able to keep temp stuff undeleted if desired and, perhaps too, be able to instruct the restore controller about tempdir changes.&lt;br /&gt;
&lt;br /&gt;
* R0404: status: to code. Exceptions: It needs to be decided if we are going to use own converter_exception/s or restore_exception/s and use them constantly along all the code base.&lt;br /&gt;
&lt;br /&gt;
* R0405: status: to code. Logging: Converters stuff must inherit / use restore_controller logging facilities.&lt;br /&gt;
&lt;br /&gt;
==== Related to the converters/moodle1 infrastructure ====&lt;br /&gt;
&lt;br /&gt;
* R0406: status: to discuss. All the parser / processor / path_elelement stuff is part of the abstract plan_converter. That stuff should be moved to moodle1_converter as far as it is highly dependent / tidied with the conversion particularities.&lt;br /&gt;
&lt;br /&gt;
* R0407: status: to discuss (not important). About converters, should class names and file names match, i.e. converter.class.php =&amp;gt; moodle1_converter.class.php&lt;br /&gt;
&lt;br /&gt;
* R0408: status: to discuss. On restore, we have both after_restore() methods available in steps (executed when the step execution ends) and in tasks (executed when the whole plan execution ends). Do we need this duality in plan_converter, or is it enough with current one. Right now it seems that we are using a lot these methods to do the work, and process_xxx() should be used instead (together with next point).&lt;br /&gt;
&lt;br /&gt;
* R0409: status: to code. Since some weeks ago the notify_path_start/end() methods are available in the xml processor, should we start using them to call some stuff in converter, able to dispatch to start_xxxx() and end_xxxx() methods in the converter steps. It would help a lot with both starting/closing XML tags, creating and closing xml files, or any other pre/post stuff needing to be executed at certain stages.&lt;br /&gt;
&lt;br /&gt;
* R0410: status: to discuss. The deprecated/new/renamed elements / mutate_datum stuff. Perhaps it should be moved from steps to path_elements instead, so each path element autocontains the basic transformations to be performed on data and they are applied automatically. It seems a better place for that definitions. Or, alternatively, we&#039;ll need deprecated/new/renamed/mutate_xxxx() methods, one for each path.&lt;br /&gt;
&lt;br /&gt;
* R0411: status: to code. After looking current uses of the xml writer, it seems clear that we need some extra methods, able to print one tag completely, push/pop last open tag and other commodities in order to make coding easier.&lt;br /&gt;
&lt;br /&gt;
* R0412: status: to code. The &amp;quot;trick&amp;quot; in the parser about dynamically modify /MOD paths seems ok (I cannot imagine another way to implement it). Similar magic will be needed for blocks and surely, the start/end implementation above will need a similar way to handle/dispatch processing.&lt;br /&gt;
&lt;br /&gt;
* R0413: status: to code. Some raw accesses to the backup_ids_temp DB stuff must be modified to use helper functions. Also, the use of the table in get_context() can be really slow (text comparison). Look for some alternative.&lt;br /&gt;
&lt;br /&gt;
* R0414: status: to code. The convert_file() method uses the backup_ids_temp to get sequential fileid values. It should be enough (completely safe), to use one static (in memory) generator instead. No concurrence problems at all IMO.&lt;br /&gt;
&lt;br /&gt;
* R0415: status: to discuss. Support for plugins is a must as far as at least qtypes require it. Note that question types are going to suffer one major revamp on Moodle 2.1, so their final architecture is unknown right now (different from both 1.9 and 2.0).&lt;br /&gt;
&lt;br /&gt;
* R0416: status: to code (tiny detail). In current moodle1_conversion, original_site_identifier should be generated only if there is one original identifier. Right now it saves one &amp;quot;?&amp;quot; that can lead to wrong results detecting same sites.&lt;br /&gt;
&lt;br /&gt;
==== Related to coding in general ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strike&amp;gt;R0417&amp;lt;/strike&amp;gt;: status: done. Copyright messages are required on each new file. It must be the standard one with GPL3 msg and MR/Mark/whatever copyright.&lt;br /&gt;
&lt;br /&gt;
* R0418: status: to code. We should have as many tests as possible, specially testing all the infrastructure stuff, in order to guarantee it continues working as expected after any refactor / modification. Right now it&#039;s practically inexistent.&lt;br /&gt;
&lt;br /&gt;
* R0419: status: to do periodically. We need to keep the main repo for all the project &amp;quot;converters_wip&amp;quot; in sync (merged) with current moodle.git master branch in order to ensure stuff will land properly (conflicts-free) and converters will be able to use any new feature / improvement available.&lt;br /&gt;
&lt;br /&gt;
==== Related to pending &amp;amp; tricky areas ====&lt;br /&gt;
&lt;br /&gt;
* R0420: status: to code. There are a lot of areas which coding hasn&#039;t been ignited yet (surely to pending work in the list above, don&#039;t worry). Here there is a brief ordered list, annotating the ones that will be really tricky:&lt;br /&gt;
** Users and enrollments: All the users with their complete information must be saved to new users.xml file and each process_xxx() method must, continuously, be annotating needed uses in order to generate proper inforef.xml files. Enrolments will be all moved to manual ones (this needs confirmation).&lt;br /&gt;
** Workshop activity: Completely revamped in 2.0. It has proper subplugins. Upgrade code needs to be deeply analyzed and XML differences too to know how to implement it. (contact: David).&lt;br /&gt;
** Wiki activity: Also brand new in 2.0. Upgrade needs analysis and XML differences too. (contact: Dongsheng).&lt;br /&gt;
** Resource activity: Split into  file/folder/page/url activities. The structure is simple (no user data) but the split makes it really tricky. Also very file-intensive. Upgrade code needs analysis and XML differences (contact: Petr).&lt;br /&gt;
** Files: 1.9 files can had site/course files (apart from the ones &amp;quot;owned&amp;quot; by the module @ moddata). They must be annotated and moved to new files.xml &amp;amp; storage. There is some code already but is not used in the general converter helper stuff (should be moodle1 converter specific instead?).&lt;br /&gt;
** Gradebook: There are important differences between how 1.9 and 2.0 backup information is handled. Scales / outcomes / grade items need annotation in inforef.xml files and also there are new xml files designed to store specifically grades (categories, items, grades...) information. Need analysis. (contact: Andrew).&lt;br /&gt;
&lt;br /&gt;
====After review, organization====&lt;br /&gt;
&lt;br /&gt;
This section will be used to annotate any agreement / conclusion / organization for the next weeks in case the Tracker isn&#039;t enough to do so. Feel free to use it, beloved colleagues, always using the R04xx nomenclature for referencing exact stuff, plz.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* Go back to [[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]].&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83226</id>
		<title>Development:Backup 2.0 - Converters review 2011-04</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83226"/>
		<updated>2011-05-04T20:05:43Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Related to integration with restore_controller &amp;amp; general behavior */ linking R0401&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]] &amp;gt; Review 2011-04&lt;br /&gt;
{{Template:Development:Backup 2.0}}{{Moodle_2.1}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the results of the review performed (on April 2011) over the code available at https://github.com/mrmark/moodle related to the implementation of a general solution for the creation and support of moodle restore converters and its first implementation as one Moodle 1.9 =&amp;gt; 2.x converter.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
* MDL-22414 - the main tracker issue for this task.&lt;br /&gt;
* [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x article]] in Moodle Docs.&lt;br /&gt;
* [http://tracker.moodle.org/secure/attachment/23241/Moodle1.9to2.0Restore.pdf PDF with initial implementation plan].&lt;br /&gt;
* [https://github.com/mrmark/moodle/compare/master...converters_wip Development branch changes] &lt;br /&gt;
&lt;br /&gt;
=== Nomenclature ===&lt;br /&gt;
&lt;br /&gt;
* The review results are shown below as one list of numbered points, briefly explained, with link to corresponding MDL-xxxx (subtask of MDL-22414), where any discussion / agreement / coding should happen.&lt;br /&gt;
* All the MDL-xxxx issue created will begin with R04xx to note they have been ignited as part of this review process and the point they correspond to.&lt;br /&gt;
* Each point below includes one short &amp;quot;status&amp;quot; message in order to know the immediate actions that must be performed on it.&lt;br /&gt;
* New points can be added to the review as long as discussion / agreement happens, if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Global summary ===&lt;br /&gt;
&lt;br /&gt;
* Overall, all code seems to be in correct places and be correct code.&lt;br /&gt;
* The main infrastructure parts (base/plan/moodle1 converters and plan/task/step architectures) are ok, though their APIs would need some improvements detailed below.&lt;br /&gt;
* There are a lot of stuff missing / todo. Files, users, enrolments, plugins, tricky activities, comments, grades...&lt;br /&gt;
* We need to push-push-push (4 weeks to freeze!).&lt;br /&gt;
&lt;br /&gt;
=== The list ===&lt;br /&gt;
&lt;br /&gt;
==== Related to integration with restore_controller &amp;amp; general behavior ====&lt;br /&gt;
&lt;br /&gt;
* R0401: status: to code (MDL-27376) Right now, the to_moodle2_format() performs instantiation of all available converters + simple loop to get the conversions to perform. Instead, it should be possible to use exclusively static methods, returning origin format, target format and cost of the conversion, and then finding the best path or so. Note this is trivial right now but can be a useful general approach if new converters arrive (core and 3rd part).&lt;br /&gt;
&lt;br /&gt;
* R0402: status: to code. The can_convert() function can be static too, passing tempdir as param. Also, the same function (or another one, mandatory) should check if all the PHP/server requirements are satisfied or no (some converters can need extra stuff available in order to be able to perform conversions).&lt;br /&gt;
&lt;br /&gt;
* R0403: status: to discuss. After each conversion, the original source directory is deleted and replaced by the converted one. This makes things complex to trace or perform repeated conversions and also, doesn&#039;t observe the $CFG-&amp;gt;keeptempdirectoriesonbackup completely. We should be able to keep temp stuff undeleted if desired and, perhaps too, be able to instruct the restore controller about tempdir changes.&lt;br /&gt;
&lt;br /&gt;
* R0404: status: to code. Exceptions: It needs to be decided if we are going to use own converter_exception/s or restore_exception/s and use them constantly along all the code base.&lt;br /&gt;
&lt;br /&gt;
* R0405: status: to code. Logging: Converters stuff must inherit / use restore_controller logging facilities.&lt;br /&gt;
&lt;br /&gt;
==== Related to the converters/moodle1 infrastructure ====&lt;br /&gt;
&lt;br /&gt;
* R0406: status: to discuss. All the parser / processor / path_elelement stuff is part of the abstract plan_converter. That stuff should be moved to moodle1_converter as far as it is highly dependent / tidied with the conversion particularities.&lt;br /&gt;
&lt;br /&gt;
* R0407: status: to discuss (not important). About converters, should class names and file names match, i.e. converter.class.php =&amp;gt; moodle1_converter.class.php&lt;br /&gt;
&lt;br /&gt;
* R0408: status: to discuss. On restore, we have both after_restore() methods available in steps (executed when the step execution ends) and in tasks (executed when the whole plan execution ends). Do we need this duality in plan_converter, or is it enough with current one. Right now it seems that we are using a lot these methods to do the work, and process_xxx() should be used instead (together with next point).&lt;br /&gt;
&lt;br /&gt;
* R0409: status: to code. Since some weeks ago the notify_path_start/end() methods are available in the xml processor, should we start using them to call some stuff in converter, able to dispatch to start_xxxx() and end_xxxx() methods in the converter steps. It would help a lot with both starting/closing XML tags, creating and closing xml files, or any other pre/post stuff needing to be executed at certain stages.&lt;br /&gt;
&lt;br /&gt;
* R0410: status: to discuss. The deprecated/new/renamed elements / mutate_datum stuff. Perhaps it should be moved from steps to path_elements instead, so each path element autocontains the basic transformations to be performed on data and they are applied automatically. It seems a better place for that definitions. Or, alternatively, we&#039;ll need deprecated/new/renamed/mutate_xxxx() methods, one for each path.&lt;br /&gt;
&lt;br /&gt;
* R0411: status: to code. After looking current uses of the xml writer, it seems clear that we need some extra methods, able to print one tag completely, push/pop last open tag and other commodities in order to make coding easier.&lt;br /&gt;
&lt;br /&gt;
* R0412: status: to code. The &amp;quot;trick&amp;quot; in the parser about dynamically modify /MOD paths seems ok (I cannot imagine another way to implement it). Similar magic will be needed for blocks and surely, the start/end implementation above will need a similar way to handle/dispatch processing.&lt;br /&gt;
&lt;br /&gt;
* R0413: status: to code. Some raw accesses to the backup_ids_temp DB stuff must be modified to use helper functions. Also, the use of the table in get_context() can be really slow (text comparison). Look for some alternative.&lt;br /&gt;
&lt;br /&gt;
* R0414: status: to code. The convert_file() method uses the backup_ids_temp to get sequential fileid values. It should be enough (completely safe), to use one static (in memory) generator instead. No concurrence problems at all IMO.&lt;br /&gt;
&lt;br /&gt;
* R0415: status: to discuss. Support for plugins is a must as far as at least qtypes require it. Note that question types are going to suffer one major revamp on Moodle 2.1, so their final architecture is unknown right now (different from both 1.9 and 2.0).&lt;br /&gt;
&lt;br /&gt;
* R0416: status: to code (tiny detail). In current moodle1_conversion, original_site_identifier should be generated only if there is one original identifier. Right now it saves one &amp;quot;?&amp;quot; that can lead to wrong results detecting same sites.&lt;br /&gt;
&lt;br /&gt;
==== Related to coding in general ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strike&amp;gt;R0417&amp;lt;/strike&amp;gt;: status: done. Copyright messages are required on each new file. It must be the standard one with GPL3 msg and MR/Mark/whatever copyright.&lt;br /&gt;
&lt;br /&gt;
* R0418: status: to code. We should have as many tests as possible, specially testing all the infrastructure stuff, in order to guarantee it continues working as expected after any refactor / modification. Right now it&#039;s practically inexistent.&lt;br /&gt;
&lt;br /&gt;
* R0419: status: to do periodically. We need to keep the main repo for all the project &amp;quot;converters_wip&amp;quot; in sync (merged) with current moodle.git master branch in order to ensure stuff will land properly (conflicts-free) and converters will be able to use any new feature / improvement available.&lt;br /&gt;
&lt;br /&gt;
==== Related to pending &amp;amp; tricky areas ====&lt;br /&gt;
&lt;br /&gt;
* R0420: status: to code. There are a lot of areas which coding hasn&#039;t been ignited yet (surely to pending work in the list above, don&#039;t worry). Here there is a brief ordered list, annotating the ones that will be really tricky:&lt;br /&gt;
** Users and enrollments: All the users with their complete information must be saved to new users.xml file and each process_xxx() method must, continuously, be annotating needed uses in order to generate proper inforef.xml files. Enrolments will be all moved to manual ones (this needs confirmation).&lt;br /&gt;
** Workshop activity: Completely revamped in 2.0. It has proper subplugins. Upgrade code needs to be deeply analyzed and XML differences too to know how to implement it. (contact: David).&lt;br /&gt;
** Wiki activity: Also brand new in 2.0. Upgrade needs analysis and XML differences too. (contact: Dongsheng).&lt;br /&gt;
** Resource activity: Split into  file/folder/page/url activities. The structure is simple (no user data) but the split makes it really tricky. Also very file-intensive. Upgrade code needs analysis and XML differences (contact: Petr).&lt;br /&gt;
** Files: 1.9 files can had site/course files (apart from the ones &amp;quot;owned&amp;quot; by the module @ moddata). They must be annotated and moved to new files.xml &amp;amp; storage. There is some code already but is not used in the general converter helper stuff (should be moodle1 converter specific instead?).&lt;br /&gt;
** Gradebook: There are important differences between how 1.9 and 2.0 backup information is handled. Scales / outcomes / grade items need annotation in inforef.xml files and also there are new xml files designed to store specifically grades (categories, items, grades...) information. Need analysis. (contact: Andrew).&lt;br /&gt;
&lt;br /&gt;
====After review, organization====&lt;br /&gt;
&lt;br /&gt;
This section will be used to annotate any agreement / conclusion / organization for the next weeks in case the Tracker isn&#039;t enough to do so. Feel free to use it, beloved colleagues, always using the R04xx nomenclature for referencing exact stuff, plz.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* Go back to [[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]].&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83220</id>
		<title>Development:Backup 2.0 - Converters review 2011-04</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Backup_2.0_-_Converters_review_2011-04&amp;diff=83220"/>
		<updated>2011-05-04T14:24:50Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Related to coding in general */ R0417 done on David&amp;#039;s branch&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]] &amp;gt; Review 2011-04&lt;br /&gt;
{{Template:Development:Backup 2.0}}{{Moodle_2.1}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes the results of the review performed (on April 2011) over the code available at https://github.com/mrmark/moodle related to the implementation of a general solution for the creation and support of moodle restore converters and its first implementation as one Moodle 1.9 =&amp;gt; 2.x converter.&lt;br /&gt;
&lt;br /&gt;
=== References ===&lt;br /&gt;
&lt;br /&gt;
* MDL-22414 - the main tracker issue for this task.&lt;br /&gt;
* [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x article]] in Moodle Docs.&lt;br /&gt;
* [http://tracker.moodle.org/secure/attachment/23241/Moodle1.9to2.0Restore.pdf PDF with initial implementation plan].&lt;br /&gt;
* [https://github.com/mrmark/moodle/compare/master...converters_wip Development branch changes] &lt;br /&gt;
&lt;br /&gt;
=== Nomenclature ===&lt;br /&gt;
&lt;br /&gt;
* The review results are shown below as one list of numbered points, briefly explained, with link to corresponding MDL-xxxx (subtask of MDL-22414), where any discussion / agreement / coding should happen.&lt;br /&gt;
* All the MDL-xxxx issue created will begin with R04xx to note they have been ignited as part of this review process and the point they correspond to.&lt;br /&gt;
* Each point below includes one short &amp;quot;status&amp;quot; message in order to know the immediate actions that must be performed on it.&lt;br /&gt;
* New points can be added to the review as long as discussion / agreement happens, if necessary.&lt;br /&gt;
&lt;br /&gt;
=== Global summary ===&lt;br /&gt;
&lt;br /&gt;
* Overall, all code seems to be in correct places and be correct code.&lt;br /&gt;
* The main infrastructure parts (base/plan/moodle1 converters and plan/task/step architectures) are ok, though their APIs would need some improvements detailed below.&lt;br /&gt;
* There are a lot of stuff missing / todo. Files, users, enrolments, plugins, tricky activities, comments, grades...&lt;br /&gt;
* We need to push-push-push (4 weeks to freeze!).&lt;br /&gt;
&lt;br /&gt;
=== The list ===&lt;br /&gt;
&lt;br /&gt;
==== Related to integration with restore_controller &amp;amp; general behavior ====&lt;br /&gt;
&lt;br /&gt;
* R0401: status: to code. Right now, the to_moodle2_format() performs instantiation of all available converters + simple loop to get the conversions to perform. Instead, it should be possible to use exclusively static methods, returning origin format, target format and cost of the conversion, and then finding the best path or so. Note this is trivial right now but can be a useful general approach if new converters arrive (core and 3rd part).&lt;br /&gt;
&lt;br /&gt;
* R0402: status: to code. The can_convert() function can be static too, passing tempdir as param. Also, the same function (or another one, mandatory) should check if all the PHP/server requirements are satisfied or no (some converters can need extra stuff available in order to be able to perform conversions).&lt;br /&gt;
&lt;br /&gt;
* R0403: status: to discuss. After each conversion, the original source directory is deleted and replaced by the converted one. This makes things complex to trace or perform repeated conversions and also, doesn&#039;t observe the $CFG-&amp;gt;keeptempdirectoriesonbackup completely. We should be able to keep temp stuff undeleted if desired and, perhaps too, be able to instruct the restore controller about tempdir changes.&lt;br /&gt;
&lt;br /&gt;
* R0404: status: to code. Exceptions: It needs to be decided if we are going to use own converter_exception/s or restore_exception/s and use them constantly along all the code base.&lt;br /&gt;
&lt;br /&gt;
* R0405: status: to code. Logging: Converters stuff must inherit / use restore_controller logging facilities.&lt;br /&gt;
&lt;br /&gt;
==== Related to the converters/moodle1 infrastructure ====&lt;br /&gt;
&lt;br /&gt;
* R0406: status: to discuss. All the parser / processor / path_elelement stuff is part of the abstract plan_converter. That stuff should be moved to moodle1_converter as far as it is highly dependent / tidied with the conversion particularities.&lt;br /&gt;
&lt;br /&gt;
* R0407: status: to discuss (not important). About converters, should class names and file names match, i.e. converter.class.php =&amp;gt; moodle1_converter.class.php&lt;br /&gt;
&lt;br /&gt;
* R0408: status: to discuss. On restore, we have both after_restore() methods available in steps (executed when the step execution ends) and in tasks (executed when the whole plan execution ends). Do we need this duality in plan_converter, or is it enough with current one. Right now it seems that we are using a lot these methods to do the work, and process_xxx() should be used instead (together with next point).&lt;br /&gt;
&lt;br /&gt;
* R0409: status: to code. Since some weeks ago the notify_path_start/end() methods are available in the xml processor, should we start using them to call some stuff in converter, able to dispatch to start_xxxx() and end_xxxx() methods in the converter steps. It would help a lot with both starting/closing XML tags, creating and closing xml files, or any other pre/post stuff needing to be executed at certain stages.&lt;br /&gt;
&lt;br /&gt;
* R0410: status: to discuss. The deprecated/new/renamed elements / mutate_datum stuff. Perhaps it should be moved from steps to path_elements instead, so each path element autocontains the basic transformations to be performed on data and they are applied automatically. It seems a better place for that definitions. Or, alternatively, we&#039;ll need deprecated/new/renamed/mutate_xxxx() methods, one for each path.&lt;br /&gt;
&lt;br /&gt;
* R0411: status: to code. After looking current uses of the xml writer, it seems clear that we need some extra methods, able to print one tag completely, push/pop last open tag and other commodities in order to make coding easier.&lt;br /&gt;
&lt;br /&gt;
* R0412: status: to code. The &amp;quot;trick&amp;quot; in the parser about dynamically modify /MOD paths seems ok (I cannot imagine another way to implement it). Similar magic will be needed for blocks and surely, the start/end implementation above will need a similar way to handle/dispatch processing.&lt;br /&gt;
&lt;br /&gt;
* R0413: status: to code. Some raw accesses to the backup_ids_temp DB stuff must be modified to use helper functions. Also, the use of the table in get_context() can be really slow (text comparison). Look for some alternative.&lt;br /&gt;
&lt;br /&gt;
* R0414: status: to code. The convert_file() method uses the backup_ids_temp to get sequential fileid values. It should be enough (completely safe), to use one static (in memory) generator instead. No concurrence problems at all IMO.&lt;br /&gt;
&lt;br /&gt;
* R0415: status: to discuss. Support for plugins is a must as far as at least qtypes require it. Note that question types are going to suffer one major revamp on Moodle 2.1, so their final architecture is unknown right now (different from both 1.9 and 2.0).&lt;br /&gt;
&lt;br /&gt;
* R0416: status: to code (tiny detail). In current moodle1_conversion, original_site_identifier should be generated only if there is one original identifier. Right now it saves one &amp;quot;?&amp;quot; that can lead to wrong results detecting same sites.&lt;br /&gt;
&lt;br /&gt;
==== Related to coding in general ====&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;strike&amp;gt;R0417&amp;lt;/strike&amp;gt;: status: done. Copyright messages are required on each new file. It must be the standard one with GPL3 msg and MR/Mark/whatever copyright.&lt;br /&gt;
&lt;br /&gt;
* R0418: status: to code. We should have as many tests as possible, specially testing all the infrastructure stuff, in order to guarantee it continues working as expected after any refactor / modification. Right now it&#039;s practically inexistent.&lt;br /&gt;
&lt;br /&gt;
* R0419: status: to do periodically. We need to keep the main repo for all the project &amp;quot;converters_wip&amp;quot; in sync (merged) with current moodle.git master branch in order to ensure stuff will land properly (conflicts-free) and converters will be able to use any new feature / improvement available.&lt;br /&gt;
&lt;br /&gt;
==== Related to pending &amp;amp; tricky areas ====&lt;br /&gt;
&lt;br /&gt;
* R0420: status: to code. There are a lot of areas which coding hasn&#039;t been ignited yet (surely to pending work in the list above, don&#039;t worry). Here there is a brief ordered list, annotating the ones that will be really tricky:&lt;br /&gt;
** Users and enrollments: All the users with their complete information must be saved to new users.xml file and each process_xxx() method must, continuously, be annotating needed uses in order to generate proper inforef.xml files. Enrolments will be all moved to manual ones (this needs confirmation).&lt;br /&gt;
** Workshop activity: Completely revamped in 2.0. It has proper subplugins. Upgrade code needs to be deeply analyzed and XML differences too to know how to implement it. (contact: David).&lt;br /&gt;
** Wiki activity: Also brand new in 2.0. Upgrade needs analysis and XML differences too. (contact: Dongsheng).&lt;br /&gt;
** Resource activity: Split into  file/folder/page/url activities. The structure is simple (no user data) but the split makes it really tricky. Also very file-intensive. Upgrade code needs analysis and XML differences (contact: Petr).&lt;br /&gt;
** Files: 1.9 files can had site/course files (apart from the ones &amp;quot;owned&amp;quot; by the module @ moddata). They must be annotated and moved to new files.xml &amp;amp; storage. There is some code already but is not used in the general converter helper stuff (should be moodle1 converter specific instead?).&lt;br /&gt;
** Gradebook: There are important differences between how 1.9 and 2.0 backup information is handled. Scales / outcomes / grade items need annotation in inforef.xml files and also there are new xml files designed to store specifically grades (categories, items, grades...) information. Need analysis. (contact: Andrew).&lt;br /&gt;
&lt;br /&gt;
====After review, organization====&lt;br /&gt;
&lt;br /&gt;
This section will be used to annotate any agreement / conclusion / organization for the next weeks in case the Tracker isn&#039;t enough to do so. Feel free to use it, beloved colleagues, always using the R04xx nomenclature for referencing exact stuff, plz.&lt;br /&gt;
&lt;br /&gt;
=== See also ===&lt;br /&gt;
&lt;br /&gt;
* Go back to [[Development:Backup 2.0|Backup 2.0]] &amp;gt; [[Development:Backup 2.0 - Provide upwards compatibility of Moodle 1.9.x backups|Backup 1.9 =&amp;gt; 2.x main page]].&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Language_customization&amp;diff=83185</id>
		<title>Language customization</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Language_customization&amp;diff=83185"/>
		<updated>2011-05-03T00:17:08Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: The language customization feature has been there since ages, removing the since-2.0 part.&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; This page describes how to change words or phrases in Moodle 2.0 onwards. For details of the process in versions prior to 2.0, see [[Language editing]].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}Location: &#039;&#039;Site administration &amp;gt; Language &amp;gt; Language customization&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Words or phrases (in any language) used on the site may be easily changed using the language customization feature. For example, you may want to change the word &amp;quot;Course&amp;quot; to &amp;quot;Unit&amp;quot;. The process consists of 4 steps:&lt;br /&gt;
&lt;br /&gt;
# Check-out the strings&lt;br /&gt;
# Filter the strings you wish to customize&lt;br /&gt;
# Customize the strings&lt;br /&gt;
# Save and check-in the strings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quick instructions for the impatient ==&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Site administration &amp;gt; Language&amp;gt; Language customization&#039;&#039; page.&lt;br /&gt;
* Pick the language to customize from the pull down list.&lt;br /&gt;
* Click the &amp;quot;Check out strings to translator&amp;quot; button.  And get ready for the change.&lt;br /&gt;
* Use the new &amp;quot;filter strings&amp;quot; interface to select the file to edit. Notice the files are grouped. For example, you will find the lesson strings under &amp;quot;mod&amp;quot; and moodle.php under core.&lt;br /&gt;
* After selecting the file, it is possible to use &amp;quot;string must contain&amp;quot; and other filters. For example, look at only string text that has &amp;quot;add&amp;quot; in the lesson.php set.&lt;br /&gt;
* Once you are done, you can save changes and pick another filter or PHP file to edit.&lt;br /&gt;
* When you want to save your edits, select &amp;quot;Save and check in string into files&amp;quot;.  This will store the changes you have made so all users will see them.   &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Do not see any string changes?  Did you remember to use the &amp;quot;Save and check in string into files&amp;quot; button? Did you refresh your browser so it is not looking at a cached page? Did you edit the language file that is actually being used in your site, course or by the user?&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Moodle is translated into many languages - see [http://download.moodle.org/langpack/2.0/] for their list and the translation completion status. The translations are distributed in so called language packages (or just lang packs) that are maintained by kind volunteers, community contributors and Moodle partners. Please read the page [[Translation]] first to understand how the whole localization machinery works.&lt;br /&gt;
&lt;br /&gt;
Moodle site administrators can customize any language pack to fit their individual needs (for example to use the term &amp;quot;Unit&amp;quot; instead of &amp;quot;Course&amp;quot;). You are discouraged from direct editing the files coming as a part official language pack. Such changes would be silently overwritten during the next upgrade. Instead, you should create a local language pack that holds all your changes from the official pack.&lt;br /&gt;
&lt;br /&gt;
Local language packs have the same structure as the official ones. They are saved in your Moodle data directory in moodledata/lang/xx_local/ folder where &#039;xx&#039; is the code of the language. You have to have the official language pack installed before you can customize it. Local language pack should contain just strings you have customized - you should not copy whole official language packs.&lt;br /&gt;
&lt;br /&gt;
When displaying a string, Moodle first looks if a local customization of it exists in moodledata/lang/xx_local/component_file.php. If so, it is used. If not, the string from the official language pack is used (eventually, if the string has not been translated yet, the original English version is displayed). Please note that the strings are cached for better performance so you have to purge Moodle caches after you modify a file in your xx_local pack (caches are purged automatically if you use the tool described below).&lt;br /&gt;
&lt;br /&gt;
== Using Language customization tool ==&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a tool that allows you to edit your local language pack via web interface. This tool is available for the site administrators via block &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Language &amp;gt; Language customization&#039;&#039;. Please refer to the following workflow diagram.&lt;br /&gt;
&lt;br /&gt;
[[image:customlang-process.png|800px|thumb|left|Workflow of the language customization (click to enlarge)]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check out strings into translator ===&lt;br /&gt;
&lt;br /&gt;
At the Language customization first page, select a language to customize and press the button &#039;Check out string into translator&#039;. During the checkout, Moodle loads the language strings from PHP files into its database. The language customization tool works with this database so the files in your xx_local pack are not touched unless your proceed to the final step of this workflow. If the xx_local language pack does not exist yet, Moodle automatically creates an empty one for you.&lt;br /&gt;
&lt;br /&gt;
There is currently a problem with &amp;quot;execution time&amp;quot;. If you get the &amp;quot;Fatal error: Maximum execution time of 180 seconds exceeded&amp;quot; message, you will have to press the button &#039;Check out string into translator&#039; several times to get the operation completed. See [http://moodle.org/mod/forum/discuss.php?d=163375 forum discussion].&lt;br /&gt;
&lt;br /&gt;
=== Filter the strings you want to customize ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_string_M2_filter.png|thumb|right|Moodle 2.0 language filter]]&lt;br /&gt;
After the checkout, use the filter form provided to find strings you want to customize for your site. The following filter options are available:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Show strings of these components&#039;&#039; - if you know which component defines the string you look for (it is a second parameter of the get_string() function), choose it here. Eventually, select all options to search across all components.&lt;br /&gt;
* &#039;&#039;Customized only&#039;&#039; - check this field to display only those strings that are already present in your xx_local pack.&lt;br /&gt;
* &#039;&#039;Help only&#039;&#039;&#039; - check this field to display only help tooltips, that is the texts used when clicking the yellow question mark icon. Started in Moodle 2.0, help string identifiers must end with _help suffix.&lt;br /&gt;
* &#039;&#039;Modified only&#039;&#039; - displays only the strings that are modified in the current session. Note the difference between &#039;customized string&#039; and &#039;modified string&#039; here. We use the term &#039;customized&#039; for strings that are saved on disk in your xx_local pack directory. While the term &#039;modified&#039; represents the changes you have done since the last checkout. Customized strings (already saved in a file) are highlighted with green. Modified strings (not saved in a file yet) are highlighted with blue. You may want to use this option to overview your current work before you check it in.&lt;br /&gt;
* &#039;&#039;Only strings containing&#039;&#039; - insert a phrase that must appear in the string, either the English or the translated. For example, if you put a word &#039;student&#039; here, you will get only those strings that mention this word. This can be effectively used for mass search and replace to change the terminology you use in your Moodle site.&lt;br /&gt;
* &#039;&#039;String identifier&#039;&#039; - if you know the string identifier (it is the first parameter of the get_string() function), type it here. For example, the names of activity modules are defined in strings &#039;modulename&#039;.&lt;br /&gt;
&lt;br /&gt;
Use any combination of filter settings to get the required set of strings and press the button &#039;Show strings&#039;. We believe that the filter is powerful part of the whole tool and with clever settings it will allow you to find the required strings effectively.&lt;br /&gt;
&lt;br /&gt;
=== Input your own translation ===&lt;br /&gt;
&lt;br /&gt;
The strings that pass all the conditions defined in the filter are displayed in a table. To replace the standard translation, put your own into the field in the last column &#039;Local customization&#039;. Do not forget to save the text you input via &#039;Save and continue editing&#039; button.&lt;br /&gt;
&lt;br /&gt;
If you want to delete your current customization, just delete the content of the input field and save the translator form. The modifications that are going to remove a customized string are highlighted in red.&lt;br /&gt;
&lt;br /&gt;
=== Saving your work into files ===&lt;br /&gt;
&lt;br /&gt;
Repeat the last two steps as needed to find all the strings you want to change. When you are ready to save your work into files in xx_local language pack, press &#039;Save and check in strings into files&#039; button.&lt;br /&gt;
&lt;br /&gt;
=== Writing the modifications into files ===&lt;br /&gt;
&lt;br /&gt;
During the checkin, the contents of the translator database are dumped into files in moodledata/lang/xx_local/ directory. Note this operation removes this directory first and then re-creates it with the actual data. Therefore it is reasonable to not to touch the files directly after you have checked out them into the translator.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Language editing]] - for versions of Moodle prior to 2.0&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Language_editing&amp;diff=83184</id>
		<title>Language editing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Language_editing&amp;diff=83184"/>
		<updated>2011-05-03T00:15:25Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: The 2.0 specific part moved to the Language customization page&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; Language editing has been improved in Moodle 2.0 onwards. See [[Language customization]] for details.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Location: &#039;&#039;Administration &amp;gt; Language &amp;gt; Language editing&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Edit words or phrases ==&lt;br /&gt;
[[Image:Editing-language-moodle-19.gif|thumb|Edit words or phrases in Moodle 1.9.5]]The language editing interface enables you to easily change any word or phrase used on the site. For example, you may want to change the word &amp;quot;Course&amp;quot; to &amp;quot;Area&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
To edit a word or phrase:&lt;br /&gt;
#Access &#039;&#039;Administration &amp;gt; Language &amp;gt; Language editing&#039;&#039;.&lt;br /&gt;
#Click the &amp;quot;Edit words or phrases&amp;quot; link in the middle of the page.&lt;br /&gt;
#Choose a file to edit. You may need to search through a few files before finding the file containing the word you wish to change. The file &#039;&#039;moodle.php&#039;&#039; contains all common site-wide phrases.&lt;br /&gt;
#Change the word or phrase.&lt;br /&gt;
#Click the &amp;quot;Save changes&amp;quot; button. The changed phrase will be highlighted in a different color.&lt;br /&gt;
&lt;br /&gt;
Note: In versions of Moodle prior to 1.9, it is necessary to click the &amp;quot;Switch lang directory&amp;quot; button on the edit words or phrases page. A local language folder, &#039;&#039;parentlanguage_local&#039;&#039;, will then be automatically created in &#039;&#039;moodledata/lang&#039;&#039;. Files of edited strings will then be saved in this folder. This is necessary to prevent changes that you make being overwritten by a newer language pack when updating. In Moodle 1.9 onwards, the option to switch is no longer provided as edited strings are automatically saved in the local language folder.&lt;br /&gt;
&lt;br /&gt;
If you wish to make further changes later, be sure to check that files of edited strings will again be saved to the folder &#039;&#039;parentlanguage_local&#039;&#039;, switching folder if necessary.&lt;br /&gt;
&lt;br /&gt;
==Changes in 1.9==&lt;br /&gt;
[[Image:screenshot-admin-lang-19.png|thumb|Language pack maintaining in Moodle 1.9]]&lt;br /&gt;
{{Moodle 1.9}}* From Moodle 1.9 onwards, only users with the capability [[Capabilities/moodle/site:langeditmaster|moodle/site:langeditmaster]] may modify the master language packages (i.e. those being saved in &#039;&#039;moodledata/lang/&#039;&#039;). By default, the admin role has this capability set to &amp;quot;&#039;&#039;prevent&#039;&#039;&amp;quot;. It is expected that only language maintainers will manually allow this for themselves. Language pack maintainers have an additional &amp;quot;Language pack maintaining&amp;quot; tab.&lt;br /&gt;
* From Moodle 1.9 onwards, only users with the capability [[Capabilities/moodle/site:langeditlocal|moodle/site:langeditlocal]] may customize the site translation (i.e. files being saved in &#039;&#039;moodledata/lang_local/&#039;&#039;). Admins are allowed to do this by default.&lt;br /&gt;
* Added ability to edit language files in non-standard locations, i.e. string files for various types of plugin (e.g. blocks, database presets, 3rd party modules etc.)&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Language FAQ]]&lt;br /&gt;
* [[Translation]]&lt;br /&gt;
* [[Local language]]&lt;br /&gt;
* [[Development:Places to search for lang strings]]&lt;br /&gt;
* [[Language customization]] for language editing in Moodle 2.0&lt;br /&gt;
* [http://www.moodletutorials.org/view_video.php?viewkey=4a10e0db5e4b97fc2af3 Tutorial Showing How to Change a Word or Phrase in Moodle 1.9]&lt;br /&gt;
Using Moodle forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=49150 Local language]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=78225 Editing help files]&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;br /&gt;
&lt;br /&gt;
[[es:admin/lang]]&lt;br /&gt;
[[fr:Langue]]&lt;br /&gt;
[[ja:言語]]&lt;br /&gt;
[[pt:Edição da língua]]&lt;br /&gt;
[[zh:语言]]&lt;br /&gt;
[[sk:Jazyk]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Language_customization&amp;diff=83183</id>
		<title>Language customization</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Language_customization&amp;diff=83183"/>
		<updated>2011-05-03T00:12:27Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Merged the 2.0 instructions from the Language editing page&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; This page describes how to change words or phrases in Moodle 2.0 onwards. For details of the process in versions prior to 2.0, see [[Language editing]].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}Location: &#039;&#039;Site administration &amp;gt; Language &amp;gt; Language customization&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0 onwards, words or phrases (in any language) used on the site may be easily changed using the language customization feature. For example, you may want to change the word &amp;quot;Course&amp;quot; to &amp;quot;Unit&amp;quot;. The process consists of 4 steps:&lt;br /&gt;
&lt;br /&gt;
# Check-out the strings&lt;br /&gt;
# Filter the strings you wish to customize&lt;br /&gt;
# Customize the strings&lt;br /&gt;
# Save and check-in the strings&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Quick instructions for the impatient ==&lt;br /&gt;
&lt;br /&gt;
* Go to the &#039;&#039;Site administration &amp;gt; Language&amp;gt; Language customization&#039;&#039; page.&lt;br /&gt;
* Pick the language to customize from the pull down list.&lt;br /&gt;
* Click the &amp;quot;Check out strings to translator&amp;quot; button.  And get ready for the change.&lt;br /&gt;
* Use the new &amp;quot;filter strings&amp;quot; interface to select the file to edit. Notice the files are grouped. For example, you will find the lesson strings under &amp;quot;mod&amp;quot; and moodle.php under core.&lt;br /&gt;
* After selecting the file, it is possible to use &amp;quot;string must contain&amp;quot; and other filters. For example, look at only string text that has &amp;quot;add&amp;quot; in the lesson.php set.&lt;br /&gt;
* Once you are done, you can save changes and pick another filter or PHP file to edit.&lt;br /&gt;
* When you want to save your edits, select &amp;quot;Save and check in string into files&amp;quot;.  This will store the changes you have made so all users will see them.   &lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;Tip:&#039;&#039; Do not see any string changes?  Did you remember to use the &amp;quot;Save and check in string into files&amp;quot; button? Did you refresh your browser so it is not looking at a cached page? Did you edit the language file that is actually being used in your site, course or by the user?&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
&lt;br /&gt;
Moodle is translated into many languages - see [http://download.moodle.org/langpack/2.0/] for their list and the translation completion status. The translations are distributed in so called language packages (or just lang packs) that are maintained by kind volunteers, community contributors and Moodle partners. Please read the page [[Translation]] first to understand how the whole localization machinery works.&lt;br /&gt;
&lt;br /&gt;
Moodle site administrators can customize any language pack to fit their individual needs (for example to use the term &amp;quot;Unit&amp;quot; instead of &amp;quot;Course&amp;quot;). You are discouraged from direct editing the files coming as a part official language pack. Such changes would be silently overwritten during the next upgrade. Instead, you should create a local language pack that holds all your changes from the official pack.&lt;br /&gt;
&lt;br /&gt;
Local language packs have the same structure as the official ones. They are saved in your Moodle data directory in moodledata/lang/xx_local/ folder where &#039;xx&#039; is the code of the language. You have to have the official language pack installed before you can customize it. Local language pack should contain just strings you have customized - you should not copy whole official language packs.&lt;br /&gt;
&lt;br /&gt;
When displaying a string, Moodle first looks if a local customization of it exists in moodledata/lang/xx_local/component_file.php. If so, it is used. If not, the string from the official language pack is used (eventually, if the string has not been translated yet, the original English version is displayed). Please note that the strings are cached for better performance so you have to purge Moodle caches after you modify a file in your xx_local pack (caches are purged automatically if you use the tool described below).&lt;br /&gt;
&lt;br /&gt;
== Using Language customization tool ==&lt;br /&gt;
&lt;br /&gt;
Moodle comes with a tool that allows you to edit your local language pack via web interface. This tool is available for the site administrators via block &#039;&#039;Settings &amp;gt; Site administration &amp;gt; Language &amp;gt; Language customization&#039;&#039;. Please refer to the following workflow diagram.&lt;br /&gt;
&lt;br /&gt;
[[image:customlang-process.png|800px|thumb|left|Workflow of the language customization (click to enlarge)]]&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Check out strings into translator ===&lt;br /&gt;
&lt;br /&gt;
At the Language customization first page, select a language to customize and press the button &#039;Check out string into translator&#039;. During the checkout, Moodle loads the language strings from PHP files into its database. The language customization tool works with this database so the files in your xx_local pack are not touched unless your proceed to the final step of this workflow. If the xx_local language pack does not exist yet, Moodle automatically creates an empty one for you.&lt;br /&gt;
&lt;br /&gt;
There is currently a problem with &amp;quot;execution time&amp;quot;. If you get the &amp;quot;Fatal error: Maximum execution time of 180 seconds exceeded&amp;quot; message, you will have to press the button &#039;Check out string into translator&#039; several times to get the operation completed. See [http://moodle.org/mod/forum/discuss.php?d=163375 forum discussion].&lt;br /&gt;
&lt;br /&gt;
=== Filter the strings you want to customize ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Language_string_M2_filter.png|thumb|right|Moodle 2.0 language filter]]&lt;br /&gt;
After the checkout, use the filter form provided to find strings you want to customize for your site. The following filter options are available:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Show strings of these components&#039;&#039; - if you know which component defines the string you look for (it is a second parameter of the get_string() function), choose it here. Eventually, select all options to search across all components.&lt;br /&gt;
* &#039;&#039;Customized only&#039;&#039; - check this field to display only those strings that are already present in your xx_local pack.&lt;br /&gt;
* &#039;&#039;Help only&#039;&#039;&#039; - check this field to display only help tooltips, that is the texts used when clicking the yellow question mark icon. Started in Moodle 2.0, help string identifiers must end with _help suffix.&lt;br /&gt;
* &#039;&#039;Modified only&#039;&#039; - displays only the strings that are modified in the current session. Note the difference between &#039;customized string&#039; and &#039;modified string&#039; here. We use the term &#039;customized&#039; for strings that are saved on disk in your xx_local pack directory. While the term &#039;modified&#039; represents the changes you have done since the last checkout. Customized strings (already saved in a file) are highlighted with green. Modified strings (not saved in a file yet) are highlighted with blue. You may want to use this option to overview your current work before you check it in.&lt;br /&gt;
* &#039;&#039;Only strings containing&#039;&#039; - insert a phrase that must appear in the string, either the English or the translated. For example, if you put a word &#039;student&#039; here, you will get only those strings that mention this word. This can be effectively used for mass search and replace to change the terminology you use in your Moodle site.&lt;br /&gt;
* &#039;&#039;String identifier&#039;&#039; - if you know the string identifier (it is the first parameter of the get_string() function), type it here. For example, the names of activity modules are defined in strings &#039;modulename&#039;.&lt;br /&gt;
&lt;br /&gt;
Use any combination of filter settings to get the required set of strings and press the button &#039;Show strings&#039;. We believe that the filter is powerful part of the whole tool and with clever settings it will allow you to find the required strings effectively.&lt;br /&gt;
&lt;br /&gt;
=== Input your own translation ===&lt;br /&gt;
&lt;br /&gt;
The strings that pass all the conditions defined in the filter are displayed in a table. To replace the standard translation, put your own into the field in the last column &#039;Local customization&#039;. Do not forget to save the text you input via &#039;Save and continue editing&#039; button.&lt;br /&gt;
&lt;br /&gt;
If you want to delete your current customization, just delete the content of the input field and save the translator form. The modifications that are going to remove a customized string are highlighted in red.&lt;br /&gt;
&lt;br /&gt;
=== Saving your work into files ===&lt;br /&gt;
&lt;br /&gt;
Repeat the last two steps as needed to find all the strings you want to change. When you are ready to save your work into files in xx_local language pack, press &#039;Save and check in strings into files&#039; button.&lt;br /&gt;
&lt;br /&gt;
=== Writing the modifications into files ===&lt;br /&gt;
&lt;br /&gt;
During the checkin, the contents of the translator database are dumped into files in moodledata/lang/xx_local/ directory. Note this operation removes this directory first and then re-creates it with the actual data. Therefore it is reasonable to not to touch the files directly after you have checked out them into the translator.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Language editing]] - for versions of Moodle prior to 2.0&lt;br /&gt;
&lt;br /&gt;
[[Category:Language]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83121</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83121"/>
		<updated>2011-04-29T23:24:33Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Added forum thread link into the infobox&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = [http://moodle.org/mod/forum/discuss.php?d=174346 link]&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
:: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Grade approval process and grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Raw&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Final&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;final&#039;&#039; value is populated. The container (column) holding the final value is populated during the grade &#039;&#039;approval&#039;&#039;. Whenever the gradebook tree is being recalculated, the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the final value (and break as we are finished)&lt;br /&gt;
* If there are no approval conditions defined, take the raw grade value and use it as the final value&lt;br /&gt;
* If there are some approval conditions defined, evaluate the list of conditions. If the evaluation passes, use the raw grade as the final grade value&lt;br /&gt;
* Otherwise, set the final grade to null and eventually indicate if there are some raw grade values available but on hold.&lt;br /&gt;
&lt;br /&gt;
The approval conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account only after all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking an icon or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;raw&#039;&#039; grade and the outgoing &#039;&#039;final&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
Note that by default there are no approval conditions. So the raw grades becomes automatically final grades (backward compatible behaviour). So simple scenarios are kept simple while complex scenarios possible.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approval conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;raw&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the final, overridden and raw grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the final value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the raw grade value is 0.97654. During the approval, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approval logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;br /&gt;
&lt;br /&gt;
=== Rubric support ===&lt;br /&gt;
&lt;br /&gt;
At the moment, rubric assessment tool is supported by the workshop module only. There is a demand to use rubric as a general assessment tool across all activities. Rubric gradeitems will be probably stored separately and the gradebook/rubric engine will process them, resulting in a single 0.000000 - 1.00000 value to be pushed into the representing gradebook gradeitem. Alternatively, rubric items can be stored as ordinary gradebook gradeitems but they will be hidden from the normal gradebook report (only the result of the rubric aggregation would be displayed).&lt;br /&gt;
&lt;br /&gt;
Rubric must not depend on standard scales as most rubric items will use their own scale that does not have much sense outside the context of the given rubric.&lt;br /&gt;
&lt;br /&gt;
=== Grades over 100% ===&lt;br /&gt;
&lt;br /&gt;
As this document suggests to separate the grades storage from the grade processing logic, there can be a separate gradebook engine designed as needed to process grades over 100%. Apparently the storage engine must support grade values &amp;gt; 1.00000 (and actually even grade values &amp;lt; 0.00000).&lt;br /&gt;
&lt;br /&gt;
=== Problem with different values seen by the teacher and by students ===&lt;br /&gt;
&lt;br /&gt;
The student views only show the final grades. And only final grades are exported to external systems. Teacher is able to view raw grades, too. It would be nice to have a way how the teacher could preview the final grades as they would look like if a set of raw grades were approved (dry-run approval).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Let us look at an example of how this mechanism could be used in a real course. Suppose there is a course called &amp;quot;Defence Against the Dark Arts&amp;quot; (D.A.D.A). The gradebook in that course is organized into three top categories (Autumn term, Spring term and Summer term), all using &amp;quot;Sum of grades&amp;quot; aggregation. The course total is aggregated as a sum, too.&lt;br /&gt;
&lt;br /&gt;
This is how &amp;quot;Categories and items &amp;gt; Simple view&amp;quot; gradebook page looks like. Note the semaphore (traffic light) icons. The teacher can click the semaphore icon to open a page where approval conditions for the given grade item are configured. He can add more condition or remove/modify the current ones.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex0.png]]&lt;br /&gt;
&lt;br /&gt;
The autumn term has just started and the students&#039; current task is to attempt the preliminary quiz. They already got grades for their introduction essays. Right now, some students already have got a grade for the preliminary quiz while others are still waiting for the attempt.&lt;br /&gt;
&lt;br /&gt;
The teacher has set up the grade items in the gradebook in the following way:&lt;br /&gt;
&lt;br /&gt;
* There was a condition on the &amp;quot;Introduction essay&amp;quot; that the teacher had to manually approve the grades before they became available to students. He already did so and therefore the green semaphore icon is displayed at the column heading of the grader report and the final grades are displayed normally.&lt;br /&gt;
* There is a condition on the &amp;quot;Preliminary quiz&amp;quot; that the grades will be hidden from students until the quiz closes. Because the quiz has not closed yet, there is the red semaphore icon displayed and the grades are in parentheses (round brackets) and slightly dimmed. These are raw grades available to the teacher, students can&#039;t see them yet. Once the quiz module sends a signal via gradebook API, the raw grades will be approved and will become final grades.&lt;br /&gt;
* There is a date condition on the &amp;quot;Course total&amp;quot; item so that the total grade is not available to student until the end of the school year. Again, the teacher can see the raw values but students can&#039;t.&lt;br /&gt;
* No other grade items have approval conditions defined so no semaphore icon is displayed for them. Their raw grades becomes final grade automatically and immediately - see for example &amp;quot;Category total&amp;quot; for the Autumn term category.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex1.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking the semaphore icon in the heading of the grader report executes the dry-run switch (approval or hiding the grade item) so the teacher can see how the grades would change. Clicking the green semaphore simulates hiding the grades (so the raw grades would be displayed only), clicking the red semaphore simulates approving the grades. In both cases, a big red warning at the top of the screen &amp;quot;This is just a preview&amp;quot; or so is displayed.&lt;br /&gt;
&lt;br /&gt;
Let us look closely at Hermione&#039;s grades, for instance. She got 20/20 for the introduction essay and got 10/10 for the preliminary quiz. However, she does not know the result of the quiz yet as that grade has not been approved yet. Therefore it is not aggregated into the category total. Her course total grade so far is 20/100 but again, this is not displayed to her yet.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development_talk:Gradebook_2.x_architecture&amp;diff=83120</id>
		<title>Development talk:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development_talk:Gradebook_2.x_architecture&amp;diff=83120"/>
		<updated>2011-04-29T23:23:32Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Forum link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PLEASE DO NOT USE THIS TALK PAGE ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;The issue is being discussed in the Gradebook forum. Please use the thread at http://moodle.org/mod/forum/discuss.php?d=174346 to comment on this spec&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
== Initial feedback from Tim ==&lt;br /&gt;
&lt;br /&gt;
May I commend to you the wise words:&lt;br /&gt;
: “Show me your flowcharts and conceal your tables, and I shall continue to be mystified. Show me your tables, and I won’t usually need your flowcharts; they’ll be obvious.” — Fred Brooks in “The Mythical Man-Month” 1975&lt;br /&gt;
&lt;br /&gt;
The point is, we need to work out exactly what data we will be storing, and more importantly, what the meaning of what we store is. If we get that right, then the rest should be obvious. Of course, it is not at all clear what data structure, solves all the problems. Getting that right will take a lot of thought.--[[User:Tim Hunt|Tim Hunt]] 22:46, 30 March 2011 (UTC)&lt;br /&gt;
&lt;br /&gt;
== More feedback from Tim ==&lt;br /&gt;
&lt;br /&gt;
Moodle developers&#039; chat about this: http://moodle.org/mod/cvsadmin/view.php?conversationid=7174#c266669&lt;br /&gt;
&lt;br /&gt;
From there, I am a bit worried about how the following scenarios are handled:&lt;br /&gt;
&lt;br /&gt;
Scenario 1:&lt;br /&gt;
* We have a course with a formative assessment that is open throughout the length of the course.&lt;br /&gt;
* Students can attempt the quiz at any time, and they can make multiple attempts.&lt;br /&gt;
* The grades for this formative quiz should appear in the gradebook the moment the student has finished an attempt, and should be visible to both students and teachers. (Although these grades do not affect the total course grade.)&lt;br /&gt;
&lt;br /&gt;
Scenario 2:&lt;br /&gt;
* Summative test with a deadline.&lt;br /&gt;
* Students should only see their grades in the gradebook after the deadline as passed, and then the teacher has approved the grades.&lt;br /&gt;
* Before the deadline, teachers must be able to see the grades for their students (think Separate groups) in the gradebook, to monitor progress.&lt;br /&gt;
&lt;br /&gt;
--[[User:Tim Hunt|Tim Hunt]] 06:39, 8 April 2011 (CDT)&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83070</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83070"/>
		<updated>2011-04-28T01:42:35Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = N/A&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
:: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Grade approval process and grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Raw&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Final&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;final&#039;&#039; value is populated. The container (column) holding the final value is populated during the grade &#039;&#039;approval&#039;&#039;. Whenever the gradebook tree is being recalculated, the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the final value (and break as we are finished)&lt;br /&gt;
* If there are no approval conditions defined, take the raw grade value and use it as the final value&lt;br /&gt;
* If there are some approval conditions defined, evaluate the list of conditions. If the evaluation passes, use the raw grade as the final grade value&lt;br /&gt;
* Otherwise, set the final grade to null and eventually indicate if there are some raw grade values available but on hold.&lt;br /&gt;
&lt;br /&gt;
The approval conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account only after all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking an icon or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;raw&#039;&#039; grade and the outgoing &#039;&#039;final&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
Note that by default there are no approval conditions. So the raw grades becomes automatically final grades (backward compatible behaviour). So simple scenarios are kept simple while complex scenarios possible.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approval conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;raw&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the final, overridden and raw grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the final value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the raw grade value is 0.97654. During the approval, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approval logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;br /&gt;
&lt;br /&gt;
=== Rubric support ===&lt;br /&gt;
&lt;br /&gt;
At the moment, rubric assessment tool is supported by the workshop module only. There is a demand to use rubric as a general assessment tool across all activities. Rubric gradeitems will be probably stored separately and the gradebook/rubric engine will process them, resulting in a single 0.000000 - 1.00000 value to be pushed into the representing gradebook gradeitem. Alternatively, rubric items can be stored as ordinary gradebook gradeitems but they will be hidden from the normal gradebook report (only the result of the rubric aggregation would be displayed).&lt;br /&gt;
&lt;br /&gt;
Rubric must not depend on standard scales as most rubric items will use their own scale that does not have much sense outside the context of the given rubric.&lt;br /&gt;
&lt;br /&gt;
=== Grades over 100% ===&lt;br /&gt;
&lt;br /&gt;
As this document suggests to separate the grades storage from the grade processing logic, there can be a separate gradebook engine designed as needed to process grades over 100%. Apparently the storage engine must support grade values &amp;gt; 1.00000 (and actually even grade values &amp;lt; 0.00000).&lt;br /&gt;
&lt;br /&gt;
=== Problem with different values seen by the teacher and by students ===&lt;br /&gt;
&lt;br /&gt;
The student views only show the final grades. And only final grades are exported to external systems. Teacher is able to view raw grades, too. It would be nice to have a way how the teacher could preview the final grades as they would look like if a set of raw grades were approved (dry-run approval).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Let us look at an example of how this mechanism could be used in a real course. Suppose there is a course called &amp;quot;Defence Against the Dark Arts&amp;quot; (D.A.D.A). The gradebook in that course is organized into three top categories (Autumn term, Spring term and Summer term), all using &amp;quot;Sum of grades&amp;quot; aggregation. The course total is aggregated as a sum, too.&lt;br /&gt;
&lt;br /&gt;
This is how &amp;quot;Categories and items &amp;gt; Simple view&amp;quot; gradebook page looks like. Note the semaphore (traffic light) icons. The teacher can click the semaphore icon to open a page where approval conditions for the given grade item are configured. He can add more condition or remove/modify the current ones.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex0.png]]&lt;br /&gt;
&lt;br /&gt;
The autumn term has just started and the students&#039; current task is to attempt the preliminary quiz. They already got grades for their introduction essays. Right now, some students already have got a grade for the preliminary quiz while others are still waiting for the attempt.&lt;br /&gt;
&lt;br /&gt;
The teacher has set up the grade items in the gradebook in the following way:&lt;br /&gt;
&lt;br /&gt;
* There was a condition on the &amp;quot;Introduction essay&amp;quot; that the teacher had to manually approve the grades before they became available to students. He already did so and therefore the green semaphore icon is displayed at the column heading of the grader report and the final grades are displayed normally.&lt;br /&gt;
* There is a condition on the &amp;quot;Preliminary quiz&amp;quot; that the grades will be hidden from students until the quiz closes. Because the quiz has not closed yet, there is the red semaphore icon displayed and the grades are in parentheses (round brackets) and slightly dimmed. These are raw grades available to the teacher, students can&#039;t see them yet. Once the quiz module sends a signal via gradebook API, the raw grades will be approved and will become final grades.&lt;br /&gt;
* There is a date condition on the &amp;quot;Course total&amp;quot; item so that the total grade is not available to student until the end of the school year. Again, the teacher can see the raw values but students can&#039;t.&lt;br /&gt;
* No other grade items have approval conditions defined so no semaphore icon is displayed for them. Their raw grades becomes final grade automatically and immediately - see for example &amp;quot;Category total&amp;quot; for the Autumn term category.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex1.png]]&lt;br /&gt;
&lt;br /&gt;
Clicking the semaphore icon in the heading of the grader report executes the dry-run switch (approval or hiding the grade item) so the teacher can see how the grades would change. Clicking the green semaphore simulates hiding the grades (so the raw grades would be displayed only), clicking the red semaphore simulates approving the grades. In both cases, a big red warning at the top of the screen &amp;quot;This is just a preview&amp;quot; or so is displayed.&lt;br /&gt;
&lt;br /&gt;
Let us look closely at Hermione&#039;s grades, for instance. She got 20/20 for the introduction essay and got 10/10 for the preliminary quiz. However, she does not know the result of the quiz yet as that grade has not been approved yet. Therefore it is not aggregated into the category total. Her course total grade so far is 20/100 but again, this is not displayed to her yet.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex0.png&amp;diff=83069</id>
		<title>File:gradebook-buffer-ex0.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex0.png&amp;diff=83069"/>
		<updated>2011-04-28T01:35:11Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: uploaded a new version of &amp;amp;quot;File:gradebook-buffer-ex0.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example structure of a demo gradebook&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83068</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83068"/>
		<updated>2011-04-28T01:29:11Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Example and first mockups&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = N/A&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
:: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Grade approval process and grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Raw&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Final&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;final&#039;&#039; value is populated. The container (column) holding the final value is populated during the grade &#039;&#039;approval&#039;&#039;. Whenever the gradebook tree is being recalculated, the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the final value (and break as we are finished)&lt;br /&gt;
* If there are no approval conditions defined, take the raw grade value and use it as the final value&lt;br /&gt;
* If there are some approval conditions defined, evaluate the list of conditions. If the evaluation passes, use the raw grade as the final grade value&lt;br /&gt;
* Otherwise, set the final grade to null and eventually indicate if there are some raw grade values available but on hold.&lt;br /&gt;
&lt;br /&gt;
The approval conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account only after all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking an icon or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;raw&#039;&#039; grade and the outgoing &#039;&#039;final&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
Note that by default there are no approval conditions. So the raw grades becomes automatically final grades (backward compatible behaviour). So simple scenarios are kept simple while complex scenarios possible.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approval conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;raw&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the final, overridden and raw grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the final value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the raw grade value is 0.97654. During the approval, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approval logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;br /&gt;
&lt;br /&gt;
=== Rubric support ===&lt;br /&gt;
&lt;br /&gt;
At the moment, rubric assessment tool is supported by the workshop module only. There is a demand to use rubric as a general assessment tool across all activities. Rubric gradeitems will be probably stored separately and the gradebook/rubric engine will process them, resulting in a single 0.000000 - 1.00000 value to be pushed into the representing gradebook gradeitem. Alternatively, rubric items can be stored as ordinary gradebook gradeitems but they will be hidden from the normal gradebook report (only the result of the rubric aggregation would be displayed).&lt;br /&gt;
&lt;br /&gt;
Rubric must not depend on standard scales as most rubric items will use their own scale that does not have much sense outside the context of the given rubric.&lt;br /&gt;
&lt;br /&gt;
=== Grades over 100% ===&lt;br /&gt;
&lt;br /&gt;
As this document suggests to separate the grades storage from the grade processing logic, there can be a separate gradebook engine designed as needed to process grades over 100%. Apparently the storage engine must support grade values &amp;gt; 1.00000 (and actually even grade values &amp;lt; 0.00000).&lt;br /&gt;
&lt;br /&gt;
=== Problem with different values seen by the teacher and by students ===&lt;br /&gt;
&lt;br /&gt;
The student views only show the final grades. And only final grades are exported to external systems. Teacher is able to view raw grades, too. It would be nice to have a way how the teacher could preview the final grades as they would look like if a set of raw grades were approved (dry-run approval).&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
Let us look at an example of how this mechanism could be used in a real course. Suppose there is a course called &amp;quot;Defence Against the Dark Arts&amp;quot; (D.A.D.A). The gradebook in that course is organized into three top categories (Autumn term, Spring term and Summer term), all using &amp;quot;Sum of grades&amp;quot; aggregation. The course total is aggregated as a sum, too.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex0.png]]&lt;br /&gt;
&lt;br /&gt;
The autumn term has just started and the students&#039; current task is to attempt the preliminary quiz. They already got grades for their introduction essays. Right now, some students already have got a grade for the preliminary quiz while others are still waiting for the attempt.&lt;br /&gt;
&lt;br /&gt;
The teacher has set up the grade items in the gradebook in the following way:&lt;br /&gt;
&lt;br /&gt;
* There was a condition on the &amp;quot;Introduction essay&amp;quot; that the teacher had to manually approve the grades before they became available to students. He already did so and therefore the green semaphore icon is displayed at the column heading of the grader report and the final grades are displayed normally.&lt;br /&gt;
* There is a condition on the &amp;quot;Preliminary quiz&amp;quot; that the grades will be hidden from students until the quiz closes. Because the quiz has not closed yet, there is the red semaphore icon displayed and the grades are in parentheses (round brackets) and slightly dimmed. These are raw grades available to the teacher, students can&#039;t see them yet. Once the quiz module sends a signal via gradebook API, the raw grades will be approved and will become final grades.&lt;br /&gt;
* There is a date condition on the &amp;quot;Course total&amp;quot; item so that the total grade is not available to student until the end of the school year. Again, the teacher can see the raw values but students can&#039;t.&lt;br /&gt;
* No other grade items have approval conditions defined so no semaphore icon is displayed for them. Their raw grades becomes final grade automatically and immediately - see for example &amp;quot;Category total&amp;quot; for the Autumn term category.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer-ex1.png]]&lt;br /&gt;
&lt;br /&gt;
The teacher can click the semaphore icon to open a page where approval conditions are configured. He can add more condition or remove/modify the current ones. Alternatively, clicking the semaphore can execute the dry-run approval so the teacher would see how the grades look like if the grade items is approved (with a big red warning at the top of the screen &amp;quot;This is just a preview&amp;quot; or so).&lt;br /&gt;
&lt;br /&gt;
Let us look closely at Hermione&#039;s grades. She got 20/20 for the introduction essay and got 10/10 for the preliminary quiz. However, she does not know the result of the quiz yet as that grade has not been approved yet. Therefore it is not aggregated into the category total. Her course total grade so far is 20/100 but again, this is not displayed to her yet.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex1.png&amp;diff=83066</id>
		<title>File:gradebook-buffer-ex1.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex1.png&amp;diff=83066"/>
		<updated>2011-04-28T00:20:45Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: UI mockup of the new gradebook features&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;UI mockup of the new gradebook features&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex0.png&amp;diff=83065</id>
		<title>File:gradebook-buffer-ex0.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer-ex0.png&amp;diff=83065"/>
		<updated>2011-04-28T00:19:39Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Example structure of a demo gradebook&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Example structure of a demo gradebook&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer.png&amp;diff=83064</id>
		<title>File:gradebook-buffer.png</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=File:gradebook-buffer.png&amp;diff=83064"/>
		<updated>2011-04-27T23:10:04Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: uploaded a new version of &amp;amp;quot;File:gradebook-buffer.png&amp;amp;quot;: Terminology change&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83063</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=83063"/>
		<updated>2011-04-27T23:04:52Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Terminology change and added some notes from the meeting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = N/A&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
:: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Grade approval process and grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Raw&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Final&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;final&#039;&#039; value is populated. The container (column) holding the final value is populated during the grade &#039;&#039;approval&#039;&#039;. Whenever the gradebook tree is being recalculated, the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the final value (and break as we are finished)&lt;br /&gt;
* If there are no approval conditions defined, take the raw grade value and use it as the final value&lt;br /&gt;
* If there are some approval conditions defined, evaluate the list of conditions. If the evaluation passes, use the raw grade as the final grade value&lt;br /&gt;
* Otherwise, set the final grade to null and eventually indicate if there are some raw grade values available but on hold.&lt;br /&gt;
&lt;br /&gt;
The approval conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account only after all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking an icon or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;raw&#039;&#039; grade and the outgoing &#039;&#039;final&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
Note that by default there are no approval conditions. So the raw grades becomes automatically final grades (backward compatible behaviour). So simple scenarios are kept simple while complex scenarios possible.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approval conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;raw&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the final, overridden and raw grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the final value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the raw grade value is 0.97654. During the approval, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approval logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;br /&gt;
&lt;br /&gt;
=== Rubric support ===&lt;br /&gt;
&lt;br /&gt;
At the moment, rubric assessment tool is supported by the workshop module only. There is a demand to use rubric as a general assessment tool across all activities. Rubric gradeitems will be probably stored separately and the gradebook/rubric engine will process them, resulting in a single 0.000000 - 1.00000 value to be pushed into the representing gradebook gradeitem. Alternatively, rubric items can be stored as ordinary gradebook gradeitems but they will be hidden from the normal gradebook report (only the result of the rubric aggregation would be displayed).&lt;br /&gt;
&lt;br /&gt;
Rubric must not depend on standard scales as most rubric items will use their own scale that does not have much sense outside the context of the given rubric.&lt;br /&gt;
&lt;br /&gt;
=== Grades over 100% ===&lt;br /&gt;
&lt;br /&gt;
As this document suggests to separate the grades storage from the grade processing logic, there can be a separate gradebook engine designed as needed to process grades over 100%. Apparently the storage engine must support grade values &amp;gt; 1.00000 (and actually even grade values &amp;lt; 0.00000).&lt;br /&gt;
&lt;br /&gt;
=== Problem with different values seen by the teacher and by students ===&lt;br /&gt;
&lt;br /&gt;
The student views only show the final grades. And only final grades are exported to external systems. Teacher is able to view raw grades, too. It would be nice to have a way how the teacher could preview the final grades as they would look like if a set of raw grades were approved (dry-run approval).&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=83060</id>
		<title>User:David Mudrak</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=83060"/>
		<updated>2011-04-27T11:50:11Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* How to motivate me */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:mudrd8mz.jpg|right]] Hi! Welcome to my profile page. I am one of [http://moodle.com/hq Moodle HQ] developers, but my background includes ICT teaching and research into the theory of education. I am the author of several Moodle extensions and customizations. I translate Moodle into Czech and run Czech Moodle portal [http://moodle.cz moodle.cz].&lt;br /&gt;
&lt;br /&gt;
==How to motivate me==&lt;br /&gt;
&lt;br /&gt;
Would you like to support yet another code monkey? [[User:David Mudrak/Postcard|Send me a postcard!]]&lt;br /&gt;
&lt;br /&gt;
==Standard color scheme I use in my code==&lt;br /&gt;
&lt;br /&gt;
The first value is web safe but I like the second one more&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;background: #EEEE22;&amp;quot; | #EEEE22 #f3f2aa&lt;br /&gt;
| style=&amp;quot;background: #AAEEAA;&amp;quot; | #AAEEAA #e7f1c3&lt;br /&gt;
| style=&amp;quot;background: #AACCEE;&amp;quot; | #AACCEE #d2ebff&lt;br /&gt;
| style=&amp;quot;background: #EEAAAA;&amp;quot; | #EEAAAA #ffd3d9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My contributions==&lt;br /&gt;
&lt;br /&gt;
* [[Workshop module]]&lt;br /&gt;
* [[Translation|Moodle language translation tool]]&lt;br /&gt;
* [[Course contents block]]&lt;br /&gt;
* [[Subcourse module]]&lt;br /&gt;
* [[Stamp Collection module]]&lt;br /&gt;
* [[Course ordering and invoicing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My images==&lt;br /&gt;
&lt;br /&gt;
[[Image:question-categories.png|thumb|left]]&lt;br /&gt;
[[Image:question-contexts.png|thumb|left]]&lt;br /&gt;
[[Image:workshop_grades_calculation.png|thumb|left]]&lt;br /&gt;
[[Image:uml_output_renderers.png|thumb|left]]&lt;br /&gt;
[[Image:versions.png|thumb|left]]&lt;br /&gt;
[[Image:branches.png|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My drafts==&lt;br /&gt;
&lt;br /&gt;
* [[Using GIT to backup moodledata]]&lt;br /&gt;
* [[Obsolete:Tutorial on using git in Moodle development]]&lt;br /&gt;
* [[Development:Commit cheat sheet]]&lt;br /&gt;
&lt;br /&gt;
==My bookmarks==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Places to search for lang strings]]&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous== &lt;br /&gt;
&lt;br /&gt;
* [[User:David Mudrak/vimrc|~/.vimrc]] - ViM configuration I use for Moodle development&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak/Postcard&amp;diff=83059</id>
		<title>User:David Mudrak/Postcard</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak/Postcard&amp;diff=83059"/>
		<updated>2011-04-27T11:49:40Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To motivate David for further work on Moodle, please send a postcard of your place to the following address. It will make yet another code monkey happy :-)&lt;br /&gt;
&lt;br /&gt;
    David Mudrak&lt;br /&gt;
    Jecna 488/23&lt;br /&gt;
    Liberec&lt;br /&gt;
    460 15&lt;br /&gt;
    Czech Republic&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak/Postcard&amp;diff=83058</id>
		<title>User:David Mudrak/Postcard</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak/Postcard&amp;diff=83058"/>
		<updated>2011-04-27T11:44:03Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Created page with &amp;quot;To motivate David for further work on Moodle, please send a postcard of your place to the following address. It will make yet another coding monkey happy :-)      David Mudrak   ...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;To motivate David for further work on Moodle, please send a postcard of your place to the following address. It will make yet another coding monkey happy :-)&lt;br /&gt;
&lt;br /&gt;
    David Mudrak&lt;br /&gt;
    Jecna 488/23&lt;br /&gt;
    Liberec&lt;br /&gt;
    460 15&lt;br /&gt;
    Czech Republic&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=83057</id>
		<title>User:David Mudrak</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=User:David_Mudrak&amp;diff=83057"/>
		<updated>2011-04-27T11:39:31Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:mudrd8mz.jpg|right]] Hi! Welcome to my profile page. I am one of [http://moodle.com/hq Moodle HQ] developers, but my background includes ICT teaching and research into the theory of education. I am the author of several Moodle extensions and customizations. I translate Moodle into Czech and run Czech Moodle portal [http://moodle.cz moodle.cz].&lt;br /&gt;
&lt;br /&gt;
==How to motivate me==&lt;br /&gt;
&lt;br /&gt;
Would you like to support yet another coding monkey? [[User:David Mudrak/Postcard|Send me a postcard!]]&lt;br /&gt;
&lt;br /&gt;
==Standard color scheme I use in my code==&lt;br /&gt;
&lt;br /&gt;
The first value is web safe but I like the second one more&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
| style=&amp;quot;background: #EEEE22;&amp;quot; | #EEEE22 #f3f2aa&lt;br /&gt;
| style=&amp;quot;background: #AAEEAA;&amp;quot; | #AAEEAA #e7f1c3&lt;br /&gt;
| style=&amp;quot;background: #AACCEE;&amp;quot; | #AACCEE #d2ebff&lt;br /&gt;
| style=&amp;quot;background: #EEAAAA;&amp;quot; | #EEAAAA #ffd3d9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My contributions==&lt;br /&gt;
&lt;br /&gt;
* [[Workshop module]]&lt;br /&gt;
* [[Translation|Moodle language translation tool]]&lt;br /&gt;
* [[Course contents block]]&lt;br /&gt;
* [[Subcourse module]]&lt;br /&gt;
* [[Stamp Collection module]]&lt;br /&gt;
* [[Course ordering and invoicing]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My images==&lt;br /&gt;
&lt;br /&gt;
[[Image:question-categories.png|thumb|left]]&lt;br /&gt;
[[Image:question-contexts.png|thumb|left]]&lt;br /&gt;
[[Image:workshop_grades_calculation.png|thumb|left]]&lt;br /&gt;
[[Image:uml_output_renderers.png|thumb|left]]&lt;br /&gt;
[[Image:versions.png|thumb|left]]&lt;br /&gt;
[[Image:branches.png|thumb|left]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;both&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==My drafts==&lt;br /&gt;
&lt;br /&gt;
* [[Using GIT to backup moodledata]]&lt;br /&gt;
* [[Obsolete:Tutorial on using git in Moodle development]]&lt;br /&gt;
* [[Development:Commit cheat sheet]]&lt;br /&gt;
&lt;br /&gt;
==My bookmarks==&lt;br /&gt;
&lt;br /&gt;
* [[Development:Places to search for lang strings]]&lt;br /&gt;
&lt;br /&gt;
==Miscellaneous== &lt;br /&gt;
&lt;br /&gt;
* [[User:David Mudrak/vimrc|~/.vimrc]] - ViM configuration I use for Moodle development&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=82751</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=82751"/>
		<updated>2011-04-14T07:46:18Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Current issues */ fixed a typo in the comment alignment&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = N/A&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
:: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Introducing grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Available&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Effectual&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;effectual&#039;&#039; value is populated. The container (column) holding the effectual value is populated during the grade &#039;&#039;approbation&#039;&#039;. Whenever a process of approbation is executed (typically during the recalculation of the gradebook tree), the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the effectual value (and break as we are finished)&lt;br /&gt;
* If there are no approbation conditions defined, take the available grade value and use it as the effectual value&lt;br /&gt;
* If there are some approbation conditions defined, evaluate the list of conditions. If the evaluation passes, use the available grade as the effectual grade value&lt;br /&gt;
&lt;br /&gt;
The approbation conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account when all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking a button or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;available&#039;&#039; grade and the outgoing &#039;&#039;effectual&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approbation conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;available&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the effectual, overridden and available grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the effectual value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the available grade value is 0.97654. During the approbation, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approbation logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=82750</id>
		<title>Development:Gradebook 2.x architecture</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Gradebook_2.x_architecture&amp;diff=82750"/>
		<updated>2011-04-14T07:45:35Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: The primary design goal and the grade values location in response to Eloy&amp;#039;s note&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Gradebook 2.x architecture&lt;br /&gt;
|state = Planning&lt;br /&gt;
|tracker = MDL-25423&lt;br /&gt;
|discussion = N/A&lt;br /&gt;
|assignee = unassigned&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
This page summarizes some initial ideas and suggestions that may help to resolve [[Development:Gradebook improvements#Stage 3|Stage 3]] of the Gradebook improvements project.&lt;br /&gt;
&lt;br /&gt;
== Current issues ==&lt;br /&gt;
&lt;br /&gt;
These are some of the most important issues with the current Gradebook design that this spec tries to deal with. See http://www.mindmeister.com/89537697/gradebook-2-x-issues-braindump for the full record of the braindumping session.&lt;br /&gt;
&lt;br /&gt;
; The grades appear in the gradebook immediately (MDL-25439) : The grade values are stateless. We need a way how to store grades in the gradebook but exclude them from aggregations yet. Currently, the &#039;&#039;hiddenuntil&#039;&#039; feature tries to solve this but it is pretty limited and hacky (MDL-25440).&lt;br /&gt;
; Students and teachers may see different values : Because of how grades hiding is implemented currently, it is practically impossible to pre-populate whole grades tree and/or export reliable data (because they are dependent on the current role permissions).&lt;br /&gt;
; Unable to alter grades processing : There is a demand for alternate methods of grades processing (eg grades over 100% or negative grades) due to local conventions in various countries and school systems.&lt;br /&gt;
; Grading logic and UI implemented in activity modules : Grading tools like single point grade, scale-based grading or a new rubric-based grading should be handled by the Gradebook core with a rich set of interface toward activity modules (and eventually other plugin types).&lt;br /&gt;
; Manual and auto grades interaction : What should happen in this scenario has never been defined: 1. Student makes first attempt at the quiz, gets grade of 50%, this is pushed to the gradebook. 2. Teacher manually edits the grade to be 60%. 3. Student makes second quiz attempt and scores 75%. What should the gradebook show now? -- Tim Hunt&lt;br /&gt;
&amp;quot;: a similar situation happens in AMOS when the original English text is modified after it has been translated. If we record the timestamps, we can highlight such overridden grade as &amp;quot;outdated&amp;quot; (with a possibility to mark it as up-to-date hence un-highlight it). Still the manually edited value 60% should be the valid one IMHO --[[User:David Mudrak|David Mudrak]] 15:45, 14 April 2011 (WST)&lt;br /&gt;
&lt;br /&gt;
== Suggested solutions and improvements ==&lt;br /&gt;
&lt;br /&gt;
The goal is to make the gradebook so that &#039;&#039;&#039;simple things are easy and complex things are possible&#039;&#039;&#039;. That is for courses that just need to maintain a list of graded activities and calculate the final grade, the setup for teacher should be straightforward using default values. Advanced usage with a complex tree of grade items and calculations happening at several layers should be possible, though the setup may require more experience and insight into the internals.&lt;br /&gt;
&lt;br /&gt;
According to this document, the gradebook to be still represented as a tree of grade items. There is no need to change this. Grade items may be associated with an activity module (multiple grade items per mod are supported) or a gradebook category. Grades are aggregated from the leaves of the tree to the root grade item that represents the total course grade.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-tree.png]]&lt;br /&gt;
&lt;br /&gt;
In the example above, there are two grade items associated with modules in the course. These two are aggregated into a single item associated with a grades category. This category grade item is aggregated together with yet another grade item (that itself is populated via grader report) and form the course total grade.&lt;br /&gt;
&lt;br /&gt;
=== Grades in core space or plugin space ===&lt;br /&gt;
&lt;br /&gt;
Generally the grade values are to be stored by the gradebook in its own core tables. This will centralize and unify the storage and processing of the grades. For most modules like Assignment, Forum, Wiki, Database etc. (and eventually other plugin types like blocks if we ever decide to support grades there, too) this is enough as they do not need to keep the grades in their own tables.&lt;br /&gt;
&lt;br /&gt;
This does not mean that the modules would be forced to give up advanced grades processing features. For example Quiz or Workshop modules must store a lot of additional data to calculate the final grades. So the Quiz will still hold the calculated grades for all user&#039;s attempts. But it will push the valid one (best attempt, average, maximum or whatever is set) to the gradebook. Similarly the Workshop will hold the information how the assessment forms were filled by peers. But the final grades for each student will be pushed into the gradebook tables via some nice API.&lt;br /&gt;
&lt;br /&gt;
=== Introducing grade values states ===&lt;br /&gt;
&lt;br /&gt;
This is a suggestion to extend the grade_grades table so that every grade item can actually hold three independent values:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Available&#039;&#039; grade value - This is the value that comes from the source - from the activity module, from the grader report or as a result of the aggregation at lower levels. It behaves as an input buffer that just keeps the most recent incoming value.&lt;br /&gt;
* &#039;&#039;Overridden&#039;&#039; grade value - This is the value of the grade defined in the gradebook.&lt;br /&gt;
* &#039;&#039;Effectual&#039;&#039; grade value - This is a public value of the grade, it is used for aggregations at higher levels, it is being exported, displayed to users etc.&lt;br /&gt;
&lt;br /&gt;
[[image:gradebook-buffer.png]]&lt;br /&gt;
&lt;br /&gt;
The key point of this new scheme is how and when the &#039;&#039;effectual&#039;&#039; value is populated. The container (column) holding the effectual value is populated during the grade &#039;&#039;approbation&#039;&#039;. Whenever a process of approbation is executed (typically during the recalculation of the gradebook tree), the following procedure is taken:&lt;br /&gt;
&lt;br /&gt;
* If the value of overridden grade is not null, then use it as the effectual value (and break as we are finished)&lt;br /&gt;
* If there are no approbation conditions defined, take the available grade value and use it as the effectual value&lt;br /&gt;
* If there are some approbation conditions defined, evaluate the list of conditions. If the evaluation passes, use the available grade as the effectual grade value&lt;br /&gt;
&lt;br /&gt;
The approbation conditions mechanism should support at least the following types of conditions:&lt;br /&gt;
&lt;br /&gt;
* Date-based conditions - This would replace the current hidden-until feature&lt;br /&gt;
* Event-based conditions - Things like &amp;quot;take the grades into account when all submissions are assessed&amp;quot;&lt;br /&gt;
* Manual trigger - special type of an event. The teacher can easily order the gradebook to &amp;quot;take the grades into account NOW&amp;quot; by clicking a button or so&lt;br /&gt;
&lt;br /&gt;
At the moment, we are unable to distinguish between the incoming &#039;&#039;available&#039;&#039; grade and the outgoing &#039;&#039;effectual&#039;&#039; grade value. Therefore it is not easy to put a grade on hold. For teachers in schools, it is pretty natural to have some grades already known but not having them counted into the total grade yet.&lt;br /&gt;
&lt;br /&gt;
To be decided: do the conditions have to pass to take the overridden value into account, too? That is - if there are some approbation conditions defined, is the overridden value dependent on them or not?&lt;br /&gt;
&lt;br /&gt;
=== Grade values and their interpretation and display ===&lt;br /&gt;
&lt;br /&gt;
Currently, grading configuration (like max grade, grade type etc) is stored by modules themselves, often independently on the associated grade item settings. This is a proposal to change it so:&lt;br /&gt;
&lt;br /&gt;
* The modules themselves do not know anything about the actual grade setting. That is, they do not know max grade, min grade, the grade display type etc.&lt;br /&gt;
* All the grade items settings is stored and controlled exclusively by the the gradebook code&lt;br /&gt;
* There is a callback mechanism introduced so that the gradebook can push the required grades setting into the mod_edit form and the module settings node in the Settings block (compare with how enrol plugins push their settings into the course edit form and how they have their own setting in the course settings node)&lt;br /&gt;
* When pushing a grade into the gradebook (so that is saved as the &#039;&#039;available&#039;&#039; grade value - see above), the activity module uses normalized decimal value from 0.00000 to 1.00000.&lt;br /&gt;
* The activity can ask the gradebook via its public API to format a given float value according the current grade item settings. &amp;quot;Hey gradebook, this student reached 0.81076. What shall I print to them?&amp;quot; and the gradebook would return &amp;quot;4/5&amp;quot; or &amp;quot;pretty good&amp;quot; or &amp;quot;81%&amp;quot; or whatever is defined there.&lt;br /&gt;
&lt;br /&gt;
So the effectual, overridden and available grade values are stored as normalized 0.00000 - 1.00000 decimals in grade_grades. Their actual interpretation depends on the grade item settings.&lt;br /&gt;
&lt;br /&gt;
Question: should the effectual value depend on the actual grade item type? Example: let us have a grade item the type of which is three-points scale 1, 2, 3 and the available grade value is 0.97654. During the approbation, should the value be transformed to 1.00000 or should it stay original?&lt;br /&gt;
&lt;br /&gt;
=== Introducing gradebook engines ===&lt;br /&gt;
&lt;br /&gt;
The grade values stored in the tree and the aggregation and approbation logic will be separated. Right now, the grade item itself contain the computation logic. A new class, so called gradebook engine, will be responsible for all grade values handling in the future. This should be pluggable and OOP-ish. This way, we should be able to implement alternative calculation engines, for example one that does not strip normalized values to &amp;lt;0; 1&amp;gt; interval but supports grades over 100% or negative grades.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82614</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82614"/>
		<updated>2011-04-07T08:43:54Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Provide clear and operational instructions to test your patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can consider this page as a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
== Split your work into a logical set of patches ==&lt;br /&gt;
&lt;br /&gt;
Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
== Provide clear commit messages ==&lt;br /&gt;
&lt;br /&gt;
Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
== Names in the commit message ==&lt;br /&gt;
&lt;br /&gt;
Retain the authorship of the patch. If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter. Make sure that your &#039;&#039;real&#039;&#039; name and contact email are recorded in patch. We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
== Provide clear and operational instructions to test your patch ==&lt;br /&gt;
&lt;br /&gt;
In the PULL request, please describe how the change can be tested. Please avoid vague phrases like &amp;quot;Make sure there is no regression in the core&amp;quot; or &amp;quot;Test all places where XXX is used&amp;quot;. Also, try to avoid requiring resources that are really difficult to gather, if possible - as in &amp;quot;Use production data from a server with 100.000+ students&amp;quot;. In most cases, the instructions for testers should go into the PULL request to make the tester&#039;s life easier. If the instructions are elsewhere (for example they were provided by the reported in the linked MDL as a part of steps to reproduce), please inform testers in the PULL request where they can find them.&lt;br /&gt;
&lt;br /&gt;
It helps if you state your estimation of the testing difficulty so that testers can pick issues for them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Easy&#039;&#039; (average community member should be able to test it) - can be tested pretty easily via the web interface only at a public test site&lt;br /&gt;
* &#039;&#039;Moderate&#039;&#039; (knowledgeable administrator should be able to test it) - requires local installation, for example to test some 1.9 -&amp;gt; 2.0 upgrade steps or some non-standard environment (for example MNet features, specific platform etc)&lt;br /&gt;
* &#039;&#039;Hard&#039;&#039; (development skills are required to test it) - for example may require data hacking at SQL level to simulate data corruption or modifying the code to reproduce the problem&lt;br /&gt;
&lt;br /&gt;
Example of instructions for testers:&lt;br /&gt;
&lt;br /&gt;
    INSTRUCTIONS FOR TESTING (difficulty: easy, requires teacher access to a course)&amp;lt;br /&amp;gt;&lt;br /&gt;
    1. Log in as a teacher and go to a course (you can use some of yours or restore the attached .mbz backup)&lt;br /&gt;
    2. Turn editing mode on&lt;br /&gt;
    3. TEST: Make sure that the control icons appear next to the activity titles&lt;br /&gt;
    4. Turn editing mode off&lt;br /&gt;
    5. TEST: Make sure that the control icons are not displayed now&lt;br /&gt;
&lt;br /&gt;
== Introducing new strings ==&lt;br /&gt;
&lt;br /&gt;
Firstly, think twice and try to think in a non-English language. Any string you introduce is supposed to be translated by translators who usually do it for free in their own time. Do not waste their time by using get_string() for debugging messages that are likely to almost never appear. It is warmly recommended to let Helen review your strings before you submit them. This way we can keep the terminology and the style consistent. When introducing new strings, keep them alphabetically sorted. Using a self-descriptive names of the string identifier and the placeholder properties helps the translators to guess the context. Compare the following&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;grade&#039;] = &#039;Grade {$a}&#039;;&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;maxgradevalue&#039;] = &#039;Grade {$a-&amp;gt;value}&#039;;&lt;br /&gt;
&lt;br /&gt;
In the first case, it is pretty difficult to guess whether the &amp;quot;Grade&amp;quot; in the string is a noun (as in &amp;quot;Grade 12/30&amp;quot;) or a verb (as in &amp;quot;Grade submission&amp;quot;). In many languages, the translation depends on it. The second case is more self-descriptive as it indicates that the placeholder will contain a value.&lt;br /&gt;
&lt;br /&gt;
See [[Development:Help strings]] if you are introducing a new help string.&lt;br /&gt;
&lt;br /&gt;
== Include AMOS script in the commit if needed ==&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message. Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82613</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82613"/>
		<updated>2011-04-07T08:41:02Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Introducing new strings */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can consider this page as a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
== Split your work into a logical set of patches ==&lt;br /&gt;
&lt;br /&gt;
Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
== Provide clear commit messages ==&lt;br /&gt;
&lt;br /&gt;
Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
== Names in the commit message ==&lt;br /&gt;
&lt;br /&gt;
Retain the authorship of the patch. If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter. Make sure that your &#039;&#039;real&#039;&#039; name and contact email are recorded in patch. We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
== Provide clear and operational instructions to test your patch ==&lt;br /&gt;
&lt;br /&gt;
In the PULL request, please describe how the change can be tested. Please avoid vague phrases like &amp;quot;Make sure there is no regression in the core&amp;quot; or &amp;quot;Test all places where XXX is used&amp;quot;. Also, try to avoid requiring resources that are really difficult to gather, if possible - as in &amp;quot;Use production data from a server with 100.000+ students&amp;quot;. The instructions can be put into the linked MDL, please instruct testers in the PULL request where they can find them.&lt;br /&gt;
&lt;br /&gt;
It helps if you state your estimation of the testing difficulty so that testers can pick issues for them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Easy&#039;&#039; (average community member should be able to test it) - can be tested pretty easily via the web interface only at a public test site&lt;br /&gt;
* &#039;&#039;Moderate&#039;&#039; (knowledgeable administrator should be able to test it) - requires local installation, for example to test some 1.9 -&amp;gt; 2.0 upgrade steps or some non-standard environment (for example MNet features, specific platform etc)&lt;br /&gt;
* &#039;&#039;Hard&#039;&#039; (development skills are required to test it) - for example may require data hacking at SQL level to simulate data corruption or modifying the code to reproduce the problem&lt;br /&gt;
&lt;br /&gt;
Example of instructions for testers:&lt;br /&gt;
&lt;br /&gt;
    INSTRUCTIONS FOR TESTING (difficulty: easy, requires teacher access to a course)&amp;lt;br /&amp;gt;&lt;br /&gt;
    1. Log in as a teacher and go to a course (you can use some of yours or restore the attached .mbz backup)&lt;br /&gt;
    2. Turn editing mode on&lt;br /&gt;
    3. TEST: Make sure that the control icons appear next to the activity titles&lt;br /&gt;
    4. Turn editing mode off&lt;br /&gt;
    5. TEST: Make sure that the control icons are not displayed now&lt;br /&gt;
&lt;br /&gt;
== Introducing new strings ==&lt;br /&gt;
&lt;br /&gt;
Firstly, think twice and try to think in a non-English language. Any string you introduce is supposed to be translated by translators who usually do it for free in their own time. Do not waste their time by using get_string() for debugging messages that are likely to almost never appear. It is warmly recommended to let Helen review your strings before you submit them. This way we can keep the terminology and the style consistent. When introducing new strings, keep them alphabetically sorted. Using a self-descriptive names of the string identifier and the placeholder properties helps the translators to guess the context. Compare the following&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;grade&#039;] = &#039;Grade {$a}&#039;;&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;maxgradevalue&#039;] = &#039;Grade {$a-&amp;gt;value}&#039;;&lt;br /&gt;
&lt;br /&gt;
In the first case, it is pretty difficult to guess whether the &amp;quot;Grade&amp;quot; in the string is a noun (as in &amp;quot;Grade 12/30&amp;quot;) or a verb (as in &amp;quot;Grade submission&amp;quot;). In many languages, the translation depends on it. The second case is more self-descriptive as it indicates that the placeholder will contain a value.&lt;br /&gt;
&lt;br /&gt;
See [[Development:Help strings]] if you are introducing a new help string.&lt;br /&gt;
&lt;br /&gt;
== Include AMOS script in the commit if needed ==&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message. Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82608</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82608"/>
		<updated>2011-04-07T07:02:31Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Preparing a patch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and ask for their inclusion via so called [[Development:PULL request|PULL request]]&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_19_STABLE MOODLE_20_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
After some time contributing to Moodle you would have a lot of branches both in your local repository and in your public repository. To prune their list and delete those that were accepted by upstream, use the following&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream                                      (1)&lt;br /&gt;
    git branch --merged upstream/master                     (2)&lt;br /&gt;
    git branch --merged upstream/MOODLE_20_STABLE           (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) fetches the changes from your upstream repository at git.moodle.org (remember that git-fetch does not modify your working dir so it is safe to run it whenever). Command (2) and (3) print all branches that are merged into the upstream master branch and MOODLE_20_STABLE branch, respectively. To delete these local branches, use&lt;br /&gt;
&lt;br /&gt;
    git branch -d MDL-xxxxx-accepted-branch&lt;br /&gt;
&lt;br /&gt;
The similar approach can be used to check the branches published at your origin repository at github.com&lt;br /&gt;
&lt;br /&gt;
    git fetch origin                                        (1)&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    git branch -r --merged upstream/master                  (2)&lt;br /&gt;
    git branch -r --merged upstream/MOODLE_20_STABLE        (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) makes sure that you have all your branches from github.com recorded as the remote tracking branch locally. Commands (2) and (3) work the same as in the previous example but they list remote tracking branches only (see -r param). To delete a branch at github.com, use&lt;br /&gt;
&lt;br /&gt;
    git push origin :MDL-xxxx-branch-to-delete&lt;br /&gt;
&lt;br /&gt;
This syntax may look weird to you. However it is pretty logical. The general syntax of the git-push command is&lt;br /&gt;
&lt;br /&gt;
    git push &amp;lt;repository&amp;gt; &amp;lt;source ref&amp;gt;:&amp;lt;target ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so deleting a remote branch can be understood as pushing an &amp;quot;empty (null) reference&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
Most bugs are fixed at a stable branch (like MOODLE_20_STABLE) and the fix must be prepared for the main development branch (master), too. In Moodle, we do not merge stable branches into the master one. So usually the contributor prepares two branches - one with the fix for the stable branch and the second with the fix for the master branch.&lt;br /&gt;
&lt;br /&gt;
If you have a patch prepared on a local branch, it is possible to use git-cherry-pick command to re-apply the commits to another branch. Suppose the following scenario.&lt;br /&gt;
&lt;br /&gt;
Let us have two local Git repositories ~/public_html/moodle20 containing local installation of Moodle 2.0 and ~/public_html/moodle21 with the local installation of Moodle 2.1dev. They both use your public repository at github.com as the origin. You have a branch in moodle20 called MDL-xxxx-topic_20_STABLE that contains several commits. Now you want to re-apply these commits to a branch MDL-xxxx-topic_master in moodle21.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodle20&lt;br /&gt;
    git log origin/MOODLE_20_STABLE..MDL-xxxx-topic_20_STABLE       (1)&lt;br /&gt;
    cd ~/public_html/moodle21&lt;br /&gt;
    git checkout -b MDL-xxxx-topic_master origin/master             (2)&lt;br /&gt;
    git fetch  ~/public_html/moodle20 MDL-xxxx-topic_20_STABLE      (3)&lt;br /&gt;
    git cherry-pick origin/MOODLE_20_STABLE..FETCH_HEAD             (4)&lt;br /&gt;
&lt;br /&gt;
The command (1) shows all commits that are added to the MDL-xxxx-topic_20_STABLE. These are the commits you want to re-apply to the another branch. The command (2) creates a new local branch forked off the current master. The command (3) fetches all data needed to re-apply commits from the topic branch and stores the pointer to the tip of that branch to FETCH_HEAD symbolic reference. The command (4) picks all commits between the MOODLE_20_STABLE branch and the FETCH_HEAD (that is the commits listed in (1)) and tries to apply them on the current branch.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82607</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82607"/>
		<updated>2011-04-07T06:58:51Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Cherry-picking changes from one branch to another */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and ask for their inclusion via so called [[Development:PULL request|PULL request]]&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_19_STABLE MOODLE_20_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
After some time contributing to Moodle you would have a lot of branches both in your local repository and in your public repository. To prune their list and delete those that were accepted by upstream, use the following&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream                                      (1)&lt;br /&gt;
    git branch --merged upstream/master                     (2)&lt;br /&gt;
    git branch --merged upstream/MOODLE_20_STABLE           (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) fetches the changes from your upstream repository at git.moodle.org (remember that git-fetch does not modify your working dir so it is safe to run it whenever). Command (2) and (3) print all branches that are merged into the upstream master branch and MOODLE_20_STABLE branch, respectively. To delete these local branches, use&lt;br /&gt;
&lt;br /&gt;
    git branch -d MDL-xxxxx-accepted-branch&lt;br /&gt;
&lt;br /&gt;
The similar approach can be used to check the branches published at your origin repository at github.com&lt;br /&gt;
&lt;br /&gt;
    git fetch origin                                        (1)&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    git branch -r --merged upstream/master                  (2)&lt;br /&gt;
    git branch -r --merged upstream/MOODLE_20_STABLE        (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) makes sure that you have all your branches from github.com recorded as the remote tracking branch locally. Commands (2) and (3) work the same as in the previous example but they list remote tracking branches only (see -r param). To delete a branch at github.com, use&lt;br /&gt;
&lt;br /&gt;
    git push origin :MDL-xxxx-branch-to-delete&lt;br /&gt;
&lt;br /&gt;
This syntax may look weird to you. However it is pretty logical. The general syntax of the git-push command is&lt;br /&gt;
&lt;br /&gt;
    git push &amp;lt;repository&amp;gt; &amp;lt;source ref&amp;gt;:&amp;lt;target ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so deleting a remote branch can be understood as pushing an &amp;quot;empty (null) reference&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
=== Deleting a branch in remote repository ===&lt;br /&gt;
&lt;br /&gt;
    git push origin :branchname&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
Most bugs are fixed at a stable branch (like MOODLE_20_STABLE) and the fix must be prepared for the main development branch (master), too. In Moodle, we do not merge stable branches into the master one. So usually the contributor prepares two branches - one with the fix for the stable branch and the second with the fix for the master branch.&lt;br /&gt;
&lt;br /&gt;
If you have a patch prepared on a local branch, it is possible to use git-cherry-pick command to re-apply the commits to another branch. Suppose the following scenario.&lt;br /&gt;
&lt;br /&gt;
Let us have two local Git repositories ~/public_html/moodle20 containing local installation of Moodle 2.0 and ~/public_html/moodle21 with the local installation of Moodle 2.1dev. They both use your public repository at github.com as the origin. You have a branch in moodle20 called MDL-xxxx-topic_20_STABLE that contains several commits. Now you want to re-apply these commits to a branch MDL-xxxx-topic_master in moodle21.&lt;br /&gt;
&lt;br /&gt;
    cd ~/public_html/moodle20&lt;br /&gt;
    git log origin/MOODLE_20_STABLE..MDL-xxxx-topic_20_STABLE       (1)&lt;br /&gt;
    cd ~/public_html/moodle21&lt;br /&gt;
    git checkout -b MDL-xxxx-topic_master origin/master             (2)&lt;br /&gt;
    git fetch  ~/public_html/moodle20 MDL-xxxx-topic_20_STABLE      (3)&lt;br /&gt;
    git cherry-pick origin/MOODLE_20_STABLE..FETCH_HEAD             (4)&lt;br /&gt;
&lt;br /&gt;
The command (1) shows all commits that are added to the MDL-xxxx-topic_20_STABLE. These are the commits you want to re-apply to the another branch. The command (2) creates a new local branch forked off the current master. The command (3) fetches all data needed to re-apply commits from the topic branch and stores the pointer to the tip of that branch to FETCH_HEAD symbolic reference. The command (4) picks all commits between the MOODLE_20_STABLE branch and the FETCH_HEAD (that is the commits listed in (1)) and tries to apply them on the current branch.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82606</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82606"/>
		<updated>2011-04-07T06:30:10Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Checking if a branch has already been merged */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and ask for their inclusion via so called [[Development:PULL request|PULL request]]&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_19_STABLE MOODLE_20_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
After some time contributing to Moodle you would have a lot of branches both in your local repository and in your public repository. To prune their list and delete those that were accepted by upstream, use the following&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream                                      (1)&lt;br /&gt;
    git branch --merged upstream/master                     (2)&lt;br /&gt;
    git branch --merged upstream/MOODLE_20_STABLE           (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) fetches the changes from your upstream repository at git.moodle.org (remember that git-fetch does not modify your working dir so it is safe to run it whenever). Command (2) and (3) print all branches that are merged into the upstream master branch and MOODLE_20_STABLE branch, respectively. To delete these local branches, use&lt;br /&gt;
&lt;br /&gt;
    git branch -d MDL-xxxxx-accepted-branch&lt;br /&gt;
&lt;br /&gt;
The similar approach can be used to check the branches published at your origin repository at github.com&lt;br /&gt;
&lt;br /&gt;
    git fetch origin                                        (1)&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    git branch -r --merged upstream/master                  (2)&lt;br /&gt;
    git branch -r --merged upstream/MOODLE_20_STABLE        (3)&lt;br /&gt;
&lt;br /&gt;
The command (1) makes sure that you have all your branches from github.com recorded as the remote tracking branch locally. Commands (2) and (3) work the same as in the previous example but they list remote tracking branches only (see -r param). To delete a branch at github.com, use&lt;br /&gt;
&lt;br /&gt;
    git push origin :MDL-xxxx-branch-to-delete&lt;br /&gt;
&lt;br /&gt;
This syntax may look weird to you. However it is pretty logical. The general syntax of the git-push command is&lt;br /&gt;
&lt;br /&gt;
    git push &amp;lt;repository&amp;gt; &amp;lt;source ref&amp;gt;:&amp;lt;target ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
so deleting a remote branch can be understood as pushing an &amp;quot;empty (null) reference&amp;quot; to it.&lt;br /&gt;
&lt;br /&gt;
=== Deleting a branch in remote repository ===&lt;br /&gt;
&lt;br /&gt;
    git push origin :branchname&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82581</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82581"/>
		<updated>2011-04-05T17:09:16Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Introducing new strings */ Added link to a help strings page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can consider this page as a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
== Split your work into a logical set of patches ==&lt;br /&gt;
&lt;br /&gt;
Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
== Provide clear commit messages ==&lt;br /&gt;
&lt;br /&gt;
Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
== Names in the commit message ==&lt;br /&gt;
&lt;br /&gt;
Retain the authorship of the patch. If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter. Make sure that your &#039;&#039;real&#039;&#039; name and contact email are recorded in patch. We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
== Provide clear and operational instructions to test your patch ==&lt;br /&gt;
&lt;br /&gt;
In the PULL request, please describe how the change can be tested. Please avoid vague phrases like &amp;quot;Make sure there is no regression in the core&amp;quot; or &amp;quot;Test all places where XXX is used&amp;quot;. Also, try to avoid requiring resources that are really difficult to gather, if possible - as in &amp;quot;Use production data from a server with 100.000+ students&amp;quot;. The instructions can be put into the linked MDL, please instruct testers in the PULL request where they can find them.&lt;br /&gt;
&lt;br /&gt;
It helps if you state your estimation of the testing difficulty so that testers can pick issues for them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Easy&#039;&#039; (average community member should be able to test it) - can be tested pretty easily via the web interface only at a public test site&lt;br /&gt;
* &#039;&#039;Moderate&#039;&#039; (knowledgeable administrator should be able to test it) - requires local installation, for example to test some 1.9 -&amp;gt; 2.0 upgrade steps or some non-standard environment (for example MNet features, specific platform etc)&lt;br /&gt;
* &#039;&#039;Hard&#039;&#039; (development skills are required to test it) - for example may require data hacking at SQL level to simulate data corruption or modifying the code to reproduce the problem&lt;br /&gt;
&lt;br /&gt;
Example of instructions for testers:&lt;br /&gt;
&lt;br /&gt;
    INSTRUCTIONS FOR TESTING (difficulty: easy, requires teacher access to a course)&amp;lt;br /&amp;gt;&lt;br /&gt;
    1. Log in as a teacher and go to a course (you can use some of yours or restore the attached .mbz backup)&lt;br /&gt;
    2. Turn editing mode on&lt;br /&gt;
    3. TEST: Make sure that the control icons appear next to the activity titles&lt;br /&gt;
    4. Turn editing mode off&lt;br /&gt;
    5. TEST: Make sure that the control icons are not displayed now&lt;br /&gt;
&lt;br /&gt;
== Introducing new strings ==&lt;br /&gt;
&lt;br /&gt;
Firstly, think twice and try to think in a non-English language. Any string you introduce is supposed to be translated by translators who usually do it for free in their own time. Do not waste their time by using get_string() for debugging messages that are likely to almost never appear. When introducing new strings, keep them alphabetically sorted. Using a self-descriptive names of the string identifier and the placeholder properties helps the translators to guess the context. Compare the following&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;grade&#039;] = &#039;Grade {$a}&#039;;&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;maxgradevalue&#039;] = &#039;Grade {$a-&amp;gt;value}&#039;;&lt;br /&gt;
&lt;br /&gt;
In the first case, it is pretty difficult to guess whether the &amp;quot;Grade&amp;quot; in the string is a noun (as in &amp;quot;Grade 12/30&amp;quot;) or a verb (as in &amp;quot;Grade submission&amp;quot;). In many languages, the translation depends on it. The second case is more self-descriptive as it indicates that the placeholder will contain a value.&lt;br /&gt;
&lt;br /&gt;
See [[Development:Help strings]] if you are introducing a new help string.&lt;br /&gt;
&lt;br /&gt;
== Include AMOS script in the commit if needed ==&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message. Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82579</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82579"/>
		<updated>2011-04-05T17:05:39Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Reformatted&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;You can consider this page as a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
== Split your work into a logical set of patches ==&lt;br /&gt;
&lt;br /&gt;
Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
== Provide clear commit messages ==&lt;br /&gt;
&lt;br /&gt;
Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
== Names in the commit message ==&lt;br /&gt;
&lt;br /&gt;
Retain the authorship of the patch. If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter. Make sure that your &#039;&#039;real&#039;&#039; name and contact email are recorded in patch. We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
== Provide clear and operational instructions to test your patch ==&lt;br /&gt;
&lt;br /&gt;
In the PULL request, please describe how the change can be tested. Please avoid vague phrases like &amp;quot;Make sure there is no regression in the core&amp;quot; or &amp;quot;Test all places where XXX is used&amp;quot;. Also, try to avoid requiring resources that are really difficult to gather, if possible - as in &amp;quot;Use production data from a server with 100.000+ students&amp;quot;. The instructions can be put into the linked MDL, please instruct testers in the PULL request where they can find them.&lt;br /&gt;
&lt;br /&gt;
It helps if you state your estimation of the testing difficulty so that testers can pick issues for them:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;Easy&#039;&#039; (average community member should be able to test it) - can be tested pretty easily via the web interface only at a public test site&lt;br /&gt;
* &#039;&#039;Moderate&#039;&#039; (knowledgeable administrator should be able to test it) - requires local installation, for example to test some 1.9 -&amp;gt; 2.0 upgrade steps or some non-standard environment (for example MNet features, specific platform etc)&lt;br /&gt;
* &#039;&#039;Hard&#039;&#039; (development skills are required to test it) - for example may require data hacking at SQL level to simulate data corruption or modifying the code to reproduce the problem&lt;br /&gt;
&lt;br /&gt;
Example of instructions for testers:&lt;br /&gt;
&lt;br /&gt;
    INSTRUCTIONS FOR TESTING (difficulty: easy, requires teacher access to a course)&amp;lt;br /&amp;gt;&lt;br /&gt;
    1. Log in as a teacher and go to a course (you can use some of yours or restore the attached .mbz backup)&lt;br /&gt;
    2. Turn editing mode on&lt;br /&gt;
    3. TEST: Make sure that the control icons appear next to the activity titles&lt;br /&gt;
    4. Turn editing mode off&lt;br /&gt;
    5. TEST: Make sure that the control icons are not displayed now&lt;br /&gt;
&lt;br /&gt;
== Introducing new strings ==&lt;br /&gt;
&lt;br /&gt;
Firstly, think twice and try to think in a non-English language. Any string you introduce is supposed to be translated by translators who usually do it for free in their own time. Do not waste their time by using get_string() for debugging messages that are likely to almost never appear. When introducing new strings, keep them alphabetically sorted. Using a self-descriptive names of the string identifier and the placeholder properties helps the translators to guess the context. Compare the following&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;grade&#039;] = &#039;Grade {$a}&#039;;&lt;br /&gt;
&lt;br /&gt;
with&lt;br /&gt;
&lt;br /&gt;
    $string[&#039;maxgradevalue&#039;] = &#039;Grade {$a-&amp;gt;value}&#039;;&lt;br /&gt;
&lt;br /&gt;
In the first case, it is pretty difficult to guess whether the &amp;quot;Grade&amp;quot; in the string is a noun (as in &amp;quot;Grade 12/30&amp;quot;) or a verb (as in &amp;quot;Grade submission&amp;quot;). In many languages, the translation depends on it. The second case is more self-descriptive as it indicates that the placeholder will contain a value.&lt;br /&gt;
&lt;br /&gt;
== Include AMOS script in the commit if needed ==&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message. Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82577</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82577"/>
		<updated>2011-04-05T16:38:51Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: How to write instructions for testing&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
; Split your work into a logical set of patches : Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
; Provide clear commit message : Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
: Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
; Retain the authorship of the patch : If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter.&lt;br /&gt;
&lt;br /&gt;
; Make sure that your real name and email are recorded in patch : We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
; If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message : Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
: If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
: See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;br /&gt;
&lt;br /&gt;
; Provide clear and operational instructions to test your patch : In the PULL request, please describe how the change can be tested. Please avoid vague phrases like &amp;quot;Make sure there is no regression in the core&amp;quot; or &amp;quot;Test all places where XXX is used&amp;quot;. Also, try to avoid requiring resources that are really difficult to gather, if possible - as in &amp;quot;Use production data from a server with 100.000+ students&amp;quot;. The instructions can be put into the linked MDL, please instruct testers in the PULL request where they can find them.&lt;br /&gt;
&lt;br /&gt;
: It helps if you state your estimation of the testing difficulty so that testers can pick issues for them:&lt;br /&gt;
&lt;br /&gt;
:* &#039;&#039;Easy&#039;&#039; (average community member should be able to test it) - can be tested pretty easily via the web interface only at a public test site&lt;br /&gt;
:* &#039;&#039;Moderate&#039;&#039; (knowledgeable administrator should be able to test it) - requires local installation, for example to test some 1.9 -&amp;gt; 2.0 upgrade steps or some non-standard environment (for example MNet features, specific platform etc)&lt;br /&gt;
:* &#039;&#039;Hard&#039;&#039; (development skills are required to test it) - for example may require data hacking at SQL level to simulate data corruption or modifying the code to reproduce the problem&lt;br /&gt;
&lt;br /&gt;
: Example of instructions for testers:&lt;br /&gt;
&lt;br /&gt;
    INSTRUCTIONS FOR TESTING (difficulty: easy, requires teacher access to a course)&amp;lt;br /&amp;gt;&lt;br /&gt;
    1. Log in as a teacher and go to a course (you can use some of yours or restore the attached .mbz backup)&lt;br /&gt;
    2. Turn editing mode on&lt;br /&gt;
    3. TEST: Make sure that the control icons appear next to the activity titles&lt;br /&gt;
    4. Turn editing mode off&lt;br /&gt;
    5. TEST: Make sure that the control icons are not displayed now&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82574</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82574"/>
		<updated>2011-04-05T14:19:14Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: /* Keeping your public repository up-to-date */ Fixed remote name&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and ask for their inclusion via so called [[Development:PULL request|PULL request]]&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_19_STABLE MOODLE_20_STABLE master; do&lt;br /&gt;
        git push origin refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== Deleting a branch in remote repository ===&lt;br /&gt;
&lt;br /&gt;
    git push origin :branchname&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82573</id>
		<title>Development:Git for developers</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Git_for_developers&amp;diff=82573"/>
		<updated>2011-04-05T14:16:51Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Do not use real MDL numbers in examples to avoid autolinking&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This document is for helping you get started on Moodle development with Git. For further details of Git, see [[:Category:Git]].&lt;br /&gt;
&lt;br /&gt;
== General workflow ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-pushpull-model.png|right|thumb|400px|Moodle development workflow with Git]]&lt;br /&gt;
In short, the Moodle development with Git looks like this:&lt;br /&gt;
&lt;br /&gt;
* You as the contributor commit changes into your personal repository at your computer&lt;br /&gt;
* You push the changes into your public repository and ask for their inclusion via so called [[Development:PULL request|PULL request]]&lt;br /&gt;
* Moodle integrators pull the changes from your public repository and if they like them, they put them into Moodle integration repository&lt;br /&gt;
* The integrated change is tested and finally pushed into Moodle production repository&lt;br /&gt;
* You update your local repository with all changes from the production repository and the next cycle may start again&lt;br /&gt;
&lt;br /&gt;
This workflow runs in roughly weekly cycles. The integration happens on Monday and the testing on Tuesday. On Wednesday, the production repository moodle.git is usually updated with changes from the last development week.&lt;br /&gt;
&lt;br /&gt;
Most Moodle developers have their public repositories hosted at [http://github.com/ Github]. Alternatively you may want to try [http://gitorious.org Gitorious] or the legendary [http://repo.or.cz repo.or.cz]. In the examples in this guide we assume you&#039;ll set up your public repository at Github.&lt;br /&gt;
&lt;br /&gt;
== Installing Git on your computer ==&lt;br /&gt;
&lt;br /&gt;
Install Git on your computer. Most Linux distributions have Git available as a package to install. If you are on Mac, [http://code.google.com/p/git-osx-installer/ git-osx-installer] installs it in few click.&lt;br /&gt;
&lt;br /&gt;
Immediately after the installation, set your name and contact e-mail. The name and e-mail will become part of your commits and they can&#039;t be changed later once your commits are accepted into the Moodle code. Therefore we ask contributors to use their real names written in capital letters, eg &amp;quot;John Smith&amp;quot; and not &amp;quot;john smith&amp;quot; or even &amp;quot;john5677&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
    git config --global user.name &amp;quot;Your Name&amp;quot;&lt;br /&gt;
    git config --global user.email yourmail@domain.tld&lt;br /&gt;
&lt;br /&gt;
Unless you are the repository maintainer, it is wise to set your Git to not push changes in file permissions:&lt;br /&gt;
&lt;br /&gt;
    git config --global core.filemode false&lt;br /&gt;
&lt;br /&gt;
== Setting-up the public repository ==&lt;br /&gt;
&lt;br /&gt;
1. Go to [http://github.com/ Github] and create an account.&lt;br /&gt;
&lt;br /&gt;
2. Go to the [http://github.com/moodle/moodle official Moodle Github repository] and click on the Fork button. You now have your own Github Moodle repository.&lt;br /&gt;
&lt;br /&gt;
3. Now you need to set up your SSH public key, so you can push to your Github Moodle repository from your local Moodle repository. On Mac you can go on this [http://help.github.com/mac-key-setup/ Github help page]. If you are on another system, go to your Github administration page, to the section SSH Public Keys, and you should see a link to a help page. Done? Good! That was the most difficult part!&lt;br /&gt;
&lt;br /&gt;
== Setting-up the local repository at your computer  ==&lt;br /&gt;
&lt;br /&gt;
Create a local clone repository of your Github repository. In a terminal:&lt;br /&gt;
&lt;br /&gt;
    git clone git@github.com:YOUR_GITHUB_USERNAME/moodle.git YOUR_LOCAL_MOODLE_FOLDER&lt;br /&gt;
&lt;br /&gt;
This command does several jobs for you. It creates a new folder, initializes an empty Git repository in it, sets your Github repository as the remote repository called &#039;origin&#039; and makes a local checkout of the branch &#039;master&#039; from it. The important point to remember now is that your Github repository is aliased as &#039;origin&#039; for your local clone.&lt;br /&gt;
&lt;br /&gt;
== Keeping your public repository up-to-date ==&lt;br /&gt;
&lt;br /&gt;
[[image:git-sync-github.png|right|thumb|400px|Fetching changes from upstream and pushing them to github]]&lt;br /&gt;
Your fork at Github is not updated automatically. To keep it synced with the upstream Moodle repository, you have to fetch the recent changes from the official moodle.git and push them to your public repository. To avoid problems with this it is strongly recommended that you never modify the standard Moodle branches. &#039;&#039;Remember: never commit directly into master and MOODLE_xx_STABLE branches.&#039;&#039; In other words, always create topic branches to work on. In Gitspeak, the master branch and MOODLE_xx_STABLE branches should be always fast-forwardable.&lt;br /&gt;
&lt;br /&gt;
To keep your public repository up-to-date, we will register remote repository git://git.moodle.org/moodle.git under &#039;upstream&#039; alias. Then we create a script to be run regularly that fetches changes from the upstream repository and pushes them to your public repository. Note that this procedure will not affect your local working directory.&lt;br /&gt;
&lt;br /&gt;
To register the upstream remote:&lt;br /&gt;
&lt;br /&gt;
    git remote add upstream git://git.moodle.org/moodle.git&lt;br /&gt;
&lt;br /&gt;
The following commands can be used to keep the standard Moodle branches at your Github repository synced with the upstream repository. You may wish to store them in a script so that you can run it every week after the upstream repository is updated.&lt;br /&gt;
&lt;br /&gt;
    git fetch upstream&lt;br /&gt;
    for BRANCH in MOODLE_19_STABLE MOODLE_20_STABLE master; do&lt;br /&gt;
        git push github refs/remotes/upstream/$BRANCH:$BRANCH&lt;br /&gt;
    done&lt;br /&gt;
&lt;br /&gt;
=== How it works ===&lt;br /&gt;
&lt;br /&gt;
The git-fetch command does not modify your current working dir (your checkout). It just downloads all recent changes from a remote repository and stores them into so called remote-tracking branches. The git-push command takes these remote-tracking branches from upstream and pushes them to Github under the same name. Understanding this fully requires a bit knowledge of Git internals - see gitrevisions(7) man page.&lt;br /&gt;
&lt;br /&gt;
Note there is no need to switch the local branch during this. You can even execute this via cron at your machine. Just note that the upstream repository updates typically just once a week.&lt;br /&gt;
&lt;br /&gt;
== Preparing a patch ==&lt;br /&gt;
&lt;br /&gt;
As said earlier at this page, you never work on standard Moodle branches directly. Every time you are going to edit something, switch to a local branch. Fork the local branch off the standard branch you it should be merged to. So if you are working on a patch for 1.9 or 2.0, fork the branch off MOODLE_19_STABLE or MOODLE_20_STABLE, respectively. Patches for the next [[Moodle versions|major version]] should be based on the master branch.&lt;br /&gt;
&lt;br /&gt;
    git checkout -b MDL-xxxxx-nasty-bug origin/master&lt;br /&gt;
&lt;br /&gt;
Note that if you forget to specify the starting point, the branch is based on the currently checked-out branch. It may not be what you want. It is recommended to always specify the starting point.&lt;br /&gt;
&lt;br /&gt;
To check the current branch, run&lt;br /&gt;
&lt;br /&gt;
    git branch&lt;br /&gt;
&lt;br /&gt;
The current branch is highlighted.&lt;br /&gt;
&lt;br /&gt;
Now go and fix the issue with your favorite IDE. Check the status of the files, view the change to be committed and finally commit the change:&lt;br /&gt;
&lt;br /&gt;
    vim filename.php&lt;br /&gt;
    git status&lt;br /&gt;
    git diff&lt;br /&gt;
    git commit -a&lt;br /&gt;
&lt;br /&gt;
Note that this is safe as the commit is recorded just locally, nothing is sent to any server yet (as it would in CVS). To see history of the commits, use&lt;br /&gt;
&lt;br /&gt;
    git log&lt;br /&gt;
&lt;br /&gt;
Once your local branch contains the change (note that it may consists of several patches) and you are happy with it, publish the branch at your public repository:&lt;br /&gt;
&lt;br /&gt;
    git push&lt;br /&gt;
&lt;br /&gt;
Because we did not specify explicit remote repository, the &#039;origin&#039; is used. Because we did not specify the branch to push, the Git will use the current branch and push it to the remote repository under the same name (by default, this is a subject of your configuration. See push.default config variable).&lt;br /&gt;
&lt;br /&gt;
Now as your branch is published, you can ask Moodle core developers to review it and eventually integrate it into the standard Moodle repository.&lt;br /&gt;
&lt;br /&gt;
=== Checking if a branch has already been merged ===&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
=== Deleting a branch in remote repository ===&lt;br /&gt;
&lt;br /&gt;
    git push origin :branchname&lt;br /&gt;
&lt;br /&gt;
== Peer-reviewing someone else&#039;s code ==&lt;br /&gt;
&lt;br /&gt;
To review a branch that someone else pushed into their public repository, you do not need to register a new remote (unless you work with such repository frequently, of course). Let us imagine your friend Alice pushed a work-in-progress branch called &#039;wip-feature&#039; into her Github repository and asked you to review it. You need to know the read-only address of the repository and the name of the branch.&lt;br /&gt;
&lt;br /&gt;
    git fetch git://github.com/alice/moodle.git wip-feature&lt;br /&gt;
&lt;br /&gt;
This will download all required data and will keep the pointer to the tip of the wip-feature branch in a local symbolic reference FETCH_HEAD. To see what&#039;s there on that branch, use&lt;br /&gt;
&lt;br /&gt;
    git log -p FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To create a new local branch called &#039;alice-wip-feature&#039; containing the work by Alice, use&lt;br /&gt;
&lt;br /&gt;
    git checkout -b alice-wip-feature FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To merge Alice&#039;s work into your current branch:&lt;br /&gt;
&lt;br /&gt;
    git merge FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
To see what would be merged into the current branch without actually modifying anything:&lt;br /&gt;
&lt;br /&gt;
    git diff ...FETCH_HEAD&lt;br /&gt;
&lt;br /&gt;
== Rebasing a branch ==&lt;br /&gt;
&lt;br /&gt;
Rebasing is a process when you cut off the branch from its current start point and transplant it to another point. Let us assume the following history exists:&lt;br /&gt;
&lt;br /&gt;
          A---B---C topic&lt;br /&gt;
         /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
From this point, the result of the command:&lt;br /&gt;
&lt;br /&gt;
    git rebase master topic&lt;br /&gt;
&lt;br /&gt;
would be:&lt;br /&gt;
&lt;br /&gt;
                  A&#039;--B&#039;--C&#039; topic&lt;br /&gt;
                 /&lt;br /&gt;
    D---E---F---G master&lt;br /&gt;
&lt;br /&gt;
and would end with &#039;topic&#039; being your current branch.&lt;br /&gt;
&lt;br /&gt;
You may be asked to rebase your branch submitted for the integration if the submitted branch was based on an outdated commit. The typical case is if you create a new branch as a fork off the upstream master branch on Tuesday. Then on Wednesday, the upstream master branch grows as all changes from the last integration cycle are merged to it. To make diff easy on Github for next weekly pull request review, you want to rebase your branch against the updated master.&lt;br /&gt;
&lt;br /&gt;
    git rebase master MDL-xxxxx-topic-branch&lt;br /&gt;
&lt;br /&gt;
Note that rebasing effectively rewrites the history of the branch. &#039;&#039;&#039;Do not rebase the branch if there is a chance that somebody has already forked it and based their own branch on it.&#039;&#039;&#039; For this reason, many Git tutorials discourage from rebasing any branch that has been published. However in Moodle, all branches submitted for integration are potential subject of rebase (even though we try to not to do it often) and you should not base your own branches on them.&lt;br /&gt;
&lt;br /&gt;
=== Conflicts during rebase ===&lt;br /&gt;
&lt;br /&gt;
During the rebase procedure, conflicts may appear. git-status commands reports the conflicted files. Explore them carefully and fix them in your editor (like you would do with CVS). Then add the files with &#039;git add&#039; command and continue.&lt;br /&gt;
&lt;br /&gt;
    vim conflicted.php&lt;br /&gt;
    git add conflicted.php&lt;br /&gt;
    git rebase --continue&lt;br /&gt;
&lt;br /&gt;
== Cherry-picking changes from one branch to another ==&lt;br /&gt;
&lt;br /&gt;
TODO&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [http://www.kernel.org/pub/software/scm/git/docs/everyday.html Everyday GIT With 20 Commands Or So]&lt;br /&gt;
* [http://gitref.org/ Git Reference]&lt;br /&gt;
* [http://progit.org/book/ Pro Git book]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Git]]&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82568</id>
		<title>Development:Commit cheat sheet</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/21/en/index.php?title=Development:Commit_cheat_sheet&amp;diff=82568"/>
		<updated>2011-04-05T10:30:23Z</updated>

		<summary type="html">&lt;p&gt;Mudrd8mz: Initial version of the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a list to check before you submit a patch for inclusion into Moodle.&lt;br /&gt;
&lt;br /&gt;
; Split your work into a logical set of patches : Keep in mind that your commits will be reviewed before they are accepted. If the patch does one clear thing and does it well, the review process is fun. Git allows you to prepare patches on your branch into a sequence of logical steps. For example, when changing some API, divide the change into two steps. In the first commit, change the API. In the following commit, change all places that use the API.&lt;br /&gt;
&lt;br /&gt;
; Provide clear commit message : Consider the commit message as an email for the developer who would explore the change in the future. We recommend to follow common Git guidelines for formatting. Include the MDL issue number and eventually the area/component at the beginning of the subject line.&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    The subject line is followed by an empty line and then a paragraph or two of&lt;br /&gt;
    a longer description follows. This longer description is useful for issues&lt;br /&gt;
    with longer history of comments in the linked MDL so that it summarizes the&lt;br /&gt;
    patch without the need to go through the whole discussion.&amp;lt;br /&amp;gt;&lt;br /&gt;
    Obviously, avoid messages like &amp;quot;as agreed in the chat&amp;quot; as they will become&lt;br /&gt;
    useless after a relatively short time.&lt;br /&gt;
&lt;br /&gt;
: Most of Git tools are optimised for this format and they can display the log of commits best then.&lt;br /&gt;
&lt;br /&gt;
; Retain the authorship of the patch : If the patch was submitted by someone else - for example a community member who published it in the tracker or in a forum - use the --author parameter.&lt;br /&gt;
&lt;br /&gt;
; Make sure that your real name and email are recorded in patch : We use real names written in capital letters like &amp;quot;John Smith&amp;quot;. Please do not use names like &amp;lt;strike&amp;gt;&amp;quot;john smith&amp;quot;, &amp;quot;John S&amp;quot;, &amp;quot;johnny7887&amp;quot;&amp;lt;/strike&amp;gt;. If you use --author parameter, apply the same rules for the name of the author. See almost any Git tutorial on how to set your name and email in the global Git configuration.&lt;br /&gt;
&lt;br /&gt;
; If you change the identifier of a string or split a string into two forks, provide a script for AMOS in the commit message : Since Moodle 2.0, the translations are kept on separated branches again. The AMOS plugin at http://lang.moodle.org tracks the changes in string files and automatically records modifications, additions and removals of strings. Therefore strings can be re-worded freely on stable branches and should be removed from the master branch if they are not needed any more.&lt;br /&gt;
&lt;br /&gt;
: If you change the identifier of the string (that is the key in the $string array), move the string from one file to another or you are introducing a new string as a copy of some current one, you should provide instructions for AMOS so that the action can be applied in all language packs. That will save valuable translators&#039; time. Instructions for AMOS are being put into the commit message of a commit that modifies the original English string files. The commit message containing such a script may look like this:&lt;br /&gt;
&lt;br /&gt;
    MDL-xxxxx code area: short description of the patch&amp;lt;br /&amp;gt;&lt;br /&gt;
    It is recommended to leave a blank line between the commit message and the&lt;br /&gt;
    script block.&amp;lt;br /&amp;gt;&lt;br /&gt;
    AMOS BEGIN&lt;br /&gt;
     MOV [configfoobar,core_admin],[foobar_desc,core_admin]&lt;br /&gt;
     CPY [submission,mod_assignment],[submission,mod_workshop]&lt;br /&gt;
    AMOS END&lt;br /&gt;
&lt;br /&gt;
: See [[Development:Languages/AMOS#AMOS_script]] for more details of the syntax. See [http://git.moodle.org/gw?p=moodle.git&amp;amp;a=search&amp;amp;h=HEAD&amp;amp;st=commit&amp;amp;s=AMOS+BEGIN the log history] real examples of usage.&lt;/div&gt;</summary>
		<author><name>Mudrd8mz</name></author>
	</entry>
</feed>