<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andrewnicols</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Andrewnicols"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Andrewnicols"/>
	<updated>2026-06-04T06:19:51Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Category:DevDocs_Migration&amp;diff=64283</id>
		<title>Category:DevDocs Migration</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Category:DevDocs_Migration&amp;diff=64283"/>
		<updated>2024-08-27T14:53:25Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Reverted edits by Fox (talk) to last revision by Andrewnicols&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Moodle is currently assessing options for improving Developer Documenation and resources.&lt;br /&gt;
&lt;br /&gt;
As a part of this assessment we are also assessing alternatives to WikiMedia for this documentation and are migrating some of the content in this wiki into the systems we have under assessment.&lt;br /&gt;
&lt;br /&gt;
To keep track of the pages that have been migrated, and to help consider how such a migration could be managed, we have created a new Category for the migration, as this will allow us to find and identify any documentation which has or has not been moved. In the event that we do adopt one of the systems that we are exploring it is hoped that we will also be able to make use of any transitioned documents, and apply any updates since the change was made.&lt;br /&gt;
&lt;br /&gt;
More information on any changes will be announced at a later date.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Policy_-_Retroactive_effects_of_completion_settings&amp;diff=64262</id>
		<title>Policy - Retroactive effects of completion settings</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Policy_-_Retroactive_effects_of_completion_settings&amp;diff=64262"/>
		<updated>2024-05-07T05:21:09Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
== Summary ==&lt;br /&gt;
&lt;br /&gt;
The question was:&lt;br /&gt;
&lt;br /&gt;
Should past activity completions be retroactively affected by changes to settings?&lt;br /&gt;
That is, after a student completes an activity and it&#039;s marked as &amp;quot;completed-passed&amp;quot;, &amp;quot;completed-failed&amp;quot;, etc., might it later become &amp;quot;incomplete&amp;quot;?  &lt;br /&gt;
&lt;br /&gt;
This question was decided by by Martin Dougiamas on Tue Mar 25 per tracker issue MDL-39624. Dougiamas decided:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Completion of an activity is final and not affected by future settings changes (unless you manually reset it and are warned loudly and students are informed).&lt;br /&gt;
&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Documentation of the reasoning, pro and con, is below as it was posted prior to the decision being made.&lt;br /&gt;
&lt;br /&gt;
-----&lt;br /&gt;
&lt;br /&gt;
As one example, a student might complete a Quiz, with a passing grade.  The quiz is marked as completed-passed, which opens up a Certificate. The student prints the certificate and files it with regulators.&lt;br /&gt;
Six months later, the teacher decides that from now on the passing grade should be higher.  The teacher changes the &amp;quot;grade to pass&amp;quot; setting. Should the student who completed and passed six months prior now &lt;br /&gt;
be marked as &amp;quot;failed&amp;quot;, and their certificate revoked?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Two major categories of actions were mentioned, and two types of &amp;quot;intentions&amp;quot;, or use-case scenarios, with different policies appearing reasonable depending on the type of &lt;br /&gt;
action and use-case or intention of the user.  Actions can be a) changes to what a student has done , such as submitting or deleting an assignment or b) settings/requirements adjustments by the teacher. &lt;br /&gt;
Settings changes may be the result of two types of intentions - a decision that the new requirements should be different from the old, or a correction to an incorrect setting.&lt;br /&gt;
&lt;br /&gt;
== Changes to what a student has done ==&lt;br /&gt;
&lt;br /&gt;
Sam Marshall gave two examples suggesting that when there is a change to what a student has done, that could change the fact that something the student completed something.&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
Example 1: If you just use &#039;on grade&#039; completion, if a student does something and gets a grade, it will be marked complete. If the teacher then deletes their grade from gradebook, it will be marked incomplete again.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example 2: In forum, if you set it to be complete after making 3 posts, and the student makes 3 posts, it will be marked complete. But if the teacher then deletes one of the posts, it will be marked incomplete again.&lt;br /&gt;
&lt;br /&gt;
It could be argued that things should not be automatically &#039;un-completed&#039; in this way (there are cases when both the above examples definitely seem appropriate, but it might be OK if the teacher had to manually un-complete them as well)&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
No reasoning was posted with an opposing view on what should happen when changes are made to &#039;&#039;what a student has done&#039;&#039;. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Changes to settings ==&lt;br /&gt;
&lt;br /&gt;
There are different opinions in regards to changes to settings, such as the grade required to pass.  If a student completes an activity, such as passing a test, and some time later the &amp;quot;grade to pass&amp;quot; is changed, should their &amp;quot;completed-passed&amp;quot; be changed to &amp;quot;completed-failed&amp;quot;, or should the changes apply &amp;quot;from now on&amp;quot;?&lt;br /&gt;
&lt;br /&gt;
Per Ekström wrote:&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
I would say, no.&lt;br /&gt;
&lt;br /&gt;
As a student, you&#039;re given a deal; &amp;quot;Get a score of X or higher and you pass.&amp;quot; If the bar is raised, and it&#039;s applied retroactively, then you are basicly breaking your end of the bargain. A pass is a pass no matter what, even if a teacher afterwards raise to 80%. ...&lt;br /&gt;
&lt;br /&gt;
The most important thing with a grading system is that it&#039;s predictable and perceived fair. Retroactivity makes it everything but. Therefore I do not recommend it.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Where Ekström uses the word &amp;quot;deal&amp;quot;, common law uses the word &amp;quot;contract&amp;quot;, and &amp;quot;breaking your end of the bargain&amp;quot; could be called &amp;quot;fraud&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Another example supporting this view was posted:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
 Working as a private investigator without passing the required classes and staying up with continuing education is a crime.  If I took the class and later the teacher changed the requirements and the system retroactively failed me, that would expose me, the student, to criminal charges.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A different view was expressed by Tim Hunt:&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&lt;br /&gt;
As a teacher, you are only human. Sometimes you make mistakes. You accidentally create a quiz with a passing grade of 90% (or forget to set the passing grade so it defaults ot 0%?). Then some students attempt the quiz and point out the mistake to you, so then you correct it to 80% and expect Moodle to automatically fix the completion state for students who already got between 80 and 90%.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It was suggested that if the teacher knows they made a mistake and are correcting it, they can also correct the results of that mistake - manually changing passes to fails or vice-versa.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
That is the open question - &#039;&#039;if settings/requirements are changed&#039;&#039;, should Moodle automatically, retroactively change prior completions based on the new settings?&lt;br /&gt;
&lt;br /&gt;
== Can changes for these two reasons be separated? (Not really.) ==&lt;br /&gt;
&lt;br /&gt;
(sam marshall)&lt;br /&gt;
&lt;br /&gt;
It will be technically difficult to separate the &#039;changing based on what a student has done&#039; from &#039;changing settings&#039;. I think we will need to make the behaviour consistent so that either of two rules applies:&lt;br /&gt;
&lt;br /&gt;
OPTION B: Once a &#039;completed&#039; or &#039;completed-passed&#039; completion status is obtained, it should not change unless a teacher manually resets it.&lt;br /&gt;
&lt;br /&gt;
OR (as supposedly true at present)&lt;br /&gt;
&lt;br /&gt;
OPTION A: All completion statuses should change if the conditions or data changes.&lt;br /&gt;
&lt;br /&gt;
(Note that I left completed-failed undefined because we want to let people retry things so it can&#039;t be 100% consistent this way...)&lt;br /&gt;
&lt;br /&gt;
In other words I don&#039;t think we should attempt to treat &#039;changes in data&#039; and &#039;changes in settings&#039; as distinct situations that can be handled differently, as the page above might imply. &lt;br /&gt;
&lt;br /&gt;
=== Example ===&lt;br /&gt;
&lt;br /&gt;
Here&#039;s why I think it is impossible to treat the two cases (changes to actual data/user input vs changes to settings) as separate in general. Imagine that we are trying to do so (update &#039;completed&#039; to &#039;not completed&#039; for data changes, but not for setting changes). Consider this sequence:&lt;br /&gt;
&lt;br /&gt;
1. In a forum, 3 posts are required for completion.&lt;br /&gt;
&lt;br /&gt;
2. Student A makes 4 posts and is marked complete. Student B makes 3 posts and is marked complete.&lt;br /&gt;
&lt;br /&gt;
3. Somebody changes the settings so that 5 posts are now required. (This is a settings change, so completion states aren&#039;t updated.)&lt;br /&gt;
&lt;br /&gt;
4. Somebody deletes one of Student A&#039;s posts so that they now only have 3 posts. (This is a data change, so completion state is updated.)&lt;br /&gt;
&lt;br /&gt;
In this situation, there has been a change to the data, so if we are treating those as separate then it is correct to potentially mark the student as not complete. But we do not store the historical values of all the setting, so we have to consider this according to current data; i.e. every time somebody gets a post deleted the system needs to check if they still have more than 5, and student A does not. As a result, student A would be marked &#039;not complete&#039;.&lt;br /&gt;
&lt;br /&gt;
This would be unfair because both students A and B have made 3 valid posts but B is still marked complete and A is not. (Note: In the current system, both A and B would have been marked incomplete at stage 3. In Option B, both A and B would remain complete; a student C who only made their posts after step 3 would have a disadvantage, but at least that&#039;s more easily understood i.e. when teachers change the settings they know they are making it harder for people from now on.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[In other words, the new criteria would apply only to currently active students, and removing a post indicates activity. This would not be ideal, but it separating them may be better than the alternatives. - Ray Morris]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=226129 Forum discussion of the question]&lt;br /&gt;
&lt;br /&gt;
[https://tracker.moodle.org/browse/MDL-37993 Tracker issue which initiated the discussion]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=SWF&amp;diff=64261</id>
		<title>SWF</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=SWF&amp;diff=64261"/>
		<updated>2024-05-07T05:20:34Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
==SWF Activity Module==&lt;br /&gt;
&lt;br /&gt;
The module documentation on this page is out of date. Please see the [[SWF Activity Module]] project site for up to date downloads, documentation and help.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve moved the project code and documentation to Google Code: [http://code.google.com/p/swf-activity-module/ code.google.com/p/swf-activity-module/]&lt;br /&gt;
&lt;br /&gt;
The most recent downloads and documentation are available there.&lt;br /&gt;
&lt;br /&gt;
==What is the SWF Activity Module?==&lt;br /&gt;
&lt;br /&gt;
The SWF Activity Module provides a comprehensive and flexible method for deploying Flash and Flex Framework learning applications as activities in a Moodle course.&lt;br /&gt;
&lt;br /&gt;
==How does is work?==&lt;br /&gt;
&lt;br /&gt;
===SWFObject===&lt;br /&gt;
&lt;br /&gt;
The SWF Activity Module uses [http://code.google.com/p/swfobject/ SWFObject] as the default embed method for Flash and Flex Framework learning applications. The module also incorporates standard XHTML 1.0 strict object and embed code that functions if SWFObject fails for any reason, e.g. If the user has Javascript blocked in his/her browser.&lt;br /&gt;
&lt;br /&gt;
Once installed, select SWF from an &amp;quot;Add an activity&amp;quot; list on a Moodle course page. The standard &amp;quot;Adding a new SWF to topic... &amp;quot; moodleform will appear. Help files are included in the SWF Activity Module in English and provide further details about the parameters. In this form you can set the following parameters:&lt;br /&gt;
&lt;br /&gt;
===Required Parameters===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* As with all Moodle activities, name and intro.&lt;br /&gt;
* SWF file&lt;br /&gt;
* Height&lt;br /&gt;
* Width&lt;br /&gt;
* Version&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Optional Parameters===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* AMF Interaction (Not yet implemented)&lt;br /&gt;
* XML file URL&lt;br /&gt;
* FlashVars #1&lt;br /&gt;
* FlashVars #2&lt;br /&gt;
* FlashVars #3&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Advanced Parameters===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* API Key (SWF Activity Module custom parameter)&lt;br /&gt;
* Align&lt;br /&gt;
* Auto Play&lt;br /&gt;
* Loop Playback&lt;br /&gt;
* Menu&lt;br /&gt;
* Quality&lt;br /&gt;
* Scale Mode&lt;br /&gt;
* Stage Align&lt;br /&gt;
* Window Mode&lt;br /&gt;
* Background&lt;br /&gt;
* Use Device Font&lt;br /&gt;
* Seamless Tabbing&lt;br /&gt;
* Allow Full Screen&lt;br /&gt;
* Allow Script Access&lt;br /&gt;
* Allow Networking&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can find more details about these parameters in the [http://code.google.com/p/swfobject/wiki/documentation SWFObject Documentation].&lt;br /&gt;
&lt;br /&gt;
==What features does it support?==&lt;br /&gt;
&lt;br /&gt;
The SWF Activity Module automatically provides a deployed SWF learning activity application with the following data:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* gateway - URL to gateway script for access to AMFPHP service library&lt;br /&gt;
* course - the current Moodle course that the user is accessing&lt;br /&gt;
* instance - Instance ID of the module&lt;br /&gt;
* swfid - The ID of the SWF learning activity application&lt;br /&gt;
* interaction - The ID of the SWF learning interaction data to consume (AMFPHP)&lt;br /&gt;
* moodledata - The URL to access the current moodledata course directory (file.php)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
It also supports a number of features, specific to Flash and Flex applications. They are:&lt;br /&gt;
&lt;br /&gt;
===Flash Remoting (AMF)===&lt;br /&gt;
&lt;br /&gt;
Flash Remoting is a method for Flash or Flex applications to communicate directly with server-side applications written in .NET, Java, PHP, Cold Fusion and Ruby on Rails. There are a number of open-source libraries for handling communication via Flash Remoting: &lt;br /&gt;
&lt;br /&gt;
See [[AMF3]] for details on how to set up AMFPHP in Moodle and more information about Flash Remoting technologies.&lt;br /&gt;
&lt;br /&gt;
===XML Data Loading===&lt;br /&gt;
&lt;br /&gt;
XML is a native data type to ActionScript 3.0 therefore Flash and Flex Framework learning applications use E4X notation to manipulate XML data in a similar way to a multidimensional array. For more details, see [http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/ Adobe Actionscript 3.0 Language and Components Reference]. XML is also currently the most commonly used format for providing elearning data for learning interactions. The most commonly used format is [http://en.wikipedia.org/wiki/IMS_Global IMS]&#039;s standard [http://en.wikipedia.org/wiki/QTI QTI] (Question and Test Interoperability specification) but basically any valid XML file with the appropriate data tree structure can be loaded into and consumed by a SWF file.&lt;br /&gt;
&lt;br /&gt;
===FlashVars===&lt;br /&gt;
&lt;br /&gt;
FlashVars is a method for passing string data into a SWF file. It is passed in from the printed HTML page that the SWF file is embedded in. It&#039;s ideally suited to very simple data sets such a vocabulary lists or series of numerical values. For learning activities such as hangman, crosswords, word searches, etc., FlashVars is simple, efficient and easy to use.&lt;br /&gt;
&lt;br /&gt;
==What&#039;s Next?==&lt;br /&gt;
&lt;br /&gt;
===Moodle Grades===&lt;br /&gt;
&lt;br /&gt;
One of the most requested features for Flash and Flex Framework learning applications deployed in Moodle is for them to have the ability to record learners&#039; activities in Moodle&#039;s Gradebook.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===AMFPHP===&lt;br /&gt;
&lt;br /&gt;
The most powerful and flexible way for Flash and Flex Framework learning applications to interact with Moodle APIs, databases and web services is via Flash Remoting AKA [http://blogs.adobe.com/mikepotter/2006/12/amfphp_adds_amf.html AMF3], a communication protocol which is similar to JSON but much faster. It allows Flash and Flex Framework learning applications to directly call PHP methods and pass a number of different data types back and forth seamlessly.&lt;br /&gt;
&lt;br /&gt;
For more details about using AMFPHP in Moodle, see [[AMF3]]&lt;br /&gt;
&lt;br /&gt;
===Learning Interaction Data DB Structure===&lt;br /&gt;
&lt;br /&gt;
A standardised DB table structure to store learning interaction data with a variety of methods to populate the tables with data, including Moodle forms, dynamic Flash or Flex Framework on-line forms.&lt;br /&gt;
&lt;br /&gt;
Also, standalone Adobe AIR desktop GUI applications, which can store data locally using SQLite, to create and edit learning interactions and then upload them. Using Adobe AIR will also provide convenient backup of interaction data and a means to easily transfer and distribute learning interactions.&lt;br /&gt;
&lt;br /&gt;
====swf_interactions fields====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* id&lt;br /&gt;
* course&lt;br /&gt;
* name&lt;br /&gt;
* intro&lt;br /&gt;
* introformat&lt;br /&gt;
* amftable - Default is swf_interaction_data but this allows for further, more specialised tables to be used&lt;br /&gt;
* timecreated&lt;br /&gt;
* timemodified&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====swf_interaction_data fields====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
* id&lt;br /&gt;
* interaction - ID of interaction (id of swf_interactions)&lt;br /&gt;
* ordernum - Allow sequential ordering of rows&lt;br /&gt;
* amp3 - URL of answer MP3 file&lt;br /&gt;
* qmp3 - URL of quesition MP3 file&lt;br /&gt;
* smp3 - URL of additional MP3 file&lt;br /&gt;
* image - URL of image file&lt;br /&gt;
* video - URL of FLV file&lt;br /&gt;
* ptext - Paragraph text&lt;br /&gt;
* qtext - Question&lt;br /&gt;
* catext - Correct answers (for multiple choice, use pipe separator as delimiter)&lt;br /&gt;
* watext - Wrong answers (for multiple choice, use pipe separator as delimiter)&lt;br /&gt;
* timecreated&lt;br /&gt;
* timemodified&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[AMF3]] Flash Remoting for Moodle.&lt;br /&gt;
* [http://code.google.com/p/moodle-mplayer/ Media Player] Activity Module for deploying video in Moodle as an activity. Leverages the full range of functions of Jeroen Wijering&#039;s JW FLV Player.&lt;br /&gt;
* [http://matbury.com/ Matt Bury&#039;s website and Moodle] with demos of SWF Activity Module and Media Player modules.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Themes_2.0_overflow_problems&amp;diff=64260</id>
		<title>Themes 2.0 overflow problems</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Themes_2.0_overflow_problems&amp;diff=64260"/>
		<updated>2024-05-07T05:19:51Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
&lt;br /&gt;
This document examines the overflow:hidden - fixed width problem currently plaguing several areas of Moodle 2.0 (as of October 26, 2010)&lt;br /&gt;
&lt;br /&gt;
http://tracker.moodle.org/browse/MDL-24895 Has been created to track implementation of a solution&lt;br /&gt;
&lt;br /&gt;
==The problem==&lt;br /&gt;
&lt;br /&gt;
Content that is too wide for the main content area is not displayed correctly is obscured behind the side blocks or off-screen, and the browser doesn&#039;t scroll horizontally.&lt;br /&gt;
&lt;br /&gt;
To see it, shrink your browser window and look at:&lt;br /&gt;
&lt;br /&gt;
# http://moodle.org/mod/forum/discuss.php?d=32796 (large image: 15.748px × 3.893px)&lt;br /&gt;
# http://moodle.org/mod/forum/discuss.php?d=114746 (large table) --[[User:Frank Ralf|Frank Ralf]] 10:44, 27 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
It is caused by &#039;&#039;&#039;oversized, unwrappable content&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
# Large images or other media of one form or another.&lt;br /&gt;
# Tables, any table that has numerous columns and/or large content in columns.&lt;br /&gt;
## Tabulated data&lt;br /&gt;
## Tables for internal layout (like the forum)&lt;br /&gt;
# Unwrappable content&lt;br /&gt;
## This is normally always user-entered text or images.&lt;br /&gt;
## Different browsers handle things differently.&lt;br /&gt;
&lt;br /&gt;
==The technical description==&lt;br /&gt;
&lt;br /&gt;
The cause is a combination of the fixed width that gets set on the core layout XHTML, and the overflow:hidden setting that is required by the layout.&lt;br /&gt;
&lt;br /&gt;
The layout used in the base theme within Moodle is based on Matthew James Taylor&#039;s [http://matthewjamestaylor.com/blog/ultimate-3-column-holy-grail-pixels.htm Holy grail layout] which is an excellent layout, however (and it does state this in the description of the layout) wide content is a known problem.&lt;br /&gt;
&lt;br /&gt;
This problem starts on the very first div that contains content within the body *&amp;amp;lt;div id=&amp;quot;page-content&amp;quot;&amp;amp;gt;....&amp;amp;lt;/div&amp;amp;gt;* which has the following style:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
#page-content {&lt;br /&gt;
    clear:both;&lt;br /&gt;
    float:left;&lt;br /&gt;
    overflow:hidden;&lt;br /&gt;
    position:relative;&lt;br /&gt;
    width:100%;&lt;br /&gt;
    min-width:900px;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Setting the width to 100% instantly boxes the displayable area to just the browsers internal display width, and then overflow:hidden ensures that any overflow is not visible.&lt;br /&gt;
&lt;br /&gt;
This is required because the premise of this layout is to move everything out of the viewport and then move things back into the correct position and in doing this it goes as far as expanding content divs out to 200% width.&lt;br /&gt;
&lt;br /&gt;
Because of this if we remove the width 100% and/or overflow hidden everything breaks because the page will ALWAYS expand beyond the browsers displayable area even if the content is easily displayed.&lt;br /&gt;
&lt;br /&gt;
As far as I can see there is no way to avoid this problem while using this layout.&lt;br /&gt;
&lt;br /&gt;
On the other hand there are very good reasons for using this layout:&lt;br /&gt;
* it is cross browser, &lt;br /&gt;
* columns are orderd 2,1,3 which is good for accessibility and search engine optimisation, and&lt;br /&gt;
* in EVERY other respect it works well&lt;br /&gt;
&lt;br /&gt;
==Proposed solution 1 - Additional wrapper DIV ==&lt;br /&gt;
&lt;br /&gt;
A couple of days ago I sat down with Martin and explained this to him and we looked into it and came up with the following three part solution:&lt;br /&gt;
&lt;br /&gt;
# Wrap format_text output within a div with a class that allows us to manage overflow.  The themes can then turn on overflow:auto for these areas to make sure that user content wraps correctly (eg forum post content).&lt;br /&gt;
# Convert places that use tables for layout to divs (eg forum posts) so that they wrap cleanly.  Without this the large user content causes the table cells to grow too large, causing wrapping issues.&lt;br /&gt;
# Locate places where tables are likely to require horizontal scrolling and wrap them in divs with a class like `flexible-wrap` that sets an overflow:auto so that the table is scrollable if required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Advantages===&lt;br /&gt;
&lt;br /&gt;
# A standard way for developers and themers to deal with these issues (can go in coding guidelines)&lt;br /&gt;
# Will remove the possibility for users to intentionally/accidentally destroy the interface by posting large content&lt;br /&gt;
&lt;br /&gt;
===Possible problems===&lt;br /&gt;
&lt;br /&gt;
# Because all format_text calls will be wrapped by this special div there might be regressions throughout Moodle - we will have to review the calls and possibly disable the new wrapping divs for some of them. (For example, quiz multiple choice options are processed by format_text, then output inside a Label. The wrapping div would break that horribly.)&lt;br /&gt;
# Some parts of Moodle can never be made to fit in a sensible width. For example the gradebook, and other reports.&lt;br /&gt;
# IE6/7 (and possibly IE 8/9?) render their scrollbars INSIDE an element rather than outside like most other browsers meaning that there is a *VERY* high chance there will be redundant scrollbars within some elements that don&#039;t actually require wrapping (on these browsers)&lt;br /&gt;
# Elements that require scrolling will have their own scrollbars and particularly in the case of tables this is likely to require scrolling the page vertically to locate the horizontal scrollbar, scrolling horizontally and then locating the desired row vertically again.&lt;br /&gt;
# Elements with a set width (e.g.style=&amp;quot;width:2000px&amp;quot;) greater than the content area will need to be wrapped in a div with the wrapping class as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed solution 2 - Source code order ==&lt;br /&gt;
&lt;br /&gt;
Compromise, and use a 1, 3, 2 or 1, 2, 3 layout (with skip links for accessibility).&lt;br /&gt;
&lt;br /&gt;
===Advantages===&lt;br /&gt;
&lt;br /&gt;
# It can be made to work for all pages.&lt;br /&gt;
# We use a 1, 3, 2 at the OU, and it is reliable.&lt;br /&gt;
&lt;br /&gt;
===Possible problems===&lt;br /&gt;
&lt;br /&gt;
# Slightly less accessible (unless you are comparing with the current situation that actually chops off text for most users even before you start resizing fonts, and is therefore infinitely less accessible, of course). &lt;br /&gt;
# Hurts our pride to give up on a 2, 1, 3 layout.&lt;br /&gt;
&lt;br /&gt;
==Proposed solution 3 - JavaScript ==&lt;br /&gt;
&lt;br /&gt;
Add some JavaScript to the page, so that once everything has been laid out, it computes how wide the page needs to be to avoid truncation, and then changes the min-width: 900px to whatever width is needed to make the content fit.&lt;br /&gt;
&lt;br /&gt;
===Advantages===&lt;br /&gt;
&lt;br /&gt;
# Might be the easiest solution to implement.&lt;br /&gt;
&lt;br /&gt;
===Possible problems===&lt;br /&gt;
&lt;br /&gt;
# Ewwwwwww! This is clearly a horrible hack.&lt;br /&gt;
# JavaScript for layout is deeply evil.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Proposed solution 4 - Admin theme ==&lt;br /&gt;
&lt;br /&gt;
Use different page layouts for different needs. Admin/settings pages show very different content than the normal learning pages. All pages for admins and teachers where they change settings or edit content are shown with the admin theme. Two different page layouts would solve a lot of issues. In for example WordPress and Drupal the concept of the admin theme for admin/settings pages and the &amp;quot;nice&amp;quot; theme for content is standard.&lt;br /&gt;
&lt;br /&gt;
# Use an &amp;quot;admin theme&amp;quot; with flexible width and a 1-2  layout for the admin and settings pages. The huge tables are mainly on the admin pages. Most table issues would be solved this way.&lt;br /&gt;
# Use the existing 2-1-3 fixed width layout for all learning pages.&lt;br /&gt;
# Change all tables in the forum layout and other modules if existent to div layouts.&lt;br /&gt;
# Create a filter to display a miniature of oversized media and open the original size in a bigger overlay on click. The maximum width can be a setting in the filter to fit different theme needs.&lt;br /&gt;
&lt;br /&gt;
===Advantages===&lt;br /&gt;
&lt;br /&gt;
# The pages with different needs get different layouts better fitting these needs.&lt;br /&gt;
# One optimized admin theme can be used with many different themes. Theme designers can focus on the content pages when they work on themes.&lt;br /&gt;
# The flexible width admin theme helps a lot when the content shall be displayed in any fixed width page layout. &lt;br /&gt;
# The different look of the admin theme signals: be careful - you are changing things which may seriously affect the system or the learning content.&lt;br /&gt;
# I use an flexible width admin theme I developed for some time now with all fixed width themes and solve the table width issues on admin/settings pages. It&#039;s always the same admin theme with very different content themes.&lt;br /&gt;
&lt;br /&gt;
===Possible problems===&lt;br /&gt;
&lt;br /&gt;
# The deeply nested forum threads issues are not solved with the admin theme.&lt;br /&gt;
&lt;br /&gt;
==Opinions==&lt;br /&gt;
&lt;br /&gt;
; Tim&lt;br /&gt;
: I vote for 2, or failing that 3. I think 1. will not work.&lt;br /&gt;
&lt;br /&gt;
; Sam&lt;br /&gt;
: agree with Tim except I don&#039;t think 3 is likely to be reliable either.&lt;br /&gt;
: http://moodle.org/mod/cvsadmin/view.php?conversationid=5929&lt;br /&gt;
&lt;br /&gt;
; Frank&lt;br /&gt;
: IMHO the only real problem is &#039;&#039;&#039;2.2.Tables for internal layout (like the forum)&#039;&#039;&#039; and possibly 3.2. (Which, by the way, only proves that tables for layout are a bad thing, [[User:Frank Ralf/Semantic HTML3]]).  Any other &#039;&#039;oversized, unwrappable content&#039;&#039; will break the layout one way or another and should be the responsibility of the author. That said, I favor solution 2; any solution which requires JavaScript (3) only makes the situation even more complex. --[[User:Frank Ralf|Frank Ralf]] 14:41, 26 October 2010 (UTC)&lt;br /&gt;
&lt;br /&gt;
; Urs&lt;br /&gt;
: I vote for 4. &lt;br /&gt;
: 3 is no option - from my experience using JavaScript to correct page issues breaks every once in a while.&lt;br /&gt;
: 2 does not solve the table width issue in fixed width themes.&lt;br /&gt;
: 1 seams to offer more problems than advantages.&lt;br /&gt;
: Please don&#039;t throw out the existing 2-1-3 page layout. In my opinion to skip it means much more than it &amp;quot;Hurts our pride to give up on a 2, 1, 3 layout.&amp;quot;. By introducing an admin specific theme many issues can be solved. Additionally theme designers have less pages to work on.&lt;br /&gt;
: I thought all table based page layouts should have gone in Moodle 2.0.&lt;br /&gt;
&lt;br /&gt;
==Chosen solution==&lt;br /&gt;
Thank you to everyone for your thoughts both in this discussion and the developers chat.&lt;br /&gt;
&lt;br /&gt;
The solution that we will go with is as follows:&lt;br /&gt;
&lt;br /&gt;
# An option will be added to format text that when set to true will wrap the text in a final div before returning it. This div will have a class with a predefined style so that large content is displayed with scrollbars if required,&amp;lt;br /&amp;gt;The option will be &#039;&#039;&#039;off by default&#039;&#039;&#039; but as part of the solution a review of format_text usage will be performed and the option turned on where required.&lt;br /&gt;
# Forum posts will be converted from using tables for layout to a div structure. I have already created a patch for this which is largely backwards compatible with existing themes and changes the forum posts structure as little as possible.&lt;br /&gt;
# A new &#039;&#039;&#039;report&#039;&#039;&#039; layout will be created, see the section below for details. A review all reports and uses of tables for pages where the new report layout should be implemented.&lt;br /&gt;
&lt;br /&gt;
As well as the above tasks there will of course be the ongoing tasks of locating areas also affected by this problem and finding solutions on a case by case basis.&lt;br /&gt;
&lt;br /&gt;
===The report layout=== &lt;br /&gt;
The new layout won&#039;t use the 2,1,3 structure of existing layouts and won&#039;t be quite so accessible which isn&#039;t a big concern as we will only use it when there is no other option and in those few cases the content is normally not at all accessible anyway.&lt;br /&gt;
&lt;br /&gt;
This layout will have one block region by default and will be a 1,2 layout (1=blocks, 2=content).&lt;br /&gt;
&lt;br /&gt;
It is unfortunate that we need to move away from the 2,1,3 layout for the default themes (base, and standard) however after much deliberation it was decided that this was going to provide the most natural feel for most users.&lt;br /&gt;
This will only be done in this one layout and it will be stressed that this layout only be used where absolutely essential, in fact it will only be allowed in situations where the content is tabulated data that is likely to require it.&lt;br /&gt;
Anywhere tables have been used incorrectly will be converted as part of the ongoing tasks.&lt;br /&gt;
&lt;br /&gt;
As part of the deliberations and trials with this there was also a report layout created that would be more accessible where the blocks were below the main content (block laid out horizontally as well). This layout whilst not used in the end will be preserved in a docs which I will link to after I write it.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Calendar_API_old&amp;diff=64157</id>
		<title>Calendar API old</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Calendar_API_old&amp;diff=64157"/>
		<updated>2024-05-02T01:37:09Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
This page documents the calendar API that existed before Moodle 3.3. For the API since then, see [[Calendar API]].&lt;br /&gt;
&lt;br /&gt;
The Calendar API allows you to add and modify events in the calendar for user, groups, courses, or the whole site.&lt;br /&gt;
&lt;br /&gt;
==Overview==&lt;br /&gt;
&lt;br /&gt;
The Moodle [[:en:Calendar|Calendar]] collects and displays calendar events from everything users have access to.&lt;br /&gt;
&lt;br /&gt;
If your plugin generates calendar events (such as due dates) then you need to add your events to the calendar.&lt;br /&gt;
&lt;br /&gt;
==File locations==&lt;br /&gt;
&lt;br /&gt;
All the calendar code is located in /calendar/lib.php.  You need to include this file in your script if you intend to use it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==The calendar_event class==&lt;br /&gt;
&lt;br /&gt;
In general functionality of calendar_event() class are to create, update and delete events.&lt;br /&gt;
&lt;br /&gt;
===Creating new event===&lt;br /&gt;
Creating new calendar event to database by defining some properties for the event.  &lt;br /&gt;
&lt;br /&gt;
If event hook is used, it will also call self::calendar_event_hook() to create event for the hook.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_event::create($properties)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Updating event===&lt;br /&gt;
Updating an existing event in database by providing at least an event id.  If the event is a repeated events, the rest of series event will also be updated (depending on the properties value of repeateditall).  This function could also be use to insert new event to database If the requested event is not exist in database.  The optional parameter $checkcapability is use to check user&#039;s capability to edit/add event.  By default $checkcapability parameter is set to true.  &lt;br /&gt;
&lt;br /&gt;
If event hook is used, it will also call self::calendar_event_hook() to update the hook event.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_event::update($data, $checkcapability = true)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Deleting event===&lt;br /&gt;
Deleting an existing event in database.  The optional parameter $deleterepeated is use as indicator to remove the rest of repeated events.  The default value for $deleterepeated is true. Deleting an event will also deleting all associated files related to the event&#039;s editor context.&lt;br /&gt;
&lt;br /&gt;
If event hook is used, it will also call self::calendar_event_hook() to delete event for the hook.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$calendar_event = new calendar_event($event_data);&lt;br /&gt;
$calendar_event-&amp;gt;delete($deleterepeated = false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Event hook===&lt;br /&gt;
The capability to use hook to perform specific action to calendar event.  This requires setting up $CFG-&amp;gt;calendar and include external calendar file in $CFG-&amp;gt;dirroot .&#039;/calendar/&#039;. $CFG-&amp;gt;calendar .&#039;/lib.php&#039;).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_event_hook($action, array $args)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Functions==&lt;br /&gt;
List of function for calendar and calendar_event.&lt;br /&gt;
&lt;br /&gt;
===Retrieve or print calendar&#039;s information===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_get_default_courses()&lt;br /&gt;
calendar_get_days()&lt;br /&gt;
calendar_get_starting_weekday()&lt;br /&gt;
calendar_day_representation($tstamp, $now = false, $usecommonwords = true)&lt;br /&gt;
calendar_time_representation($time)&lt;br /&gt;
calendar_wday_name($englishname)&lt;br /&gt;
calendar_days_in_month($month, $year)&lt;br /&gt;
calendar_get_link_href($linkbase, $d, $m, $y)&lt;br /&gt;
calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_year = false)&lt;br /&gt;
calendar_get_popup($is_today, $event_timestart, $popupcontent = &#039;&#039;) &lt;br /&gt;
calendar_add_month($month, $year)&lt;br /&gt;
calendar_sub_month($month, $year)&lt;br /&gt;
calendar_get_module_cached(&amp;amp;$coursecache, $modulename, $instance) &lt;br /&gt;
calendar_get_course_cached(&amp;amp;$coursecache, $courseid)&lt;br /&gt;
calendar_print_month_selector($name, $selected)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Control calendar display===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_top_controls($type, $data)&lt;br /&gt;
calendar_filter_controls(moodle_url $returnurl)&lt;br /&gt;
calendar_preferences_button(stdClass $course)&lt;br /&gt;
calendar_set_filters(array $courseeventsfrom, $ignorefilters = false)&lt;br /&gt;
calendar_get_link_previous($text, $linkbase, $d, $m, $y, $accesshide = false)&lt;br /&gt;
calendar_get_link_next($text, $linkbase, $d, $m, $y, $accesshide = false)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Retrieve calendar_event information===&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
calendar_get_allowed_types(&amp;amp;$allowed, $course = null)&lt;br /&gt;
calendar_add_event_allowed($event) &lt;br /&gt;
calendar_edit_event_allowed($event)&lt;br /&gt;
calendar_user_can_add_event($course)&lt;br /&gt;
calendar_show_event_type($type, $user = null)&lt;br /&gt;
calendar_set_event_type_display($type, $display = null, $user = null)&lt;br /&gt;
calendar_get_events($tstart, $tend, $users, $groups, $courses, $withduration = true, $ignorehidden = true)&lt;br /&gt;
calendar_events_by_day($events, $month, $year, &amp;amp;$eventsbyday, &amp;amp;$durationbyday, &amp;amp;$typesbyday, &amp;amp;$courses) &lt;br /&gt;
calendar_get_upcoming($courses, $groups, $users, $daysinfuture, $maxevents, $fromtime = 0)&lt;br /&gt;
calendar_get_block_upcoming($events, $linkhref = NULL)&lt;br /&gt;
calendar_format_event_time($event, $now, $linkparams = null, $usecommonwords = true, $showtime = 0)&lt;br /&gt;
calendar_add_event_metadata($event)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following are examples of using the basic calendar_event API in Moodle.&lt;br /&gt;
&lt;br /&gt;
===Example to create new event===&lt;br /&gt;
Creating new calendar event for closing feedback date.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$event = new stdClass;&lt;br /&gt;
$event-&amp;gt;name         = get_string(&#039;stop&#039;, &#039;feedback&#039;).&#039; &#039;.$feedback-&amp;gt;name;&lt;br /&gt;
$event-&amp;gt;description  = format_module_intro(&#039;feedback&#039;, $feedback, $feedback-&amp;gt;coursemodule);&lt;br /&gt;
$event-&amp;gt;courseid     = $feedback-&amp;gt;course;&lt;br /&gt;
$event-&amp;gt;groupid      = 0;&lt;br /&gt;
$event-&amp;gt;userid       = 0;&lt;br /&gt;
$event-&amp;gt;modulename   = &#039;feedback&#039;;&lt;br /&gt;
$event-&amp;gt;instance     = $feedback-&amp;gt;id;&lt;br /&gt;
$event-&amp;gt;eventtype    = &#039;feedbackcloses&#039;; // For activity module&#039;s events, this can be used to set the alternative text of the event icon. Set it to &#039;pluginname&#039; unless you have a better string.&lt;br /&gt;
$event-&amp;gt;timestart    = $feedback-&amp;gt;timeclose;&lt;br /&gt;
$event-&amp;gt;visible      = instance_is_visible(&#039;feedback&#039;, $feedback);&lt;br /&gt;
$event-&amp;gt;timeduration = 0;&lt;br /&gt;
&lt;br /&gt;
calendar_event::create($event);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Updating existing calendar event===&lt;br /&gt;
Simple example of updating exiting event through moodle form.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$eventid = required_param(&#039;id&#039;, PARAM_INT);&lt;br /&gt;
$event = calendar_event::load($eventid);&lt;br /&gt;
&lt;br /&gt;
$data = $mform-&amp;gt;get_data();&lt;br /&gt;
$event-&amp;gt;update($data);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Deleting existing calendar event===&lt;br /&gt;
Simple example of deleting existing event from database.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$eventid = required_param(&#039;id&#039;, PARAM_INT);&lt;br /&gt;
$event = calendar_event::load($eventid);&lt;br /&gt;
$event-&amp;gt;delete($repeats);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Core APIs]]&lt;br /&gt;
* [[:en:Calendar|Calendar user docs]]&lt;br /&gt;
* [[Calendar types]]&lt;br /&gt;
&lt;br /&gt;
[[Category:API]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Collaborate&amp;diff=64156</id>
		<title>Collaborate</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Collaborate&amp;diff=64156"/>
		<updated>2024-05-02T01:35:55Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
A module for integration with Blackboard Collaborate.&lt;br /&gt;
&lt;br /&gt;
Now your users can join a Collaborate with the Ultra experience session from their Moodle class. They don&#039;t need to install Java or download and open Java-reliant files to their devices. The session opens in a new window or tab, depending on a their browser settings.&lt;br /&gt;
&lt;br /&gt;
When you install and enable the module, your instructors can add Collaborate to their classes. They can create virtual classrooms, offices, and meeting spaces to engage their students in a more collaborative and interactive learning experience.&lt;br /&gt;
&lt;br /&gt;
Visit [https://en-us.help.blackboard.com/Moodlerooms/Administrator/020_Manage_a_Site/050_External_Tools/010_Blackboard_Collaborate Blackboard&#039;s Help documentation on Collaborate] for more information&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Code_Cross-Reference&amp;diff=64155</id>
		<title>Code Cross-Reference</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Code_Cross-Reference&amp;diff=64155"/>
		<updated>2024-05-02T01:35:32Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
There used to be a code cross-reference at http://xref.moodle.org (generated from the Moodle source code using [http://phpxref.sourceforge.net/ PPHPXref])&lt;br /&gt;
&lt;br /&gt;
Unfortunately it can no longer be maintained on that server.  If you create a replacement site please link to it from this page.&lt;br /&gt;
&lt;br /&gt;
To have xref.moodle.org pointed to your site, please contact Martin Dougiamas via the http://moodle.com/helpdesk&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Access the Moodle 1.8&#039;&#039;&#039; Code [http://72.15.209.135/index.html cross-reference here]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Testing_strategy/The_Moodle_Testing_Process&amp;diff=64154</id>
		<title>Testing strategy/The Moodle Testing Process</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Testing_strategy/The_Moodle_Testing_Process&amp;diff=64154"/>
		<updated>2024-05-01T23:17:34Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
=Methodologies in the Moodle Development Process=&lt;br /&gt;
Moodle has an established process for developing and integrating software. This section describes relevant testing methodology within the existing process.&lt;br /&gt;
The full [https://docs.moodle.org/dev/Process development]&lt;br /&gt;
life-cycle at Moodle is documented in detail [https://docs.moodle.org/dev/Releases#General_release_calendar elsewhere].&lt;br /&gt;
Moodle is currently developed using Agile methodologies including&lt;br /&gt;
Scrum. The following stages of development take place within this&lt;br /&gt;
life-cycle:&lt;br /&gt;
&lt;br /&gt;
* Weekly integration cycle&lt;br /&gt;
* 3-weekly stable sprints&lt;br /&gt;
* 6-monthly major releases&lt;br /&gt;
* 3 minor releases between every major release&lt;br /&gt;
&lt;br /&gt;
==Weekly (Continuous) Integration Cycle==&lt;br /&gt;
A manual testing phase of integration issues occurs towards&lt;br /&gt;
the end of the SDLC at Moodle during the Wednesday (AWST) testing&lt;br /&gt;
phase. This is the last possible chance Moodle gets to capture&lt;br /&gt;
regressions. Relying soley on this phase to capture regressions could result in the late discovery of regressions&lt;br /&gt;
during unguided exploratory testing and worse still the introduction&lt;br /&gt;
of regressions into Master. Discovery of issues late in the SDLC&lt;br /&gt;
prevents issues from being dealt with in a timely manner when&lt;br /&gt;
integrators, or even those writing the code, are able to resolve those issues relatively easily.&lt;br /&gt;
&lt;br /&gt;
The processes described here ensure the bulk of&lt;br /&gt;
testing and the majority of responsibility for capturing regressions&lt;br /&gt;
does not lie with the Wednesday testing phase. Testing is performed as early in the SDLC as possible.&lt;br /&gt;
==New Unit Tests==&lt;br /&gt;
Creating unit tests prior to coding starts&lt;br /&gt;
the whole SDLC off with a focus on quality. If code isn&#039;t&lt;br /&gt;
considered complete until unit tests pass, then the code itself will&lt;br /&gt;
be of a high quality by the time it is implemented. This also creates a&lt;br /&gt;
repository of unit regression tests in an iterative manner while not&lt;br /&gt;
requiring of a great deal of extra effort to write those tests. As&lt;br /&gt;
these tests are added, they will provide early regression testing of&lt;br /&gt;
new code.&lt;br /&gt;
&lt;br /&gt;
Unit tests in the PHPUnit framework are a requirement when submitting code to Moodle.&lt;br /&gt;
&lt;br /&gt;
==Integration Steps==&lt;br /&gt;
===Step 1: GIT Pull to integration CI server===&lt;br /&gt;
When developers are ready to submit their code into the integration process, they set the status of the tracker issue to &#039;Ready for integration&#039;. This in turn triggers the Jenkins CI job &amp;quot;Pre-check remote branch&amp;quot;. This job performs the following tasks:&lt;br /&gt;
* Pull the changes to a local branch on the Integration CI Server.&lt;br /&gt;
** git reset --hard origin =&amp;gt; so it is in the same status than the official git repository&lt;br /&gt;
** git pull =&amp;gt; get the changes proposed by a developer&lt;br /&gt;
* Run checks on the code.&lt;br /&gt;
* Generate a results artefact that is sent to the developer.&lt;br /&gt;
&lt;br /&gt;
Please note; each job begins by resetting the local git repository to the original state so the pulls are never permanent. This mitigates the risk posed by &amp;quot;collisions&amp;quot; as the purpose of this step is not to test for &amp;quot;collisions&amp;quot; between conflicting patches but to verify that code meets the required standard to proceed to peer review.&lt;br /&gt;
===Step 2: Peer Review===&lt;br /&gt;
Any code sent back to the developer at Peer Review, after any changes have been made, must be must pass step 1 again before re-review.&lt;br /&gt;
===Step 3: GIT Pull to integration===&lt;br /&gt;
Code passing peer review can be pulled from the developers repository to integration where, among other things, the main Jenkins integration jobs run. At this stage integrators also check for &amp;quot;collisions&amp;quot; and conflicts between submitted patches.&lt;br /&gt;
===Step 4: GIT Pull to Nightly Build Machine, performance and browser driven automation suite===&lt;br /&gt;
A set of regression tests are run at 2AM AWST Daily. These tests are scheduled to run automatically from the Moodle test automation framework and run on all supported platforms e.g. all databases MySQL, Oracle, MSSQL, PostgreSQL. The following tests are performed in this order:&lt;br /&gt;
# Moodle unit tests, including those submitted by developers.&lt;br /&gt;
# PerfComp performance comparison tests.&lt;br /&gt;
# Selenium acceptance tests, automated browser tests based upon the existing Moodle QA test suite.&lt;br /&gt;
===Step 5: Issue retest===&lt;br /&gt;
On Wednesday (AWST) the manual issue retesting is performed at Moodle HQ. Issue test steps must be clear and concise, allowing the issue to be recreated easily. Testing steps must go in the testing instructions field to prove that the bug is resolved. Areas of Moodle to investigate with extra exploratory testing should be entered here also.&lt;br /&gt;
&lt;br /&gt;
==Stable Sprints and Point Releases==&lt;br /&gt;
Development work performed during stable sprints and point releases are subject to the stringent integration review and testing process described above.&lt;br /&gt;
&lt;br /&gt;
==Major Releases and New Development==&lt;br /&gt;
The Moodle QA cycle is a user acceptance testing phase at the end of every 6 month development cycle and is a chance for the community to become directly involved in road testing the latest testing release. &lt;br /&gt;
&lt;br /&gt;
In reality testing starts much earlier in the development process. All code submitted to Moodle has to pass through the integration process and normally does so in an incremental manner. Any additional testing to be undertaken for a Moodle release is tailored to what will be in that release and defined in the [https://docs.moodle.org/dev/2.4_Test_Plan current release test plan test plan ].&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=en/Mathjax_docs_changes&amp;diff=64153</id>
		<title>en/Mathjax docs changes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=en/Mathjax_docs_changes&amp;diff=64153"/>
		<updated>2024-05-01T23:14:47Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
In MDL-44780 the new Mathjax filter was turned on by default in Moodle 2.7. The following user documentation changes are suggested.&lt;br /&gt;
&lt;br /&gt;
==https://docs.moodle.org/26/en/Performance_recommendations==&lt;br /&gt;
&lt;br /&gt;
I would suggest a link to https://docs.moodle.org/26/en/Performance_settings at the end of the &amp;quot;Performance of different Moodle modules&amp;quot; section in the form of a link like &amp;quot;Click here for additional information on performance related Moodle settings&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
==https://docs.moodle.org/26/en/Performance_settings==&lt;br /&gt;
&lt;br /&gt;
There current text is...&lt;br /&gt;
&lt;br /&gt;
Check your filters. Having too many filters active can have serious effects on server load, especially on lower-end systems. The number of active filters has a direct effect on the perceived latency of your site; that is the time taken for each page impression. &lt;br /&gt;
&lt;br /&gt;
My suggestion is...&lt;br /&gt;
&lt;br /&gt;
Check your filters. Having too many filters active can have serious effects on server load, especially on lower-end systems. The number of active filters has a direct effect on the perceived latency of your site; that is the time taken for each page impression. Check if any of the filters can be disabled. For example, if your site does not need to be able to display mathematical equations you can disable the Mathjax filter.&lt;br /&gt;
&lt;br /&gt;
==Thanks==&lt;br /&gt;
Changes added to 2.7 docs, thanks. --[[User:Mary Cooch|Mary Cooch]] ([[User talk:Mary Cooch|talk]]) 20:15, 5 May 2014 (WST)&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Community_hub_tests&amp;diff=64152</id>
		<title>Community hub tests</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Community_hub_tests&amp;diff=64152"/>
		<updated>2024-05-01T05:00:43Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note:&#039;&#039;&#039; This list is a work in progress. See [[QA testing]] if you&#039;d like to help writing new QA tests and if you have any questions or comments on any aspect of our QA testing process, please post in the [http://moodle.org/mod/forum/view.php?id=56 Testing and QA forum].&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page lists community hub tests with links to corresponding QA tests.&lt;br /&gt;
&lt;br /&gt;
If you&#039;d like to help with Moodle testing, see [[QA testing]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Requirement:&#039;&#039;&#039; for most of these tests you will need to have access to a site and a hub as administrator.&lt;br /&gt;
&lt;br /&gt;
==Hub registration==&lt;br /&gt;
* MDLQA-123 Register a hub  &lt;br /&gt;
* MDLQA-XX Update a hub  &lt;br /&gt;
* MDLQA-124 Unregister a hub&lt;br /&gt;
&lt;br /&gt;
==Site registration==&lt;br /&gt;
* MDLQA-125 Register a site&lt;br /&gt;
* MDLQA-XX Update a site&lt;br /&gt;
* MDLQA-126 Unregister a site&lt;br /&gt;
&lt;br /&gt;
==Course publication==&lt;br /&gt;
* MDLQA-127 A teacher can advertise a course on a hub&lt;br /&gt;
* MDLQA-XX A teacher can update an advertised course&lt;br /&gt;
* MDLQA-128 A teacher can share a course on a hub&lt;br /&gt;
* MDLQA-129 A teacher can remove an advertised or shared course on a hub&lt;br /&gt;
&lt;br /&gt;
==Community block==&lt;br /&gt;
* MDLQA-XX Add a course to the community block&lt;br /&gt;
* MDLQA-XX Download a course&lt;br /&gt;
&lt;br /&gt;
[[Category:Functional testing]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Main_features&amp;diff=64151</id>
		<title>Main features</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Main_features&amp;diff=64151"/>
		<updated>2024-05-01T04:59:07Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
The main features of the survey module are:&lt;br /&gt;
&lt;br /&gt;
* branching based on answer given by the users&lt;br /&gt;
* mandatory question answer&lt;br /&gt;
* user entry validation&lt;br /&gt;
* capability based access to survey elements&lt;br /&gt;
* permissions for groups of users feeding the same surveys submission&lt;br /&gt;
* pluggable question types&lt;br /&gt;
* pluggable format types&lt;br /&gt;
* pluggable master templates&lt;br /&gt;
* pluggable reports&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=PHPXref&amp;diff=64150</id>
		<title>PHPXref</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=PHPXref&amp;diff=64150"/>
		<updated>2024-05-01T04:57:20Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{stub}}&lt;br /&gt;
&lt;br /&gt;
== What is PHPXref? ==&lt;br /&gt;
&lt;br /&gt;
PHPXref is a developer tool that&#039;s designed to ease the process of working on large PHP projects by making it very fast and easy to browse the code documentation along with the code itself.&lt;br /&gt;
&lt;br /&gt;
It works by scanning a project directory and translating the files it finds into readable cross-referenced HTML, simultaneously utilizing comments in the code to produce documentation to accompany it.&lt;br /&gt;
&lt;br /&gt;
The result is a collection of plain HTML files that can be read using any browser, with no supporting software required. &amp;lt;br /&amp;gt;&lt;br /&gt;
(see http://phpxref.sourceforge.net)&lt;br /&gt;
&lt;br /&gt;
== Moodle and PHPXref ==&lt;br /&gt;
&lt;br /&gt;
For the most up-to-date and detailed description of how the Moodle code works you can [http://xref.moodle.org browse the code online].&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Usually with PHPXref you can search for a class, functions, variables, constants and tables. When searching for a function (eg. get_records) you will reach a page wich lists where it id defined and where it is referenced, giving you a better idea of what it is used for.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=PHP_error_logs&amp;diff=64149</id>
		<title>PHP error logs</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=PHP_error_logs&amp;diff=64149"/>
		<updated>2024-05-01T04:56:39Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command. &lt;br /&gt;
&lt;br /&gt;
== How to enable and check PHP error logs==&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways: two of these involve the use of the php.ini file and the ini_set command. &lt;br /&gt;
* &#039;&#039;&#039;Using the php.ini file&#039;&#039;&#039;: The log settings are contained in the php.ini file stored on the server. If you don&#039;t know where that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
:then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
:When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039;, &#039;&#039;&#039;display_startup_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Using ini_set commands&#039;&#039;&#039;: If you are using Moodle 1.7 or higher, the previous steps are not enough. In those versions error logging parameters are dependant on certain administrative settings that you specify in the debugging section. The problem is that if you can&#039;t access the administrative pages, you can&#039;t set the debugging options. So the only way to modify them is by adding the following lines to your config.php file, just before the last line (the one containing a single&#039;?&amp;gt;&#039; , if present):&lt;br /&gt;
&lt;br /&gt;
  ini_set (&#039;display_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;log_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;display_startup_errors&#039;, &#039;on&#039;);&lt;br /&gt;
  ini_set (&#039;error_reporting&#039;, E_ALL);&lt;br /&gt;
  $CFG-&amp;gt;debug = 30719; // DEBUG_ALL, but that constant is not defined here.&lt;br /&gt;
&lt;br /&gt;
:This will enable the same settings specified above even if Moodle sets them otherwise. &lt;br /&gt;
:&#039;&#039;&#039;Important&#039;&#039;&#039;: Remember to put them just before the last line of config.php.&lt;br /&gt;
&lt;br /&gt;
Debug Mode for version 3.9:&lt;br /&gt;
@error_reporting(E_ALL | E_STRICT); &lt;br /&gt;
@ini_set(&#039;display_errors&#039;, &#039;1&#039;); &lt;br /&gt;
$CFG-&amp;gt;debug = (E_ALL | E_STRICT); &lt;br /&gt;
$CFG-&amp;gt;debugdisplay = 1;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Error Logs== &lt;br /&gt;
&lt;br /&gt;
The default settings of the PHP Error Log file varies from OS to OS. The location of the error log file itself can be set manually in the php.ini file. On a Windows server, in IIS, it may be something like  &amp;quot;&#039;error_log = C:\log_files\php_errors.log&#039;&amp;quot; in Linux it may be a value of &amp;quot;&#039;/var/log/php_errors.log&#039;&amp;quot;. The php_errors.log file may be required to be manually created, which would mean that the ownership and rw permissions will need to be set accordingly. &lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[[:en:Installing Moodle|Installing Moodle]]&lt;br /&gt;
*[[:en:Installation FAQ|Installation FAQ]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=PHP_FAQ&amp;diff=64148</id>
		<title>PHP FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=PHP_FAQ&amp;diff=64148"/>
		<updated>2024-05-01T04:56:16Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
== What is PHP? ==&lt;br /&gt;
&lt;br /&gt;
PHP  is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML.&lt;br /&gt;
&lt;br /&gt;
== Where can I learn more about PHP? ==&lt;br /&gt;
&lt;br /&gt;
=== Online resources: ===&lt;br /&gt;
&lt;br /&gt;
* The [http://www.php.net official PHP Homepage] with documentation, tutorials, FAQ, etc.&lt;br /&gt;
* The [http://www.w3schools.com/PHP/DEfaULT.asP W3Schools PHP Tutorial] is a great way to learn about PHP by example.&lt;br /&gt;
&lt;br /&gt;
=== Books: ===&lt;br /&gt;
&lt;br /&gt;
* [http://books.google.de/books?id=iUfIqyAbIU4C&amp;amp;output=html PHP Cookbook] by David Sklar and Adam Trachtenberg.&lt;br /&gt;
* [http://www.manning.com/reiersol/ PHP in Action] by Dagfinn Reiersøl with Marcus Baker and Chris Shiflett. ([http://books.slashdot.org/article.pl?sid=08/01/23/1446243 Book review on Slashdot].)&lt;br /&gt;
&lt;br /&gt;
== How is PHP used by Moodle? ==&lt;br /&gt;
&lt;br /&gt;
* [[:en:Installing Moodle/Creating custom php.ini files|Installing Moodle/Creating custom php.ini files]]&lt;br /&gt;
* [[:en:PHP settings by Moodle version|PHP settings by Moodle version]]&lt;br /&gt;
* [[PHP error logs]]&lt;br /&gt;
* [http://moodle.org/mod/forum/search.php?notwords=Re:&amp;amp;id=5&amp;amp;subject=php.ini php.ini related discussions] in the Moodle forums&lt;br /&gt;
&lt;br /&gt;
== Which version of PHP is required by Moodle? ==&lt;br /&gt;
&lt;br /&gt;
* See [[:en:Installing_Moodle#Requirements|Installation requirements]]. &lt;br /&gt;
* You can tell which version you are using by looking at [[:en:PHP info|PHP info]].&lt;br /&gt;
&lt;br /&gt;
==How do I install PHP?==&lt;br /&gt;
&lt;br /&gt;
Usually you don&#039;t have to install PHP at all, as normally it is installed alongside [[:en:Apache|Apache]] and [[:en:MySQL|MySQL]] in a combination known as AMP (see [[:en:Installing AMP|Installing AMP]] for details). If you run Moodle on hosted web space PHP is also usually installed already.&lt;br /&gt;
&lt;br /&gt;
It is possible to build PHP from source - you might have to if you need a very new version for developing Moodle - however, it is quite challenging. PHP itself has many dependencies that you will need to obtain and build, some of which are also tricky to build from source (e.g. GD).&lt;br /&gt;
&lt;br /&gt;
==How do I check the PHP configuration on my server?==&lt;br /&gt;
Run the [http://www.php.net/manual/en/function.phpinfo.php phpinfo()] command. It will display a whole lot of information about the current PHP configuration on your server.&lt;br /&gt;
&lt;br /&gt;
You can also run this command from within Moodle. This option is available under &lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;Administration &amp;gt; Server &amp;gt; PHP info&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The PHP info page provides information on the version of PHP your server is running, including PHP compilation options and extensions, server information, the PHP environment and OS version information.&lt;br /&gt;
&lt;br /&gt;
If you have a problem with your Moodle site and ask for help in a Moodle.org forum, you may be asked to provide some information from this page.&lt;br /&gt;
&lt;br /&gt;
See also [[:en:phpinfo|phpinfo]] and [http://www.php.net/manual/en/function.phpinfo.php PHP manual: phpinfo].&lt;br /&gt;
&lt;br /&gt;
== See also: ==&lt;br /&gt;
&lt;br /&gt;
* [[:en:Installing MSSQL for PHP|Installing MSSQL for PHP]]&lt;br /&gt;
* [[:en:Installing Oracle for PHP|Installing Oracle for PHP]]&lt;br /&gt;
* [[:en:Installing Postgres for PHP|Installing Postgres for PHP]] &lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Reference&amp;diff=64147</id>
		<title>Reference</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Reference&amp;diff=64147"/>
		<updated>2024-05-01T04:55:35Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
==This is the start of a few pages of largely version independent reference==&lt;br /&gt;
&lt;br /&gt;
In the spirit of wiki and in response to the post here: http://moodle.org/mod/forum/discuss.php?d=205117&lt;br /&gt;
&lt;br /&gt;
Go for it Guillermo.&lt;br /&gt;
&lt;br /&gt;
Maybe start here, and later on add a category:Reference and see what happens.  I&#039;ve set a watch on, and I may do a page on JSON errors.&lt;br /&gt;
&lt;br /&gt;
= Database =&lt;br /&gt;
&lt;br /&gt;
I&#039;ll start writing here about database and utf8 issues, but I guess that the idea would be for this to be the main reference table of contents page so it then links to each main topic page.&lt;br /&gt;
&lt;br /&gt;
== Basic concepts ==&lt;br /&gt;
&lt;br /&gt;
=== Byte, character, character set, character encoding and collation ===&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;byte&amp;lt;/span&amp;gt; (or &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;octet&amp;lt;/span&amp;gt;) is the smallest unit of storage that can be allocated and, in almost all modern computers, it consists of 8 bits, where a bit can only have two values: 0 or 1.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character&amp;lt;/span&amp;gt; is a symbol used in a writing system, such as a letter of the alphabet.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character set&amp;lt;/span&amp;gt;, or a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;coded character set&amp;lt;/span&amp;gt;, refers to the set of characters and numbers, or &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;code points&amp;lt;/span&amp;gt;, used to represent them. A code point can be understood as the position the character occupies in the set.&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character encoding&amp;lt;/span&amp;gt;, or a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character encoding form&amp;lt;/span&amp;gt;, refers to how the code points are converted (encoded) into &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;code values&amp;lt;/span&amp;gt; to be saved or stored in a computer.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;Unicode&amp;lt;/span&amp;gt; is a character set developed to consistently encode, represent and handle text in most of the world&#039;s writing systems in use today. Unicode can be implemented by different character encodings, where the two most commonly used are UTF-8 and UTF-16:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;UTF-8&#039;&#039;&#039; is a variable-width character encoding that can represent every character in the Unicode character set. UTF-8 encodes each of the 1,112,064 code points in the Unicode character set using one to four bytes.&lt;br /&gt;
:* &#039;&#039;&#039;Note&#039;&#039;&#039;. MySQL utf8 Unicode character set uses a maximum of three bytes per multi-byte character (http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8.html).&lt;br /&gt;
* &#039;&#039;&#039;UTF-16&#039;&#039;&#039; is a variable-length character encoding for Unicode that uses one or two 16-bit code units, where each unit takes two 8-bit bytes, and the order of the bytes may depend on the byte order (&amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;endianness&amp;lt;/span&amp;gt;) of the computer architecture. To assist in recognizing the byte order of code units, UTF-16 allows a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;Byte Order Mark&amp;lt;/span&amp;gt; (BOM), a code unit with the hexadecimal value U+FEFF, to precede the first actual coded value.&lt;br /&gt;
&lt;br /&gt;
Eventhough UTF-8 is the preferred character encoding nowadays, many others have been used, for example:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;ISO-8859-1&#039;&#039;&#039; (or &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;Latin-1&amp;lt;/span&amp;gt;). A character encoding for the Latin script, where each character is encoded as a single 8-bit code value. This character-encoding scheme consists of 191 characters and it is used throughout The Americas, Western Europe, Oceania, and much of Africa. It is also commonly used in most standard romanizations of East-Asian languages.&lt;br /&gt;
* &#039;&#039;&#039;ISO-8859-15&#039;&#039;&#039; (or &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;Latin-9&amp;lt;/span&amp;gt;). A character encoding similar to Latin-1, except that it substituted some rarely used characters with the euro sign and a few other letters.&lt;br /&gt;
* &#039;&#039;&#039;Shift JIS&#039;&#039;&#039;. A character encoding for the Japanese language.&lt;br /&gt;
&lt;br /&gt;
To illustrate the concepts given above, the € (euro) character has a code point equal to 8364 (or U+20AC, in hexadecimal notation) in the Unicode character set. This code point can be stored in different ways, depending on the character encoding used:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Character encoding&lt;br /&gt;
! Code value (hex)&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ISO-8859-15&#039;&#039;&#039;&lt;br /&gt;
| A4&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;UTF-8&#039;&#039;&#039;&lt;br /&gt;
| E2 82 AC&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;UTF-16&#039;&#039;&#039;&lt;br /&gt;
| 20AC&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Finally, a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;Collation&amp;lt;/span&amp;gt; determines how data is sorted and how strings are compared to each other.&lt;br /&gt;
&lt;br /&gt;
=== Encoding and decoding ===&lt;br /&gt;
&lt;br /&gt;
One of the most important things one must keep in mind when working with databases (or files, for that matter) is to be aware of how characters (letters, numbers and non-alphanumeric characters) are actually being saved or encoded and how bytes (represented with hexadecimal values) are actually being interpreted or decoded.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. In a database, character encoding only applies to text type columns (e.g. CHAR, VARCHAR, TEXT).&lt;br /&gt;
&lt;br /&gt;
For example, it is not enough to say that character “é” (small letter e with acute) has been saved in a text file, one also has to be aware of how was it encoded. Why? Because if it was encoded as Latin-1, the file will have one byte of hex value E9, but if it was encoded as UTF-8, the file would then have two bytes of hex value C3 and A9:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Character&lt;br /&gt;
! Latin-1 hex value&lt;br /&gt;
! UTF-8 hex values&lt;br /&gt;
|-&lt;br /&gt;
| é&lt;br /&gt;
| E9&lt;br /&gt;
| C3 A9&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
In the same way, it is not enough to say that an UTF-8 encoded character “é” is going to be read from a text file, because eventhough we might know that two bytes of hex value “C3 A9” will be read, if they are decoded (interpreted) as Latin-1, we will get characters Ã©, but if they are decoded as UTF-8, we would then get character “é”:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Hex value&lt;br /&gt;
! Latin-1 characters&lt;br /&gt;
! UTF-8 character&lt;br /&gt;
|-&lt;br /&gt;
| C3 A9&lt;br /&gt;
| Ã©&lt;br /&gt;
| é&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Being aware of these two concepts will become relevant when trying to understand how data is encoded and decoded through the many database stages (source, client, server) in order to be saved or restored.&lt;br /&gt;
&lt;br /&gt;
== MySQL ==&lt;br /&gt;
&lt;br /&gt;
=== Character sets and collations ===&lt;br /&gt;
&lt;br /&gt;
Until version 4.1, MySQL tables used the latin1 character set by default. From version 4.1, not only the concepts of &amp;quot;character set&amp;quot; and &amp;quot;collation&amp;quot; were introduced, but the character set by default (at the configuration file) was changed to utf8.&lt;br /&gt;
&lt;br /&gt;
In MySQL, a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character set&amp;lt;/span&amp;gt; is a set of symbols and encodings, and a &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;collation&amp;lt;/span&amp;gt; is a set of rules for comparing characters in a character set.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. Eventhough in MySQL the term &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character set&amp;lt;/span&amp;gt; is used, it should actually be &amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;character encoding&amp;lt;/span&amp;gt; (&amp;lt;span style=&amp;quot;color:#800020;&amp;quot;&amp;gt;charset&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
The MySQL server supports multiple character sets, like ascii, koi8r, latin1, sjis and utf8. Each character set has at least one collation, however, as it may have many more, a default one is always defined for each character set.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Character set&lt;br /&gt;
! Default collation&lt;br /&gt;
! Other collations&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;ascii&#039;&#039;&#039;&lt;br /&gt;
| ascii_general_ci&lt;br /&gt;
| ascii_bin&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;koi8r&#039;&#039;&#039;&lt;br /&gt;
| koi8r_general_ci&lt;br /&gt;
| koi8r_bin&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;latin1&#039;&#039;&#039;&lt;br /&gt;
| latin1_swedish_ci&lt;br /&gt;
| latin1_bin, latin1_general_ci, latin1_spanish_ci&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;sjis&#039;&#039;&#039;&lt;br /&gt;
| sjis_japanese_ci&lt;br /&gt;
| sjis_bin&lt;br /&gt;
|-&lt;br /&gt;
| &#039;&#039;&#039;utf8&#039;&#039;&#039;&lt;br /&gt;
| utf8_general_ci&lt;br /&gt;
| utf8_bin, utf8_unicode_ci, utf8_turkish_ci&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Collation names follow a convention: they start with the name of the character set with which they are associated, they usually include a language name, and they end with &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;_ci&amp;lt;/tt&amp;gt; (case insensitive), &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;_cs&amp;lt;/tt&amp;gt; (case sensitive), or &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;_bin&amp;lt;/tt&amp;gt; (binary). From this, is should be evident that two different character sets cannot have the same collation.&lt;br /&gt;
&lt;br /&gt;
=== Character set variables ===&lt;br /&gt;
&lt;br /&gt;
MySQL uses several “character set” type system variables that could be classified in three groups according to their use.&lt;br /&gt;
&lt;br /&gt;
==== For data encoding ====&lt;br /&gt;
&lt;br /&gt;
The following three determine the character encoding used to transform data as it flows from the client to the server and viceversa.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_client&amp;lt;/tt&amp;gt;. This variable defines the character set used by the client and in which it sends statements to the server.&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_connection&amp;lt;/tt&amp;gt;. This variable defines the character set in which the server translates statements received from the client.&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_results&amp;lt;/tt&amp;gt;. This variable defines the character set in which the server returns query results to the client.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. For the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_connection&amp;lt;/tt&amp;gt; variable there is also a related collation type variable: &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;collation_connection&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== As default values ====&lt;br /&gt;
&lt;br /&gt;
The following two are used to determine the character encoding to be used when a database or a table is created, respectively.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_server&amp;lt;/tt&amp;gt;. This variable defines the character set of a new schema when the database charset is not specified in the CREATE DATABASE statement.&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_database&amp;lt;/tt&amp;gt;. This variable defines the character set of a new table when the table charset is not specified in the CREATE TABLE statement.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. For these two variables there are also two related collation type variables: &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;collation_server&amp;lt;/tt&amp;gt; and &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;collation_database&amp;lt;/tt&amp;gt;, respectively.&lt;br /&gt;
&lt;br /&gt;
==== Other uses ====&lt;br /&gt;
&lt;br /&gt;
The following two have other uses.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_filesystem&amp;lt;/tt&amp;gt;. This variable defines the character set used by the file system (names of directories or names of files).&lt;br /&gt;
* &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_system&amp;lt;/tt&amp;gt;. This variable defines the character set used to save metadata (data about data, for example, names of tables).&lt;br /&gt;
&lt;br /&gt;
=== Default settings ===&lt;br /&gt;
&lt;br /&gt;
The MySQL database server uses a very flexible scheme where default settings for character sets and collations can be set at four levels: Server, Database, Table and Column.&lt;br /&gt;
&lt;br /&gt;
; Server&lt;br /&gt;
: The server charset and collation are used as default values for schema definitions when the database charset and collation are not specified in CREATE DATABASE statements.&lt;br /&gt;
: The server character set and collation can be determined from the values of the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_server&amp;lt;/tt&amp;gt; and &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;collation_server&amp;lt;/tt&amp;gt; system variables.&lt;br /&gt;
&lt;br /&gt;
; Database&lt;br /&gt;
: The database charset and collation are used as default values for table definitions when the table charset and collation are not specified in CREATE TABLE statements.&lt;br /&gt;
: The character set and collation for the default database can be determined from the values of the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_database&amp;lt;/tt&amp;gt; and &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;collation_database&amp;lt;/tt&amp;gt; system variables.&lt;br /&gt;
&lt;br /&gt;
; Table&lt;br /&gt;
: The table charset and collation are used as default values for column definitions when the column charset and collation are not specified in individual column definitions.&lt;br /&gt;
: The table character set and collation are MySQL extensions; therefore they do not exist in standard SQL.&lt;br /&gt;
&lt;br /&gt;
; Column&lt;br /&gt;
: A character set and a collation may be specified for every character type column (that is, columns of type CHAR, VARCHAR, or TEXT).&lt;br /&gt;
: The column character set and collate clauses are standard SQL.&lt;br /&gt;
&lt;br /&gt;
=== Configuration files ===&lt;br /&gt;
&lt;br /&gt;
==== MySQL settings ====&lt;br /&gt;
&lt;br /&gt;
All MySQL settings, both for the server and the client components, are defined under one configuration or option file: &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;my.ini&amp;lt;/tt&amp;gt; (Windows) or &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;my.cnf&amp;lt;/tt&amp;gt; (Linux), although many copies of this file might be read at startup.&lt;br /&gt;
&lt;br /&gt;
Settings in the configuration file are divided in option groups, where each one contains the settings for: the server, all clients and each particular client:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Settings for&lt;br /&gt;
! Option group&lt;br /&gt;
|-&lt;br /&gt;
| The server&lt;br /&gt;
| [mysqld], [server], etc.&lt;br /&gt;
|-&lt;br /&gt;
| All clients&lt;br /&gt;
| [client]&lt;br /&gt;
|-&lt;br /&gt;
| Each particular client&lt;br /&gt;
| [mysql], [mysqldump], [myisamchk], [mysqlhotcopy], etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
&lt;br /&gt;
For each database created, its character set and collation values are saved in a text file named &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;db.opt&amp;lt;/tt&amp;gt;, located in the corresponding database folder (&#039;&#039;db_name&#039;&#039;) under the &#039;&#039;datadir&#039;&#039; directory.&lt;br /&gt;
&lt;br /&gt;
 more C:\MySqlServer5.5\data\&#039;&#039;db_name&#039;&#039;\db.opt&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 default-character-set=latin1&lt;br /&gt;
 default-collation=latin1_swedish_ci&lt;br /&gt;
&lt;br /&gt;
When a database is first created, if the character set and collation options are not defined in the CREATE DATABASE statement, then they are taken from the server charset and collation values. These two values can be modified via the ALTER DATABASE statement.&lt;br /&gt;
&lt;br /&gt;
=== Gathering information (1) ===&lt;br /&gt;
&lt;br /&gt;
To run the commands given in this section, one has to have direct access to the MySQL server.&lt;br /&gt;
&lt;br /&gt;
From here on it will be assumed that the server is already running. Also, for Windows users, commands must be entered from a Windows command (system) window.&lt;br /&gt;
&lt;br /&gt;
==== Server and client ====&lt;br /&gt;
&lt;br /&gt;
Running a particular program with the parameters &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--verbose --help&amp;lt;/tt&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 mysqld --verbose --help&lt;br /&gt;
 mysql --verbose --help&lt;br /&gt;
 mysqldump --verbose --help&lt;br /&gt;
&lt;br /&gt;
will list four pieces of information:&lt;br /&gt;
&lt;br /&gt;
# The location of the configuration files.&lt;br /&gt;
# The option groups read by the program.&lt;br /&gt;
# The allowed options or variables (parameters) with their abreviations and descriptions.&lt;br /&gt;
# The default values of variables that can be set from the command line.&lt;br /&gt;
&lt;br /&gt;
===== Location of the configuration files =====&lt;br /&gt;
&lt;br /&gt;
Default options are read from the following files in the given order:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! OS&lt;br /&gt;
! The following groups are read&lt;br /&gt;
|-&lt;br /&gt;
| Windows&lt;br /&gt;
| &#039;&#039;WINDIR&#039;&#039;\my.ini &#039;&#039;WINDIR&#039;&#039;\my.cnf  C:\my.ini C:\my.cnf  &#039;&#039;INSTALLDIR&#039;&#039;\my.ini &#039;&#039;INSTALLDIR&#039;&#039;\my.cnf&lt;br /&gt;
|-&lt;br /&gt;
| Linux&lt;br /&gt;
| /etc/my.cnf  /etc/mysql/my.cnf  SYSCONFDIR/my.cnf  $MYSQL_HOME/my.cnf&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. &#039;&#039;WINDIR&#039;&#039; is the Windows directory (e.g. C:\Windows) and &#039;&#039;INSTALLDIR&#039;&#039; is the MySQL installation directory (e.g. C:\MySqlServer5.5).&lt;br /&gt;
&lt;br /&gt;
===== The option groups read =====&lt;br /&gt;
&lt;br /&gt;
The option groups (in the configuration file) read by each program; for example:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Program&lt;br /&gt;
! The following groups are read&lt;br /&gt;
|-&lt;br /&gt;
| mysqld&lt;br /&gt;
| mysqld server mysqld-5.5&lt;br /&gt;
|-&lt;br /&gt;
| mysql&lt;br /&gt;
| mysql client&lt;br /&gt;
|-&lt;br /&gt;
| mysqldump&lt;br /&gt;
| mysqldump client&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Allowed options (variables) =====&lt;br /&gt;
&lt;br /&gt;
The variables accepted (in the command line) by the program, with their abreviations and descriptions; for example, the following are some of those listed for the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysql&amp;lt;/tt&amp;gt; client program:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Variable (option)&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| -D, --database=name&lt;br /&gt;
| Database to use.&lt;br /&gt;
|-&lt;br /&gt;
| --default-character-set=name&lt;br /&gt;
| Set the default character set.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===== Variables and their values =====&lt;br /&gt;
&lt;br /&gt;
The default values of variables that can be set from the command line for each program; for example, the following are some of those listed by the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqld&amp;lt;/tt&amp;gt; server program:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Variable&lt;br /&gt;
! Default value&lt;br /&gt;
|-&lt;br /&gt;
| basedir&lt;br /&gt;
| C:/MySqlServer5.5/&lt;br /&gt;
|-&lt;br /&gt;
| character-set-server&lt;br /&gt;
| latin1&lt;br /&gt;
|-&lt;br /&gt;
| datadir&lt;br /&gt;
| C:\ MySqlServer5.5\Data\&lt;br /&gt;
|-&lt;br /&gt;
| date-format&lt;br /&gt;
| %Y-%m-%d&lt;br /&gt;
|-&lt;br /&gt;
| innodb&lt;br /&gt;
| ON&lt;br /&gt;
|-&lt;br /&gt;
| tmpdir&lt;br /&gt;
| C:\Tmp&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;* Important note&#039;&#039;&#039;. The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqld&amp;lt;/tt&amp;gt; program lists the values of the variables that the server (based on its compiled-in defaults) will use; however, some of those values might change depending on the command line parameters given. For example, if the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;my.ini&amp;lt;/tt&amp;gt; (or &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;my.cnf&amp;lt;/tt&amp;gt;) configuration file has the following lines:&lt;br /&gt;
&lt;br /&gt;
 [mysqld]&lt;br /&gt;
 character-set-server=utf8&lt;br /&gt;
&lt;br /&gt;
Then we will get a different value for variable &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character-set-server&amp;lt;/tt&amp;gt; if we use the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;no-defaults&amp;lt;/tt&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Command&lt;br /&gt;
! Action&lt;br /&gt;
! Value of &#039;&#039;character-set-server&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqld --no-defaults --verbose --help&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Ignore the settings in any option files.&lt;br /&gt;
| &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;latin1&amp;lt;/tt&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqld --verbose --help&amp;lt;/tt&amp;gt;&lt;br /&gt;
| Include the settings of any option files that it reads.&lt;br /&gt;
| &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;utf8&amp;lt;/tt&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== System values used by a running server ====&lt;br /&gt;
&lt;br /&gt;
While the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--help --verbose&amp;lt;/tt&amp;gt; options of the MySQL server program (&amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqld&amp;lt;/tt&amp;gt;) show command line options and their default values, there are also other variables that can only be seen after the server has been started and that provide information about its operation.&lt;br /&gt;
&lt;br /&gt;
To see what system values is using a running server, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqladmin&amp;lt;/tt&amp;gt; program can be used with the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;variables&amp;lt;/tt&amp;gt; option:&lt;br /&gt;
&lt;br /&gt;
 mysqladmin [-u root -p&#039;&#039;your_password&#039;&#039;] variables&lt;br /&gt;
&lt;br /&gt;
The following are some of the variables and values listed:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Variable_name&lt;br /&gt;
! Value&lt;br /&gt;
|-&lt;br /&gt;
| character_set_client&lt;br /&gt;
| latin1&lt;br /&gt;
|-&lt;br /&gt;
| character_set_connection&lt;br /&gt;
| latin1&lt;br /&gt;
|-&lt;br /&gt;
| collation_connection&lt;br /&gt;
| latin1_swedish_ci&lt;br /&gt;
|-&lt;br /&gt;
| connect_timeout&lt;br /&gt;
| 10&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==== Server status information ====&lt;br /&gt;
&lt;br /&gt;
The server status information provided by the mysqladmin &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;extended-status&amp;lt;/tt&amp;gt; option is rather technical and so it will only be useful for DBAs (database administrators), however it is worth knowing how to display it:&lt;br /&gt;
&lt;br /&gt;
 mysqladmin [-u root -p&#039;&#039;your_password&#039;&#039;] extended-status&lt;br /&gt;
&lt;br /&gt;
=== Gathering information (2) ===&lt;br /&gt;
&lt;br /&gt;
The first step before trying to fix a character set or a collation problem in a database, table or column is to determine how are they actually defined. The aim of this section then, is to show how to get specific pieces of information about these components.&lt;br /&gt;
&lt;br /&gt;
To run all the SQL queries shown in this section, one can work from:&lt;br /&gt;
&lt;br /&gt;
* A mysql command window, in which case the mysql client program must be running:&lt;br /&gt;
&lt;br /&gt;
 mysql -u root -p&#039;&#039;your_password&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Starts a mysql session:&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* The phpMyAdmin tool, through the “Run SQL query/queries on database &#039;&#039;db_name&#039;&#039;” window.&lt;br /&gt;
&lt;br /&gt;
==== Saving the output of a query into a file ====&lt;br /&gt;
&lt;br /&gt;
As results from many commands might be a bit long to be analyzed from a window, it is useful to know how to send them into a file.&lt;br /&gt;
&lt;br /&gt;
===== Windows =====&lt;br /&gt;
&lt;br /&gt;
Use command &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;tee&amp;lt;/tt&amp;gt; to save the output of a query into a file, and command &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;notee&amp;lt;/tt&amp;gt; to stop writing into a file. These commands can only be run from a mysql command window.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; tee e:/tmp/vars.out;&lt;br /&gt;
 mysql&amp;gt; show variables;&lt;br /&gt;
 mysql&amp;gt; notee;&lt;br /&gt;
 Outfile disabled.&lt;br /&gt;
&lt;br /&gt;
To determine into which file output is being written, just type &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;tee&amp;lt;/tt&amp;gt; by itself:&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; tee;&lt;br /&gt;
 Currently logging to file &#039;e:/tmp/vars.out&#039;&lt;br /&gt;
&lt;br /&gt;
===== Unix =====&lt;br /&gt;
&lt;br /&gt;
Use command &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;pager&amp;lt;/tt&amp;gt; to save the output of a query into a file, and command &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;nopager&amp;lt;/tt&amp;gt; to stop writing into a file. These commands can only be run from a mysql command window.&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; pager cat &amp;gt; /tmp/vars.out&lt;br /&gt;
 mysql&amp;gt; show variables;&lt;br /&gt;
 mysql&amp;gt; nopager;&lt;br /&gt;
&lt;br /&gt;
===== phpMyAdmin =====&lt;br /&gt;
&lt;br /&gt;
Once a query is run and the results are displayed, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;Print view&amp;lt;/tt&amp;gt; or the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;Print view (with full texts)&amp;lt;/tt&amp;gt; links from the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;Query results operations&amp;lt;/tt&amp;gt; section can be used to save them.&lt;br /&gt;
&lt;br /&gt;
==== Basic server status information ====&lt;br /&gt;
&lt;br /&gt;
The STATUS command will get basic status information from the server, like the current database in use, the server version, the TCP port or the characterset defined for the server, the database, the client and the connection. This command can only be run from a mysql command window.&lt;br /&gt;
&lt;br /&gt;
 mysql&amp;gt; STATUS;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 Current database:&lt;br /&gt;
 mysql  Ver 14.14 Distrib 5.5.8, for Win32 (x86)&lt;br /&gt;
 Connection id:          232&lt;br /&gt;
 Current database:&lt;br /&gt;
 Current user:           root@localhost&lt;br /&gt;
 SSL:                    Not in use&lt;br /&gt;
 Using delimiter:        ;&lt;br /&gt;
 Server version:         5.5.8 MySQL Community Server (GPL)&lt;br /&gt;
 Protocol version:       10&lt;br /&gt;
 Connection:             localhost via TCP/IP&lt;br /&gt;
 Server characterset:    latin1&lt;br /&gt;
 Db     characterset:    latin1&lt;br /&gt;
 Client characterset:    latin1&lt;br /&gt;
 Conn.  characterset:    latin1&lt;br /&gt;
 TCP port:               3306&lt;br /&gt;
 Uptime:                 18 hours 25 min 38 sec&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. If a database hasn’t been set active, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;Db characterset&amp;lt;/tt&amp;gt; variable will contain the global default, otherwise its value will reflect that of the selected database.&lt;br /&gt;
&lt;br /&gt;
==== Server status information ====&lt;br /&gt;
&lt;br /&gt;
The following will list the same variables as the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqladmin extended-status&amp;lt;/tt&amp;gt; command:&lt;br /&gt;
&lt;br /&gt;
 SHOW STATUS;&lt;br /&gt;
&lt;br /&gt;
As the list of variables is quite long, the LIKE clause can be used to list only those that match.&lt;br /&gt;
&lt;br /&gt;
==== System variables with their values ====&lt;br /&gt;
&lt;br /&gt;
The following will list the same system variables as the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqladmin variables&amp;lt;/tt&amp;gt; command, plus a few more:&lt;br /&gt;
&lt;br /&gt;
 SHOW VARIABLES;&lt;br /&gt;
&lt;br /&gt;
As the list of variables is quite long, the LIKE clause can be used to list only those that match.&lt;br /&gt;
&lt;br /&gt;
To list all the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set&amp;lt;/tt&amp;gt; variables:&lt;br /&gt;
&lt;br /&gt;
 SHOW VARIABLES LIKE &#039;character_set\_%&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------------------+-----------------------------------+&lt;br /&gt;
 | Variable_name            | Value                             |&lt;br /&gt;
 +--------------------------+-----------------------------------+&lt;br /&gt;
 | character_set_client     | latin1                            |&lt;br /&gt;
 | character_set_connection | latin1                            |&lt;br /&gt;
 | character_set_database   | latin1                            |&lt;br /&gt;
 | character_set_filesystem | binary                            |&lt;br /&gt;
 | character_set_results    | latin1                            |&lt;br /&gt;
 | character_set_server     | latin1                            |&lt;br /&gt;
 | character_set_system     | utf8                              |&lt;br /&gt;
 +--------------------------+-----------------------------------+&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. If a database hasn’t been set active, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;character_set_database&amp;lt;/tt&amp;gt; variable will contain the global default, otherwise its value will reflect that of the selected database.&lt;br /&gt;
&lt;br /&gt;
To list all the collations defined:&lt;br /&gt;
&lt;br /&gt;
 SHOW VARIABLES LIKE &#039;coll%&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +----------------------+-------------------+&lt;br /&gt;
 | Variable_name        | Value             |&lt;br /&gt;
 +----------------------+-------------------+&lt;br /&gt;
 | collation_connection | latin1_swedish_ci |&lt;br /&gt;
 | collation_database   | latin1_swedish_ci |&lt;br /&gt;
 | collation_server     | latin1_swedish_ci |&lt;br /&gt;
 +----------------------+-------------------+&lt;br /&gt;
&lt;br /&gt;
==== Database ====&lt;br /&gt;
&lt;br /&gt;
===== How was it created =====&lt;br /&gt;
&lt;br /&gt;
The following command shows how a database (schema) was created (i.e., the complete CREATE DATABASE statement used to create it).&lt;br /&gt;
&lt;br /&gt;
 show create database &#039;&#039;db_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 CREATE DATABASE `test02` /*!40100 DEFAULT CHARACTER SET latin1 */&lt;br /&gt;
&lt;br /&gt;
If a database was created with a specific character set and/or collation (i.e. it isn’t using the server’s default), the result will include the defined collation, for example:&lt;br /&gt;
&lt;br /&gt;
 CREATE DATABASE `temp01` /*!40100 DEFAULT CHARACTER SET latin1 &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;COLLATE latin1_spanish_ci&amp;lt;/span&amp;gt; */&lt;br /&gt;
&lt;br /&gt;
As mentioned before, when a database is created or when its character set and/or collation are modified, these two values are saved in the corresponding &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;db.opt&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
&lt;br /&gt;
===== Character set and collation =====&lt;br /&gt;
&lt;br /&gt;
The following SQL statement gives both, the character set and collation of a schema (database).&lt;br /&gt;
&lt;br /&gt;
 SELECT schema_name, default_character_set_name &amp;quot;character_set&amp;quot;, default_collation_name &amp;quot;collation&amp;quot;&lt;br /&gt;
 FROM information_schema.schemata&lt;br /&gt;
 WHERE schema_name = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +-------------+---------------+-------------------+&lt;br /&gt;
 | schema_name | character_set | collation         |&lt;br /&gt;
 +-------------+---------------+-------------------+&lt;br /&gt;
 | test02      | latin1        | latin1_swedish_ci |&lt;br /&gt;
 +-------------+---------------+-------------------+&lt;br /&gt;
&lt;br /&gt;
It is important to remember that these values only act as defaults to define the character set and the collation of newly created tables.&lt;br /&gt;
&lt;br /&gt;
==== Tables and columns ====&lt;br /&gt;
&lt;br /&gt;
A database must first be selected before trying to use the SHOW and DESCRIBE commands.&lt;br /&gt;
&lt;br /&gt;
* From a mysql command window:&lt;br /&gt;
 use &#039;&#039;db_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
* From phpMyAdmin, just select the database to be used.&lt;br /&gt;
&lt;br /&gt;
===== Table, how was it created =====&lt;br /&gt;
&lt;br /&gt;
The following command shows how a table was created.&lt;br /&gt;
&lt;br /&gt;
 SHOW CREATE TABLE &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE `t1_latin` (&lt;br /&gt;
   `userid` smallint(5) unsigned DEFAULT NULL,&lt;br /&gt;
   `coll_swd` char(16) NOT NULL,&lt;br /&gt;
   PRIMARY KEY (`coll_swd`)&lt;br /&gt;
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1&lt;br /&gt;
&lt;br /&gt;
If a particular table was created with a specific character set and/or collation (i.e. it isn’t using the database’s default), the result will include the defined collation both in the table definition and in each of the text type column definitions, for example:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE `t3_latin` (&lt;br /&gt;
   `userid` smallint(5) unsigned DEFAULT NULL,&lt;br /&gt;
   `coll_swd` char(16) &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;COLLATE latin1_spanish_ci&amp;lt;/span&amp;gt; NOT NULL,&lt;br /&gt;
   `coll_spa` text &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;COLLATE latin1_spanish_ci&amp;lt;/span&amp;gt;,&lt;br /&gt;
   PRIMARY KEY (`coll_swd`)&lt;br /&gt;
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1 &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;COLLATE=latin1_spanish_ci&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Furthermore, if a particular column was created with a specific character set and/or collation (i.e. it isn’t using the table’s default), the result will include the character set and collation definition in the respective column, for example:&lt;br /&gt;
&lt;br /&gt;
 CREATE TABLE `t2_latin` (&lt;br /&gt;
   `userid` smallint(5) unsigned DEFAULT NULL,&lt;br /&gt;
   `coll_gr1` char(16) &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;CHARACTER SET latin1 COLLATE latin1_german1_ci&amp;lt;/span&amp;gt; NOT NULL,&lt;br /&gt;
   PRIMARY KEY (`coll_gr1`)&lt;br /&gt;
 ) ENGINE=InnoDB DEFAULT CHARSET=latin1&lt;br /&gt;
&lt;br /&gt;
===== Table, describe its structure =====&lt;br /&gt;
&lt;br /&gt;
Either of the two following commands display a simple view of the structure of table.&lt;br /&gt;
&lt;br /&gt;
 DESCRIBE &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
 SHOW COLUMNS FROM &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +----------+----------------------+------+-----+---------+-------+&lt;br /&gt;
 | Field    | Type                 | Null | Key | Default | Extra |&lt;br /&gt;
 +----------+----------------------+------+-----+---------+-------+&lt;br /&gt;
 | userid   | smallint(5) unsigned | YES  |     | NULL    |       |&lt;br /&gt;
 | coll_swd | char(16)             | NO   | PRI | NULL    |       |&lt;br /&gt;
 +----------+----------------------+------+-----+---------+-------+&lt;br /&gt;
&lt;br /&gt;
The following command displays a more complete view of the structure of table.&lt;br /&gt;
&lt;br /&gt;
 SHOW FULL COLUMNS FROM &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +----------+----------------------+-------------------+------+-----+---------+-------+---------------------------------+---------+&lt;br /&gt;
 | Field    | Type                 | Collation         | Null | Key | Default | Extra | Privileges                      | Comment |&lt;br /&gt;
 +----------+----------------------+-------------------+------+-----+---------+-------+---------------------------------+---------+&lt;br /&gt;
 | userid   | smallint(5) unsigned | NULL              | YES  |     | NULL    |       | select,insert,update,references |         |&lt;br /&gt;
 | coll_swd | char(16)             | latin1_swedish_ci | NO   | PRI | NULL    |       | select,insert,update,references |         |&lt;br /&gt;
 +----------+----------------------+-------------------+------+-----+---------+-------+---------------------------------+---------+&lt;br /&gt;
&lt;br /&gt;
===== Table, index information =====&lt;br /&gt;
&lt;br /&gt;
The following command lists the indexes (if there are any) on a table.&lt;br /&gt;
&lt;br /&gt;
 SHOW INDEX FROM &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+&lt;br /&gt;
 | Table    | Non_unique | Key_name | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |&lt;br /&gt;
 +----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+&lt;br /&gt;
 | t1_latin |          0 | PRIMARY  |            1 | coll_swd    | A         |           4 |     NULL | NULL   |      | BTREE      |         |               |&lt;br /&gt;
 +----------+------------+----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+&lt;br /&gt;
&lt;br /&gt;
===== Table, character set and collation =====&lt;br /&gt;
&lt;br /&gt;
The following SQL query displays the character set and collation of a table in a particular schema.&lt;br /&gt;
&lt;br /&gt;
 SELECT t.table_schema, t.table_name, ccsa.character_set_name &amp;quot;table_character_set&amp;quot;, t.table_collation&lt;br /&gt;
 FROM information_schema.`tables` t,&lt;br /&gt;
      information_schema.`collation_character_set_applicability` ccsa&lt;br /&gt;
 WHERE ccsa.collation_name = t.table_collation&lt;br /&gt;
 AND t.table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND t.table_name = &#039;&amp;lt;em&amp;gt;tbl_name&amp;lt;/em&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
 | table_schema | table_name | table_character_set | table_collation   |&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
 | test02       | t1_latin   | latin1              | latin1_swedish_ci |&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
&lt;br /&gt;
To list the same information for all the tables in a particular schema, one only needs to remove the last AND clause from the previous query.&lt;br /&gt;
&lt;br /&gt;
 SELECT t.table_schema, t.table_name, ccsa.character_set_name &amp;quot;table_character_set&amp;quot;, t.table_collation&lt;br /&gt;
 FROM information_schema.`tables` t,&lt;br /&gt;
      information_schema.`collation_character_set_applicability` ccsa&lt;br /&gt;
 WHERE ccsa.collation_name = t.table_collation&lt;br /&gt;
 AND t.table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
 | table_schema | table_name | table_character_set | table_collation   |&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
 | test02       | t1_latin   | latin1              | latin1_swedish_ci |&lt;br /&gt;
 | test02       | t2_latin   | latin1              | latin1_swedish_ci |&lt;br /&gt;
 +--------------+------------+---------------------+-------------------+&lt;br /&gt;
&lt;br /&gt;
===== Tables, with different character set and collation =====&lt;br /&gt;
&lt;br /&gt;
The following SQL query lists all tables in a particular schema that differ from a specific collation (e.g. &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1_swedish_ci&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 SELECT t.table_schema, t.table_name, ccsa.character_set_name &amp;quot;table_character_set&amp;quot;, t.table_collation&lt;br /&gt;
 FROM information_schema.`tables` t,&lt;br /&gt;
 information_schema.`collation_character_set_applicability` ccsa&lt;br /&gt;
 WHERE ccsa.collation_name = t.table_collation&lt;br /&gt;
 AND t.table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND table_collation NOT LIKE &#039;&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1_swedish_ci&amp;lt;/span&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+---------------------+-----------------+&lt;br /&gt;
 | table_schema | table_name | table_character_set | table_collation |&lt;br /&gt;
 +--------------+------------+---------------------+-----------------+&lt;br /&gt;
 | test03       | t1_default | utf8                | utf8_unicode_ci |&lt;br /&gt;
 +--------------+------------+---------------------+-----------------+&lt;br /&gt;
&lt;br /&gt;
===== Columns, displaying character data as hexadecimal values =====&lt;br /&gt;
&lt;br /&gt;
Sometimes it is necessary to confirm how text type data (e.g. CHAR, VARCHAR, TEXT) is actually saved (encoded).&lt;br /&gt;
&lt;br /&gt;
To do this, a SELECT query can be created with an &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;HEX()&amp;lt;/tt&amp;gt; function around the column to be checked.&lt;br /&gt;
&lt;br /&gt;
For example, if we have the string “áéíóú” stored in column &#039;&#039;col_name&#039;&#039;, the following query:&lt;br /&gt;
&lt;br /&gt;
 SELECT &#039;&#039;col_name&#039;&#039;, HEX(&#039;&#039;col_name&#039;&#039;) FROM &#039;&#039;tbl_name&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
Would give the following output if the string was encoded in latin1:&lt;br /&gt;
&lt;br /&gt;
 +----------+---------------+&lt;br /&gt;
 | &#039;&#039;col_name&#039;&#039; | HEX(&#039;&#039;col_name&#039;&#039;) |&lt;br /&gt;
 +----------+---------------+&lt;br /&gt;
 | áéíóú    | E1E9EDF3FA    |&lt;br /&gt;
 +----------+---------------+&lt;br /&gt;
&lt;br /&gt;
And it would give the following output if the string was encoded in utf8:&lt;br /&gt;
&lt;br /&gt;
 +----------+----------------------+&lt;br /&gt;
 | &#039;&#039;col_name&#039;&#039; | HEX(&#039;&#039;col_name&#039;&#039;)        |&lt;br /&gt;
 +----------+----------------------+&lt;br /&gt;
 | áéíóú    | C3A1C3A9C3ADC3B3C3BA |&lt;br /&gt;
 +----------+----------------------+&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. In this example it is assumed that in each case the column is defined with the correct character set (latin1 and utf8, respectively).&lt;br /&gt;
&lt;br /&gt;
===== Columns, character set and collation =====&lt;br /&gt;
&lt;br /&gt;
The following SQL query displays the character set and collation of all text type (e.g. CHAR, VARCHAR, TEXT) columns in a particular table.&lt;br /&gt;
&lt;br /&gt;
 SELECT table_schema, table_name,&lt;br /&gt;
   column_name, character_set_name &amp;quot;column_character_set&amp;quot;, collation_name &amp;quot;column_collation&amp;quot;,&lt;br /&gt;
   data_type, column_type&lt;br /&gt;
 FROM information_schema.columns&lt;br /&gt;
 WHERE table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND table_name = &#039;&amp;lt;em&amp;gt;tbl_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND data_type IN (&#039;char&#039;, &#039;varchar&#039;, &#039;tinytext&#039;, &#039;text&#039;, &#039;mediumtext&#039;, &#039;longtext&#039;, &#039;enum&#039;, &#039;set&#039;);&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | table_schema | table_name | column_name | column_character_set | column_collation  | data_type | column_type |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | test02       | t1_latin   | coll_swd    | latin1               | latin1_swedish_ci | char      | char(16)    |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
&lt;br /&gt;
To list the same information for all the tables in a particular schema, one only needs to remove the first AND clause from the previous query.&lt;br /&gt;
&lt;br /&gt;
 SELECT table_schema, table_name,&lt;br /&gt;
   column_name, character_set_name &amp;quot;column_character_set&amp;quot;, collation_name &amp;quot;column_collation&amp;quot;,&lt;br /&gt;
   data_type, column_type&lt;br /&gt;
 FROM information_schema.columns&lt;br /&gt;
 WHERE table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND data_type IN (&#039;char&#039;, &#039;varchar&#039;, &#039;tinytext&#039;, &#039;text&#039;, &#039;mediumtext&#039;, &#039;longtext&#039;, &#039;enum&#039;, &#039;set&#039;);&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | table_schema | table_name | column_name | column_character_set | column_collation  | data_type | column_type |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | test02       | t1_latin   | coll_swd    | latin1               | latin1_swedish_ci | char      | char(16)    |&lt;br /&gt;
 | test02       | t2_latin   | coll_gr1    | latin1               | latin1_german_ci  | char      | char(16)    |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
&lt;br /&gt;
===== Columns, with different character set and collation =====&lt;br /&gt;
&lt;br /&gt;
The following SQL query displays all text type (e.g. CHAR, VARCHAR, TEXT) columns in all tables of a particular database, that differ from a specific collation (e.g. &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1_swedish_ci&amp;lt;/span&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
 SELECT table_schema, table_name,&lt;br /&gt;
   column_name, character_set_name &amp;quot;column_character_set&amp;quot;, collation_name &amp;quot;column_collation&amp;quot;,&lt;br /&gt;
   data_type, column_type&lt;br /&gt;
 FROM information_schema.columns&lt;br /&gt;
 WHERE table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND data_type IN (&#039;char&#039;, &#039;varchar&#039;, &#039;tinytext&#039;, &#039;text&#039;, &#039;mediumtext&#039;, &#039;longtext&#039;, &#039;enum&#039;, &#039;set&#039;)&lt;br /&gt;
 AND collation_name NOT LIKE &#039;&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1_swedish_ci&amp;lt;/span&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
Outputs something like:&lt;br /&gt;
&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | table_schema | table_name | column_name | column_character_set | column_collation  | data_type | column_type |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
 | test02       | t2_latin   | coll_gr1    | latin1               | latin1_german1_ci | char      | char(16)    |&lt;br /&gt;
 +--------------+------------+-------------+----------------------+-------------------+-----------+-------------+&lt;br /&gt;
&lt;br /&gt;
To display the same information, but only for a specific table, an extra AND clause can be added to the SQL query:&lt;br /&gt;
&lt;br /&gt;
 SELECT table_schema, table_name,&lt;br /&gt;
   column_name, character_set_name &amp;quot;column_character_set&amp;quot;, collation_name &amp;quot;column_collation&amp;quot;,&lt;br /&gt;
   data_type, column_type&lt;br /&gt;
 FROM information_schema.columns&lt;br /&gt;
 WHERE table_schema = &#039;&amp;lt;em&amp;gt;db_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND table_name = &#039;&amp;lt;em&amp;gt;tbl_name&amp;lt;/em&amp;gt;&#039;&lt;br /&gt;
 AND data_type IN (&#039;char&#039;, &#039;varchar&#039;, &#039;tinytext&#039;, &#039;text&#039;, &#039;mediumtext&#039;, &#039;longtext&#039;, &#039;enum&#039;, &#039;set&#039;)&lt;br /&gt;
 AND collation_name NOT LIKE &#039;&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1_swedish_ci&amp;lt;/span&amp;gt;&#039;;&lt;br /&gt;
&lt;br /&gt;
=== Dumping a database ===&lt;br /&gt;
&lt;br /&gt;
To backup or transfer databases to another SQL server, MySQL includes a client program called &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqldump&amp;lt;/tt&amp;gt;. This program generates a text file with a series of SQL statements to recreate the original database, its tables and the corresponding data.&lt;br /&gt;
&lt;br /&gt;
Basically, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqldump&amp;lt;/tt&amp;gt; program can be run in one of the following ways:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Command&lt;br /&gt;
! Action&lt;br /&gt;
|-&lt;br /&gt;
| mysqldump [options] db_name [tbl_name ...]&lt;br /&gt;
| dumps database, a table or a series of tables&lt;br /&gt;
|-&lt;br /&gt;
| mysqldump [options] --databases db_name ...&lt;br /&gt;
| dumps a series of databases&lt;br /&gt;
|-&lt;br /&gt;
| mysqldump [options] --all-databases&lt;br /&gt;
| dumps all databases&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This program is simple to use, but it is important to be familiar with a few of its options, as using a wrong setting could lead to corrupted data.&lt;br /&gt;
&lt;br /&gt;
==== Options ====&lt;br /&gt;
&lt;br /&gt;
===== --default-character-set =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--default-character-set&amp;lt;/tt&amp;gt; option defines &#039;&#039;charset_name&#039;&#039; as the default character set.&lt;br /&gt;
&lt;br /&gt;
This is one of the most critical options, as it specifies:&lt;br /&gt;
&lt;br /&gt;
# The file character encoding to be used or how the file is going to be encoded: as column values from the database are read, they are converted to the character set specified by this option before being saved in the dump file (see, Encoding and decoding).&lt;br /&gt;
# The &#039;&#039;default_character_set&#039;&#039; for the SET NAMES statement when the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-set-charset&amp;lt;/tt&amp;gt; or the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--no-set-names&amp;lt;/tt&amp;gt; options are not used.&lt;br /&gt;
&lt;br /&gt;
For example, the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump --default-character-set=&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt; &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would generate a &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt; encoded dump file; whereas either of the following:&lt;br /&gt;
&lt;br /&gt;
 mysqldump --default-character-set=&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;utf8&amp;lt;/span&amp;gt; &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
 mysqldump &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would generate a &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;utf8&amp;lt;/span&amp;gt; encoded dump file.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;. If a character set is not specified (as shown in the last example), &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysqldump&amp;lt;/tt&amp;gt; will use utf8 by default (versions lower than 4.1.2 use latin1 by default).&lt;br /&gt;
&lt;br /&gt;
===== --set-charset =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--set-charset&amp;lt;/tt&amp;gt; option adds a SET NAMES &#039;&#039;default_character_set&#039;&#039; statement to the output. This option is enabled by default.&lt;br /&gt;
&lt;br /&gt;
As the SET NAMES &#039;&#039;character_set&#039;&#039; statement is equivalent to the following three statements:&lt;br /&gt;
&lt;br /&gt;
 SET character_set_client = &#039;&#039;character_set&#039;&#039;;&lt;br /&gt;
 SET character_set_results = &#039;&#039;character_set&#039;&#039;;&lt;br /&gt;
 SET character_set_connection = &#039;&#039;character_set&#039;&#039;;&lt;br /&gt;
&lt;br /&gt;
the SET NAMES statement specifies the character set to be used (during the restore of the dump file) by the client to send SQL statements to the server, and the character set that the server should use for sending results back to the client (see, For data encoding).&lt;br /&gt;
&lt;br /&gt;
Since this option is enabled by default, the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump --default-character-set=&amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt; &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would add the following conditional comments at the beginning of the dump file:&lt;br /&gt;
&lt;br /&gt;
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;&lt;br /&gt;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;&lt;br /&gt;
 /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;&lt;br /&gt;
 /*!40101 SET NAMES &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt; */;&lt;br /&gt;
&lt;br /&gt;
and the following at the end:&lt;br /&gt;
&lt;br /&gt;
 /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;&lt;br /&gt;
 /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;&lt;br /&gt;
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;&lt;br /&gt;
&lt;br /&gt;
where the &amp;quot;SET NAMES &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt;&amp;quot; command will instruct the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysql&amp;lt;/tt&amp;gt; program to use, send and receive data encoded in &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;latin1&amp;lt;/span&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
===== --skip-set-charset =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-set-charset&amp;lt;/tt&amp;gt; option is used to disable the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--set-charset&amp;lt;/tt&amp;gt; option, which is enabled by default.&lt;br /&gt;
&lt;br /&gt;
===== --no-set-names (-N) =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--no-set-names&amp;lt;/tt&amp;gt; is equivalent to &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-set-charset&amp;lt;/tt&amp;gt;, and so this option disables the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--set-charset&amp;lt;/tt&amp;gt; option: it indicates that a SET NAMES &#039;&#039;default_character_set&#039;&#039; should not be added to the output.&lt;br /&gt;
&lt;br /&gt;
===== --complete-insert (-c) =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--complete-insert&amp;lt;/tt&amp;gt; option indicates to use complete INSERT statements that include column names.&lt;br /&gt;
&lt;br /&gt;
For example, the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;-c&amp;lt;/span&amp;gt; &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would create an INSERT statement that includes the names of the columns:&lt;br /&gt;
&lt;br /&gt;
 INSERT INTO `t1_latin` &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;(`id`, `string`)&amp;lt;/span&amp;gt; VALUES (1,&#039;text1&#039;),(2,&#039; text2&#039;);&lt;br /&gt;
&lt;br /&gt;
But the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would create an INSERT statement without the names of the columns:&lt;br /&gt;
&lt;br /&gt;
 INSERT INTO `t1_latin` VALUES (1,&#039;text1&#039;),(2,&#039;text2&#039;);&lt;br /&gt;
&lt;br /&gt;
===== --extended-insert (-e) =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--extended-insert&amp;lt;/tt&amp;gt; indicates to use a multiple-row INSERT syntax that include several VALUES lists. This results in smaller dump files and faster inserts when the file is reloaded. This option is enabled by default.&lt;br /&gt;
&lt;br /&gt;
Since this option is enabled by default, the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would create an INSERT statement that includes all the records to be added:&lt;br /&gt;
&lt;br /&gt;
 INSERT INTO `t1_latin` VALUES &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;(1,&#039;text1&#039;),(2,&#039;text2&#039;)&amp;lt;/span&amp;gt;;&lt;br /&gt;
&lt;br /&gt;
===== --skip-extended-insert =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-extended-insert&amp;lt;/tt&amp;gt; disables the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--extended-insert&amp;lt;/tt&amp;gt; option, which is enabled by default.&lt;br /&gt;
&lt;br /&gt;
For example, the following command:&lt;br /&gt;
&lt;br /&gt;
 mysqldump --skip-extended-insert &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
would create multiple INSERT statements, one for each record added:&lt;br /&gt;
&lt;br /&gt;
 INSERT INTO `t1_latin` (`id`, `string`) VALUES (1,&#039;text1&#039;);&lt;br /&gt;
 INSERT INTO `t1_latin` (`id`, `string`) VALUES (2,&#039;text2&#039;);&lt;br /&gt;
&lt;br /&gt;
===== --result-file (-r) =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--result-file&amp;lt;/tt&amp;gt; option directs output to a given file.&lt;br /&gt;
&lt;br /&gt;
Since this option prevents newline characters from being converted to carriage return/newline sequences, it should be used when working in a Windows environment:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &#039;&#039;db_name&#039;&#039; &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;-r&amp;lt;/span&amp;gt; backup.sql&lt;br /&gt;
&lt;br /&gt;
instead of using &amp;quot;&amp;gt;&amp;quot; to redirect output to a file:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &#039;&#039;db_name&#039;&#039; &amp;gt; backup.sql&lt;br /&gt;
&lt;br /&gt;
===== --single-transaction =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--single-transaction&amp;lt;/tt&amp;gt; option issues a BEGIN SQL statement before dumping data from the server, and it should be used with transactional tables (like InnoDB).&lt;br /&gt;
&lt;br /&gt;
Since this option and the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--lock-tables&amp;lt;/tt&amp;gt; option are mutually exclusive, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-lock-tables&amp;lt;/tt&amp;gt; option should also be used prior to using the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--single-transaction&amp;lt;/tt&amp;gt; option:&lt;br /&gt;
&lt;br /&gt;
 mysqldump &amp;lt;span style=&amp;quot;color:#CC0000;&amp;quot;&amp;gt;--skip-lock-tables --single-transaction&amp;lt;/span&amp;gt; &#039;&#039;db_name&#039;&#039; -r backup.sql&lt;br /&gt;
&lt;br /&gt;
===== --opt =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--opt&amp;lt;/tt&amp;gt; option is shorthand for the following:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Command&lt;br /&gt;
! Action&lt;br /&gt;
|-&lt;br /&gt;
| --add-drop-table&lt;br /&gt;
| Add a DROP TABLE statement before each CREATE TABLE statement.&lt;br /&gt;
|-&lt;br /&gt;
| --add-locks&lt;br /&gt;
| Surround each table dump with LOCK TABLES and UNLOCK TABLES statements.&lt;br /&gt;
|-&lt;br /&gt;
| --create-options&lt;br /&gt;
| Include all MySQL-specific table options in CREATE TABLE statements.&lt;br /&gt;
|-&lt;br /&gt;
| --disable-keys&lt;br /&gt;
| For each table, surround the INSERT statements with statements to disable and enable keys.&lt;br /&gt;
|-&lt;br /&gt;
| --extended-insert&lt;br /&gt;
| Use multiple-row INSERT syntax that include several VALUES lists.&lt;br /&gt;
|-&lt;br /&gt;
| --lock-tables&lt;br /&gt;
| Lock all tables before dumping them.&lt;br /&gt;
|-&lt;br /&gt;
| --quick&lt;br /&gt;
| Retrieve rows for a table from the server a row at a time.&lt;br /&gt;
|-&lt;br /&gt;
| --set-charset&lt;br /&gt;
| Add SET NAMES default_character_set to the output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Since all of these options are enabled by default, the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--opt&amp;lt;/tt&amp;gt; option is also enabled by default.&lt;br /&gt;
&lt;br /&gt;
===== --skip-opt =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--skip-opt&amp;lt;/tt&amp;gt; disables the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--opt&amp;lt;/tt&amp;gt; option, which is enabled by default.&lt;br /&gt;
&lt;br /&gt;
===== --add-drop-database =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--add-drop-database&amp;lt;/tt&amp;gt; option adds a DROP DATABASE statement before each CREATE DATABASE statement.&lt;br /&gt;
&lt;br /&gt;
===== --add-drop-table =====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;--add-drop-table&amp;lt;/tt&amp;gt; option adds a DROP TABLE statement before each CREATE TABLE statement.&lt;br /&gt;
&lt;br /&gt;
==== Internal structure of a dump file ====&lt;br /&gt;
&lt;br /&gt;
A dump file usually consists of three different elements: comments, conditional comments and SQL statements.&lt;br /&gt;
&lt;br /&gt;
===== Comments =====&lt;br /&gt;
&lt;br /&gt;
Comments are completely ignored by the &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysql&amp;lt;/tt&amp;gt; client program and only serve to describe what follows. Comments have the following structure:&lt;br /&gt;
&lt;br /&gt;
 -- &#039;&#039;comment&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
For example:&lt;br /&gt;
&lt;br /&gt;
 -- MySQL dump 10.13  Distrib 5.5.8, for Win32 (x86)&lt;br /&gt;
&lt;br /&gt;
===== Conditional comments =====&lt;br /&gt;
&lt;br /&gt;
Conditional comments are used to hide SET commands or SQL statements from older versions of &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysql&amp;lt;/tt&amp;gt; (used to restore a dump file). Conditional comments have the following structure:&lt;br /&gt;
&lt;br /&gt;
 /*!&#039;&#039;five digit version number&#039;&#039; SET|SQL statement */&lt;br /&gt;
&lt;br /&gt;
For example, the following line, which contains two conditional comments:&lt;br /&gt;
&lt;br /&gt;
 CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test04` /*!40100 DEFAULT CHARACTER SET latin1 */;&lt;br /&gt;
&lt;br /&gt;
would be interpreted differently by each &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;mysql&amp;lt;/tt&amp;gt; version:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! mysql versions&lt;br /&gt;
! would read it as&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 3.23.12&lt;br /&gt;
| CREATE DATABASE `test04`;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= 3.23.12 and &amp;lt; 4.1.0&lt;br /&gt;
| CREATE DATABASE IF NOT EXISTS `test04`;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;=4.1.0 (4.01.00)&lt;br /&gt;
| CREATE DATABASE IF NOT EXISTS `test04` DEFAULT CHARACTER SET latin1;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Conditional comments usually set some variables at the beginning of a block and reset them at the end.&lt;br /&gt;
&lt;br /&gt;
About the variable syntax of the SET command:&lt;br /&gt;
&lt;br /&gt;
* The string &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;@@&#039;&#039;variable_name&#039;&#039;&amp;lt;/tt&amp;gt; can refer to a session value or a global value:&lt;br /&gt;
** When being refered, MySQL returns the session value if it exists and the global value otherwise.&lt;br /&gt;
** When being set (e.g. &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;SET @@variable_name=value&amp;lt;/tt&amp;gt;), it always refers to the session value.&lt;br /&gt;
* The string &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;@variable_name&amp;lt;/tt&amp;gt; refers to a user variable.&lt;br /&gt;
* When a variable doesn&#039;t have a modifier, it is a session variable.&lt;br /&gt;
&lt;br /&gt;
===== SQL statements =====&lt;br /&gt;
&lt;br /&gt;
The actual SQL statements, for example:&lt;br /&gt;
&lt;br /&gt;
 USE `&#039;&#039;db_name&#039;&#039;`;&lt;br /&gt;
 DROP TABLE IF EXISTS `&#039;&#039;tbl_name&#039;&#039;`;&lt;br /&gt;
&lt;br /&gt;
== Useful tools ==&lt;br /&gt;
&lt;br /&gt;
The tools listed here are useful when working with database dumps and character encodings.&lt;br /&gt;
&lt;br /&gt;
=== Windows ===&lt;br /&gt;
&lt;br /&gt;
==== SuperEdi ====&lt;br /&gt;
&lt;br /&gt;
[http://www.wolosoft.com/en/superedi/ SuperEdi] is a text editor that supports Unicode UTF-8, UTF-16 and many locale-specific encodings.&lt;br /&gt;
&lt;br /&gt;
Download: [http://www.wolosoft.com/files/SuperEdi-4.3.3.exe SuperEdi].&lt;br /&gt;
&lt;br /&gt;
==== HxD hexeditor ====&lt;br /&gt;
&lt;br /&gt;
[http://mh-nexus.de/en/ HxD hexeditor] is a fast free hex editor that can open files of any size.&lt;br /&gt;
&lt;br /&gt;
Download: [http://mh-nexus.de/downloads/HxDSetupEN.zip HxD hexeditor].&lt;br /&gt;
&lt;br /&gt;
==== Super Sed ====&lt;br /&gt;
&lt;br /&gt;
[http://sed.sourceforge.net/grabbag/ssed/ Super Sed] is a heavily enhanced version of &amp;lt;tt style=&amp;quot;color:#0000b0;&amp;quot;&amp;gt;sed&amp;lt;/tt&amp;gt; (a stream editor used to perform basic text transformations on an input stream).&lt;br /&gt;
&lt;br /&gt;
Download: [http://sed.sourceforge.net/grabbag/ssed/sed-3.62.zip Super Sed].&lt;br /&gt;
&lt;br /&gt;
==== LibIconv ====&lt;br /&gt;
&lt;br /&gt;
GNU [http://gnuwin32.sourceforge.net/packages/libiconv.htm LibIconv] is an encoding conversion library.&lt;br /&gt;
&lt;br /&gt;
Download: [http://gnuwin32.sourceforge.net/downlinks/libiconv.php LibIconv complete package].&lt;br /&gt;
&lt;br /&gt;
Download zip files (only the bin folder has to be extracted from both files):&lt;br /&gt;
&lt;br /&gt;
* [http://gnuwin32.sourceforge.net/downlinks/libiconv-bin-zip.php LibIconv binaries].&lt;br /&gt;
* [http://gnuwin32.sourceforge.net/downlinks/libiconv-dep-zip.php LibIconv dependencies].&lt;br /&gt;
&lt;br /&gt;
==== Charco ====&lt;br /&gt;
&lt;br /&gt;
[http://www.marblesoftware.com/Marble_Software/Charco.html Charco] is a character set conversion tool used to recode character sets, much like iconv on Linux does, but in a more portable way and with a GUI for easy-of-use. Charco supports the most common character set encodings found on Windows, OS X and Linux, including a full complement of UTF-encodings. Charco also has a batch processing mode.&lt;br /&gt;
&lt;br /&gt;
Download: [http://www.marblesoftware.com/downloads/windows/Charco%20for%20Windows.zip Charco].&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Required_code_upgrades&amp;diff=64146</id>
		<title>Required code upgrades</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Required_code_upgrades&amp;diff=64146"/>
		<updated>2024-05-01T04:54:52Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
This page lists all changes that may be needed to be done in 3rd party modules and other integration code.&lt;br /&gt;
&lt;br /&gt;
=Moodle 2.0=&lt;br /&gt;
&lt;br /&gt;
Note to developrs: please keep adding more info here ;-)&lt;br /&gt;
&lt;br /&gt;
==Mandatory==&lt;br /&gt;
&lt;br /&gt;
===New Data Manipulation Layer (DML)===&lt;br /&gt;
* All database calls must be updated - new bound parameters syntax, magic quotes not used any more, see [https://docs.moodle.org/en/Development:DB_layer_2.0_migration_docs DB layer 2.0 migration].&lt;br /&gt;
&lt;br /&gt;
===File API===&lt;br /&gt;
It consists of [https://docs.moodle.org/en/Development:File_API three parts]:&lt;br /&gt;
# file storage - modules can not access the course files anymore, they must store alll files in own area&lt;br /&gt;
# file browsing - each module/plugin defines what files are browsable and acessible&lt;br /&gt;
# file serving - each plugin/module is responsible for file sending though pluginfile.php&lt;br /&gt;
&lt;br /&gt;
* Handling of files in backup/restore needs to be fully rewritten too.&lt;br /&gt;
* File uploading in formslib fully rewritten - old API should not be used&lt;br /&gt;
&lt;br /&gt;
===Upgrade code===&lt;br /&gt;
* Upgrade allowed only from 1.9.x (upgrade of contrib modules does not do version tests yet)&lt;br /&gt;
* Backup/restore must use new DDL API.&lt;br /&gt;
* Concurrent upgrades are now prevented.&lt;br /&gt;
&lt;br /&gt;
=== Messaging reimplemented ===&lt;br /&gt;
Mailing and notifications from modules needs to be updated (not finished yet)&lt;br /&gt;
&lt;br /&gt;
==Optional==&lt;br /&gt;
&lt;br /&gt;
* [https://docs.moodle.org/en/Development:Portfolio_API Portfolio integration]&lt;br /&gt;
* [https://docs.moodle.org/en/Development:Conditional_activities Conditional activities]&lt;br /&gt;
&lt;br /&gt;
==Other changes==&lt;br /&gt;
These changes might affect some unsupported core code customisations. Modules and other plugins should not be affected.&lt;br /&gt;
&lt;br /&gt;
* rewritten course category sorting&lt;br /&gt;
&lt;br /&gt;
== See also: ==&lt;br /&gt;
* [[Migrating contrib code to 2.0]]&lt;br /&gt;
* [[User:Frank Ralf/Experience of converting a module to Moodle 2]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Styling_and_customising_the_dock&amp;diff=64145</id>
		<title>Styling and customising the dock</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Styling_and_customising_the_dock&amp;diff=64145"/>
		<updated>2024-05-01T04:53:53Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Template:Themes}}&lt;br /&gt;
&lt;br /&gt;
The dock was an addition to Moodle 2.0, it allows the user to move blocks from the flow of the page onto a special bar that is displayed in a constant position on the side of the page by default.&lt;br /&gt;
&lt;br /&gt;
The dock is not supported by all themes. It is not supported in the default theme &amp;quot;Boost&amp;quot; for Moodle 3.2.&lt;br /&gt;
&lt;br /&gt;
This document looks at how to style the dock using CSS, as well as how to customise or manipulate it within JavaScript.&lt;br /&gt;
&lt;br /&gt;
==Styling the dock==&lt;br /&gt;
Styling the dock is really no different to styling anything else within a web site however there are a couple of things that may slow you down and reading the following document may help you in your understanding of how the dock works and how you should go about styling it.&lt;br /&gt;
&lt;br /&gt;
The following items are things that you should be aware of before starting to style the dock:&lt;br /&gt;
# When a block is docked the dock attempts to ensure that existing styles for the block are still applied by adding the standard block &#039;&#039;&#039;.block_&#039;&#039;blockname&#039;&#039;&#039;&#039;&#039;. Because of this trick we don&#039;t need to look at the actual content of a docked item it will always be the same as the block.&lt;br /&gt;
# The dock remembers what blocks are docked by saving the user&#039;s choices within the database using AJAX calls. This can be looked at to minimise display jumping within a theme&#039;s layoutfile. Read on to learn how.&lt;br /&gt;
# The dock uses CSS classes to transition the different states. These CSS classes control things such as the whether the dock is visible, whether the panel is visible, and how we know which item is being viewed. Read the section on [[#State_classes|state classes]] to learn more about these.&lt;br /&gt;
# The structure of the dock is built entirely by JavaScript. Because of this you will need a tool such as FireBug to inspect it within a page as it won&#039;t be there until JavaScript has run.&lt;br /&gt;
# Although the base theme doesn&#039;t support the dock it does contain some core CSS to structure the dock by default.&lt;br /&gt;
&lt;br /&gt;
So lets get started and look at the structure.&lt;br /&gt;
===The structure of the dock===&lt;br /&gt;
[[Image:Dock.structure.201005.png|300px|thumb|Dock structure]]&lt;br /&gt;
The first image to the right graphically describes the hierarchical structure of the dock. The first thing you will notice about this image is that it doesn&#039;t describe what each element is for. It is just to illustrate the html structure without at styles or transformation.&lt;br /&gt;
&lt;br /&gt;
So what are the important elements here?&lt;br /&gt;
&lt;br /&gt;
; div#dock.dock.dock_left_vertical : This is the bar on the left. Positioned by default to be fixed position in the top left hand corner of the screen and 30px wide.&lt;br /&gt;
; div.dockeditem_container : This box contains all of the buttons which when clicked or hovered over will display the docked item. Or more technically causing the docked item panel to be shown.&lt;br /&gt;
; div#dock_item_x.dockeditem : This represents one of possibly several docked item buttons containing the title of the docked item. There are two things to note about this element: First it is repeated for every docked item. Second the x within the id is the item instance and should not be used for styling.&lt;br /&gt;
; div.controls : This contains any special controls for the dock and by default is displayed at the bottom of the dock. As of Moodle 2 Preview Release the only control here is to undock all docked items.&lt;br /&gt;
; div#dockeditempanel : This is the panel in which docked items are shown. Although it is within the dock is it positioned outside of the page relative to the button for the item it is currently showing. This element is based loosely off the YUI3 overlay.&lt;br /&gt;
&lt;br /&gt;
===The layout of the dock===&lt;br /&gt;
[[Image:Dock.layout.201005.png|300px|thumb|Dock layout]]&lt;br /&gt;
The second image on the right shows the layout of these elements within the standard theme.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;So what has gone on here?&#039;&#039;&#039;&lt;br /&gt;
First up ignore the bright colours and margins. I have put these colours in simply to highlight everything and ensure there is space between elements so I can show them apart.&lt;br /&gt;
&lt;br /&gt;
; div#dock : So immediately you notice that the dock is in the top left of the screen and the is fixed width. This is achieved by setting a strict with of 30px and setting the position of the &#039;&#039;#dock&#039;&#039; to fixed. The reason that everything is within the one &#039;&#039;#dock&#039;&#039; element is because it makes positioning everything very simple, now that we have set the position of &#039;&#039;#dock&#039;&#039; we don&#039;t need to worry about anything other than the panel which we&#039;ll get to shortly. You should also note that because of the strict width and position you need to be careful when applying styles to this element as it can have nasty effects on everything else.&lt;br /&gt;
&lt;br /&gt;
; div.dockeditem_container : Next you should notice that the &#039;&#039;.dockeditem_container&#039;&#039; doesn&#039;t extend to the bottom of the dock. Because there is not special positioning here it is behaving as div&#039;s normally do and this is the perfect place to really start styling your dock.&lt;br /&gt;
&lt;br /&gt;
; div.controls : After that within the structure we have &#039;&#039;div.controls&#039;&#039;. This element is positioned absolutely at the bottom of the dock, is 100% wide (so the full width of the dock) and uses &#039;&#039;text-align:center&#039;&#039; to ensure that the controls are centred.&lt;br /&gt;
&lt;br /&gt;
; div.dockeditem : Simply representing a button that can be hovered over or clicked to display the docked item the only important thing to note about this is that you should change the cursor to a pointer so that it is clear you can interact with it.&lt;br /&gt;
&lt;br /&gt;
; div#dockeditempanel : After &#039;&#039;#dock&#039;&#039; this is the most serious element in the dock. This element will contain the docked item and needs to positioned to the left of the dock and at the same height as the title of the item that is being displayed. Luckily you don&#039;t need to worry about the top position of the element that will be automatically adjusted by JavaScript however you will need to push the element to the left. This can be done easily by setting the position of the element to relative, and then setting left to 100%. Note you shouldn&#039;t style this element unless you know what you are doing, like the main dock element the smallest change can cause some terrible effects.&lt;br /&gt;
&lt;br /&gt;
; div.dockeditempanel_container : This element is there specifically to give you the themer an easy place to start styling the panel.&lt;br /&gt;
&lt;br /&gt;
; div.dockeditempanel_hd : This element contains the title of the docked item plus controls to undock or close it.&lt;br /&gt;
&lt;br /&gt;
; div.dockeditempanel_bd : Contains is the main content area for the panel.&lt;br /&gt;
&lt;br /&gt;
===State classes===&lt;br /&gt;
There are several state classes that the dock makes use of to achieve things such as the visibility of the dock, visibility of the panel, and which item is active.&lt;br /&gt;
The following table illustrates where these state classes are used.&lt;br /&gt;
{|  class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Element&lt;br /&gt;
! Class&lt;br /&gt;
! Description&lt;br /&gt;
! Default CSS&lt;br /&gt;
|-&lt;br /&gt;
|body&lt;br /&gt;
|has_dock&lt;br /&gt;
|This class is added to the body element when the dock is visible.&lt;br /&gt;
|Margin-left: 30px&lt;br /&gt;
|-&lt;br /&gt;
|#dock&lt;br /&gt;
|nothingdocked&lt;br /&gt;
|This class is added to the dock when there is nothing docked.&lt;br /&gt;
|visibility: hidden; display: none;&lt;br /&gt;
|-&lt;br /&gt;
|#dock&lt;br /&gt;
|.dock_&#039;&#039;position&#039;&#039;_&#039;&#039;style&#039;&#039;&lt;br /&gt;
|A special class is added to describe the docks desired position e.g. dock_left_vertical&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|.dockeditem&lt;br /&gt;
|activeitem&lt;br /&gt;
|This class is added to the item that is currently being shown.&lt;br /&gt;
|Change the background colour&lt;br /&gt;
|-&lt;br /&gt;
|.dockeditem&lt;br /&gt;
|firstdockitem&lt;br /&gt;
|This class is added to the first dock item.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|.dockeditem h2&lt;br /&gt;
|filterrotate&lt;br /&gt;
|Added when the title is being rotated by an IE filter [Internet Explorer only]&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|#dockeditempanel&lt;br /&gt;
|dockitempanel_hidden&lt;br /&gt;
|Added to the panel when it is not being shown.&lt;br /&gt;
|visibility: hidden; display: none;&lt;br /&gt;
|-&lt;br /&gt;
|#dockeditempanel&lt;br /&gt;
|oversized_content&lt;br /&gt;
|Added when the panel required scrolling to show everything.&lt;br /&gt;
|Set the overflow method&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Layout file changes===&lt;br /&gt;
There is only one thing that you need to make sure of within your layout files if you are creating your own. You need to add the class &#039;&#039;block-region&#039;&#039; to all of the block region div&#039;s as shown below.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;region-post&amp;quot; class=&amp;quot;block-region&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Whilst there is nothing else you &#039;&#039;&#039;need&#039;&#039;&#039; to change within your layout files there one other thing that you may want to do.&lt;br /&gt;
&lt;br /&gt;
Because the dock is loaded entirely by JavaScript you will notice a visual jump on the page if all of the blocks within a region have been docked. This is because the dock shrinks sections that have been completely docked so that they don&#039;t wast page space.&lt;br /&gt;
&lt;br /&gt;
Within you layout files you can check whether a section has been completely docked and then if it has set the body classes so that it is shrunk when the page is delivered.&lt;br /&gt;
&lt;br /&gt;
I&#039;m going to assume that you have all read the [[Themes 2.0 creating your first theme]]. If you haven&#039;t go read it now.&lt;br /&gt;
So now that you&#039;ve created your first theme think back to the code you wrote at the top of your layout files that checks whether a page has block regions pre and post. The code was as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$hassidepre = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-pre&#039;, $OUTPUT);&lt;br /&gt;
$hassidepost = $PAGE-&amp;gt;blocks-&amp;gt;region_has_content(&#039;side-post&#039;, $OUTPUT);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Right below these two lines we are going to add two more:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$showsidepre = ($hassidepre &amp;amp;&amp;amp; !$PAGE-&amp;gt;blocks-&amp;gt;region_completely_docked(&#039;side-pre&#039;, $OUTPUT));&lt;br /&gt;
$showsidepost = ($hassidepost &amp;amp;&amp;amp; !$PAGE-&amp;gt;blocks-&amp;gt;region_completely_docked(&#039;side-post&#039;, $OUTPUT));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
What we have here is two variables that tell use whether we should show the block regions pre and post. The verbal interpretation of this string is to say &#039;&#039;We will show this side if this side has content and if there is at least one block that has not been docked.&#039;&#039; and we repeat it for each side.&lt;br /&gt;
&lt;br /&gt;
Now that we know for each region that it has content and that we should show it we need some way to tell the page what block regions to show.&lt;br /&gt;
This is achieved by adding special classes to the body element of the page as follows:&lt;br /&gt;
; side-pre-only : This gets added to the body if we only want to show the block region pre.&lt;br /&gt;
; side-post-only : Just like side-pre-only except for the post region.&lt;br /&gt;
; content-only : This gets added if don&#039;t want to show either block region.&lt;br /&gt;
By default we want to show both regions so we don&#039;t need to add any class for this.&lt;br /&gt;
So how to do this in PHP?&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$bodyclasses = array();&lt;br /&gt;
if ($showsidepre &amp;amp;&amp;amp; !$showsidepost) {&lt;br /&gt;
    $bodyclasses[] = &#039;side-pre-only&#039;;&lt;br /&gt;
} else if ($showsidepost &amp;amp;&amp;amp; !$showsidepre) {&lt;br /&gt;
    $bodyclasses[] = &#039;side-post-only&#039;;&lt;br /&gt;
} else if (!$showsidepost &amp;amp;&amp;amp; !$showsidepre) {&lt;br /&gt;
    $bodyclasses[] = &#039;content-only&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
What we have here is three if-else statements, of which either one or none will be true.&lt;br /&gt;
# The first if statement says if we want to show the pre region but not the post region add the class &#039;&#039;side-pre-only&#039;&#039;&lt;br /&gt;
# The second if statement says if we want to show the post region but not the pre region add the class &#039;&#039;side-post-only&#039;&#039;&lt;br /&gt;
# The third class says if we don&#039;t want to display either region add the class &#039;&#039;content-only&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Now that we know which class we want to add to the body element we need to do so. This can be done as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;body id=&amp;quot;&amp;lt;?php echo $PAGE-&amp;gt;bodyid ?&amp;gt;&amp;quot; class=&amp;quot;&amp;lt;?php echo $PAGE-&amp;gt;bodyclasses.&#039; &#039;.join(&#039; &#039;, $bodyclasses) ?&amp;gt;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
You&#039;ll notice this is very similar to the body tag you wrote in your first theme, however we have added&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
join(&#039; &#039;, $bodyclasses)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This php command simply concatenates each body class putting a space between each.&lt;br /&gt;
&lt;br /&gt;
Now the final thing to do is make sure that we don&#039;t show a block region if we don&#039;t have content for it. This can be done by adding if statements around each block region as follows:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php if ($hassidepre) { ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;region-pre&amp;quot; class=&amp;quot;block-region&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-pre&#039;) ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
                &lt;br /&gt;
&amp;lt;?php if ($hassidepost) { ?&amp;gt;&lt;br /&gt;
&amp;lt;div id=&amp;quot;region-post&amp;quot; class=&amp;quot;block-region&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;div class=&amp;quot;region-content&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;?php echo $OUTPUT-&amp;gt;blocks_for_region(&#039;side-post&#039;) ?&amp;gt;&lt;br /&gt;
    &amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;?php } ?&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
For each if statement we are saying &#039;&#039;If this region has content display it.&#039;&#039; You&#039;ll notice that here we are using &#039;&#039;$hasside...&#039;&#039; instead of &#039;&#039;$showside...&#039;&#039; this is because we want to add them if they have content even if they won&#039;t be shown. Otherwise the dock won&#039;t be able to find them and you simply won&#039;t see the block.&lt;br /&gt;
&lt;br /&gt;
Having made the above changes if you now look at the layout files for the base theme you start to notice that they are looking very similar and indeed they are. If at any point you get stuck or don&#039;t know how to proceed have a look at the base themes layout files and see how its done there.&lt;br /&gt;
&lt;br /&gt;
===The core CSS===&lt;br /&gt;
As mentioned in the key points at the start of this document the base theme although not supporting the dock does contain structural CSS that ensure the dock is functional on all themes that choose to support it.&lt;br /&gt;
Lets look at the CSS within &#039;&#039;theme/base/style/dock.css&#039;&#039;, this is the core structural CSS for the dock.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
/* Put a margin on the body if the dock is shown */&lt;br /&gt;
body.has_dock {margin-left:30px;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Well this is very simple, if the dock is being shown apply a 30px margin to the body. This is done to ensure that the dock doesn&#039;t overlap the body.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
/** For the dock itself */&lt;br /&gt;
#dock {width:30px;position:fixed;top:0px;left:0px;height:100%;background-color:#FFF;border-right:1px solid #000;z-index:11000;}&lt;br /&gt;
#dock.nothingdocked {visibility: hidden;display:none;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
These two rules style the dock itself. Note the second rule is only applied when nothing is docked in which case we will hide the empty dock.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
#dock .dockeditem .firstdockitem {margin-top:1em;}&lt;br /&gt;
#dock .dockeditem .dockedtitle {border-bottom:1px solid #000;border-top:1px solid #000;cursor:pointer;}&lt;br /&gt;
#dock .dockeditem .dockedtitle h2 {font-size:0.8em;line-height:100%;text-align:center;}&lt;br /&gt;
#dock .dockeditem .dockedtitle .filterrotate {margin-left:8px;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The four rules above style the buttons that will show the docked items. Each docked item has one. The styles being used here arn&#039;t doing anything to special other than setting the cursor to pointer so that it is recognised as an actionable element.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
#dock .controls {position:absolute;bottom:1em;text-align:center;width:100%;}&lt;br /&gt;
#dock .controls img {cursor:pointer;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Very simply this bit of CSS. It is positioning the controls for the dock at the bottom centre of the dock.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
/** For the panel the docked blocks are shown in */&lt;br /&gt;
#dockeditempanel {min-width:200px;position:relative;z-index:12000;left:100%;}&lt;br /&gt;
#dockeditempanel.dockitempanel_hidden {display:none;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
These two lines are applied to the docked item panel&#039;s base element and are VERY important to the operation of the dock. They ensure that when shown the panel is top the left of the dock and that when it is not being displayed it is not visible.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;&lt;br /&gt;
#dockeditempanel .dockeditempanel_content {background-color:#fff;border:1px solid #000;z-index:12050;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_bd {overflow:auto;width:auto;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_bd .block_docked {margin:10px;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_hd {border-bottom:1px solid #000;text-align:right;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_hd h2 {display:inline;margin:0;padding-right:1em;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_hd .commands {display:inline;}&lt;br /&gt;
#dockeditempanel .dockeditempanel_hd .commands img {margin-right:2px;vertical-align:middle;}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The above lines of CSS are used to style the internal content of the panel. Note the styles for the block will be applied as if it were not docked.&lt;br /&gt;
&lt;br /&gt;
And that is it!&lt;br /&gt;
&lt;br /&gt;
Whilst things don&#039;t look to difficult when styling things if you don&#039;t think carefully about where you are applying styles you can quickly dig yourself a big hole. I would suggest going slowly at first when applying more styles and making sure you don&#039;t apply too many styles to the base elements #dock and #dockeditempanel.&lt;br /&gt;
&lt;br /&gt;
==Customising the dock==&lt;br /&gt;
This section of the document looks at how to customise the dock using JavaScript.&lt;br /&gt;
&lt;br /&gt;
It was recognised early on during the development of the dock that it probably won&#039;t suit everyone&#039;s needs, nor would it appeal to everyone. Because of this during development and the frequent revisions that were occurring during Moodle 2.0s development there was always a focus on ensuring the dock was customisable and that someone with a bit of time on their hands and a good knowledge of JavaScript could hack it to bits and make it into the tool they desired.&lt;br /&gt;
&lt;br /&gt;
This document doesn&#039;t go into the full details of how to customise the dock but should get anyone keen started quickly. Those who fear JavaScript should leave now!&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
The dock is written to make use of YUI3 and all the functionality that it has to offer, the main dock object both looks for specific callback functions and adds manages and fires several important events. At the same time it is also object orientated JavaScript which has the advantage in JavaScript of allowing subsequent JavaScript events to redefine methods of the object.&lt;br /&gt;
&lt;br /&gt;
This allows you the theme designer to write JavaScript to customise the dock in two fashions. The first through events and callbacks. The second through manually overriding the methods the dock uses.&lt;br /&gt;
&lt;br /&gt;
We will look into these two methods in the subsequent sections of this document, for the time being what you need to learn about is the JavaScript structure of the dock.&lt;br /&gt;
&lt;br /&gt;
First all of the code for the dock within Moodle 2.0 is located within the file &#039;&#039;&#039;moodle/blocks/dock.js&#039;&#039;&#039; and can be viewed online through the CVS repository[http://cvs.moodle.org/moodle/blocks/dock.js?view=markup]&lt;br /&gt;
&lt;br /&gt;
There are three main objects that get used for the dock:&lt;br /&gt;
# First up is of course the dock, which is namespaced to M.core_dock.dock. It is instantiated only once per page and is essentially a static object that manages and operates the dock plus everything on it.&lt;br /&gt;
# Second is a generic block class. Every block on the page gets instantiated as a generic block unless it has a more specific class (that should extend the generic block class). This generic block class is responsible for moving a block between the dock and its normal block position. It is namespaced to M.core_dock.generic_block.&lt;br /&gt;
# The third class is the dock item class which is used to represent an item on the dock. It is responsible for showing the item when required and handles the events that the dock + user trigger. I can hear you asking now why not just add this functionality to the generic block class? because this keeps it open for things other than blocks to be docked.&lt;br /&gt;
&lt;br /&gt;
As well as the above three classes there are some important class objects and properties that you should also be aware of as you may want to work with them when customising the dock.&lt;br /&gt;
; M.core_dock.Y : Is a YUI instance for use with the dock.&lt;br /&gt;
; M.core_dock.nodes.dock : Is the façade for the dock itself (#dock) and is a YUI3 Node instance.&lt;br /&gt;
; M.core_dock.getPanel() : This will return the panel that is used to display docked item within. It is stored locally through M.core_dock.nodes.panel however as it is not initialised until it is required you should always use the getPanel method.&lt;br /&gt;
&lt;br /&gt;
The following are other important notes about the dock that you should read and understand before customising the dock.&lt;br /&gt;
# The dock emulates the YUI3 &#039;&#039;&#039;on&#039;&#039;&#039; method for listening to events. Because the dock requires initialisation which may occur through module dependencies we needed a method of exposing the dock to events prior to initialisation and this is it. It ensures that if you attach events to the dock before it is initialised everything still works fine.&lt;br /&gt;
# Both the dock and the item class inherit from Y.EventTarget and publish several events.&lt;br /&gt;
# The dock is designed to work both on old and modern browsers and as such there are several places where we branch based on browser and version.&lt;br /&gt;
# The generic block class should never be added to for the needs of a single block. Only things that are generic to all blocks should be added to this class. Independent needs should be handled by creating a block specific class that extends the generic block class. The navigation and settings blocks do this currently.&lt;br /&gt;
&lt;br /&gt;
===Extending the dock through events===&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
===Using custom methods for the dock===&lt;br /&gt;
Under construction&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Making a horizontal dock]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Turnitin_errors&amp;diff=64144</id>
		<title>Turnitin errors</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Turnitin_errors&amp;diff=64144"/>
		<updated>2024-05-01T04:53:22Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
This is a list of the Turnitin Codes, and their descriptions.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Success States 1-99 ==&lt;br /&gt;
*1	General Success State, no errors&lt;br /&gt;
*10	FID 1, FCMD 1 – successful, send to login&lt;br /&gt;
*11	FID 1, FCMD 2 – successful, do not send to login	&lt;br /&gt;
*20	FID 2, FCMD 1 – successful, send to login&lt;br /&gt;
*21	FID 2, FCMD 2 – successful, do not sent to login&lt;br /&gt;
*30	FID 3, FCMD 1 – successful, send to login&lt;br /&gt;
*31	FID 3, FCMD 2 – successful, do not send to login&lt;br /&gt;
*40	FID 4, FCMD 1,5 – successful, redirect user to assignment creation/modification page&lt;br /&gt;
*41	FID 4, FCMD 2 – successful&lt;br /&gt;
*42	FID 4, FCMD 3 – successful&lt;br /&gt;
*43	FID 4, FCMD 4 – successful&lt;br /&gt;
*50	FID 5, FCMD 1 – successful, redirect user to submission page&lt;br /&gt;
*51	FID 5, FCMD 2 - successful&lt;br /&gt;
*60 	FID 6, FCMD 1 - successful&lt;br /&gt;
*61 	FID 6, FCMD 2 - successful&lt;br /&gt;
*70 	FID 7, FCMD 1,2 – successful&lt;br /&gt;
*70	FID 12, FCMD 1 – successful, redirect to administrator statistics page&lt;br /&gt;
*71 	FID 8, FCMD 2 - successful&lt;br /&gt;
*72 	FID 10, FCMD 2 - successful&lt;br /&gt;
*73	FID 11, FCMD 2 – successful&lt;br /&gt;
*74 	FID 0 – successful &lt;br /&gt;
*75 	FID 9, FCMD 2 - successful&lt;br /&gt;
&lt;br /&gt;
== Data Errors 100-199 ==&lt;br /&gt;
*100	Primary account ID missing from URL &lt;br /&gt;
*101	No HTTPS - the URL was not transmitted via HTTPS&lt;br /&gt;
*102 	GMT missing from URL&lt;br /&gt;
*103	GMT malformed - the date/time in the URL is bad&lt;br /&gt;
*104	Email missing from URL&lt;br /&gt;
*105	Email address is not between 5-75 characters&lt;br /&gt;
*106	Email address contains whitespace&lt;br /&gt;
*107 	Email address in URL is malformed&lt;br /&gt;
*108	Password in URL contained whitespace&lt;br /&gt;
*109	Diagnostic value in URL is bad&lt;br /&gt;
*110	MD5 missing from URL&lt;br /&gt;
*111	fcmd missing from URL&lt;br /&gt;
*112	User first name missing from URL or incorrect length&lt;br /&gt;
*113	User last name missing from URL or incorrect length&lt;br /&gt;
*114	Class title missing from URL, or not between 5-50 characters&lt;br /&gt;
*115	Password is not between 6-12 characters&lt;br /&gt;
*116 	fid missing from URL, or does not reference existing function&lt;br /&gt;
*117 	User type missing from URL or is not valid&lt;br /&gt;
*118 	encrypt value in URL is bad or missing&lt;br /&gt;
*119 	Paper author’s first name missing or incorrect length&lt;br /&gt;
*120 	Paper author’s last name missing or incorrect length&lt;br /&gt;
*121	Paper title missing – Please make sure to include a paper title before submitting your paper&lt;br /&gt;
*122 	Paper type missing or invalid&lt;br /&gt;
*123 	Assignment title missing or incorrect length&lt;br /&gt;
*124	ObjectID missing&lt;br /&gt;
*125	Password is required for function&lt;br /&gt;
*126	Date start and date due is required for function&lt;br /&gt;
*127	If one unique ID is used, they must all be used&lt;br /&gt;
*128	The class end date parameter is not in the right format.  Please make sure that the format is in YYYMMDD.”&lt;br /&gt;
*140	Undocumented, but appears to occur when assignment title is too long.  Should probably return either 2302 or 123 in this situation.&lt;br /&gt;
*141    &amp;quot;The value for the a date parameter is invalid&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Turnitin Database Errors 200-299 ==&lt;br /&gt;
*200	Primary account ID for Turnitin not activated to use the API&lt;br /&gt;
*201	IP address validation range for Turnitin not configured&lt;br /&gt;
*202	Primary account entry not active in Turnitin database &lt;br /&gt;
*203	MD5 key missing from Turnitin database&lt;br /&gt;
*204	Class does not exist in Turnitin database.  Please contact you instructor for further details.&lt;br /&gt;
*205	Database error verifying class&lt;br /&gt;
*206	Assignment does not exist in Turnitin database for this class.  The assignment may have been deleted.&lt;br /&gt;
*207	Database error verifying assignment&lt;br /&gt;
*208	User is not enrolled in class&lt;br /&gt;
*209	Database error verifying user’s enrollment in class&lt;br /&gt;
*210	User password does not match user email&lt;br /&gt;
*211	Database error verifying objectID&lt;br /&gt;
*212 	objectID does not exist for this user&lt;br /&gt;
*213 	objectID does not belong to this user &lt;br /&gt;
*214	Filename does not exist for this paper&lt;br /&gt;
*215	This primary account ID is not authorized to use this product&lt;br /&gt;
*216 	Student limit for this account has been reached.  Cannot join student to this class.&lt;br /&gt;
*217	The product for this account has expired.  Please contact your sales agent to renew the product&lt;br /&gt;
*218	Database Error inserting unique ID into the database &#039;&#039;(Note: This may happen on a new install of Moodle if the mdl_assignment ID&#039;s clash with turnitin assignment ID&#039;s in the previous installation. Fix this by increasing the autoincrement for mdl_assignment in the new installation to a number greater than the maximum ID in the old Moodle)&#039;&#039;&lt;br /&gt;
*219	Unique user id in the database does not match submitted uid&lt;br /&gt;
*220	More than one class exists with this title and unique ids must be used in this case&lt;br /&gt;
*221	More than one assignment exists with this title and unique ids must be used in this case&lt;br /&gt;
*222	User is associated with a different external uid.  If you have another user account with the same email address as the user account you are currently using, that could be the cause of the problem.  Please try modifying the email address for your current user account to a unique email address and try again.&lt;br /&gt;
*223	Cannot verify Blackboard user’s identity within Turnitin.  Missing Blackboard user id&lt;br /&gt;
*224	Could not verify user as primary instructor for this course&lt;br /&gt;
*225	Database error checking if student can view reports&lt;br /&gt;
*226	The class you are trying to update could not be found.  Please check to make sure that the class exists.&lt;br /&gt;
*227 	The class you are trying to update has an assignment which ends after the class end date you have specified.  Please change you class end date or modify the assignment.&lt;br /&gt;
*228 	The assignment with the assignment id that you entered does not belong to the class with the class id you entered.  Please check to make sure that you are not using a duplicate assignment id.&lt;br /&gt;
*229 There was an error creating the rollover assignment.&lt;br /&gt;
*230 You have been dropped from this class on the Turnitin end by your instructor. Please contact your instructor if you think you are receiving this message in error.&lt;br /&gt;
*231 There was an error processing your request: please try your action again. Please contact the Turnitin helpdesk if the problem persists.&lt;br /&gt;
*232 Grademark is currently inactive for this account.&lt;br /&gt;
*233 There was an error accessing this Turnitin Assignment because it was created via Course Copy, Snapshot, or some other process, and the original Turnitin Assignment could not be found.&lt;br /&gt;
*234 Could not find class with the given unique ID or title.&lt;br /&gt;
*235 Could not find assignment with the given assignment ID or title.&lt;br /&gt;
*236 Could not retrieve assignment info with the given information.&lt;br /&gt;
*237 Could not retrieve grade for the given object.&lt;br /&gt;
*238 Could not find user with the given userid or email.&lt;br /&gt;
*239 There was an error disabling Anonymous Marking for this submission.&lt;br /&gt;
*240 Migrating of this product is not supported.&lt;br /&gt;
*241 The user does not have the specified role in the class.&lt;br /&gt;
*242 There was an error with the attached file, please make sure it follows the proper format.&lt;br /&gt;
*243 The attached file is not a CSV file.&lt;br /&gt;
*244 The number of files you have selected exceeds the 500 file maximum for bulk download. Please make sure that the number of files you select for bulk download does not exceed 500 files.&lt;br /&gt;
*245 The objectIDs that were provided do not all belong to the same assignment.&lt;br /&gt;
*246 The compression process cannot begin because the students you selected do not have GradeMark files.&lt;br /&gt;
*247 We are compressing a file you previously requested for download. When this compression is complete, you may request another file for download.&lt;br /&gt;
*248 The class you have selected has been deleted.&lt;br /&gt;
*250 Submission Error: There was an error building up the user session data to submit the paper. Please verify the user information being used.&lt;br /&gt;
&lt;br /&gt;
== Inconsistency Errors 300-399 ==&lt;br /&gt;
*300 	Your IP address does not fall within the range of accepted IP addresses as specified by your Turnitin account administrator.  Please check with your Turnitin account administrator if your IP address needs to be added as an accepted IP address.&lt;br /&gt;
*301	Date/time expired – GMT timestamp used in MD5 calculation is off. API calls must have a GMT within 60 	minutes of the current GMT&lt;br /&gt;
*302	MD5 not authenticated - the MD5 in the URL does not match the MD5 calculated&lt;br /&gt;
&lt;br /&gt;
== Function Errors 400-499 ==&lt;br /&gt;
*400	Creating new user failed&lt;br /&gt;
*401	Unauthorized access - user exists, but does not belong to correct primary account ID or sub-account ID, do not execute function&lt;br /&gt;
*402	User is not an instructor, must be an instructor to run this function&lt;br /&gt;
*403	User is not a student, must be a student to run this function&lt;br /&gt;
*404 	FCMD is not valid&lt;br /&gt;
*405	Class title is not unique&lt;br /&gt;
*406	Creating new class failed in fid 2&lt;br /&gt;
*407	Student failed to join or log in to a class in fid 3&lt;br /&gt;
*408 	Attempt to join new user to account failed&lt;br /&gt;
*409 	Function requires POST request&lt;br /&gt;
*410	Function requires GET request&lt;br /&gt;
*411 	Creating/Updating/Deleting assignment failed in fid 4&lt;br /&gt;
*412	Assignment title is not unique&lt;br /&gt;
*413 	Error while trying to save the paper&lt;br /&gt;
*414	Originality report not generated yet in fid 6, fcmd 1&lt;br /&gt;
*415 	Originality score not available yet in fid 6, fcmd 2&lt;br /&gt;
*416	Error checking if submission existed for user&lt;br /&gt;
*417	Error trying to change user password&lt;br /&gt;
*418	Error trying to delete submission&lt;br /&gt;
*419	Could not create a new assignment.  An assignment with this title already exists for this class and 		instructor.  Please change the assignment title.&lt;br /&gt;
*420	Error trying to build up session data for user/class&lt;br /&gt;
*421	Error trying to retrieve paper submission info for assignment&lt;br /&gt;
*422	Updating user information failed&lt;br /&gt;
*423	Updating user information failed because user email was changed to an address that is already associated with an account&lt;br /&gt;
*424	Updating class title failed&lt;br /&gt;
*425	Error trying to sync grades between servers&lt;br /&gt;
*426	Error trying to sync roster between servers&lt;br /&gt;
*427 	Unable to establish web services session with remove webct server&lt;br /&gt;
*428	Unable to create WebCT gradebook column for assignment&lt;br /&gt;
*429	Web services parameters error&lt;br /&gt;
*430	(This is a general webservices error – there could be a number of different messages that come with it)&lt;br /&gt;
*431	Error trying to connect back to the Blackboard web service.&lt;br /&gt;
*432	Students are not allowed to view reports in this assignment&lt;br /&gt;
*434    The start time you specified is invalid or not formatted correctly (YYYY-MM-DD HH:MM:SS).&lt;br /&gt;
*435    Error trying to grade submission.&lt;br /&gt;
*436 Institution repository is not available for this account, please change the submit_papers_to parameter to either 0 (no repository) or 1 (standards repository).&lt;br /&gt;
*437 The account administrator has set that all papers must be submitted to a repository, please change the submit_papers_to parameter.&lt;br /&gt;
*438 Error trying to set submissions to be stored in a standard repository. The account is using its own private institutional node. Please change the submit_papers_to parameter.&lt;br /&gt;
*439 The institutional check is not available for this account. Please set the institution_check parameter to 0&lt;br /&gt;
*440 Please specify an email for the new instructor for this course.&lt;br /&gt;
*441 New instructor specified doesn’t exist, please create the user first.&lt;br /&gt;
*442 New Instructor is not joined to this account, please join them to the account first.&lt;br /&gt;
*443 Anonymous Marking is enabled for this assignment. Cannot download file until after the assignment post date.&lt;br /&gt;
*444 Usage of this account is not currently high enough to generate meaningful statistics. If you would like more information or would like to see these statistics any way, please contact your Turnitin sales representative.&lt;br /&gt;
*445 User login failed.&lt;br /&gt;
*446 Session ID missing from URL&lt;br /&gt;
*447 Error trying to set user as an instructor for the class.&lt;br /&gt;
*448 Error migrating this account to another product.&lt;br /&gt;
*449 Error removing user from class.&lt;br /&gt;
*450 Cannot remove user from class because the user is the only instructor for the class.&lt;br /&gt;
*451 Error initiating GradeMark Bulk Download.&lt;br /&gt;
&lt;br /&gt;
== Paper Submission Errors 1000-1099 ==&lt;br /&gt;
*1000	The due date for this assignment has passed.  Please see your instructor to request a late submission.&lt;br /&gt;
*1001	You may not submit a paper to this assignment until the assignment start date&lt;br /&gt;
*1002You may not submit a paper to this assignment because the Plagiarism Prevention product is unavailable&lt;br /&gt;
*1003You have reached the maximum limit of 10 papers for the InSite demo account&lt;br /&gt;
*1004Paper author’s first name missing or incorrect length in URL&lt;br /&gt;
*1005Paper author’s last name missing or incorrect length in URL&lt;br /&gt;
*1006Paper title missing&lt;br /&gt;
*1007The file you have uploaded is too big (TurnItIn site has a note that file size may not exceed 10.48576Mb)&lt;br /&gt;
*1008No file uploaded!  Please make sure that you have attached the file that you wish to submit before sending the request&lt;br /&gt;
*1009Invalid file type!  Valid file types are MS Word, Acrobat PDF, Postscript, Text, HTML, WordPerfect (WPD) and Rich Text Format.  Please make sure the format of your file is one of the valid file types.&lt;br /&gt;
*1010You must submit more than 100 characters of non-whitespace&lt;br /&gt;
*1011The paper you are tyring to submit is incorrectly formatted.  There seems to be spaces between each letter in your paper.  Please try submitting again or contact our helpdesk if the problem persists.&lt;br /&gt;
*1012Paper length exceeds limits&lt;br /&gt;
*1013You must submit more than 20 words of text&lt;br /&gt;
*1014You must select an enrolled student as the author of this paper&lt;br /&gt;
*1015You have already submitted a paper to this assignment.  Please contact your instructor to request a resubmission&lt;br /&gt;
*1016This student has already submitted a paper to this assignment.  Please delete the original paper before submitting a new one.&lt;br /&gt;
*1017Paper author&#039;s first name missing or incorrect length in URL&lt;br /&gt;
*1018Paper author&#039;s last name missing or incorrect length in URL&lt;br /&gt;
*1019Paper title exceeds maximum of 200 characters&lt;br /&gt;
*1020 This document cannot be accepted because it contains characters from a character set that is not supported.&lt;br /&gt;
*1021	You have already submitted a paper to this assignment.  Please contact your instructor to request a 	resubmission.&lt;br /&gt;
*1022	This student has already submitted a portfolio item to this assignment.  Please delete the original portfolio 	item before submitting a new one.&lt;br /&gt;
*1023	We&#039;re sorry, but we could not read the PDF you submitted.  Please make sure that the file is not password 	protected and contains selectable text rather than scanned images.&lt;br /&gt;
*1024	The paper you are tyring to submit does not meet our cirteria for a legitimate paper.  Please try submitting 	again or contact our helpdesk if the problem persists.&lt;br /&gt;
&lt;br /&gt;
== Assignment Creation Errors 2025-2324 ==&lt;br /&gt;
*2025	The class name must be between 5-200 characters&lt;br /&gt;
*2026 	The class enrollment password must be between 4-12 characters&lt;br /&gt;
*2027	There was an error processing your request&lt;br /&gt;
*2028	The class end date must be within 6 months of the start date&lt;br /&gt;
*2029	The end date for this class must occur on or after today&lt;br /&gt;
*2030	The end date for this class must occur on or after the start date&lt;br /&gt;
*2031	The end date for this class must occur at least 3 months after the start date&lt;br /&gt;
*2032	There was an error updating the class end date&lt;br /&gt;
*2035	There was an error processing your request&lt;br /&gt;
*2036	There was an error processing your request&lt;br /&gt;
*2100	User first name missing from URL&lt;br /&gt;
*2101	User last name missing from URL&lt;br /&gt;
*2102	Email is missing.  Please make sure that your email address has been set&lt;br /&gt;
*2108   The email address needs to conform to Internet Standard RFC822&lt;br /&gt;
*2109   The email address needs to have a fully qualified domain name.&lt;br /&gt;
*2110	We only allow email addressses with 5-75 characters&lt;br /&gt;
*2111	The email address cannot contain white space&lt;br /&gt;
*2112	Please make sure you are entering a valid email address.  The email address you enter can only contain 	letters, numbers, and the symbols _ (underscore), - (dash), . (period), &#039; (apostrophe), and + (plus).”&lt;br /&gt;
*2300	You have entered an invalid date!&lt;br /&gt;
*2301	You must select a rubric set to user with remediation&lt;br /&gt;
*2302 	The assignment title must be between 2-100 characters&lt;br /&gt;
*2303	The assignment must have a point value between 0 and 1000&lt;br /&gt;
*2304	The assignment instructions must be less than 1000 characters&lt;br /&gt;
*2305	The start date for this assignment must occur on or after today&lt;br /&gt;
*2306	The due date for this assignment must occur on or after the start date&lt;br /&gt;
*2307	The due date for this assignment must occur within 6 months of the start date&lt;br /&gt;
*2308	When creating your assignment, the post date must occur on or before the class end date.  The class end 	date in Turnitin is by default set to 6 months from the day the class was created.  The class end date can be 	chaned in the class update area in Turnitin&lt;br /&gt;
*2309	When creating your assignment, please make sure that the post date is on or after the due date of the 	assignment&lt;br /&gt;
*2310	You must specify a point value for this assignment because this class is using distributed grading&lt;br /&gt;
*2314	When modifying your assignment, please make sure that the post date is on or after the due date of the 	assignment&lt;br /&gt;
*2315	There was an error processing your request&lt;br /&gt;
*2316	There was an error processing your request&lt;br /&gt;
*2317	There was an error processing your request&lt;br /&gt;
*2318	You cannot change the search targets because papers have already been submitted to this assignment.  You must create a new assignment if you would like to change the search targets&lt;br /&gt;
*2319	There was an error processing your request&lt;br /&gt;
*2320	There was an error processing your request&lt;br /&gt;
*2321    When excluding small matches by word, you must enter a positive number&lt;br /&gt;
*2324	 When excluding small matches by percentage, you must enter a number between 1 and 100&lt;br /&gt;
&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Turnitin&amp;diff=64143</id>
		<title>Turnitin</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Turnitin&amp;diff=64143"/>
		<updated>2024-05-01T04:52:54Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
==Development Plan for Turnitin Plagiarism plugin==&lt;br /&gt;
===Current Features in Released code===&lt;br /&gt;
* Integrated with Advanced upload and single upload assignment types.&lt;br /&gt;
* capability moodle/course:enableturnitin to give teachers to use TII submission.&lt;br /&gt;
* Teachers will be able to &amp;quot;enable&amp;quot; the TII submission when creating a new Advanced Assignment Type.&lt;br /&gt;
* TII originality Score, and Full report will only be available to Teachers via the submissions page.&lt;br /&gt;
* all files uploaded to the assignment will be submitted to TII via cron&lt;br /&gt;
* Originality score/Full report will be checked for availability via cron.&lt;br /&gt;
* Display some &amp;quot;disclaimer&amp;quot; type text to the student when TII is enabled to explain that the assignment will be automatically submitted to TII&lt;br /&gt;
Add the ability for teachers to elect who/when a originality score and or full report is available to:&lt;br /&gt;
* As soon as the report is back&lt;br /&gt;
* After the due date of the assignment&lt;br /&gt;
* Add options to admin pages to set what settings are the default for TII settings within modules.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Stuff that would be nice to do at some point, but is not currently funded===&lt;br /&gt;
* add the functionality to the Online assignment type&lt;br /&gt;
* add the functionality to the discussion forum uploads&lt;br /&gt;
* add the functionality for files uploaded via html editor(essay questions etc)&lt;br /&gt;
&lt;br /&gt;
From The University of Waikato&lt;br /&gt;
* Provide option for to not store assignment submissions on the Tii database and what to check/compare them against (as per Tii &#039;Allow other papers to be checked against submission&#039; option)&lt;br /&gt;
* Better error display to students so they are informed if a file is not valid or long enough etc&lt;br /&gt;
* ‘keep alive’ type communication when a lecturer is viewing a report to prevent Tii website timeout&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Wiki_2.0.3_Files&amp;diff=64142</id>
		<title>Wiki 2.0.3 Files</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Wiki_2.0.3_Files&amp;diff=64142"/>
		<updated>2024-05-01T02:16:32Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
This page specs for cleaning up file handling in wiki 2.  See MDL-26739 for details.&lt;br /&gt;
&lt;br /&gt;
==File management page==&lt;br /&gt;
Create a new tab in wiki main page, named &amp;quot;Files&amp;quot;, the Files page will display all files shared in current wiki instance. Users with manage files capability will see &amp;quot;Manage files&amp;quot; button under the files tree view, click the button will take users to moodle file manager.&lt;br /&gt;
[[Image:Wiki_Files_Tab.jpg]]&lt;br /&gt;
&lt;br /&gt;
==Wiki editors==&lt;br /&gt;
&lt;br /&gt;
Nwiki and creole wiki editors will have a new select to choose existing files from shared area. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Image:Wiki_Editor.jpg]]&lt;br /&gt;
&lt;br /&gt;
==File handling==&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=What_to_do_about_weblib_methods_with_lots_of_arguments&amp;diff=64141</id>
		<title>What to do about weblib methods with lots of arguments</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=What_to_do_about_weblib_methods_with_lots_of_arguments&amp;diff=64141"/>
		<updated>2024-05-01T02:14:24Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
{{Work in progress}}&lt;br /&gt;
&lt;br /&gt;
In Moodle 2.0, all the functions in lib/weblib.php that are to do with generating output are being replaced by methods in lib/outputlib.php.&lt;br /&gt;
&lt;br /&gt;
This is a chance to clean up the API. For example, we have already decided that all these methods will return a string, rather than giving a choice of outputting the HTML immediately via a $output parameter.&lt;br /&gt;
&lt;br /&gt;
(Just to reassure you: We will make new versions of all the old weblib functions in deprecatedlib.php, that implement the old API in terms of the new methods, so you existing code will not break.)&lt;br /&gt;
&lt;br /&gt;
==The problem==&lt;br /&gt;
&lt;br /&gt;
While some of the weblib functions are quite sensible. For example:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function print_box($message, $classes=&#039;generalbox&#039;, $ids=&#039;&#039;, $return=false) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
some of them are ridiculous:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function choose_from_menu ($options, $name, $selected=&#039;&#039;, $nothing=&#039;choose&#039;, $script=&#039;&#039;,&lt;br /&gt;
                           $nothingvalue=&#039;0&#039;, $return=false, $disabled=false, $tabindex=0,&lt;br /&gt;
                           $id=&#039;&#039;, $listbox=false, $multiple=false, $class=&#039;&#039;) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Suppose you want to create a &amp;amp;lt;select&amp;gt; menu with a particular class attribute. You have to pass all 13 arguments, most of them just the default value, just to be able to pass class.&lt;br /&gt;
&lt;br /&gt;
We should look for a better way to handle these methods with a lot of parameters.&lt;br /&gt;
&lt;br /&gt;
Fortunately, there is a precedent. Here is the print_table function:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Print a nicely formatted table.&lt;br /&gt;
 *&lt;br /&gt;
 * @param array $table is an object with several properties.&lt;br /&gt;
 * &amp;lt;ul&amp;gt;&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;head - An array of heading names.&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;align - An array of column alignments&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;size  - An array of column sizes&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;wrap - An array of &amp;quot;nowrap&amp;quot;s or nothing&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;data[] - An array of arrays containing the data.&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;width  - A percentage of the page&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;tablealign  - Align the whole table&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;cellpadding  - Padding on each cell&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;cellspacing  - Spacing between cells&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;class - class attribute to put on the table&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;id - id attribute to put on the table.&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;rowclass[] - classes to add to particular rows. (space-separated string)&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;colclass[] - classes to add to every cell in a particular colummn. (space-separated string)&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;summary - Description of the contents for screen readers.&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;headspan can be used to make a heading span multiple columns.&lt;br /&gt;
 *     &amp;lt;li&amp;gt;$table-&amp;gt;rotateheaders - Causes the contents of the heading cells to be rotated 90 degrees.&lt;br /&gt;
 * &amp;lt;/ul&amp;gt;&lt;br /&gt;
 * @param bool $return whether to return an output string or echo now&lt;br /&gt;
 * @return boolean|string depending on $return&lt;br /&gt;
 */&lt;br /&gt;
function print_table($table, $return=false) {&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That is, we just pass in one object which has all the necessary information as properties, many of which are optional. Should we use this approach for more functions?&lt;br /&gt;
&lt;br /&gt;
On this page I explore this idea by rewriting the choose_from_menu function.&lt;br /&gt;
&lt;br /&gt;
==Code to create a menu==&lt;br /&gt;
&lt;br /&gt;
===Simple example===&lt;br /&gt;
&lt;br /&gt;
====Old code====&lt;br /&gt;
&lt;br /&gt;
A simple example (from backup/restore_form.html).&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
choose_from_menu($gradebook_history_options, &amp;quot;restore_gradebook_history&amp;quot;, &lt;br /&gt;
        $restore_gradebook_history, &amp;quot;&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====New code====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$menu = new moodle_select_menu;&lt;br /&gt;
$menu-&amp;gt;options = $gradebook_history_options;&lt;br /&gt;
$menu-&amp;gt;name = &#039;restore_gradebook_history&#039;;&lt;br /&gt;
$menu-&amp;gt;selectedoption = $restore_gradebook_history;&lt;br /&gt;
echo $OUTPUT-&amp;gt;select_menu($menu);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Complex example===&lt;br /&gt;
&lt;br /&gt;
====Old code====&lt;br /&gt;
&lt;br /&gt;
A complex example (from mod/assignment/lib.php)&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
choose_from_menu($options, &#039;outcome_&#039;.$n.&#039;[&#039;.$userid.&#039;]&#039;,&lt;br /&gt;
        $outcome-&amp;gt;grades[$submission-&amp;gt;userid]-&amp;gt;grade, get_string(&#039;nooutcome&#039;, &#039;grades&#039;),&lt;br /&gt;
        &#039;&#039;, 0, false, false, 0, &#039;menuoutcome_&#039;.$n);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====New code====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$menu = new moodle_select_menu;&lt;br /&gt;
$menu-&amp;gt;options = $options;&lt;br /&gt;
$menu-&amp;gt;name = &#039;outcome_&#039;.$n.&#039;[&#039;.$userid.&#039;]&#039;;&lt;br /&gt;
$menu-&amp;gt;selectedoption = $outcome-&amp;gt;grades[$submission-&amp;gt;userid]-&amp;gt;grade;&lt;br /&gt;
$menu-&amp;gt;nothinglabel = get_string(&#039;nooutcome&#039;, &#039;grades&#039;);&lt;br /&gt;
$menu-&amp;gt;id = &#039;menuoutcome_&#039;.$n;&lt;br /&gt;
echo $OUTPUT-&amp;gt;select_menu($menu);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Although the new code is longer, I think it is much easier to see which parameters we have set (to non-default values).&lt;br /&gt;
&lt;br /&gt;
==Code behind the scenes==&lt;br /&gt;
&lt;br /&gt;
The remainder of this page is a bit out-of-date following some discussions which caused me to change some details above, however it is basically right.&lt;br /&gt;
&lt;br /&gt;
===Old code===&lt;br /&gt;
&lt;br /&gt;
The implementation of choose_from_menu is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Given an array of values, output the HTML for a select element with those options.&lt;br /&gt;
 *&lt;br /&gt;
 * Normally, you only need to use the first few parameters.&lt;br /&gt;
 *&lt;br /&gt;
 * @param array $options The options to offer. An array of the form&lt;br /&gt;
 *      $options[{value}] = {text displayed for that option};&lt;br /&gt;
 * @param string $name the name of this form control, as in &amp;amp;lt;select name=&amp;quot;...&amp;quot; ...&lt;br /&gt;
 * @param string $selected the option to select initially, default none.&lt;br /&gt;
 * @param string $nothing The label for the &#039;nothing is selected&#039; option. Defaults to get_string(&#039;choose&#039;).&lt;br /&gt;
 *      Set this to &#039;&#039; if you don&#039;t want a &#039;nothing is selected&#039; option.&lt;br /&gt;
 * @param string $script if not &#039;&#039;, then this is added to the &amp;amp;lt;select&amp;gt; element as an onchange handler.&lt;br /&gt;
 * @param string $nothingvalue The value corresponding to the $nothing option. Defaults to 0.&lt;br /&gt;
 * @param boolean $return if false (the default) the the output is printed directly, If true, the&lt;br /&gt;
 *      generated HTML is returned as a string.&lt;br /&gt;
 * @param boolean $disabled if true, the select is generated in a disabled state. Default, false.&lt;br /&gt;
 * @param int $tabindex if give, sets the tabindex attribute on the &amp;amp;lt;select&amp;gt; element. Default none.&lt;br /&gt;
 * @param string $id value to use for the id attribute of the &amp;amp;lt;select&amp;gt; element. If none is given,&lt;br /&gt;
 *      then a suitable one is constructed.&lt;br /&gt;
 * @param mixed $listbox if false, display as a dropdown menu. If true, display as a list box.&lt;br /&gt;
 *      By default, the list box will have a number of rows equal to min(10, count($options)), but if&lt;br /&gt;
 *      $listbox is an integer, that number is used for size instead.&lt;br /&gt;
 * @param boolean $multiple if true, enable multiple selections, else only 1 item can be selected. Used&lt;br /&gt;
 *      when $listbox display is enabled&lt;br /&gt;
 * @param string $class value to use for the class attribute of the &amp;amp;lt;select&amp;gt; element. If none is given,&lt;br /&gt;
 *      then a suitable one is constructed.&lt;br /&gt;
 * @return string|void If $return=true returns string, else echo&#039;s and returns void&lt;br /&gt;
 */&lt;br /&gt;
function choose_from_menu ($options, $name, $selected=&#039;&#039;, $nothing=&#039;choose&#039;, $script=&#039;&#039;,&lt;br /&gt;
                           $nothingvalue=&#039;0&#039;, $return=false, $disabled=false, $tabindex=0,&lt;br /&gt;
                           $id=&#039;&#039;, $listbox=false, $multiple=false, $class=&#039;&#039;) {&lt;br /&gt;
&lt;br /&gt;
    if ($nothing == &#039;choose&#039;) {&lt;br /&gt;
        $nothing = get_string(&#039;choose&#039;) .&#039;...&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    $attributes = ($script) ? &#039;onchange=&amp;quot;&#039;. $script .&#039;&amp;quot;&#039; : &#039;&#039;;&lt;br /&gt;
    if ($disabled) {&lt;br /&gt;
        $attributes .= &#039; disabled=&amp;quot;disabled&amp;quot;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ($tabindex) {&lt;br /&gt;
        $attributes .= &#039; tabindex=&amp;quot;&#039;.$tabindex.&#039;&amp;quot;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ($id ===&#039;&#039;) {&lt;br /&gt;
        $id = &#039;menu&#039;.$name;&lt;br /&gt;
         // name may contaion [], which would make an invalid id. e.g. numeric question type editing form, assignment quickgrading&lt;br /&gt;
        $id = str_replace(&#039;[&#039;, &#039;&#039;, $id);&lt;br /&gt;
        $id = str_replace(&#039;]&#039;, &#039;&#039;, $id);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if ($class ===&#039;&#039;) {&lt;br /&gt;
        $class = &#039;menu&#039;.$name;&lt;br /&gt;
         // name may contaion [], which would make an invalid class. e.g. numeric question type editing form, assignment quickgrading&lt;br /&gt;
        $class = str_replace(&#039;[&#039;, &#039;&#039;, $class);&lt;br /&gt;
        $class = str_replace(&#039;]&#039;, &#039;&#039;, $class);&lt;br /&gt;
    }&lt;br /&gt;
    $class = &#039;select &#039; . $class; /// Add &#039;select&#039; selector always&lt;br /&gt;
&lt;br /&gt;
    if ($listbox) {&lt;br /&gt;
        if (is_integer($listbox)) {&lt;br /&gt;
            $size = $listbox;&lt;br /&gt;
        } else {&lt;br /&gt;
            $numchoices = count($options);&lt;br /&gt;
            if ($nothing) {&lt;br /&gt;
                $numchoices += 1;&lt;br /&gt;
            }&lt;br /&gt;
            $size = min(10, $numchoices);&lt;br /&gt;
        }&lt;br /&gt;
        $attributes .= &#039; size=&amp;quot;&#039; . $size . &#039;&amp;quot;&#039;;&lt;br /&gt;
        if ($multiple) {&lt;br /&gt;
            $attributes .= &#039; multiple=&amp;quot;multiple&amp;quot;&#039;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    $output = &#039;&amp;lt;select id=&amp;quot;&#039;. $id .&#039;&amp;quot; class=&amp;quot;&#039;. $class .&#039;&amp;quot; name=&amp;quot;&#039;. $name .&#039;&amp;quot; &#039;. $attributes .&#039;&amp;gt;&#039; . &amp;quot;\n&amp;quot;;&lt;br /&gt;
    if ($nothing) {&lt;br /&gt;
        $output .= &#039;   &amp;lt;option value=&amp;quot;&#039;. s($nothingvalue) .&#039;&amp;quot;&#039;. &amp;quot;\n&amp;quot;;&lt;br /&gt;
        if ($nothingvalue === $selected) {&lt;br /&gt;
            $output .= &#039; selected=&amp;quot;selected&amp;quot;&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        $output .= &#039;&amp;gt;&#039;. $nothing .&#039;&amp;lt;/option&amp;gt;&#039; . &amp;quot;\n&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!empty($options)) {&lt;br /&gt;
        foreach ($options as $value =&amp;gt; $label) {&lt;br /&gt;
            $output .= &#039;   &amp;lt;option value=&amp;quot;&#039;. s($value) .&#039;&amp;quot;&#039;;&lt;br /&gt;
            if ((string)$value == (string)$selected ||&lt;br /&gt;
                    (is_array($selected) &amp;amp;&amp;amp; in_array($value, $selected))) {&lt;br /&gt;
                $output .= &#039; selected=&amp;quot;selected&amp;quot;&#039;;&lt;br /&gt;
            }&lt;br /&gt;
            if ($label === &#039;&#039;) {&lt;br /&gt;
                $output .= &#039;&amp;gt;&#039;. $value .&#039;&amp;lt;/option&amp;gt;&#039; . &amp;quot;\n&amp;quot;;&lt;br /&gt;
            } else {&lt;br /&gt;
                $output .= &#039;&amp;gt;&#039;. $label .&#039;&amp;lt;/option&amp;gt;&#039; . &amp;quot;\n&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    $output .= &#039;&amp;lt;/select&amp;gt;&#039; . &amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    if ($return) {&lt;br /&gt;
        return $output;&lt;br /&gt;
    } else {&lt;br /&gt;
        echo $output;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===New code===&lt;br /&gt;
&lt;br /&gt;
My new implementation of moodle_core_renderer::select_menu is&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
    /**&lt;br /&gt;
     * Output a &amp;lt;select&amp;gt; menu.&lt;br /&gt;
     *&lt;br /&gt;
     * You can either call this function with a single moodle_select_menu argument&lt;br /&gt;
     * or, with a list of parameters, in which case those parameters are sent to&lt;br /&gt;
     * the moodle_select_menu constructor.&lt;br /&gt;
     *&lt;br /&gt;
     * @param moodle_select_menu $selectmenu a moodle_select_menu that describes&lt;br /&gt;
     *      the select menu you want output.&lt;br /&gt;
     * @return string the HTML for the &amp;lt;select&amp;gt;&lt;br /&gt;
     */&lt;br /&gt;
    public function select_menu($selectmenu) {&lt;br /&gt;
        if ($selectmenu-&amp;gt;nothinglabel) {&lt;br /&gt;
            $options = array($selectmenu-&amp;gt;nothingvalue =&amp;gt; $selectmenu-&amp;gt;nothinglabel) +&lt;br /&gt;
                    $selectmenu-&amp;gt;options;&lt;br /&gt;
        } else {&lt;br /&gt;
            $options = $selectmenu-&amp;gt;options;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        $attributes = array(&lt;br /&gt;
            &#039;name&#039; =&amp;gt; $selectmenu-&amp;gt;name,&lt;br /&gt;
            &#039;id&#039; =&amp;gt; $selectmenu-&amp;gt;id,&lt;br /&gt;
            &#039;class&#039; =&amp;gt; $selectmenu-&amp;gt;get_classes_string(),&lt;br /&gt;
            &#039;onchange&#039; =&amp;gt; $selectmenu-&amp;gt;script,&lt;br /&gt;
        );&lt;br /&gt;
        if ($selectmenu-&amp;gt;disabled) {&lt;br /&gt;
            $attributes[&#039;disabled&#039;] = &#039;disabled&#039;;&lt;br /&gt;
        }&lt;br /&gt;
        if ($selectmenu-&amp;gt;tabindex) {&lt;br /&gt;
            $attributes[&#039;tabindex&#039;] = $tabindex;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        if ($selectmenu-&amp;gt;listbox) {&lt;br /&gt;
            if (is_integer($selectmenu-&amp;gt;listbox)) {&lt;br /&gt;
                $size = $selectmenu-&amp;gt;listbox;&lt;br /&gt;
            } else {&lt;br /&gt;
                $size = min($selectmenu-&amp;gt;maxautosize, count($options));&lt;br /&gt;
            }&lt;br /&gt;
            $attributes[&#039;size&#039;] = $size;&lt;br /&gt;
            if ($selectmenu-&amp;gt;multiple) {&lt;br /&gt;
                $attributes[&#039;multiple&#039;] = &#039;multiple&#039;;&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        $html = $this-&amp;gt;output_start_tag(&#039;select&#039;, $attributes) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
        foreach ($options as $value =&amp;gt; $label) {&lt;br /&gt;
            $attributes = array(&#039;value&#039; =&amp;gt; $value);&lt;br /&gt;
            if ((string)$value == (string)$selectmenu-&amp;gt;selectedvalue ||&lt;br /&gt;
                    (is_array($selectmenu-&amp;gt;selectedvalue) &amp;amp;&amp;amp; in_array($value, $selectmenu-&amp;gt;selectedvalue))) {&lt;br /&gt;
                $attributes[&#039;selected&#039;] = &#039;selected&#039;;&lt;br /&gt;
            }&lt;br /&gt;
            $html .= &#039;    &#039; . $this-&amp;gt;output_tag(&#039;option&#039;, $attributes, s($label)) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        $html .= $this-&amp;gt;output_end_tag(&#039;select&#039;) . &amp;quot;\n&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
        return $html;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The moodle_select_menu class is little more than a stdClass. The main reason to have it is that it lets us PHPdoc the various fields. However note that moodle_core_renderer::select_menu will work fine if you pass a stdClass with the right fields.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * This class hold all the information required to describe a &amp;lt;select&amp;gt; menu that&lt;br /&gt;
 * will be printed by {@link moodle_core_renderer::select_menu()}. (Or by an overrides&lt;br /&gt;
 * version of that method in a subclass.)&lt;br /&gt;
 *&lt;br /&gt;
 * All the fields that are not set by the constructor have sensible defaults, so&lt;br /&gt;
 * you only need to set the properties where you want non-default behaviour.&lt;br /&gt;
 *&lt;br /&gt;
 * @copyright 2009 Tim Hunt&lt;br /&gt;
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later&lt;br /&gt;
 * @since     Moodle 2.0&lt;br /&gt;
 */&lt;br /&gt;
class moodle_select_menu extends moodle_html_component {&lt;br /&gt;
    /**&lt;br /&gt;
     * @var array the choices to show in the menu. An array $value =&amp;gt; $label.&lt;br /&gt;
     */&lt;br /&gt;
    public $options;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var string the name of this form control. That is, the name of the GET/POST&lt;br /&gt;
     * variable that will be set if this select is submmitted as part of a form.&lt;br /&gt;
     */&lt;br /&gt;
    public $name;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var string the option to select initially. Should match one&lt;br /&gt;
     * of the $options array keys. Default none.&lt;br /&gt;
     */&lt;br /&gt;
    public $selectedvalue;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var string The label for the &#039;nothing is selected&#039; option.&lt;br /&gt;
     * Defaults to get_string(&#039;choosedots&#039;).&lt;br /&gt;
     * Set this to &#039;&#039; if you do not want a &#039;nothing is selected&#039; option.&lt;br /&gt;
     */&lt;br /&gt;
    public $nothinglabel = null;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var string The value returned by the &#039;nothing is selected&#039; option. Defaults to 0.&lt;br /&gt;
     */&lt;br /&gt;
    public $nothingvalue = 0;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var boolean set this to true if you want the control to appear disabled.&lt;br /&gt;
     */&lt;br /&gt;
    public $disabled = false;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var integer if non-zero, sets the tabindex attribute on the &amp;lt;select&amp;gt; element. Default 0.&lt;br /&gt;
     */&lt;br /&gt;
    public $tabindex = 0;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var mixed Defaults to false, which means display the select as a dropdown menu.&lt;br /&gt;
     * If true, display this select as a list box whose size is chosen automatically.&lt;br /&gt;
     * If an integer, display as list box of that size.&lt;br /&gt;
     */&lt;br /&gt;
    public $listbox = false;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var integer if you are using $listbox === true to get an automatically&lt;br /&gt;
     * sized list box, the size of the list box will be the number of options,&lt;br /&gt;
     * or this number, whichever is smaller.&lt;br /&gt;
     */&lt;br /&gt;
    public $maxautosize = 10;&lt;br /&gt;
    /**&lt;br /&gt;
     * @var boolean if true, allow multiple selection. Only used if $listbox is true.&lt;br /&gt;
     */&lt;br /&gt;
    public $multiple = false;&lt;br /&gt;
    /**&lt;br /&gt;
     * @deprecated&lt;br /&gt;
     * @var string JavaScript to add as an onchange attribute. Do not use this.&lt;br /&gt;
     * Use the YUI even library instead.&lt;br /&gt;
     */&lt;br /&gt;
    public $script = &#039;&#039;;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===New support code===&lt;br /&gt;
&lt;br /&gt;
Note that the moodle_core_renderer::select_menu code depends on this code in moodle_renderer_base:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class moodle_renderer_base {&lt;br /&gt;
    // ...&lt;br /&gt;
&lt;br /&gt;
    protected function output_tag($tagname, $attributes, $contents) {&lt;br /&gt;
        return $this-&amp;gt;output_start_tag($tagname, $attributes) . $contents .&lt;br /&gt;
                $this-&amp;gt;output_end_tag($tagname);&lt;br /&gt;
    }&lt;br /&gt;
    protected function output_start_tag($tagname, $attributes) {&lt;br /&gt;
        return &#039;&amp;lt;&#039; . $tagname . $this-&amp;gt;output_attributes($attributes) . &#039;&amp;gt;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    protected function output_end_tag($tagname) {&lt;br /&gt;
        return &#039;&amp;lt;/&#039; . $tagname . &#039;&amp;gt;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    protected function output_empty_tag($tagname, $attributes) {&lt;br /&gt;
        return &#039;&amp;lt;&#039; . $tagname . $this-&amp;gt;output_attributes($attributes) . &#039; /&amp;gt;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    protected function output_attribute($name, $value) {&lt;br /&gt;
        if ($value || is_numeric($value)) { // We want 0 to be output.&lt;br /&gt;
            return &#039; &#039; . $name . &#039;=&amp;quot;&#039; . $value . &#039;&amp;quot;&#039;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    protected function output_attributes($attributes) {&lt;br /&gt;
        $output = &#039;&#039;;&lt;br /&gt;
        foreach ($attributes as $name =&amp;gt; $value) {&lt;br /&gt;
            $output .= $this-&amp;gt;output_attribute($name, $value);&lt;br /&gt;
        }&lt;br /&gt;
        return $output;&lt;br /&gt;
    }&lt;br /&gt;
    protected function output_class_attribute($classes) {&lt;br /&gt;
        return $this-&amp;gt;output_attribute(&#039;class&#039;, implode(&#039; &#039;, $classes));&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Navigation 2.0 implementation plan]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Quality_assurance&amp;diff=64140</id>
		<title>Quality assurance</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Quality_assurance&amp;diff=64140"/>
		<updated>2024-05-01T02:10:22Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: This page contains very out-dated content.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Template:Work in progress}}[[Category:Quality Assurance]]&lt;br /&gt;
&lt;br /&gt;
==What is Quality assurance (QA)?==&lt;br /&gt;
&lt;br /&gt;
QA is generally one of the last stages of the software development. However QA can start even before the developers write any code. From the functional specification and use case, a QA test plans writer writes test cases, usually one test case per use case. Once the test cases are written, QA testers will test the software following these test cases. When they find a bug, they will report the issue in the tracker. Once all test cases have been completed, the QA manager can review the results to determine how ready the software is for release. A test case management system may be used for managing test cases and reviewing results.&lt;br /&gt;
&lt;br /&gt;
==QA objective==&lt;br /&gt;
&lt;br /&gt;
The goals of QA testing are to:&lt;br /&gt;
&lt;br /&gt;
# Bring more clarity and thoroughness to the process of testing a new Moodle release.&lt;br /&gt;
# Ensure that all significant functionality has been tested before a new version is released.&lt;br /&gt;
# Give people a new way to easily contribute to the Moodle project.&lt;br /&gt;
&lt;br /&gt;
A major version is ready for release when there are:&lt;br /&gt;
* &amp;lt; 1% open blocker issues&lt;br /&gt;
* &amp;lt; 5% open critical issues&lt;br /&gt;
* &amp;lt; 20% open major issues&lt;br /&gt;
&lt;br /&gt;
Also, all test cases should have been written/updated for new features and all test cases marked as &#039;Passed&#039;.&lt;br /&gt;
&lt;br /&gt;
A successful QA cycle assures all major Moodle functionality has been tested.&lt;br /&gt;
&lt;br /&gt;
==The QA cycle==&lt;br /&gt;
&lt;br /&gt;
=== Setting a QA cycle ===&lt;br /&gt;
&lt;br /&gt;
Test cases should be created in the tracker then updated for each new QA cycle. Ideally, poeple writing/updating the functional specs would write/update test cases at the same time. Alternatively a &#039;Cannot be run test&#039; case status could be used when a tester cannot run a test case because the feature changed. This would alert the QA manager that the test case needs to be updated.&lt;br /&gt;
&lt;br /&gt;
=== Running a QA cycle ===&lt;br /&gt;
&lt;br /&gt;
Testers will choose a feature to test (with status &#039;Not run&#039; or &#039;To retest&#039;).&lt;br /&gt;
&lt;br /&gt;
* If the tester finds a blocker/critical/major issue, the test case is set to &#039;Failed&#039;. The tester then writes a bug issue and links the test case to the bug issue. Once the bug is fixed, the bug fixer changes the test case status from &#039;Failed&#039; to &#039;To retest&#039;. &lt;br /&gt;
* If the bug is minor and the feature is working, the tester still writes a bug issue and still links the test case to the bug issue. However, the test case status may be set to &#039;Passed&#039;.&lt;br /&gt;
&lt;br /&gt;
== Validating a QA cycle ==&lt;br /&gt;
&lt;br /&gt;
The test case management system needs to display:&lt;br /&gt;
* The number of failed, passed, not run, to retest test case issues for a particular version or component&lt;br /&gt;
* The number of critical/major issues for a specific version or component &lt;br /&gt;
&lt;br /&gt;
The QA manager can review these results to determine how ready the software is for release.&lt;br /&gt;
&lt;br /&gt;
==For further consideration==&lt;br /&gt;
&lt;br /&gt;
Need to be identify the time cost of writing test cases, preparing a QA cycle (updating test cases, getting a new QA system ready for testing) and running all test cases.&lt;br /&gt;
&lt;br /&gt;
Additional questions:&lt;br /&gt;
*When should a QA cycle be run?&lt;br /&gt;
*What functional specs/use cases do we have?&lt;br /&gt;
*Who can write test cases?&lt;br /&gt;
*Who can run test cases?&lt;br /&gt;
*Do we need test data?&lt;br /&gt;
&lt;br /&gt;
Jerome&#039;s ideas/notes:&lt;br /&gt;
* it would be good to identify the different kind of Moodledocs: User Manuals, Function Specifications, Technical Specifications, Requirements, ... due to the wiki collaborative aspect, it is understandable that sometimes documents are a mix of User Manual, Functional and Technical specs. Maybe could we create these specific category: User Manuals, Function Specifications, Technical Specifications, Requirements&lt;br /&gt;
* There is a lack of detailed functional specifications and Use Cases =&amp;gt; at this moment only developers and highly experimented users would be able to write test cases with missing use cases.&lt;br /&gt;
* Moodle doesn&#039;t have deadline. It is released when it will be ready. However we have to take care about no-end QA phase.&lt;br /&gt;
* there are many experimented users who can test Moodle.&lt;br /&gt;
* some people/companies using Moodle probably have already written test plans, test cases, maybe even use cases.&lt;br /&gt;
* need documentation on how to write a test case and how to run test cases. Need also document for QA manager (setting a QA cycle, read the result, managing the QA cycle)&lt;br /&gt;
* write an easy-to-read Quality Engineering section in Moodledocs (include Code Testing as well).&lt;br /&gt;
* we could create a testing program as Netbeans [http://qa.netbeans.org/processes/cat/65/index.html]&lt;br /&gt;
* create a Moodle package including test data for people testing in local&lt;br /&gt;
* We don&#039;t have a long build process, so smoke testing could seem not required. However it could be good to have it if we create a testing program.&lt;br /&gt;
&lt;br /&gt;
==Jira as Test Case Management System==&lt;br /&gt;
The main reason to use Jira as Test Case Management System is that the Moodle community is familiar with. It will also be easy to link test case issues to bug issues.&lt;br /&gt;
* The search tool of Jira will provide the QA results.&lt;br /&gt;
* we will create a main issue containing thousand of sub-tasks. These subtasks will be the test cases. Then for every new QA cycle we will clone this main issue. Need to identify how to change subtask version quickly/easily.&lt;br /&gt;
* re-write the &#039;&#039;Jira as a Test Case Management Software documentation&#039;&#039; [https://docs.moodle.org/en/Jira_as_a_Test_Case_Management_Software]&lt;br /&gt;
&lt;br /&gt;
==Other QA from popular open-source projects==&lt;br /&gt;
* Netbeans wrote specification tests [http://wiki.netbeans.org/TestSpecifications]. They have a QA program [http://qa.netbeans.org/processes/cat/65/index.html]&lt;br /&gt;
* Firefox use an integrated testcase management and QA tool called Litmus [https://litmus.mozilla.org/]. An example of a test case: [https://litmus.mozilla.org/show_test.cgi?id=5036]. They&#039;ve got more than 7000 test cases.&lt;br /&gt;
* OpenOffice has a QA page [http://qa.openoffice.org/ooQAReloaded/ooQA-ManualTesting.html]. I found it a bit a hassle to navigate into these pages. Make some succinct documentation for Moodle QA tester in order to start quickly and easily.&lt;br /&gt;
&lt;br /&gt;
[[Category:Quality Assurance]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=SimpleTest_conversion&amp;diff=64139</id>
		<title>SimpleTest conversion</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=SimpleTest_conversion&amp;diff=64139"/>
		<updated>2024-04-30T16:28:18Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Moodle 2.3}}&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
Moodle 2.3 switched to PHPUnit as the recommended unit testing framework. SimpleTest support will be completely removed from Moodle 2.4.&lt;br /&gt;
&lt;br /&gt;
The migration is pretty straightforward:&lt;br /&gt;
# create new test file in `xxx/tests/yyy_test.php`&lt;br /&gt;
# copy contents of the old test file&lt;br /&gt;
# replace &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;extends UnitTestCase&amp;lt;/syntaxhighlight&amp;gt; with &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;extends basic_testcase&amp;lt;/syntaxhighlight&amp;gt; and  &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;extends UnitTestCaseUsingDatabase&amp;lt;/syntaxhighlight&amp;gt; with &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;extends advanced_testcase&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# move constructor code to setUp()&lt;br /&gt;
# fix setUp() and tearDown() to be protected&lt;br /&gt;
# fix assert syntax&lt;br /&gt;
# add &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;resetAfterTest();&amp;lt;/syntaxhighlight&amp;gt; in advanced test cases that modify database&lt;br /&gt;
# add missing &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;global $CFG;&amp;lt;/syntaxhighlight&amp;gt; for includes outside of testcase classes&lt;br /&gt;
# Usages of &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$UNITTEST-&amp;gt;running&amp;lt;/syntaxhighlight&amp;gt; must be replaced with &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;PHPUNIT_TEST&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Usually the tests using database can be significantly simplified, the performance in PHPUnit is also a lot better.&lt;br /&gt;
&lt;br /&gt;
The old SimpleTest execution page is hidden in 2.3, if you want to execute the old tests go to http://www.example.com/admin/tool/unittest/index.php page on your server.&lt;br /&gt;
&lt;br /&gt;
=Assert differences=&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! SimpleTest&lt;br /&gt;
! PHPUnit&lt;br /&gt;
! Notes&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertEqual($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertEquals($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotEqual($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotEquals($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertWithinMargin($expected, $actual, $margin)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertEquals($expected, $actual, &#039;&#039;, $margin)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertIdentical($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertSame($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotIdentical($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotSame($expected, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertTrue($actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertTrue((bool)$actual)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotEmpty($actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| SimpleTest converts parameter to bool&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertFalse($actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertFalse((bool)$actual)&amp;lt;/syntaxhighlight&amp;gt;&amp;lt;br /&amp;gt;&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertEmpty($actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| SimpleTest converts parameter to bool&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertIsA($actual, &#039;classname&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertInstanceOf(&#039;classname&#039;, $actual)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| objects instances only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertIsA($actual, &#039;array&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertEquals(&#039;array&#039;, gettype($actual))&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| arrays only&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertPattern($pattern, $string)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertRegExp($pattern, $string)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNoPattern($pattern, $string)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertNotRegExp($pattern, $string)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;expectException(true)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;setExpectedException(&#039;exception_classname&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| alternatively use phpdocs: @expectedException exception_classname&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;expectError()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;setExpectedException(&#039;PHPUnit_Framework_Error&#039;)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
| alternatively use phpdocs: @expectedException PHPUnit_Framework_Error&lt;br /&gt;
|-&lt;br /&gt;
| various HTML expectations&lt;br /&gt;
| &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$this-&amp;gt;assertTag()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=SimpleTest emulation=&lt;br /&gt;
Some original SimpleTests can be executed directly via PHPUnit with minimal modifications (try adding global $CFG for includes outside of test case class).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Unit testing]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Sprint&amp;diff=64138</id>
		<title>Sprint</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Sprint&amp;diff=64138"/>
		<updated>2024-04-30T16:27:51Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
A Moodle sprint is a designated time e.g. a weekend in which developers (and in future also testers and documentation writers) keep each other company whilst working on Moodle.&lt;br /&gt;
&lt;br /&gt;
==Sprint participation==&lt;br /&gt;
&lt;br /&gt;
To take part in the sprint as a developer, simply choose a feature in Moodle 2.0 which needs finishing, or some 2.0 bugs which need fixing, then when you have time during the sprint period, get coding! Remember to drop by our Jabber developer chat room and/or #moodle on freenode at some point and let others know what you’re working on.&lt;br /&gt;
&lt;br /&gt;
Note that the sprint is not organised in the sense that nobody will be told what to do! Developers with CVS access may continue what they are currently working on, and developers without access can post patches and comments in the tracker.&lt;br /&gt;
&lt;br /&gt;
Useful filters: [http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&amp;amp;requestId=10825 Easy bugs 2.0], [http://tracker.moodle.org/secure/IssueNavigator.jspa?mode=hide&amp;amp;requestId=10727 Unresolved 2.0.x (all)]&lt;br /&gt;
&lt;br /&gt;
Details on how to take part in a sprint as a tester or a documentation writer will follow soon.&lt;br /&gt;
&lt;br /&gt;
==Upcoming sprints==&lt;br /&gt;
&lt;br /&gt;
The first ever Moodle 2.0 sprint will be held on Saturday and Sunday 20-21 March 2010 - see [http://moodle.org/mod/forum/discuss.php?d=146083 Moodle 2.0 sprint this weekend].&lt;br /&gt;
&lt;br /&gt;
Further sprints will be announced soon. Testers and documentation writers will be warmly welcomed to sprints after the release of Moodle 2.0 beta.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Rationale&amp;diff=64137</id>
		<title>Rationale</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Rationale&amp;diff=64137"/>
		<updated>2024-04-30T16:27:14Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
The idea standing after the development of this module is to provide answers to the more frequent requirements of end users.&lt;br /&gt;
&lt;br /&gt;
Their frequent requirements are:&lt;br /&gt;
==at element level==&lt;br /&gt;
* possibility to add custom question type matching specific needs&lt;br /&gt;
* question predefined value&lt;br /&gt;
* question level validation&lt;br /&gt;
* reduce, as much as possible, the range of possible answers&lt;br /&gt;
* mandatory questions&lt;br /&gt;
* have some typographic option to display elements in different ways&lt;br /&gt;
* tools to quickly reuse set a specific questions that never change in each survey&lt;br /&gt;
==at survey level==&lt;br /&gt;
* conditional branching&lt;br /&gt;
* force the user to provide a his/her own answer&lt;br /&gt;
* subset of questions available to teachers ONLY&lt;br /&gt;
* include permission management for groups of users submitting surveys in behalf of the same institution&lt;br /&gt;
* use captcha&lt;br /&gt;
* allow/deny submitted survey modification (including deletion)&lt;br /&gt;
* allow a backup copy of submitted surveys each time they are modified in order to preserve their history&lt;br /&gt;
* speed up form fill as much as it is possible&lt;br /&gt;
&lt;br /&gt;
==at report level==&lt;br /&gt;
* possibility to add custom reports&lt;br /&gt;
* export of submitted surveys&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Prototypes&amp;diff=64136</id>
		<title>Prototypes</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Prototypes&amp;diff=64136"/>
		<updated>2024-04-30T16:26:24Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
This page provides links to prototype sites demonstrating new features that will be included in coming versions of Moodle.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;We would love to hear what you think of these new features! After exploring the sites, please post your feedback in the [https://moodle.org/mod/forum/view.php?id=8052 Future major features forum].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== New projects and prototype site demonstrations ==&lt;br /&gt;
=== Calendar usability improvements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| As part of the UX improvements for Moodle 4.0, we are working on updates to the calendar.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main aims for this project are to make the calendar, calendar block and subscription management more intuitive, easier to use and improve accessibility.&lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| [https://tracker.moodle.org/browse/MDL-71770 Tracker epic containing all related issues]&lt;br /&gt;
|-&lt;br /&gt;
| Prototype&lt;br /&gt;
| [https://calendartest.prototype.moodledemo.net/ Calendar usability improvements demo]&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
=== Course creation improvements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| As part of the UX improvements for Moodle 4.0, we are working on making the like easier on creating and editing courses.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main aims for this project are to improve the user experience of creating and editing courses in Moodle helping teachers to create and organize their courses. Adding new cool features like course index will allow teachers an easy way to view course structure, add new sections and activities, reorganize them and so on.&lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| [https://tracker.moodle.org/browse/MDL-70907 Tracker epic containing all related issues]&lt;br /&gt;
|-&lt;br /&gt;
| Prototype&lt;br /&gt;
| [https://createcourse.prototype.moodledemo.net/ Course creation improvements demo]&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
=== Navigation update ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| We are updating the navigation around Moodle.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main aim is to reduce the cognitive load associated with navigating around a Moodle site. For anyone that is new to using our LMS, there are a lot of settings that are immediately present and possibly not relevant. We are going through and improving the layout of the navigation from the front page all the way to how different activities are displaying settings and buttons.&lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| [https://tracker.moodle.org/browse/MDL-69588 Tracker epic containing all related issues]&lt;br /&gt;
|-&lt;br /&gt;
| Prototype&lt;br /&gt;
| [https://navigation.prototype.moodledemo.net/ Navigation prototype demo]&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
=== Timeline block improvements ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| As part of the UX improvements for Moodle 4.0, we are working on improving the timeline block.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main aims for this project are to improve the layout of information within the timeline block to make it easier to extract important information, replace pagination with &amp;quot;show more&amp;quot; (lazy-loading) functionality, and to provide bug fixes that improve the overall usability of the block.&lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| [https://tracker.moodle.org/browse/MDL-72274 Tracker epic containing all related issues]&lt;br /&gt;
|-&lt;br /&gt;
| Prototype&lt;br /&gt;
|[https://calendartest.prototype.moodledemo.net/ Timeline improvements demo](Note: The timeline features are demonstrated on the same Moodle site as the calendar improvements mentioned above).&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
=== Site admin presets ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| As part of the UX improvements for Moodle 4.0, we are working on helping administrators to enable/disable features and plugins easily to simplify their Moodle sites.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main aim is to adapt and integrate the [https://moodle.org/plugins/block_admin_presets third-party plugin &amp;quot;Admin presets&amp;quot;], created by David Monllaó and maintained by developers from [https://pimenko.com/ Pimenko]. &lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| [https://tracker.moodle.org/browse/MDL-72111 Tracker epic containing all related issues]&lt;br /&gt;
|-&lt;br /&gt;
| Prototype&lt;br /&gt;
| [https://siteadminpresets.prototype.moodledemo.net/ Site admin presets demo]&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== How to contribute ==&lt;br /&gt;
=== [[File:logo moodle.png|frameless|100px]] &amp;lt;br /&amp;gt; Moodle User Experience (UX) Forums ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| As part of the UX 4.0 release, the UX team are establishing a presence on the Moodle.org platform in order to collaborate and communicate with the wider Moodle Community.&lt;br /&gt;
We&#039;re looking forward to working with you and sharing what we learn and what we do!&lt;br /&gt;
|-&lt;br /&gt;
| More&lt;br /&gt;
| User Experience Forum [https://moodle.org/course/view.php?id=17248 Want to shape the Moodle future with us?].&lt;br /&gt;
|-&lt;br /&gt;
| Project Tracker&lt;br /&gt;
| Moodle UX 4.0 [https://tracker.moodle.org/projects/UX/issues/ tracker issues and epics]&lt;br /&gt;
|-&lt;br /&gt;
| Prototypes&lt;br /&gt;
| [https://www.figma.com/proto/A4d9WOUVxCqS93mvXVCr8P/4.0-UX-Demo?node-id=2394%3A15559&amp;amp;viewport=727%2C769%2C0.07944665849208832&amp;amp;scaling=scale-down 4.0 Desktop Navigation UX Project]&lt;br /&gt;
[https://www.figma.com/proto/A4d9WOUVxCqS93mvXVCr8P/4.0-UX-Demo?node-id=2392%3A11210&amp;amp;viewport=1413%2C310%2C0.31215807795524597&amp;amp;scaling=scale-down 4.0 Mobile Navigation UX Project]&lt;br /&gt;
|-&lt;br /&gt;
| Target Version&lt;br /&gt;
| 4.0&lt;br /&gt;
|}&lt;br /&gt;
=== [[File:logo_moodle_tracker.jpg|frameless|100px]] &amp;lt;br /&amp;gt; Moodle Tracker ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| This is where we record and manage all issues related to Moodle and related systems.&lt;br /&gt;
It&#039;s not just for developers! :-) All users should use this system to report problems or new ideas for Moodle and help us make it better.&lt;br /&gt;
|-&lt;br /&gt;
| More&lt;br /&gt;
| Moodle Tracker [https://tracker.moodle.org/secure/Dashboard.jspa Want to shape the Moodle future with us?].&lt;br /&gt;
|}&lt;br /&gt;
=== [[File:mua-logo-small-onblue.png|frameless|100px]] &amp;lt;br /&amp;gt; Moodle Users Association ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| MUA&#039;s mission is to support the growth of Moodle by providing a strong and united voice to users, giving direction and resources for new developments.&lt;br /&gt;
|-&lt;br /&gt;
| More&lt;br /&gt;
| Join MUA [https://moodle.org/course/view.php?id=17248 Shape the future of Moodle today.].&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
== [[File:logo_moodle_dev.jpg|frameless|100px]] &amp;lt;br /&amp;gt; Other Moodle demo sites ==&lt;br /&gt;
=== QA Moodle Demo ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| It is updated daily at 13:00 UTC with the latest fixes for testers to test and do a final check for any problems.&lt;br /&gt;
Every hour (on the hour) the database and files are reset.&lt;br /&gt;
|-&lt;br /&gt;
| Moodle Version&lt;br /&gt;
| The latest Moodle dev release!&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Site&lt;br /&gt;
| &#039;&#039;&#039;[https://qa.moodledemo.net/ qa.moodledemo.net/]&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
=== School Moodle Demo ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| This demonstration site gives you the opportunity to explore Moodle in action as a manager, teacher, student, parent or privacy officer with realistic content.&lt;br /&gt;
This site is reset every hour on the hour so anything you &amp;quot;break&amp;quot; will get fixed.&lt;br /&gt;
|-&lt;br /&gt;
| Moodle Version&lt;br /&gt;
| The latest Moodle stable release!&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Site&lt;br /&gt;
| &#039;&#039;&#039;[https://school.moodledemo.net/ school.moodledemo.net/]&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
=== Sandbox Moodle Demo ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; border=&amp;quot;1&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| Description&lt;br /&gt;
| This site is a plain installation of Moodle using the Boost theme.&lt;br /&gt;
This site is reset to its blank state every hour, on the hour.&lt;br /&gt;
|-&lt;br /&gt;
| Moodle Version&lt;br /&gt;
| The latest Moodle stable release!&lt;br /&gt;
|-&lt;br /&gt;
|-&lt;br /&gt;
| Site&lt;br /&gt;
| &#039;&#039;&#039;[https://sandbox.moodledemo.net/ sandbox.moodledemo.net/]&#039;&#039;&#039;&lt;br /&gt;
|}&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Roadmap]] - for an overview of new features planned for the next release&lt;br /&gt;
* [[Releases]] - for all official releases of Moodle, grouped by branch in reverse chronological order&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=PublicPrivate&amp;diff=64135</id>
		<title>PublicPrivate</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=PublicPrivate&amp;diff=64135"/>
		<updated>2024-04-30T16:25:33Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
This page will spec out the features of Public/Private.&lt;br /&gt;
&lt;br /&gt;
Public/Private is a means whereby any resource/activity within moodle can be made private to only members of that course, or public and available to anyone that visits that site (including guests).&lt;br /&gt;
&lt;br /&gt;
A practical use for this feature is making the syllabus public so that potential students can shop around for classes, but the rest of the course material is private and only available to the members of that course.&lt;br /&gt;
&lt;br /&gt;
== Database structures ==&lt;br /&gt;
Below are the fields that are added to the already existing table.&lt;br /&gt;
&lt;br /&gt;
=== course ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;groupautoassign&#039;&#039;&#039; &lt;br /&gt;
|BIGINT(10)  &lt;br /&gt;
|0&lt;br /&gt;
|Group id to auto-assign members of the course.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;grouppublicprivate&#039;&#039;&#039; &lt;br /&gt;
|TINYINT(1)  &lt;br /&gt;
|0&lt;br /&gt;
|Whether public/private is enabled for that course.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== groups_members ===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;type&#039;&#039;&#039; &lt;br /&gt;
|VARCHAR(36)  &lt;br /&gt;
|NULL&lt;br /&gt;
|This field indicates whether the user was auto-assigned to a group, or not. (as opposed to manually added)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Overview of module communication ==&lt;br /&gt;
&lt;br /&gt;
=== Setup ===&lt;br /&gt;
Setup is very simple.  Once moodle is installed, All that needs to take place before using Public/Private is going into Administration-&amp;gt;Miscellaneous-&amp;gt;Experimental, and check both &amp;quot;Enable groupings&amp;quot;, and &amp;quot;Enable Public/Private&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Now, create a course like normal, and add either a resource or activity to that course.  The default behavior should be that when a resource or activity is added, it will read &amp;quot;(Private Course Material)&amp;quot; next to it, and have an extra icon: a lock.  If that lock icon is pressed, the &amp;quot;(Private Course Material)&amp;quot; text will disapear, and an open-lock icon will replace the closed-lock icon.  This indicates that the course is now unlocked, and available to everyone.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Ubuntu Server Install&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;19 April, 2010&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Installation on an Ubuntu Server running Moodle 1.9.7+&lt;br /&gt;
&lt;br /&gt;
These steps can be followed on an Ubuntu server to install this Mod:&lt;br /&gt;
&lt;br /&gt;
1.  Make sure that you have &amp;quot;patch&amp;quot; installed using &#039;&#039;&#039;sudo apt-get install patch&#039;&#039;&#039; or the Synaptic Packet Manager if you are in a GUI environment.&lt;br /&gt;
&lt;br /&gt;
2.  Download the compressed Public/Private file.&lt;br /&gt;
&lt;br /&gt;
3.  Uncompress the archive to your home directory.&lt;br /&gt;
&lt;br /&gt;
4.  Copy the file &#039;&#039;&#039;public_private.patch&#039;&#039;&#039; to the root directory of your moodle installation.&lt;br /&gt;
&lt;br /&gt;
5.  Execute the command &#039;&#039;&#039;sudo patch -p0 &amp;lt; public_private.patch&#039;&#039;&#039; from the command line, WHILE IN THE ROOT DIRECTORY OF MOODLE.&lt;br /&gt;
&lt;br /&gt;
6.  You must now manually copy several icons to whatever Moodle theme you are using.  The pictures are located in your uncompressed archive, which you put in your home directory in Step 2.  Move the files in the &#039;&#039;&#039;pix/t&#039;&#039;&#039; and &#039;&#039;&#039;pix/i&#039;&#039;&#039; folders to the corresponding folders of your currently used theme.  The theme is located in the &#039;&#039;&#039;theme&#039;&#039;&#039; folder of the root directory of Moodle.&lt;br /&gt;
&lt;br /&gt;
7.  You should now be ready to go to Moodle, and click on NOTIFICATIONS.  Agree to install Public Private.&lt;br /&gt;
&lt;br /&gt;
8.  Save all the default configuration settings.&lt;br /&gt;
&lt;br /&gt;
9.  Enable GROUPINGS in the Site Administrations-&amp;gt;Miscellaneous-&amp;gt;Experimental.&lt;br /&gt;
&lt;br /&gt;
10.  Any new courses will now have Public/Private enabled.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTES:&#039;&#039;&#039;  Step 5 produced a large number of error output for me, but still worked.  The package I downloaded was for Moodle 1.9.5, and I am using 1.9.7+, so that may explain the discrepancies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;More Notes:&#039;&#039;&#039;  You should &#039;&#039;&#039;NOT&#039;&#039;&#039; need to unpack the archive into your root web folder, nor will you need the other files in the archive.  All you need are the three icon pictures, and the file public_private.patch from the compressed archive.&lt;br /&gt;
&lt;br /&gt;
=== How it Works - Behind the Scenes ===&lt;br /&gt;
&lt;br /&gt;
==== When a course is created: ====&lt;br /&gt;
#course members group is created&lt;br /&gt;
#private course material grouping is created&lt;br /&gt;
#course members group gets assigned to private course material&lt;br /&gt;
#all enrollees of that course are assigned to the course members group&lt;br /&gt;
&lt;br /&gt;
==== When a resource/activity is added: ====&lt;br /&gt;
#groupmembersonly field is set to 1&lt;br /&gt;
#groupingid field is set to the grouping id that corresponds to the Private Course Material grouping for that particular course&lt;br /&gt;
&lt;br /&gt;
==== When the closed lock icon is clicked: ====&lt;br /&gt;
#course material togles from being private-&amp;gt;public&lt;br /&gt;
#groupmembersonly field is set to 0&lt;br /&gt;
#groupingid field is set to 0&lt;br /&gt;
&lt;br /&gt;
==== When the closed lock icon is clicked: ====&lt;br /&gt;
#groupmembersonly field is set to 1&lt;br /&gt;
#groupingid field is set to the grouping id that corresponds to the Private Course Material grouping for that particular course&lt;br /&gt;
&lt;br /&gt;
=== Code: Make Private ===&lt;br /&gt;
The below code demonstrates how to make a forum private.  The same technique can be applied for any course module.&lt;br /&gt;
&lt;br /&gt;
                $grouping_id = groups_get_grouping_publicprivate($COURSE-&amp;gt;id);&lt;br /&gt;
                $course_module = get_record(&amp;quot;course_modules&amp;quot;, &amp;quot;instance&amp;quot;, $forum-&amp;gt;id, &amp;quot;course&amp;quot;, $COURSE-&amp;gt;id);&lt;br /&gt;
                set_coursemodule_groupingid($course_module-&amp;gt;id, $grouping_id);&lt;br /&gt;
                set_coursemodule_groupmembersonly($course_module-&amp;gt;id,1);&lt;br /&gt;
&lt;br /&gt;
=== Code: Make Public ===&lt;br /&gt;
The below code demonstrates how to make a forum public.  The same technique can be applied for any course module.&lt;br /&gt;
                $grouping_id = groups_get_grouping_publicprivate($COURSE-&amp;gt;id);&lt;br /&gt;
                $course_module = get_record(&amp;quot;course_modules&amp;quot;, &amp;quot;instance&amp;quot;, $forum-&amp;gt;id, &amp;quot;course&amp;quot;, $COURSE-&amp;gt;id);&lt;br /&gt;
                set_coursemodule_groupingid($course_module-&amp;gt;id, 0);&lt;br /&gt;
                set_coursemodule_groupmembersonly($course_module-&amp;gt;id,0);&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Policy_on_Moodle_Partner_discussions&amp;diff=64134</id>
		<title>Policy on Moodle Partner discussions</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Policy_on_Moodle_Partner_discussions&amp;diff=64134"/>
		<updated>2024-04-30T16:24:47Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;Note: The policy on Moodle Partner discussions is now part of the &#039;&#039;&#039;[https://moodle.org/mod/page/view.php?id=7080 Moodle.org site policy]&#039;&#039;&#039;.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[[:Forums code of conduct]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Moodle.org]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Patch&amp;diff=64133</id>
		<title>Patch</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Patch&amp;diff=64133"/>
		<updated>2024-04-30T16:24:19Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
A patch, sometimes also called a diff, is a file that shows what changes have been made to a file, or group of files. They are a common way for developers to exchange changes to software. For practical instructions see:&lt;br /&gt;
&lt;br /&gt;
* [[How_to_create_a_patch|How to create a patch]]&lt;br /&gt;
* [[How_to_apply_a_patch|How to apply a patch]]&lt;br /&gt;
&lt;br /&gt;
For more information about the patch format, read on. Here is a simple sample patch file:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
Index: lang/en_utf8/quiz.php&lt;br /&gt;
===================================================================&lt;br /&gt;
RCS file: /cvsroot/moodle/moodle/lang/en_utf8/quiz.php,v&lt;br /&gt;
retrieving revision 1.57.2.10&lt;br /&gt;
diff -u -r1.57.2.10 quiz.php&lt;br /&gt;
--- lang/en_utf8/quiz.php	29 May 2007 17:47:25 -0000	1.57.2.10&lt;br /&gt;
+++ lang/en_utf8/quiz.php	25 Jun 2007 12:58:34 -0000&lt;br /&gt;
@@ -252,7 +255,6 @@&lt;br /&gt;
 $string[&#039;indivresp&#039;] = &#039;Responses of Individuals to Each Item&#039;;&lt;br /&gt;
 $string[&#039;info&#039;] = &#039;Info&#039;;&lt;br /&gt;
 $string[&#039;introduction&#039;] = &#039;Introduction&#039;;&lt;br /&gt;
-$string[&#039;invalidcategory&#039;] = &#039;Category ID is invalid&#039;;&lt;br /&gt;
 $string[&#039;invalidnumericanswer&#039;] = &#039;One of the answers you entered was not a valid number.&#039;;&lt;br /&gt;
 $string[&#039;invalidnumerictolerance&#039;] = &#039;One of the tolerances you entered was not a valid number.&#039;;&lt;br /&gt;
 $string[&#039;invalidsource&#039;] = &#039;The source is not accepted as valid.&#039;;&lt;br /&gt;
@@ -375,8 +377,10 @@&lt;br /&gt;
 $string[&#039;questiontypesetupoptions&#039;] = &#039;Setup options for question types:&#039;;&lt;br /&gt;
 $string[&#039;quiz:attempt&#039;] = &#039;Attempt quizzes&#039;;&lt;br /&gt;
 $string[&#039;quiz:deleteattempts&#039;] = &#039;Delete quiz attempts&#039;;&lt;br /&gt;
+$string[&#039;quiz:emailconfirmsubmission&#039;] = &#039;Receive own quiz submission notification&#039;;&lt;br /&gt;
+$string[&#039;quiz:emailnotifysubmission&#039;] = &#039;Receive student quiz submission notifications&#039;;&lt;br /&gt;
 $string[&#039;quiz:grade&#039;] = &#039;Grade quizzes manually&#039;;&lt;br /&gt;
-$string[&#039;quiz:ignoretimelimits&#039;] = &#039;Ignores time limit on quizzes&#039;;&lt;br /&gt;
+$string[&#039;quiz:ignoretimelimits&#039;] = &#039;Ignores time limit on quizs&#039;;&lt;br /&gt;
 $string[&#039;quiz:manage&#039;] = &#039;Manage quizzes&#039;;&lt;br /&gt;
 $string[&#039;quiz:preview&#039;] = &#039;Preview quizzes&#039;;&lt;br /&gt;
 $string[&#039;quiz:view&#039;] = &#039;View quiz information&#039;;&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
At the top it says which file is being affected. Changes to several files can be included in one patch. Lines added are shown with a &#039;+&#039;, lines removed are shown with a &#039;-&#039;, lines changed are shown as the old line being removed and the new one added.&lt;br /&gt;
&lt;br /&gt;
Patch files are good because they only show the changed parts of the file. This has two advantages: it easy to understand the change; and if other parts of the same files change between the patch being made an being used, there is no problem, the patch will still apply.&lt;br /&gt;
&lt;br /&gt;
Note that there are several slight variants of the patch format. The example above is a &#039;unified&#039; patch, which is now the standard.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[How_to_create_a_patch|How to create a patch]]&lt;br /&gt;
* [[How_to_apply_a_patch|How to apply a patch]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_IDE&amp;diff=64132</id>
		<title>Moodle IDE</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_IDE&amp;diff=64132"/>
		<updated>2024-04-30T16:23:02Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
== [http://download.moodle.org/download.php/ide/Moodle-IDE-Setup.exe Moodle IDE (1.0.6)]==&lt;br /&gt;
&#039;&#039;&#039;Student Developer:&#039;&#039;&#039; [[User:Grady Laksmono|Grady Laksmono]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentor:&#039;&#039;&#039; Petr Skoda and Anthony Borrow&lt;br /&gt;
&lt;br /&gt;
Google Summer of Code 2008&lt;br /&gt;
&lt;br /&gt;
https://docs.moodle.org/en/Student_projects/Moodle_IDE&lt;br /&gt;
&lt;br /&gt;
* Community feedback [http://moodle.org/mod/forum/discuss.php?d=102197 forum discussion]&lt;br /&gt;
&#039;&#039;&#039;Features&#039;&#039;&#039;&lt;br /&gt;
* Create a Moodle project&lt;br /&gt;
* Apache, MySQL, and PHP (XAMPP)&lt;br /&gt;
* XDebug&lt;br /&gt;
* Moodle CVS&lt;br /&gt;
* Splashscreen &lt;br /&gt;
* Moodle Browser&lt;br /&gt;
* Checkstyle&lt;br /&gt;
* Installer&lt;br /&gt;
&lt;br /&gt;
== Workspace Environment ==&lt;br /&gt;
&lt;br /&gt;
1. Install &#039;&#039;&#039;&#039;&#039;Java SE&#039;&#039;&#039;&#039;&#039; (http://java.sun.com/javase/downloads/index.jsp) if you don&#039;t have it installed&lt;br /&gt;
&lt;br /&gt;
2. Run &#039;&#039;&#039;&#039;&#039;Moodle-IDE-Setup.exe&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Run &#039;&#039;&#039;&#039;&#039;Moodle IDE.exe&#039;&#039;&#039;&#039;&#039; as Administrator (&#039;&#039;&#039;&#039;&#039;Right click → Run as Administrator&#039;&#039;&#039;&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
4. &#039;&#039;&#039;&#039;&#039;Workspace Launcher&#039;&#039;&#039;&#039;&#039; dialog box shows up, &#039;&#039;&#039;&#039;&#039;check mark Use this as the default and do not ask again&#039;&#039;&#039;&#039;&#039;, leave everything else as default, then click &#039;&#039;&#039;&#039;&#039;OK&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;!NOTE&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;Default Workspace configuration is needed if you don&#039;t want to configure Virtual Server&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
4. &#039;&#039;&#039;&#039;&#039;File → New → Other...&#039;&#039;&#039;&#039;&#039;, then &#039;&#039;&#039;&#039;&#039;Moodle → Moodle Project&#039;&#039;&#039;&#039;&#039;, then &#039;&#039;&#039;&#039;&#039;click Next&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
5. If you have the local zip package (from http://download.moodle.org/) that you wanted to use, then &#039;&#039;&#039;&#039;&#039;Browse&#039;&#039;&#039;&#039;&#039; for &#039;&#039;&#039;&#039;&#039;Moodle zip package&#039;&#039;&#039;&#039;&#039; for Moodle field. Otherwise, &#039;&#039;&#039;&#039;&#039;click on the drop down list&#039;&#039;&#039;&#039;&#039; on the &#039;&#039;&#039;&#039;&#039;Download Moodle&#039;&#039;&#039;&#039;&#039; and select &#039;&#039;&#039;&#039;&#039;the version&#039;&#039;&#039;&#039;&#039; that you wanted to download, &#039;&#039;&#039;&#039;&#039;the IDE will download and unpacks the package in the project folder&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
6. Name the project (e.g. 19stable, Moodle 1.9, or MoodleWorld)&lt;br /&gt;
&lt;br /&gt;
7. Click &#039;&#039;&#039;&#039;&#039;Finish&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;!NOTE&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;It will take a while for the IDE to either unpacks the Moodle package or Download the Moodle then unpacks it. In general, if you chose to download the Moodle, then the process should take longer than if you have the local Moodle package because the IDE will download the Moodle package first before unpacking it to the project folder in the workspace.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Installing Moodle ==&lt;br /&gt;
Press the &#039;&#039;&#039;&#039;&#039;orange X&#039;&#039;&#039;&#039;&#039; button in the toolbar to run XAMPP (Apache, PHP, and MySQL).&lt;br /&gt;
&lt;br /&gt;
[[Image:XAMPP_Start.jpg]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;!NOTE&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If you have previously installed Apache on your computer, and have it running, then you will see red error messages when you&#039;re trying to run XAMPP. The solution is to stop your previously installed Apache through &#039;&#039;&#039;&#039;&#039;Control Panel → Administration → Sevices, find Apache&#039;&#039;&#039;&#039;&#039; that is currently running, &#039;&#039;&#039;&#039;&#039;Right Click&#039;&#039;&#039;&#039;&#039;, select &#039;&#039;&#039;&#039;&#039;Stop&#039;&#039;&#039;&#039;&#039;, then run XAMPP through Moodle IDE.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Right click &#039;&#039;&#039;&#039;&#039;install.php&#039;&#039;&#039;&#039;&#039; in the project&lt;br /&gt;
&lt;br /&gt;
2. Select &#039;&#039;&#039;&#039;&#039;Open Moodle Browser&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Create a single database for Moodle to store all it&#039;s tables in (or choose an existing database).&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;OR&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Open a web browser&lt;br /&gt;
&lt;br /&gt;
2. Go to &#039;&#039;&#039;&#039;&#039;http://localhost/&amp;lt;Project Name&amp;gt;/moodle/install.php&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Create a single database for Moodle to store all it&#039;s tables in (or choose an existing database).&lt;br /&gt;
&lt;br /&gt;
4. Install Moodle&lt;br /&gt;
&lt;br /&gt;
== CVS ==&lt;br /&gt;
1. Click the &#039;&#039;&#039;&#039;&#039;Moodle icon&#039;&#039;&#039;&#039;&#039; (located on the CVS Respository view panel)&#039;&#039;&#039;&#039;&#039;→ CVS Dialog Box&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:CVS_Location.jpg]]&lt;br /&gt;
&lt;br /&gt;
2. Drop down arrow for the Host (already pre-populated with Moodle hosts)&lt;br /&gt;
&lt;br /&gt;
3. Drop down arrow for the Repository Path (already pre-populated with Moodle repository path)&lt;br /&gt;
&lt;br /&gt;
4. Username, drop down arrow for annonymous, or use yours if you have one (already pr-populated with anonymous)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;!NOTE&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Password for annonymous user is blank&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
5. Password&lt;br /&gt;
&lt;br /&gt;
6. Click &#039;&#039;&#039;&#039;&#039;Finish&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== XDebug ==&lt;br /&gt;
&lt;br /&gt;
=== Debugging Script ===&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;&#039;&#039;Right click&#039;&#039;&#039;&#039;&#039; in the gutter and selecting &#039;&#039;&#039;&#039;&#039;Toggle Breakpoint&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Debug_toggle_breakpoint.png]]&lt;br /&gt;
&lt;br /&gt;
You should see a blue dot appear to signify where the breakpoint is. Now change to the Debug Perspective. &#039;&#039;&#039;&#039;&#039;Window→ Open Perspective → Debug&#039;&#039;&#039;&#039;&#039; Now we can configure our XDebug Debug Profile. We will only need to do this once per project.&lt;br /&gt;
&lt;br /&gt;
2. Specify the PHP Interpreter Path, go to &#039;&#039;&#039;&#039;&#039;Window → Preferences → PHPeclipse → XDebug&#039;&#039;&#039;&#039;&#039;, if you&#039;re using the default Moodle IDE&#039;s installation, the Interpreter path should be &#039;&#039;&#039;&#039;&#039;C:\Moodle IDE\xampp\php\php.exe&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Window_Preference_PHPeclipse_XDebug_Interpreter.jpg]]&lt;br /&gt;
&lt;br /&gt;
3. Click on the &#039;&#039;&#039;&#039;&#039;OK&#039;&#039;&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
=== XDebug Debug Profile ===&lt;br /&gt;
&lt;br /&gt;
Now that we have configured XDebug, we need to create a debug configuration. This will tell Eclipse how to start the debugger for your project. To do this, select &#039;&#039;&#039;&#039;&#039;Open Debug Dialog&#039;&#039;&#039;&#039;&#039; from the &#039;&#039;&#039;&#039;&#039;Run drop down menu&#039;&#039;&#039;&#039;&#039;. You will be presented with a list of items which you can debug. &#039;&#039;&#039;&#039;&#039;Double click on the entry titled PHP XDebug Script&#039;&#039;&#039;&#039;&#039;. This will create a new configuration and allow you to specify the necessary options. You can provide a name for your debug configuration, and then &#039;&#039;&#039;&#039;&#039;you must specify the filename which should be executed for debugging purposes&#039;&#039;&#039;&#039;&#039;. In this case, the filename that I created for testing purpose is named xdebug.php.&lt;br /&gt;
&lt;br /&gt;
[[Image:Debug_Dropdown_OpenDebugDialog_XDebugRemoteScript.jpg]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Debug_Dropdown_OpenDebugDialog_XDebugScript.jpg]]&lt;br /&gt;
&lt;br /&gt;
Once you have selected a configuration name and have chosen an identification string, &#039;&#039;&#039;&#039;&#039;click on the Pathmap tab&#039;&#039;&#039;&#039;. In the pathmap tab, you specify how Eclipse translates local path names to remote path names. To map a path, click on the New button to create a new map. &#039;&#039;&#039;&#039;If your web server is located on the same system that Eclipse is running on, both of these paths will be the same.&#039;&#039;&#039;&#039; In either case, under &#039;&#039;&#039;&#039;&#039;Local Path&#039;&#039;&#039;&#039;&#039; enter the path to the root of your project on the machine that Eclipse is running on. In &#039;&#039;&#039;&#039;&#039;Remote Path&#039;&#039;&#039;&#039;&#039;, enter the path to the root of your project on the machine the web server is running on.&lt;br /&gt;
&lt;br /&gt;
[[Image:Debug_Dropdown_OpenDebugDialog_XDebugRemoteScript_Pathmap.jpg]]&lt;br /&gt;
&lt;br /&gt;
4. Once you have specified the proper pathmap, &#039;&#039;&#039;&#039;&#039;press the Debug button&#039;&#039;&#039;&#039;&#039; to begin the debugger.&lt;br /&gt;
&lt;br /&gt;
Now in your browser you will need to &#039;&#039;&#039;&#039;&#039;start the XDEBUG_SESSION&#039;&#039;&#039;&#039;&#039;, so type in the following&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;http://localhost/&amp;lt;Project Name&amp;gt;/moodle/&amp;lt;File Name&amp;gt;.php?XDEBUG_SESSION_START=&amp;lt;Ide Identification String&amp;gt;&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The debugger should stop at the breakpoint that we set earlier.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;!NOTE&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Starting XDEBUG_SESSION can be done by &#039;&#039;&#039;Right clicking the file → Open Moodle Browser → Append the ?XDEBUG_SESSION_START=&amp;lt;Ide Identification String&amp;gt; to the URL&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;I created xdebug.php that contains a loop for testing purposes. But in general, the file will be much bigger such that it will take longer for XDebug to complete its debugging process.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:XDebug_Initial.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== Open the Debugger Perspective ===&lt;br /&gt;
&lt;br /&gt;
5. Press the &#039;&#039;&#039;&#039;&#039;Open Perspective&#039;&#039;&#039;&#039;&#039; button&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenPerspective_Button.jpg]]&lt;br /&gt;
&lt;br /&gt;
6. Select &#039;&#039;&#039;&#039;&#039;Other...&#039;&#039;&#039;&#039;&#039;, &#039;&#039;&#039;&#039;&#039;Open Perspective&#039;&#039;&#039;&#039;&#039; dialog box will pop up&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenPerspective_Other.jpg]]&lt;br /&gt;
&lt;br /&gt;
7. Select &#039;&#039;&#039;&#039;&#039;Debug&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:OpenPerspective_Other_Debug.jpg]]&lt;br /&gt;
&lt;br /&gt;
8. Click &#039;&#039;&#039;&#039;&#039;OK&#039;&#039;&#039;&#039;&#039;, debug perspective will be displayed&lt;br /&gt;
&lt;br /&gt;
[[Image:DebuggerView.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Checkstyle ==&lt;br /&gt;
1. &#039;&#039;&#039;&#039;&#039;Right click&#039;&#039;&#039;&#039;&#039; on any PHP file that you want to check&lt;br /&gt;
&lt;br /&gt;
2. Select &#039;&#039;&#039;&#039;&#039;PHP Checkstyle&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
3. Report will be displayed&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reference&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
https://docs.moodle.org/en/Development:Coding#Coding_style&lt;br /&gt;
&lt;br /&gt;
== Screenshots ==&lt;br /&gt;
=== Moodle IDE 1.0.6 ===&lt;br /&gt;
[[Image:Environment.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
&lt;br /&gt;
== Source code ==&lt;br /&gt;
Extract the following .jars located in the eclipse&#039;s plugin directory to obtain the source codes:&lt;br /&gt;
* org.moodle_&amp;lt;version&amp;gt;.jar&lt;br /&gt;
* net.sourceforge.phpeclipse.externaltools_&amp;lt;version&amp;gt;.jar&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Libraries_Organization&amp;diff=64131</id>
		<title>Libraries Organization</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Libraries_Organization&amp;diff=64131"/>
		<updated>2024-04-30T16:19:48Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
This document defines standard library structures to keep Moodle readable and organised.&lt;br /&gt;
&lt;br /&gt;
= Structure =&lt;br /&gt;
&lt;br /&gt;
There are several standard locations for library code in Moodle. &lt;br /&gt;
&lt;br /&gt;
==Simple core library==&lt;br /&gt;
&lt;br /&gt;
If the widget feature is a very simple core library with no GUI scripts (like formslib) then do it like this:&lt;br /&gt;
&lt;br /&gt;
====lib/widgetlib.php====&lt;br /&gt;
&lt;br /&gt;
::This contains the main library functions.  New ones should always implement these as a class.  &lt;br /&gt;
&lt;br /&gt;
====lib/widget====&lt;br /&gt;
&lt;br /&gt;
::Any supporting files for this library can go in this sub-directory.  This directory should not contain any GUI scripts and files from here should NOT be directly included in Moodle code.&lt;br /&gt;
&lt;br /&gt;
==Plugins and complex core libraries==&lt;br /&gt;
&lt;br /&gt;
If the feature has some GUI scripts then it should have its own directory (eg like blog, comment, mod/forum, local/widget etc) and then this is always applies:&lt;br /&gt;
&lt;br /&gt;
====widget/classes====&lt;br /&gt;
::for classes that will be used by scripts in widget directory.  See [[Automatic class loading]] for more information.&lt;br /&gt;
&lt;br /&gt;
====widget/lib.php====&lt;br /&gt;
::the main library file for the module containing functions that are either required by core code (eg forum_cron()), or simply being made available to other Moodle code (eg comment/lib.php).  Generally there will be no capability checks in these functions.&lt;br /&gt;
====\component\external classes (previously widget/externallib.php files)====&lt;br /&gt;
::for functions and classes implementing external interface for use by third-party systems like web services, and may also be used by other modules in Moodle. These functions are a very stable API and implement full capability checking.&lt;br /&gt;
&lt;br /&gt;
= Refactoring of old code = &lt;br /&gt;
&lt;br /&gt;
This is some code that was refactored in 2.0 to fit the above guidelines. &lt;br /&gt;
&lt;br /&gt;
==Groups==&lt;br /&gt;
&lt;br /&gt;
===currently in group/lib.php===&lt;br /&gt;
* groups_add_member($grouporid, $userorid)&lt;br /&gt;
* groups_remove_member($grouporid, $userorid)&lt;br /&gt;
* groups_create_group($data, $editform=false, $editoroptions=null)&lt;br /&gt;
* groups_create_grouping($data, $editoroptions=null)&lt;br /&gt;
* groups_update_group($data, $editform=false)&lt;br /&gt;
* groups_update_grouping($data, $editoroptions=null)&lt;br /&gt;
* groups_delete_group($grouporid)&lt;br /&gt;
* groups_delete_grouping($groupingorid)&lt;br /&gt;
* groups_delete_group_members($courseid, $userid=0, $showfeedback=false)&lt;br /&gt;
* groups_delete_groupings_groups($courseid, $showfeedback=false)&lt;br /&gt;
* groups_delete_groups($courseid, $showfeedback=false)&lt;br /&gt;
* groups_delete_groupings($courseid, $showfeedback=false)&lt;br /&gt;
* groups_get_possible_roles($context)&lt;br /&gt;
* groups_get_potential_members($courseid, $roleid = null, $orderby = &#039;lastname,firstname&#039;)&lt;br /&gt;
* groups_parse_name($format, $groupnumber)&lt;br /&gt;
* groups_assign_grouping($groupingid, $groupid)&lt;br /&gt;
* groups_unassign_grouping($groupingid, $groupid)&lt;br /&gt;
* groups_get_members_by_role($groupid, $courseid, $fields=&#039;u.*&#039;, $sort=&#039;u.lastname ASC&#039;, $extrawheretest=&#039;&#039;, $whereparams=array())&lt;br /&gt;
* groups_calculate_role_people($rs, $context)&lt;br /&gt;
&lt;br /&gt;
===currently in lib/grouplib.php===&lt;br /&gt;
* groups_group_exists($groupid)&lt;br /&gt;
* groups_get_group_name($groupid)&lt;br /&gt;
* groups_get_grouping_name($groupingid)&lt;br /&gt;
* groups_get_group_by_name($courseid, $name)&lt;br /&gt;
* groups_get_grouping_by_name($courseid, $name)&lt;br /&gt;
* groups_get_group($groupid, $fields=&#039;*&#039;, $strictness=IGNORE_MISSING)&lt;br /&gt;
* groups_get_grouping($groupingid, $fields=&#039;*&#039;, $strictness=IGNORE_MISSING)&lt;br /&gt;
* groups_get_all_groups($courseid, $userid=0, $groupingid=0, $fields=&#039;g.*&#039;)&lt;br /&gt;
* groups_get_user_groups($courseid, $userid=0)&lt;br /&gt;
* groups_get_all_groupings($courseid)&lt;br /&gt;
* groups_is_member($groupid, $userid=null)&lt;br /&gt;
* groups_has_membership($cm, $userid=null)&lt;br /&gt;
* groups_get_members($groupid, $fields=&#039;u.*&#039;, $sort=&#039;lastname ASC&#039;)&lt;br /&gt;
* groups_get_grouping_members($groupingid, $fields=&#039;u.*&#039;, $sort=&#039;lastname ASC&#039;)&lt;br /&gt;
* groups_get_course_groupmode($course)&lt;br /&gt;
* groups_get_activity_groupmode($cm, $course=null)&lt;br /&gt;
* groups_print_course_menu($course, $urlroot, $return=false)&lt;br /&gt;
* groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false)&lt;br /&gt;
* groups_get_course_group($course, $update=false)&lt;br /&gt;
* groups_get_activity_group($cm, $update=false)&lt;br /&gt;
* groups_get_activity_allowed_groups($cm,$userid=0)&lt;br /&gt;
* groups_course_module_visible($cm, $userid=null)&lt;br /&gt;
&lt;br /&gt;
=== New group/lib.php ===&lt;br /&gt;
* groups_add_member($grouporid, $userorid)&lt;br /&gt;
* groups_remove_member($grouporid, $userorid)&lt;br /&gt;
* groups_create_group($data, $editform=false, $editoroptions=null)&lt;br /&gt;
* groups_create_grouping($data, $editoroptions=null)&lt;br /&gt;
* groups_update_group($data, $editform=false)&lt;br /&gt;
* groups_update_grouping($data, $editoroptions=null)&lt;br /&gt;
* groups_delete_group($grouporid)&lt;br /&gt;
* groups_delete_grouping($groupingorid)&lt;br /&gt;
* groups_delete_group_members($courseid, $userid=0, $showfeedback=false)&lt;br /&gt;
* groups_delete_groupings_groups($courseid, $showfeedback=false)&lt;br /&gt;
* groups_delete_groups($courseid, $showfeedback=false)&lt;br /&gt;
* groups_delete_groupings($courseid, $showfeedback=false)&lt;br /&gt;
* groups_assign_grouping($groupingid, $groupid)&lt;br /&gt;
* groups_unassign_grouping($groupingid, $groupid)&lt;br /&gt;
* groups_get_members_by_role($groupid, $courseid, $fields=&#039;u.*&#039;, $sort=&#039;u.lastname ASC&#039;, $extrawheretest=&#039;&#039;, $whereparams=array())&lt;br /&gt;
* groups_group_exists($groupid)&lt;br /&gt;
* groups_get_group_name($groupid)&lt;br /&gt;
* groups_get_grouping_name($groupingid)&lt;br /&gt;
* groups_get_group_by_name($courseid, $name)&lt;br /&gt;
* groups_get_grouping_by_name($courseid, $name)&lt;br /&gt;
* groups_get_group($groupid, $fields=&#039;*&#039;, $strictness=IGNORE_MISSING)&lt;br /&gt;
* groups_get_grouping($groupingid, $fields=&#039;*&#039;, $strictness=IGNORE_MISSING)&lt;br /&gt;
* groups_get_all_groups($courseid, $userid=0, $groupingid=0, $fields=&#039;g.*&#039;)&lt;br /&gt;
* groups_get_user_groups($courseid, $userid=0)&lt;br /&gt;
* groups_get_all_groupings($courseid)&lt;br /&gt;
* groups_is_member($groupid, $userid=null)&lt;br /&gt;
* groups_has_membership($cm, $userid=null)&lt;br /&gt;
* groups_get_members($groupid, $fields=&#039;u.*&#039;, $sort=&#039;lastname ASC&#039;)&lt;br /&gt;
* groups_get_grouping_members($groupingid, $fields=&#039;u.*&#039;, $sort=&#039;lastname ASC&#039;)&lt;br /&gt;
* groups_get_course_groupmode($course)&lt;br /&gt;
* groups_get_activity_groupmode($cm, $course=null)&lt;br /&gt;
* groups_get_course_group($course, $update=false)&lt;br /&gt;
* groups_get_activity_group($cm, $update=false)&lt;br /&gt;
* groups_get_activity_allowed_groups($cm,$userid=0)&lt;br /&gt;
* groups_print_course_menu($course, $urlroot, $return=false)&lt;br /&gt;
* groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false)&lt;br /&gt;
* groups_course_module_visible($cm, $userid=null)&lt;br /&gt;
&lt;br /&gt;
=== New group/locallib.php ===&lt;br /&gt;
groups_get_possible_roles($context)&amp;lt;br/&amp;gt;&lt;br /&gt;
groups_get_potential_members($courseid, $roleid = null, $orderby = &#039;lastname,firstname&#039;)&amp;lt;br/&amp;gt;&lt;br /&gt;
groups_parse_name($format, $groupnumber)&amp;lt;br/&amp;gt;&lt;br /&gt;
groups_calculate_role_people($rs, $context)&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Users==&lt;br /&gt;
&lt;br /&gt;
===Currently in lib/datalib.php ===&lt;br /&gt;
* get_users($get=true, $search=&#039;&#039;, $confirmed=false, array $exceptions=null, $sort=&#039;firstname ASC&#039;, $firstinitial=&#039;&#039;, $lastinitial=&#039;&#039;, $page=&#039;&#039;, $recordsperpage=&#039;&#039;, $fields=&#039;*&#039;, $extraselect=&#039;&#039;, array $extraparams=null) &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* get_users_confirmed()&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* get_users_listing($sort=&#039;lastaccess&#039;, $dir=&#039;ASC&#039;, $page=0, $recordsperpage=0, $search=&#039;&#039;, $firstinitial=&#039;&#039;, $lastinitial=&#039;&#039;, $extraselect=&#039;&#039;, array $extraparams=null)&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* search_users($courseid, $groupid, $searchtext, $sort=&#039;&#039;, array $exceptions=null)&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* user_accesstime_log($courseid=0)&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* user_can_create_courses()&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Currently in user/profile/lib.php ===&lt;br /&gt;
* profile_user_record($userid) &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
* profile_load_data(&amp;amp;$user)&amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;New for triage&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Currently in lib/moodlelib.php ===&lt;br /&gt;
authenticate_user_login($username, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
check_user_preferences_loaded($time = null)&amp;lt;br/&amp;gt;&lt;br /&gt;
complete_user_login($user, $setcookie=true)&amp;lt;br/&amp;gt;&lt;br /&gt;
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)&amp;lt;br/&amp;gt;&lt;br /&gt;
create_user_record($username, $password, $auth=&#039;manual&#039;)&amp;lt;br/&amp;gt;&lt;br /&gt;
delete_user($user)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_complete_user_data($field, $value, $mnethostid=null)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_directories($only_non_empty=true, $legacy=false)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_fieldnames()&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_preferences($name=NULL, $default=NULL, $otheruserid=NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_timezone($tz = 99)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_timezone_offset($tz = 99)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_users_from_config($value, $capability)&amp;lt;br/&amp;gt;&lt;br /&gt;
guest_user()&amp;lt;br/&amp;gt;&lt;br /&gt;
hash_internal_user_password($password)&amp;lt;br/&amp;gt;&lt;br /&gt;
is_restored_user($username)&amp;lt;br/&amp;gt;&lt;br /&gt;
isguestuser($user=NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
isloggedin()&amp;lt;br/&amp;gt;&lt;br /&gt;
make_user_directory($userid, $test=false)&amp;lt;br/&amp;gt;&lt;br /&gt;
mark_user_preferences_changed($userid)&amp;lt;br/&amp;gt;&lt;br /&gt;
set_user_preference($name, $value, $otheruserid=NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
set_user_preferences($prefarray, $otheruserid=NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
truncate_userinfo($info)&amp;lt;br/&amp;gt;&lt;br /&gt;
unset_user_preference($name, $otheruserid=NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
update_internal_user_password(&amp;amp;$user, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
update_user_login_times()&amp;lt;br/&amp;gt;&lt;br /&gt;
update_user_record($username, $authplugin)&amp;lt;br/&amp;gt;&lt;br /&gt;
user_not_fully_set_up($user)&amp;lt;br/&amp;gt;&lt;br /&gt;
user_preference_allow_ajax_update($name, $paramtype)&amp;lt;br/&amp;gt;&lt;br /&gt;
userdate($date, $format = &#039;&#039;, $timezone = 99, $fixday = true)&amp;lt;br/&amp;gt;&lt;br /&gt;
usergetdate($time, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usergetmidnight($date, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usertime($date, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usertimezone($timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
validate_internal_user_password(&amp;amp;$user, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Move to lib/deprecatedlib.php ===&lt;br /&gt;
* create_user_record($username, $password, $auth=&#039;manual&#039;)&lt;br /&gt;
* update_user_record($username, $authplugin)&lt;br /&gt;
* get_complete_user_data($field, $value, $mnethostid=null)&lt;br /&gt;
&lt;br /&gt;
=== New user/lib.php ===&lt;br /&gt;
* user_create_user($user)&lt;br /&gt;
* user_delete_user($user)&lt;br /&gt;
* user_update_user($user)&lt;br /&gt;
* user_get_user($user)&lt;br /&gt;
&lt;br /&gt;
* get_user_preferences($name=NULL, $default=NULL, $otheruserid=NULL)&lt;br /&gt;
* set_user_preference($name, $value, $otheruserid=NULL)&lt;br /&gt;
* set_user_preferences($prefarray, $otheruserid=NULL)&lt;br /&gt;
* unset_user_preference($name, $otheruserid=NULL)&lt;br /&gt;
* guest_user()&lt;br /&gt;
* isguestuser($user=NULL)&lt;br /&gt;
* isloggedin()&lt;br /&gt;
* is_restored_user($username)&lt;br /&gt;
* complete_user_login($user, $setcookie=true)&lt;br /&gt;
&lt;br /&gt;
=== New user/locallib.php ===&lt;br /&gt;
authenticate_user_login($username, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
check_user_preferences_loaded($time = null)&amp;lt;br/&amp;gt;&lt;br /&gt;
create_user_key($script, $userid, $instance=null, $iprestriction=null, $validuntil=null)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_directories($only_non_empty=true, $legacy=false)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_fieldnames()&amp;lt;br/&amp;gt;&lt;br /&gt;
get_users_from_config($value, $capability)&amp;lt;br/&amp;gt;&lt;br /&gt;
hash_internal_user_password($password)&amp;lt;br/&amp;gt;&lt;br /&gt;
make_user_directory($userid, $test=false)&amp;lt;br/&amp;gt;&lt;br /&gt;
mark_user_preferences_changed($userid)&amp;lt;br/&amp;gt;&lt;br /&gt;
truncate_userinfo($info)&amp;lt;br/&amp;gt;&lt;br /&gt;
update_internal_user_password(&amp;amp;$user, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
update_user_login_times()&amp;lt;br/&amp;gt;&lt;br /&gt;
user_not_fully_set_up($user)&amp;lt;br/&amp;gt;&lt;br /&gt;
user_preference_allow_ajax_update($name, $paramtype)&amp;lt;br/&amp;gt;&lt;br /&gt;
validate_internal_user_password(&amp;amp;$user, $password)&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== New lib/timelib.php ===&lt;br /&gt;
&lt;br /&gt;
userdate($date, $format = &#039;&#039;, $timezone = 99, $fixday = true)&amp;lt;br/&amp;gt;&lt;br /&gt;
usergetdate($time, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usergetmidnight($date, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usertime($date, $timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
usertimezone($timezone=99)&amp;lt;br/&amp;gt;&lt;br /&gt;
calculate_user_dst_table($from_year = NULL, $to_year = NULL, $strtimezone = NULL)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_timezone($tz = 99)&amp;lt;br/&amp;gt;&lt;br /&gt;
get_user_timezone_offset($tz = 99)&amp;lt;br/&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Automatic_class_loading&amp;diff=64130</id>
		<title>Automatic class loading</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Automatic_class_loading&amp;diff=64130"/>
		<updated>2024-04-30T16:19:22Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Moodle 2.6}}&lt;br /&gt;
&lt;br /&gt;
This document describes how to use the functionality of the automatic classloader provided by Moodle.&lt;br /&gt;
&lt;br /&gt;
==Class naming==&lt;br /&gt;
&lt;br /&gt;
To be discoverable by the Moodle automatic classloader, classes must adhere to some class naming and location rules:&lt;br /&gt;
&lt;br /&gt;
* Sit under the &#039;&#039;&#039;classes&#039;&#039;&#039; directory of every component:&lt;br /&gt;
** &#039;&#039;&#039;/lib/classes/&#039;&#039;&#039; for core component (core).&lt;br /&gt;
** &#039;&#039;&#039;SUBSYSTEMDIR/classes/&#039;&#039;&#039; for subsystem (core_subsystem).&lt;br /&gt;
** &#039;&#039;&#039;PLUGINDIR/classes/&#039;&#039;&#039; for plugins (plugintype_plugin).&lt;br /&gt;
:::Note: The list of valid subsystems and plugin types with their corresponding directories [https://github.com/moodle/moodle/blob/master/lib/components.json can be found in code].&lt;br /&gt;
* One class file for each class.&lt;br /&gt;
* Autoloading is always [[Frankenstyle|Frankenstyle-based]] and it will be important part of the discovery.&lt;br /&gt;
* It provides autoloading of both:&lt;br /&gt;
** &#039;&#039;&#039;Frankenstyle namespaced classes&#039;&#039;&#039;, where the component name is the namespace (&#039;&#039;&#039;\core_user\example&#039;&#039;&#039; or &#039;&#039;&#039;\mod_forum\example&#039;&#039;&#039;). This is the [[Coding style#Namespaces|actual way]] to add new classes to Moodle.&lt;br /&gt;
** &#039;&#039;&#039;Frankenstyle prefixed classes&#039;&#039;&#039;, where the component name is the prefix of the class (&#039;&#039;&#039;core_user_example&#039;&#039;&#039; or &#039;&#039;&#039;mod_forum_example&#039;&#039;&#039;). This is now considered deprecated and only should be used for existing code or APIs not supporting autoloading.&lt;br /&gt;
:::Note: Since June 2020 the later is deprecated, see MDLSITE-6087 for more information.&lt;br /&gt;
&lt;br /&gt;
== Frankenstyle namespaced classes ==&lt;br /&gt;
&lt;br /&gt;
PHP namespaces are designed to improve code organisation in your projects. Directory structure in classes/ is matching the namespace structure. Main details about their implementation:&lt;br /&gt;
&lt;br /&gt;
* Actual, preferred.&lt;br /&gt;
* [[Frankenstyle]] Namespaces:&lt;br /&gt;
** Core classes must use the &#039;&#039;&#039;namespace core&#039;&#039;&#039;.&lt;br /&gt;
** Subsystem classes must use the &#039;&#039;&#039;namespace core_subsystem&#039;&#039;&#039;.&lt;br /&gt;
** Plugin classes must use the &#039;&#039;&#039;namespace plugintype_pluginname&#039;&#039;&#039;&lt;br /&gt;
** File names will be the class names (plus the php extension).&lt;br /&gt;
*** e.g. Class &#039;&#039;&#039;\mod_forum\some_class&#039;&#039;&#039; is stored in file &#039;&#039;&#039;mod/forum/classes/some_class.php&#039;&#039;&#039;&lt;br /&gt;
*** e.g. Class &#039;&#039;&#039;\core\frankenstyle&#039;&#039;&#039; is stored in file &#039;&#039;&#039;lib/classes/frankenstyle.php&#039;&#039;&#039;&lt;br /&gt;
** For more details about valid first and second level namespaces see [[Coding_style#Rules_for_level1]].&lt;br /&gt;
&lt;br /&gt;
=== Code examples (namespaced) ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace core\event;&lt;br /&gt;
&lt;br /&gt;
// file lib/classes/event/base.php&lt;br /&gt;
&lt;br /&gt;
class base {&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
namespace mod_forum\event;&lt;br /&gt;
&lt;br /&gt;
// file mod/forum/classes/event/post_read.php&lt;br /&gt;
&lt;br /&gt;
class post_read extends \core\event\base {&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// in any file&lt;br /&gt;
&lt;br /&gt;
\mod_forum\event\post_read::create($post-&amp;gt;id, ...)-&amp;gt;trigger();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Frankenstyle prefixed classes (deprecated)==&lt;br /&gt;
&lt;br /&gt;
Main details about their implementation:&lt;br /&gt;
&lt;br /&gt;
* Deprecated, only for BC and not autoloaded stuff.&lt;br /&gt;
* [[Frankenstyle]] Prefixes:&lt;br /&gt;
** Core classes must start with the prefix &#039;&#039;&#039;core_&#039;&#039;&#039;.&lt;br /&gt;
** Subsystem classes must start with the prefix &#039;&#039;&#039;core_subsystem&#039;&#039;&#039;.&lt;br /&gt;
** Plugin classes must start with the prefix &#039;&#039;&#039;plugintype_pluginname&#039;&#039;&#039;&lt;br /&gt;
** File names will be the class names &#039;&#039;&#039;without the prefix&#039;&#039;&#039; (plus the php extension).&lt;br /&gt;
*** e.g. Class &#039;&#039;&#039;mod_forum_some_class&#039;&#039;&#039; is stored in file &#039;&#039;&#039;mod/forum/classes/some_class.php&#039;&#039;&#039;&lt;br /&gt;
*** e.g. Class &#039;&#039;&#039;core_frankenstyle&#039;&#039;&#039; class is stored in &#039;&#039;&#039;lib/classes/frankenstyle.php&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Code Examples (prefixed)===&lt;br /&gt;
&lt;br /&gt;
Example of autoloaded class in forum module:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// file mod/forum/classes/some_class.php&lt;br /&gt;
&lt;br /&gt;
class mod_forum_some_class {&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
// file mod/forum/lib.php&lt;br /&gt;
&lt;br /&gt;
// no require_once() necessary here&lt;br /&gt;
&lt;br /&gt;
$instance = new mod_forum_some_class();&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
// in any file&lt;br /&gt;
&lt;br /&gt;
if (class_exists(&#039;mod_forum_some_class&#039;)) {&lt;br /&gt;
  // do something&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Backwards compatibility ==&lt;br /&gt;
&lt;br /&gt;
There are no known issues that could cause backwards incompatibility, however it is strongly recommended to use the classes subdirectory only for classes that are included automatically.&lt;br /&gt;
&lt;br /&gt;
== Performance and developer mode ==&lt;br /&gt;
&lt;br /&gt;
Class autoloading improves performance and reduces memory footprint. Location of all classes is automatically stored in class map cache, the cache is updated automatically before upgrade or installation, during cache reset and in developer mode.&lt;br /&gt;
&lt;br /&gt;
There is only one inconvenience - if you add new class or remove it you need to do one of the following:&lt;br /&gt;
* visit yourserver/admin/index.php&lt;br /&gt;
* purge caches&lt;br /&gt;
* or add &#039;&#039;&#039;$CFG-&amp;gt;debug = (E_ALL | E_STRICT);&#039;&#039;&#039; to your config.php&lt;br /&gt;
&lt;br /&gt;
Otherwise the new class would not be found.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Frankenstyle]]&lt;br /&gt;
* [[Automatic Class Loading Proposal]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Plugins]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Development_talk:Wiki_requirements&amp;diff=64129</id>
		<title>Development talk:Wiki requirements</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Development_talk:Wiki_requirements&amp;diff=64129"/>
		<updated>2024-04-30T16:18:23Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
What about wrapping the already existing bits of Moodle together to create a new wiki (oh, no...not another wiki) My thinking is that we already have the following tools:&lt;br /&gt;
&lt;br /&gt;
* a &amp;quot;standard&amp;quot; markup (Markdown)&lt;br /&gt;
* several ways to store attachments/images/binary files in various modules&lt;br /&gt;
* filters for multimedia, Latex, Math and the like.&lt;br /&gt;
&lt;br /&gt;
Could these instances be refactored and refined then called from the wiki parser? This would avoid re-inventing the wheel(s) and simplify maintanence of system. I guess I&#039;m suggesting a &amp;quot;plugin&amp;quot; mechanism where each of these tools could be added to Moodle and then assembled to form the wiki rather than create a monolithic and eventually cumbersome script. If all wiki pages are simply text, the wiki script will just dole out portions of each page to the proper tool. I&#039;m imagining these tools could be used everywhere in Moodle, rather than being specific to the wiki...kind of following the unix philosophy of assembling several simpler tools to perform complicated tasks. Looking at Martin D&#039;s post outlining the must-have features, he alludes to this approach when discussing Mediawiki. Posts in other discussions have as well.&lt;br /&gt;
&lt;br /&gt;
Regarding feature ideas, I would recommend folks look at Uniwakka. This &amp;quot;academically oriented&amp;quot; wiki engine has some great possibilities including support for MathML (better than latex filter for sophisticated maths?), Latex, chemistry (a personal favorite), and bibliographies; it exports/imports OpenOffice documents directly and exports Latex versions of the pages. Veeerryy nice!&lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
~Steve&lt;br /&gt;
----&lt;br /&gt;
These are interesting thougts Steve, in fact it was my fisrt idea twio years ago when I longed to develop tools for the current wiki. But teh coding and features of the current wiki convinced me that we needed a new wiki from scratch. I vbeliebe that the aproach you propose can be implemented once we have the [[Dfwiki module]] up and official.&lt;br /&gt;
&lt;br /&gt;
By the way we are already working on a wiki parser compilant with mediawiki, comming soon .&lt;br /&gt;
&lt;br /&gt;
Ludo - DFWikiteam &lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The features I find myself often missing in the current Moodle Wiki are:&lt;br /&gt;
&lt;br /&gt;
* editable sections/sub-pages&lt;br /&gt;
* in history: ability to compare two arbitrary versions&lt;br /&gt;
&lt;br /&gt;
These are things I have grown used to in MediaWiki.&lt;br /&gt;
&lt;br /&gt;
In the markup department I&#039;d like to see:&lt;br /&gt;
&lt;br /&gt;
* at minimum: a basic wiki-like markup as the default&lt;br /&gt;
* optionally: ability to define your own markup&lt;br /&gt;
* optionally 2: ability to define what if the default markup&lt;br /&gt;
&lt;br /&gt;
I find that most cases people will use the default markup. I don&#039;t use the Markdown format although I hear great things about it from people who do use it. I wouldn&#039;t want to make the users at our site transfer to Markdown, when I didn&#039;t even mention it in the basic training sessions they participated in.&lt;br /&gt;
&lt;br /&gt;
~Jussi&lt;br /&gt;
&lt;br /&gt;
I have used a number of different wiki systems and some of them with students. I&#039;ve tried [http://www.twiki.org/ TWiki] and found that students with no knowledge of html take to it quite readily (and do understand the wiki way of makinglinks). I use different versions of [http://www.tiddlywiki.com/ Tiddlywiki] but the markup drives me bonkers (eg because links use | you cannot encluse a URL inside a table). I have also helped faculty use the Moodle wiki (Moodle v 1.5.1) for class but what I don&#039;t like about it is the html editor approach. A student actually managed to crunch the wiki at one point with mangled html code pasted in from MS Word which was then edited! My favourite and what I consider to be the most flexible markup system is [http://www.centeredwork.com/xilize2/index.html Xilize] which at version 2 is powerful strong. There&#039;s a plugin for Jedit which I use to create web pages.&lt;br /&gt;
&lt;br /&gt;
Personally, I hope that the Moodle wiki behaves more like a &#039;traditional&#039; wiki with CamelCase links and a default markup system that&#039;s easy to comprehend and orthogonal (I don&#039;t much like the accent on quotes in Markdown). &lt;br /&gt;
&lt;br /&gt;
For me the selling point of Moodle wiki for use in a course is the flexibility of access control -- one can configure it to be individual access or group access, etc etc. If it defaulted to a wiki like markup and were more stable (especially with Postgres back end) I and many faculty would be happy campers.&lt;br /&gt;
&lt;br /&gt;
~Markpea 25 Jan 2006&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I think you should either put the same information that you find in this link or the link itself in the wiki part of the documentation.  I needed to know about the markup used in Moodle&#039;s wiki, and it would be nice if it were laid out right here.&lt;br /&gt;
&lt;br /&gt;
I didn&#039;t know if it were more appropriate to link to this previous documentation, or if it would be better to re-create it.&lt;br /&gt;
&lt;br /&gt;
[http://moodle.org/help.php?module=wiki&amp;amp;file=howtowiki.html /moodle.org help, how to wiki]&lt;br /&gt;
&lt;br /&gt;
Thank you,&lt;br /&gt;
atw&lt;br /&gt;
&lt;br /&gt;
== New wiki (old)issue list  ==&lt;br /&gt;
 This list is very old, we (dfwikiteam) have commented. &lt;br /&gt;
 Rigth now (may 07) the nwiki development plans are &lt;br /&gt;
 being worked out in the [[NWiki roadmap]] page. --[[User:Ludo (Marc Alier)|Ludo (Marc Alier)]] 09:40, 3 June 2007 (CDT)  &lt;br /&gt;
# &#039;&#039;&#039;There is no userid column in the wiki_pages table (author char-string instead). Must be supported in migration too.&#039;&#039;&#039; userid has been there since June06&lt;br /&gt;
# &#039;&#039;&#039;There is no intro and introformat in the wiki table.&#039;&#039;&#039;. I can&#039;t remember when Eloy Lafuente added these two columns... A long, long time ago...&lt;br /&gt;
# &#039;&#039;&#039;In the upgrade from wiki to dfwiki, as there aren&#039;t userids, my wiki-pages were assigned to &amp;quot;guest&amp;quot;. Once more, userid seems to be critical.&#039;&#039;&#039;. Solved. We are using userids. In case of mismatching, we assign the page to the current user.&lt;br /&gt;
# &#039;&#039;&#039;Wikis having different wiki_entries (group or user ones) have no support in new wiki (only one simultaneous line of versions is available?) so we get a lot of duplicate version errors with data-lost of such pedagogical feature! Or am I losing anything? With only groupid and version in the UK of the table, old student wikis can fit in the new one. Once more, userid!&#039;&#039;&#039; Solved UNIQUE KEY `wiki_pages_uk` (`pagename`, `version`, `dfwiki`, `groupid`, `userid`, `ownerid`).&lt;br /&gt;
# &#039;&#039;&#039;Search doesn&#039;t work for diacritics. And/or match is performed with case matching (I think).&#039;&#039;&#039; Search has some bugs. We hae to improve it. Minor priority.&lt;br /&gt;
# &#039;&#039;&#039;Search seems to work against titles and contents always (no matter the checkbox was selected or no). Perhaps it&#039;s due to that usage of globals? Ah! After a second try I saw that such checkbox is to decide to show the details of the search in the body of the page. Perhaps the title should be changed to be a bit more clear? Something like &amp;quot;show results page&amp;quot; and some sort of nice help...&#039;&#039;&#039; I don&#039;t think so. I&#039;ll review it.&lt;br /&gt;
# &#039;&#039;&#039;The useful &amp;quot;What links here&amp;quot; block isn&#039;t available.&#039;&#039;&#039; Now it is.&lt;br /&gt;
# &#039;&#039;&#039;Wiki backup and restore don&#039;t support individual activities!&#039;&#039;&#039; Why not? Where is the problem?&lt;br /&gt;
# &#039;&#039;&#039;Wikis aren&#039;t included in the backup/restore at all!&#039;&#039;&#039; Backup/Restore are working correctly. We have not noticed any bug.&lt;br /&gt;
# &#039;&#039;&#039;Blocks system. Would be difficult to migrate to core block system?&#039;&#039;&#039; Migrated in May06.&lt;br /&gt;
# &#039;&#039;&#039;UTF-8 migration always get teacher_main_language() and it should get page author language! If we know the author responsible for the version, we must look for their original encoding instead of using the teacher one! Similar to forum_posts (if I&#039;m not wrong). And we should know the user: userid again! ;-)&#039;&#039;&#039; I&#039;m gonna take a look to this.&lt;br /&gt;
# &#039;&#039;&#039;In the wiki_pages table there is one &amp;quot;dfwiki&amp;quot; field. Should be &amp;quot;wikiid&amp;quot;. Such name doesn&#039;t sound ok. (although it&#039;s possible that migation become painful, so we can change it in the future...).&#039;&#039;&#039; I know. Pain! It will be changed with the API integration.&lt;br /&gt;
# &#039;&#039;&#039;dfwiki is inside a lot of places in code. It should go out (although it&#039;s possible that migation become painful, so we can change it in the future...).&#039;&#039;&#039; Yes, variables, comments... We have to clean it out.&lt;br /&gt;
# &#039;&#039;&#039;globals, globals, globals usage should be out. Just request parameters filtered with xxxx_param() functions.&#039;&#039;&#039; There is only a big one. We are making it smaller every day.&lt;br /&gt;
# &#039;&#039;&#039;Attachment storage (as I&#039;ve seen in the old-new migration script) seems to be a bit special with a lot of &amp;quot;dfwikiXXXX&amp;quot; dirs generated.&#039;&#039;&#039; I made a script to rename all these dirs.&lt;br /&gt;
# &#039;&#039;&#039;The old-new migration script seems to be twice, once under the wikimigrate dir (the used one) and under the mod directory (unused?).&#039;&#039;&#039; I gonna bet for duplicated code...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This summer three of us will apply a re-engineering process to adapt NWiki to Moodle standards, solve incoherences and improve architecture.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Docs_wiki_upgrade_testing&amp;diff=64128</id>
		<title>Docs wiki upgrade testing</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Docs_wiki_upgrade_testing&amp;diff=64128"/>
		<updated>2024-04-30T16:15:38Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
==Testing checklist==&lt;br /&gt;
&lt;br /&gt;
# Log in and log out&lt;br /&gt;
# Edit a page and check that the edit appears in the page history and recent changes&lt;br /&gt;
# Create a new page and check that it appears in the recent changes&lt;br /&gt;
# Ensure email notification of watched pages is enabled, watch a page, log in as a different user and edit the watched page then check that an email is received&lt;br /&gt;
# Delete a page and check that it is shown in the deletion log&lt;br /&gt;
# Upload a file and check that it is shown in my contributions and in the upload log&lt;br /&gt;
# Edit my preferences and check that changes are saved&lt;br /&gt;
# Check a page diff and try rolling back an edit&lt;br /&gt;
&lt;br /&gt;
[[Category:Documentation]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Bootstrap_2&amp;diff=64127</id>
		<title>Bootstrap 2</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Bootstrap_2&amp;diff=64127"/>
		<updated>2024-04-30T16:14:23Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Themes}}&lt;br /&gt;
== Overview == &lt;br /&gt;
&lt;br /&gt;
Moodle 3.2 includes a theme based on the latest version of [[Bootstrap]] - Bootstrap 4. This page talks about the previous themes which were based on Bootstrap 2.&lt;br /&gt;
&lt;br /&gt;
Bootstrap 2 (http://getbootstrap.com/2.3.2) is a &amp;quot;sleek, intuitive, and powerful front-end framework for faster and easier web development&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Moodle now has 3 themes (bootstrapbase, clean and more) that build upon the best practices, documentation, tools and resources that Bootstrap 2 provides.&lt;br /&gt;
&lt;br /&gt;
If you&#039;re new to Bootstrap we&#039;d suggest starting by reading through the documentation. Not only is it well written and informative, it uses Bootstrap itself and so is a live demonstration too.&lt;br /&gt;
&lt;br /&gt;
http://getbootstrap.com/2.3.2/getting-started.html&lt;br /&gt;
&lt;br /&gt;
A common complaint about Bootstrap is that all Bootstrap-built sites look the same, since people like the defaults so much they just don&#039;t bother to change them. It is however not designed to be a final look, just a platform to build on. Some examples of what can be done can be found at http://builtwithbootstrap.com/ and http://expo.getbootstrap.com (Note that some of these examples may use Bootstrap 3. Then the code of these examples won&#039;t work on themes that use bootstrap 2.3.2)&lt;br /&gt;
&lt;br /&gt;
== Features ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Responsive design ===&lt;br /&gt;
&lt;br /&gt;
A key feature of Bootstrap is responsive design. This means that the look of the page changes based on the width of your screen and allows you to alter the presentation so that iPhones, iPads, Netbooks &amp;amp; Desktops get subtly (or radically) different views of the same page.&lt;br /&gt;
&lt;br /&gt;
http://getbootstrap.com/2.3.2/scaffolding.html#responsive&lt;br /&gt;
&lt;br /&gt;
=== Less ===&lt;br /&gt;
&lt;br /&gt;
Bootstrap&#039;s stylesheets are written in a variant of CSS called LESS. It is possible to use Bootstrap without LESS as they provide the compiled output as CSS too, but for integration with existing Moodle HTML it is (at least currently) necessary for Moodle Bootstrap&#039;s core styles to be compiled after any changes. See the [[LESS]] page for more on this.&lt;br /&gt;
&lt;br /&gt;
=== Glyphicons ===&lt;br /&gt;
&lt;br /&gt;
Bootstrap provides an set of icons called Glyphicons. These are not used for the core Moodle icons as there aren&#039;t enough suitable icons to cover Moodle&#039;s needs. But they are available for use in content by applying simple CSS classes via the HTML editor. (Note in the next version of Bootstrap this &amp;quot;icon sprite&amp;quot; is replaced with an icon font. It is hoped that Moodle can merge it&#039;s SVG icons into this font and all icons will be applied in the same manner)&lt;br /&gt;
&lt;br /&gt;
http://getbootstrap.com/2.3.2/base-css.html#icons&lt;br /&gt;
&lt;br /&gt;
=== Grids ===&lt;br /&gt;
&lt;br /&gt;
Bootstrap uses CSS grids where previously web developers would have used floats (or before that tables). A key feature of grids is that they can &amp;quot;collapse&amp;quot; at smaller widths and so items that would be in a row will appear as a single column on smaller devices like iPhones.&lt;br /&gt;
&lt;br /&gt;
http://getbootstrap.com/2.3.2/scaffolding.html#fluidGridSystem&lt;br /&gt;
&lt;br /&gt;
=== Layouts ===&lt;br /&gt;
&lt;br /&gt;
The core Bootstrap theme uses a &amp;quot;Fluid Grid System&amp;quot;. (Note that in the next version of Bootstrap, there is only one grid system and it is fluid, though it is no longer called that since it is the only grid system.)&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Moodle_and_PHP_7.0_details&amp;diff=64126</id>
		<title>Moodle and PHP 7.0 details</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Moodle_and_PHP_7.0_details&amp;diff=64126"/>
		<updated>2024-04-30T16:10:55Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
[[Moodle and PHP]] / 7.0 details&lt;br /&gt;
&lt;br /&gt;
==Changes in engine==&lt;br /&gt;
&lt;br /&gt;
There are multiple small changes that may require action from developers. They include but not limited to:&lt;br /&gt;
* invalid class, interface and trait names (null, int, string, bool, true, false, resource, object, mixed, numeric)&lt;br /&gt;
* handling of indirect variables, properties, and methods (for example, &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;$foo-&amp;gt;$bar[&#039;baz&#039;]&amp;lt;/syntaxhighlight&amp;gt; is not going to work the same in php5 and php7)&lt;br /&gt;
* &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;foreach&amp;lt;/syntaxhighlight&amp;gt; no longer changes the internal array pointer&lt;br /&gt;
&lt;br /&gt;
For a complete list see http://php.net/manual/en/migration70.incompatible.php and https://github.com/tpunt/PHP7-Reference#changes&lt;br /&gt;
&lt;br /&gt;
For PHP 7.1 see http://php.net/manual/en/migration71.incompatible.php&lt;br /&gt;
&lt;br /&gt;
https://github.com/sstalle/php7cc is a handy tool for checking your code.&lt;br /&gt;
&lt;br /&gt;
==Exception and Throwable==&lt;br /&gt;
&lt;br /&gt;
In PHP7 engine errors can be caught using &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;try {} catch (Throwable $e) {}&amp;lt;/syntaxhighlight&amp;gt;. In PHP5 they were either warnings or fatal errors. Throwable is a new interface that Exception implements, which means that these new exceptions are NOT caugh by &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;try {} catch (Exception $e) {}&amp;lt;/syntaxhighlight&amp;gt; in both PHP5 in PHP7. This is great, allows to treat engine errors nicely and usually backward-compatible.&lt;br /&gt;
&lt;br /&gt;
Why is it a separate topic then? &#039;&#039;&#039;Because error handling in Moodle is not standard&#039;&#039;&#039;. Moodle developers have already thought that it would be nice to catch engine errors same way as exceptions and implemented a workaround. This change in PHP7 conflicts with Moodle error handling. Here is an example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function f(stdClass $a) {}&lt;br /&gt;
try {&lt;br /&gt;
    f(0);&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Caught exception: &amp;quot;.get_class($e).&amp;quot;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
echo &amp;quot;hello, world!\n&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Output&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;PHP5 by itself:&#039;&#039;&#039; PHP Catchable fatal error: Argument 1 passed to f() must be an instance of stdClass, integer given, called in - on line 4 and defined in - on line 2&lt;br /&gt;
* &#039;&#039;&#039;PHP5 + moodle:&#039;&#039;&#039; Caught exception: coding_exception. &#039;&#039;&#039;hello, world!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;PHP7 by itself:&#039;&#039;&#039; Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of stdClass, integer given, called in on line 4 and defined in&lt;br /&gt;
* &#039;&#039;&#039;PHP7 + moodle:&#039;&#039;&#039; Fatal error: Uncaught TypeError: Argument 1 passed to f() must be an instance of stdClass, integer given, called in  on line 4 and defined in.&lt;br /&gt;
&lt;br /&gt;
So this change in moodle means that the code after the try-catch that would be executed in PHP5 is skipped in PHP7. This can be quite critical.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Why is it happening?&#039;&#039;&#039; We call in lib/setup.php &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;set_error_handler(&#039;default_error_handler&#039;, E_ALL | E_STRICT);&amp;lt;/syntaxhighlight&amp;gt; and inside the handler convert the fatal catchable errors into coding_exception. coding_exception is a class extending Exception and it gets caught properly. PHP7 no longer triggers an error, it throws a TypeError which implements Throwable but it does not extend Exception and does not get caught in this example.&lt;br /&gt;
&lt;br /&gt;
The best solution:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
function f(stdClass $a) {}&lt;br /&gt;
try {&lt;br /&gt;
    f(0);&lt;br /&gt;
} catch (Exception $e) {&lt;br /&gt;
    echo &amp;quot;Caught exception: &amp;quot;.get_class($e).&amp;quot;\n&amp;quot;;&lt;br /&gt;
} catch (Throwable $e) {&lt;br /&gt;
    echo &amp;quot;Caught throwable: &amp;quot;.get_class($e).&amp;quot;\n&amp;quot;;&lt;br /&gt;
} &lt;br /&gt;
echo &amp;quot;hello, world!\n&amp;quot;;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Output:&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;PHP5 + moodle:&#039;&#039;&#039; Caught exception: coding_exception. &#039;&#039;&#039;hello, world!&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;PHP7 + moodle:&#039;&#039;&#039; Caught throwable: TypeError &#039;&#039;&#039;hello, world!&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Note here that &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;catch (Throwable $e)&amp;lt;/syntaxhighlight&amp;gt; will be ignored in PHP5 because there is no interface/class with the name Throwable. Using non-existing class name in &amp;quot;catch&amp;quot; does not produce any warnings or errors. If we were writing code for PHP7 only we could remove &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;catch (Exception $e)&amp;lt;/syntaxhighlight&amp;gt; because all exceptions will be caught by Throwable. But we want to make our code work on both PHP5 and PHP7. See also MDL-52284 for related changes that were made in Moodle core.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;How it can affect plugins?&#039;&#039;&#039; Plugins that call &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;eval()&amp;lt;/syntaxhighlight&amp;gt; inside try/catch may need to change the code similar to how we did in MDL-52333 . Also if your plugin also calls &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;set_error_handler()&amp;lt;/syntaxhighlight&amp;gt; you may step on the same error.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Try to avoid &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;catch (Exception $e)&amp;lt;/syntaxhighlight&amp;gt; at all, instead catch specific exceptions (dml_exception, moodle_exception, etc.)&lt;br /&gt;
&lt;br /&gt;
==Constructors==&lt;br /&gt;
&lt;br /&gt;
PHP4-style constructors (method with the same name as class) became deprecated in PHP7. Moodle has a lot of code that was written before PHP5 and lots of constructors were not modified later because they continued to work fine. There are also lots of 3rd party libraries that were also using the PHP4-style constructor. Quite a few of issues in MDL-50565 epic are related to the constructor changes.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;How Moodle addressed it:&#039;&#039;&#039; There are now two methods in each class that used to have PHP4-style constructor - one is called __construct() and another is called the same as the class name and inside it calls &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;self::__construct(...)&amp;lt;/syntaxhighlight&amp;gt;. Starting from Moodle 3.1 the second one gets deprecated and displays debugging message.&lt;br /&gt;
&lt;br /&gt;
Why not just replace the method name with __construct()? The reason is that if some plugin extends this class, it may call &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;parent::parentclassname()&amp;lt;/syntaxhighlight&amp;gt; in its constructor. This would end in fatal error if we did not leave the php4-style constructor. Good thing is that having method with the same name as the class name does not show any warnings in PHP7 if the __construct() is also present in the same class.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;What plugin developers should do?&#039;&#039;&#039; First of all, make sure that all your classes have proper constructors. Second, make sure that you don&#039;t call parent constructors with the old style, for example &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;parent::moodleform()&amp;lt;/syntaxhighlight&amp;gt; or &amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;parent::HTML_QuickForm_input()&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Good to know:&#039;&#039;&#039; This code will work in ANY moodle version:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class myform extends moodleform {&lt;br /&gt;
    public function __construct() {&lt;br /&gt;
        parent::__construct(); // In 2.9 where moodleform::__construct did not yet exist this will call moodleform::moodleform() .&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Remember, even if you don&#039;t care about PHP7 support by your plugin you must change the way you are calling parent constructors. Otherwise you will see debugging messages starting from Moodle 3.1&lt;br /&gt;
&lt;br /&gt;
==Manually installing Memcached==&lt;br /&gt;
 REMI repository now have fresh PHP 7.1 RPMs for [https://rpms.remirepo.net/enterprise/7/debug-php71/x86_64/repoview/ php-pecl-memcached]&lt;br /&gt;
&lt;br /&gt;
(Was running the following commands on RedHat 7)&lt;br /&gt;
&lt;br /&gt;
php-memcached version 3.0.0b1&lt;br /&gt;
&lt;br /&gt;
libmemcached     version 1.0.16&lt;br /&gt;
&lt;br /&gt;
* git clone https://github.com/php-memcached-dev/php-memcached/&lt;br /&gt;
* git checkout -b php7 origin/php7&lt;br /&gt;
* yum install php70u-devel zlib-devel libmemcached-devel&lt;br /&gt;
* phpize &amp;amp; ./configure &amp;amp; make &amp;amp; make install&lt;br /&gt;
* Added a new /etc/php.d/20-memcached.ini (with the following line: extension=memcached.so)&lt;br /&gt;
* systemctl restart php-fpm&lt;br /&gt;
* yum install memcached&lt;br /&gt;
* systemctl enable memcached&lt;br /&gt;
* systemctl start memcached&lt;br /&gt;
* Now, setup Moodle as you usually would...&lt;br /&gt;
&lt;br /&gt;
(Was running the following commands on Ubuntu 16.04)&lt;br /&gt;
* git clone https://github.com/php-memcached-dev/php-memcached/&lt;br /&gt;
* git checkout -b php7 origin/php7&lt;br /&gt;
* (sudo) apt-get install php7.0-dev zlib1g-dev libmemcached-dev&lt;br /&gt;
* phpize &amp;amp; ./configure &amp;amp; make &amp;amp; make install&lt;br /&gt;
* Added a new &amp;quot;(sudo) vim /etc/php/7.0/mods-available/memcached.ini&amp;quot; (with the following line: extension=memcached.so)&lt;br /&gt;
* Link above to php-fpm relevant modules folders: &amp;quot;(sudo) ln -s /etc/php/7.0/mods-available/memcached.ini /etc/php/7.0/fpm/conf.d/20-memcached.ini&amp;quot;&lt;br /&gt;
* Link above to php-cli relevant modules folders: &amp;quot;(sudo) ln -s /etc/php/7.0/mods-available/memcached.ini /etc/php/7.0/cli/conf.d/20-memcached.ini&amp;quot;&lt;br /&gt;
* (sudo) systemctl restart php7.0-fpm&lt;br /&gt;
* (sudo) apt-get install memcached&lt;br /&gt;
* (sudo) systemctl enable memcached&lt;br /&gt;
* (sudo) systemctl start memcached&lt;br /&gt;
* Now, setup Moodle as you usually would...&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=New_docs_theme&amp;diff=64125</id>
		<title>New docs theme</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=New_docs_theme&amp;diff=64125"/>
		<updated>2024-04-30T16:09:43Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
This page describes page edits required following the deployment of the the new docs theme.&lt;br /&gt;
&lt;br /&gt;
* Create MediaWiki:MoodleDocsVersionLinks&lt;br /&gt;
* Edit MediaWiki:Actions&lt;br /&gt;
* For main pages containing blocks as for [[:en:Main page]], edit and amend divs&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=OAuth2_Services&amp;diff=64124</id>
		<title>OAuth2 Services</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=OAuth2_Services&amp;diff=64124"/>
		<updated>2024-04-30T16:05:26Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Template:Work in progress}}&lt;br /&gt;
= OAuth 2 Services =&lt;br /&gt;
{{Moodle 3.3}}&lt;br /&gt;
&lt;br /&gt;
Moodle 3.3 adds support for OAuth 2 services in core which can be used by any plugins to provide authenticated access to external services either as the current user, or using a system account.&lt;br /&gt;
&lt;br /&gt;
OAuth 2 services are used for example, to provide a &amp;quot;Login using Google/Microsoft/Facebook&amp;quot; feature on the login page, and then to share that authenticated session with repositories like Google Drive and Office 365 without having to re-authenticate.&lt;br /&gt;
&lt;br /&gt;
OAuth 2 services can be used by plugins even if they do not use them on the login page, and it&#039;s possible to login to multiple services at the same time. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Login ==&lt;br /&gt;
&lt;br /&gt;
The steps required to enable login using an OAuth 2 service are:&lt;br /&gt;
&lt;br /&gt;
1. Create the OAuth 2 Service using the administration page at &amp;quot;Site administration -&amp;gt; Server -&amp;gt; OAuth 2 Services&amp;quot;. There are templates available to create a pre-configured OAuth 2 service for Google, Office 365 and Facebook or you can manually enter all the required details for a custom OAuth 2 service.&lt;br /&gt;
&lt;br /&gt;
2. Register a new application with the OAuth 2 Service provider. Instructions for how to do this with Google, Office 365 and Facebook are listed below.&lt;br /&gt;
&lt;br /&gt;
3. Enter the Client ID and Secret into the configuration page for the OAuth 2 service in Moodle.&lt;br /&gt;
&lt;br /&gt;
4. Enable the OAuth 2 Authentication module.&lt;br /&gt;
&lt;br /&gt;
=== Open ID Connect ===&lt;br /&gt;
&lt;br /&gt;
Open ID Connect is a standard for OAuth 2 login services that makes it easier to setup a working login system. If the service you are setting up is Open ID Connect compliant, you will only have to enter the base url for the service, and Moodle will discover all the other information required by requesting the &amp;quot;discovery document&amp;quot; which is expected to exist at &amp;lt;issuer base url&amp;gt;/.well-known/openid-configuration. &lt;br /&gt;
&lt;br /&gt;
=== How do I get a clientid and secret? ===&lt;br /&gt;
&lt;br /&gt;
The client ID and secret are created outside of Moodle when setting up the OAuth provider. Instructions for prominent OAuth 2 providers are linked here.&lt;br /&gt;
&lt;br /&gt;
* [[OAuth2_Services_Setup_Project_In_Google|Setup Project In Google]]&lt;br /&gt;
* [[OAuth2_Services_Setup_Project_In_Microsoft|Setup Project In Microsoft]]&lt;br /&gt;
* [[OAuth2_Services_Setup_Project_In_Facebook|Setup Project In Facebook]]&lt;br /&gt;
* [[OAuth2_Services_Setup_Project_In_LinkedIn|Setup Project In LinkedIn]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Microsoft&amp;diff=64123</id>
		<title>OAuth2 Services Setup Project In Microsoft</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Microsoft&amp;diff=64123"/>
		<updated>2024-04-30T16:05:04Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
=== Setup App In Microsoft ===&lt;br /&gt;
&lt;br /&gt;
To setup  an OAuth 2 client with Microsoft, first we need to login to the [[https://apps.dev.microsoft.com/#/appList Microsoft Application Console]] and create a new app.&lt;br /&gt;
&lt;br /&gt;
[[Image:microsoft-1-create-new.png|none|frame|Create new project]]&lt;br /&gt;
&lt;br /&gt;
Note: If you have previously registered Applications with an older API your Application Console may look different. In this case you should create a new &amp;quot;Converged Application&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-1-1-alternate-app-page.png|none|frame|Create new project with older APIs enabled]]&lt;br /&gt;
&lt;br /&gt;
Choose a good name as this is what is shown to users when they are asked to approve the permissions. &lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-2-name-it.png|none|frame|Name it]]&lt;br /&gt;
&lt;br /&gt;
Next you have to add a platform to your application. &lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-3-add-platform.png|none|frame|Add platform]]&lt;br /&gt;
&lt;br /&gt;
Choose &amp;quot;Web platform&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-3.1-web-platform.png|none|frame|Web platform]]&lt;br /&gt;
&lt;br /&gt;
Uncheck the &amp;quot;Allow Implicit Flow&amp;quot; checkbox and set the callback URL. The callback URL should point to &amp;quot;your Moodle site URL + /admin/oauth2callback.php&amp;quot;. If your Moodle site was available at https://lemon.edu/ the callback URL would be https://lemon.edu/admin/oauth2callback.php. It is important that your Moodle site uses https and not http. Microsoft will not allow the callback url if it is not using https.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-4-platform-settings.png|none|frame|Platform settings]]&lt;br /&gt;
&lt;br /&gt;
Make sure the &amp;quot;Microsoft Graph Permissions&amp;quot; section contains the &amp;quot;User.Read&amp;quot; permission.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-5-permissions.png|none|frame|Permissions]]&lt;br /&gt;
&lt;br /&gt;
Set the options for the consent screen.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-6-consent.png|none|frame|Consent]]&lt;br /&gt;
&lt;br /&gt;
Save all the details and then generate a new password.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-7-new-password.png|none|frame|Generate a new password]]&lt;br /&gt;
&lt;br /&gt;
Enter the password in Moodle as the &amp;quot;Client secret&amp;quot; and the Application ID as the &amp;quot;Client id&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
[[File:microsoft-8-got-it.png|none|frame|Got it]]&lt;br /&gt;
&lt;br /&gt;
[[OAuth2 Services|Back to OAuth 2 Services]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_LinkedIn&amp;diff=64122</id>
		<title>OAuth2 Services Setup Project In LinkedIn</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_LinkedIn&amp;diff=64122"/>
		<updated>2024-04-30T16:04:51Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
=== Setup App in LinkedIn ===&lt;br /&gt;
&lt;br /&gt;
To setup  an OAuth 2 client with LinkedIn, first we need to login to the [[https://developer.linkedin.com/ LinkedIn Developers page]] and create a new app.&lt;br /&gt;
&lt;br /&gt;
[[File:linkedin-1-new-app.png|none|frame|New App]]&lt;br /&gt;
&lt;br /&gt;
Enable the r_basicprofile and r_emailaddress permissions and enter the OAuth 2 authorized redirect URL. This is your site url followed by /admin/oauth2callback.php (e.g. for a Moodle site of https://teach.me/moodle/ the callback url should be https://teach.me/moodle/admin/oauth2callback.php)&lt;br /&gt;
&lt;br /&gt;
[[File:linkedin-2-configure-app.png|none|frame|Configure App]]&lt;br /&gt;
&lt;br /&gt;
Make sure you save your changes and record your client id and client secret.&lt;br /&gt;
&lt;br /&gt;
Now you have configured your LinkedIn App - you can add the required information to Moodle.&lt;br /&gt;
&lt;br /&gt;
LinkedIn does not have a &amp;quot;template&amp;quot; in Moodle so we will need to configure it as a &amp;quot;Custom OAuth 2 Service&amp;quot;. From the &amp;quot;Site administration &amp;gt; Server &amp;gt; OAuth 2 services&amp;quot; page click on &amp;quot;Create new custom service&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Use &amp;quot;LinkedIn&amp;quot; as the name (This is displayed on the login page). &lt;br /&gt;
&lt;br /&gt;
Enter your client id and secret for the LinkedIn App that you created earlier.&lt;br /&gt;
&lt;br /&gt;
For the &amp;quot;Scopes included in a login request&amp;quot; and &amp;quot;Scopes included in a login request for offline access&amp;quot; use &amp;quot;r_basicprofile r_emailaddress&amp;quot; which means fetch basic profile information as well as the users email address.&lt;br /&gt;
&lt;br /&gt;
Enter a url to a logo image.&lt;br /&gt;
&lt;br /&gt;
Check the box for &amp;quot;Show on login page&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Save the details and you should be returned to the list of OAuth 2 Services.&lt;br /&gt;
&lt;br /&gt;
We still need to provide information on the mappings between linked in user fields and moodle fields as well as the URL&#039;s to access the LinkedIn APIs.&lt;br /&gt;
&lt;br /&gt;
First we will setup the API URL&#039;s.&lt;br /&gt;
&lt;br /&gt;
Click on the &amp;quot;Configure Endpoints&amp;quot; icon for the LinkedIn service. &lt;br /&gt;
&lt;br /&gt;
Add 3 endpoints as listed below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
userinfo_endpoint 	https://api.linkedin.com/v1/people/~:(id,email-address,first-name,last-name,picture-url)?format=json	 &lt;br /&gt;
&lt;br /&gt;
authorization_endpoint 	https://www.linkedin.com/oauth/v2/authorization	 &lt;br /&gt;
&lt;br /&gt;
token_endpoint 	https://www.linkedin.com/oauth/v2/accessToken	&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now we need to add the mapping from LinkedIn user fields to Moodle user fields. From the list of OAuth services click on the &amp;quot;Configure user field mappings&amp;quot; icon. &lt;br /&gt;
&lt;br /&gt;
Add the following user field mappings:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
firstName	 firstname	 &lt;br /&gt;
lastName	 lastname	 &lt;br /&gt;
emailAddress 	username	 &lt;br /&gt;
emailAddress 	email	 &lt;br /&gt;
pictureUrl 	picture&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The final step is to make sure the OAuth 2 authentication plugin is enabled and you should now be able to login with LinkedIn.&lt;br /&gt;
&lt;br /&gt;
[[OAuth2 Services|Back to OAuth 2 Services]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Google&amp;diff=64121</id>
		<title>OAuth2 Services Setup Project In Google</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Google&amp;diff=64121"/>
		<updated>2024-04-30T16:04:34Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
=== Setup Project In Google ===&lt;br /&gt;
&lt;br /&gt;
To setup an OAuth 2 client with Google, first we need to login to the [[https://console.developers.google.com/ Google Developers Console]] and create a new project.&lt;br /&gt;
&lt;br /&gt;
Create a new project using the menu at the top of the page.&lt;br /&gt;
&lt;br /&gt;
[[File:google-1-create-new.png|none|frame|Create new project]]&lt;br /&gt;
&lt;br /&gt;
Call the new project whatever you like, this name is not shown to users when they are asked to authorise this application.&lt;br /&gt;
&lt;br /&gt;
[[File:google-2-create-new-modal.png|none|frame|Name the project]]&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;credentials&amp;quot; from the menu on the left.&lt;br /&gt;
&lt;br /&gt;
[[File:google-3-credentials.png|none|frame|Switch to credentials page]]&lt;br /&gt;
&lt;br /&gt;
Setup the consent screen for your application. This is where you provide the public information that is shown to users when they are asked to authorise your application. Setting a product name is the minimum information that is required, but the more information you provide here - the more confidence users will have when granting this authorisation.&lt;br /&gt;
&lt;br /&gt;
[[File:google-4-consent.png|none|frame|Setup consent screen]]&lt;br /&gt;
&lt;br /&gt;
Now you can create some client credentials. Switch to the credentials tab and create a new OAuth client ID. &lt;br /&gt;
&lt;br /&gt;
[[File:google-5-oauth-credentials.png|none|frame|Create an OAuth Client ID]]&lt;br /&gt;
&lt;br /&gt;
Setup the credentials for a Web Application. The most important setting here is to set the callback URL. This must be set to &amp;quot;your moodle site url + /admin/oauth2callback.php&amp;quot;. If your moodle site was accessible at https://lemon.edu/ then this callback URL should be set to https://lemon.edu/admin/oauth2callback.php&lt;br /&gt;
&lt;br /&gt;
[[File:google-6-web-application-credentials.png|none|frame|Set the callback URL]]&lt;br /&gt;
&lt;br /&gt;
When you have saved the information on this page, Google will give you the client ID and client secret that you need to enter into Moodle.&lt;br /&gt;
&lt;br /&gt;
[[File:google-7-oauth-details.png|none|frame|Got my secrets!]]&lt;br /&gt;
&lt;br /&gt;
Finally we have to enable the Drive API (if we want to use the google drive repository or file converter plugins).&lt;br /&gt;
&lt;br /&gt;
[[File:google-8-library.png|none|frame|View the Library tab]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-9-select-drive.png|none|frame|Select Drive API]]&lt;br /&gt;
&lt;br /&gt;
[[File:google-10-enable-drive.png|none|frame|Enable the API]]&lt;br /&gt;
&lt;br /&gt;
[[OAuth2_Services|Back to OAuth 2 Services]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Facebook&amp;diff=64120</id>
		<title>OAuth2 Services Setup Project In Facebook</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=OAuth2_Services_Setup_Project_In_Facebook&amp;diff=64120"/>
		<updated>2024-04-30T16:04:12Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
=== Setup App in Facebook ===&lt;br /&gt;
&lt;br /&gt;
To setup  an OAuth 2 client with Facebook, first we need to login to the [[https://developers.facebook.com/apps Facebook for Developers Apps page]] and create a new app.&lt;br /&gt;
&lt;br /&gt;
[[File:facebook-1-new-app.png|none|frame|New App]]&lt;br /&gt;
&lt;br /&gt;
Enter the name for the new App and choose a category (Education?). &lt;br /&gt;
&lt;br /&gt;
[[File:facebook-2-name.png|none|frame|Name it]]&lt;br /&gt;
&lt;br /&gt;
Go to the app basic settings and set the app icon, and the URLs to your privacy policy and terms of service.&lt;br /&gt;
&lt;br /&gt;
[[File:facebook-3-basic-settings.png|none|frame|Basic settings]]&lt;br /&gt;
&lt;br /&gt;
Add the &amp;quot;Facebook Login&amp;quot; product to the app.&lt;br /&gt;
&lt;br /&gt;
[[File:facebook-4-add-product.png|none|frame|Add a product]]&lt;br /&gt;
&lt;br /&gt;
Configure the OAuth settings. Set the callback URL to &amp;quot;your site url + /admin/oauth2callback.php&amp;quot;. If your moodle site is available at https://lemon.edu/ then the callback URL should be set to &amp;quot;https://lemon.edu/admin/oauth2callback.php&amp;quot;. Enable the Web OAuth Login but for best security disable all other types of login.&lt;br /&gt;
&lt;br /&gt;
[[File:facebook-5-oauth-settings-v2.png|none|frame|OAuth settings]]&lt;br /&gt;
&lt;br /&gt;
Go to App Review and make your App public.&lt;br /&gt;
&lt;br /&gt;
[[File:facebook-6-public.png|none|frame|Make it public]]&lt;br /&gt;
&lt;br /&gt;
Finally go to the basic settings and get the App ID and App secret and enter them in Moodle as the Client ID and Client Secret.&lt;br /&gt;
&lt;br /&gt;
[[OAuth2 Services|Back to OAuth 2 Services]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=HTML_editor_2.0&amp;diff=64119</id>
		<title>HTML editor 2.0</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=HTML_editor_2.0&amp;diff=64119"/>
		<updated>2024-04-30T16:02:38Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Moodle_2.0}}This page details the specification of the HTML editor in Moodle 2.0.&lt;br /&gt;
&lt;br /&gt;
[[Image:HTML editor toolbar 2 0 a.png|center|frame|HTML editor for 2.0 (April 2010)]]&lt;br /&gt;
== What we want ==&lt;br /&gt;
Ticket MDL-11113 discusses most issues.&lt;br /&gt;
=== Requirements ===&lt;br /&gt;
* Integration - With Moodle (smileys, different formats, etc.) with a minimum of changes, cleaning up current code as much as possible&lt;br /&gt;
* Compatibility - With web browsers (mostly FF, IE, Safari, Opera)&lt;br /&gt;
* Standard - Outputs valid XHTML code&lt;br /&gt;
* Accessibility - Is it 100% keyboard accessible? Is it usable in JAWS? Etc.&lt;br /&gt;
* Configurability - Possibility to make it show different options and buttons according to the user, the context, etc.&lt;br /&gt;
* Support - Developed by an active community that will support it for a long time.&lt;br /&gt;
&lt;br /&gt;
=== Features ===&lt;br /&gt;
Some features that should be evaluated:&lt;br /&gt;
* Handling of Word documents&lt;br /&gt;
* HTML code direct editing&lt;br /&gt;
* Highlighting (not text background color, with &amp;quot;set-on&amp;quot; operation--Word style)&lt;br /&gt;
* Image uploading&lt;br /&gt;
* Mathematical formulas/equation editing&lt;br /&gt;
* Possible to turn it on and off on demand (on the page) without losing (possibly modified) content (see [http://wiki.moxiecode.com/examples/tinymce/installation_example_07.php this TinyMCE example of this])&lt;br /&gt;
* Right-to-left text input&lt;br /&gt;
* Smileys (has to be possible to use the Moodle list of smileys)&lt;br /&gt;
* Special characters&lt;br /&gt;
* Tables&lt;br /&gt;
* Themeable (possible to make a theme that fits with Moodle&#039;s)&lt;br /&gt;
&lt;br /&gt;
=== Wishes ===&lt;br /&gt;
* Make it possible to change to a different editor (provided someone comes up with the necessary code to &amp;quot;plug it&amp;quot; in Moodle)&lt;br /&gt;
* Possible to run many instances on the same page (see MDL-11101 in tracker)&lt;br /&gt;
* Fix [http://tracker.moodle.org/secure/IssueNavigator.jspa?reset=true&amp;amp;pid=10011&amp;amp;resolution=-1&amp;amp;component=10070&amp;amp;sorter/field=summary&amp;amp;sorter/order=ASC&amp;amp;sorter/field=resolution&amp;amp;sorter/order=ASC&amp;amp;sorter/field=status&amp;amp;sorter/order=ASC&amp;amp;sorter/field=priority&amp;amp;sorter/order=DESC all the bugs] related to the HTML editor&lt;br /&gt;
* Submit drafts in the background, using ajax.&lt;br /&gt;
&lt;br /&gt;
== Possibilities and evaluation ==&lt;br /&gt;
* [http://en.wikipedia.org/wiki/Comparison_of_WYSIWYG_HTML_editors Comparison of WYSIWYG HTML editors on Wikipedia]&lt;br /&gt;
* [http://tinymce.moxiecode.com/ TinyMCE]: [http://wiki.moxiecode.com/index.php/TinyMCE:Compatibility Compatibility], [http://wiki.moxiecode.com/index.php/TinyMCE:Index Documentation], [http://tinymce.moxiecode.com/example_full.php?example=true Demo]&lt;br /&gt;
* [http://www.fckeditor.net/ FCKeditor]: [http://docs.fckeditor.net/FCKeditor_3.x/Design_and_Architecture/Browsers_Compatibility Compatibility] [http://docs.fckeditor.net/ Documentation], [http://www.fckeditor.net/demo Demo]&lt;br /&gt;
* [http://xinha.webfactional.com/ Xinha]: [http://xinha.webfactional.com/wiki/Documentation Documentation], [http://xinha.webfactional.com/wiki/Examples Demo]&lt;br /&gt;
* [http://developer.yahoo.com/yui/editor/ Yahoo RTE]: [http://developer.yahoo.com/yui/docs/module_editor.html Documentation], [http://developer.yahoo.com/yui/examples/editor/index.html Demo], &lt;br /&gt;
As of 16 April 2008, the preference goes to TinyMCE.&lt;br /&gt;
&lt;br /&gt;
== Plan of action ==&lt;br /&gt;
&lt;br /&gt;
See: MDL-11113 and MDL-14739&lt;br /&gt;
&lt;br /&gt;
* Get latest TinyMCE in HEAD before 13 May 2008 so that work can be done there (done, MDL-14739)&lt;br /&gt;
* Have the XHTML profile active by default in TinyMCE (done)&lt;br /&gt;
* Attack each Moodle plugin in turn, keeping modifications to TinyMCE code base as modular and minimal as possible&lt;br /&gt;
&lt;br /&gt;
=== Plugins to write ===&lt;br /&gt;
Some plugins will have to be written for each editor to make integration with Moodle possible.  These should be as abstracted as possible, to make as much code as possible common between each.  Since editors will be located under /lib/editor, let&#039;s store this common code under /lib/editormod.&lt;br /&gt;
&lt;br /&gt;
* File browser: the file browser (especially with the [[File API]]) will be Moodle specific&lt;br /&gt;
* Emoticons (smileys): Moodle defines its own list of emoticons, we need to make sure the editors use these consistently&lt;br /&gt;
* Language files: Moodle has a lot more languages than any editors, and some strings will be Moodle-specific.  We need a way to make for each editor to use Moodle strings, reusing as many existing strings as possible, and using lang/xx/editor.php for the rest.&lt;br /&gt;
* Equation editor: there is [[DragMath_equation_editor| ongoing work]] to get [http://www.dragmath.bham.ac.uk/ Dragmath] working in Moodle, making a common plugin could be a nice improvement&lt;br /&gt;
* Multilang:  all editors need to support multilang properly.&lt;br /&gt;
&lt;br /&gt;
It also may be possible to use Moodle&#039;s CSS files to define editors themes/skins, this needs investigation&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Editor-specific information:&#039;&#039;&#039;&lt;br /&gt;
* TinyMCE makes it possible to have [http://tinymce.moxiecode.com/punbb/viewtopic.php?pid=9317#p9317 self-registering plugins], that don&#039;t need to be under it&#039;s /plugins folder (and so could be in a moodle-specific folder).&lt;br /&gt;
* FCKeditor [http://docs.fckeditor.net/FCKeditor_2.x/Developers_Guide/Customization/Plug-ins needs to have its plugins in a specific place].&lt;br /&gt;
&lt;br /&gt;
=== Change in formats ===&lt;br /&gt;
&lt;br /&gt;
There is a bug (MDL-4868) about Markdown not being converted to HTML when using the HTML editor (after creating a post with Markdown). &lt;br /&gt;
&lt;br /&gt;
This really applies to all non-HTML formats.&lt;br /&gt;
&lt;br /&gt;
Proposal: whenever the HTML editor is used to edit existing non-HTML text, we convert the text to HTML for use in the editor.  Saving the changes will save the text (and format) as HTML.&lt;br /&gt;
&lt;br /&gt;
Although we are losing some information, we feel it&#039;s an acceptable tradeoff against overall usability, particularly as the HTML editor works on a wider range of browsers and we make XHTML compliance a requirement.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Using the File API in Moodle forms]]&lt;br /&gt;
&lt;br /&gt;
== Links to forum discussions, tracker, docs, etc. ==&lt;br /&gt;
* [http://tracker.moodle.org/browse/MDL-11113 MDL-11113 - Get a fully working HTML editor in Moodle]&lt;br /&gt;
* [[Moodle-specific customisations to the HTML editor]]&lt;br /&gt;
&lt;br /&gt;
Using Moodle General developer forum discussions:&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=88382 TinyMCE3 Integration]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=93475 XINHA has started to support Opera and Safari]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=76912 What is the current position with the HTML editor?]&lt;br /&gt;
* [http://moodle.org/mod/forum/discuss.php?d=96160 The most important decision on editor integration]&lt;br /&gt;
&lt;br /&gt;
[[Category:Editing text]]&lt;br /&gt;
[[Category:Files]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=HQ_component_teams&amp;diff=64118</id>
		<title>HQ component teams</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=HQ_component_teams&amp;diff=64118"/>
		<updated>2024-04-30T16:01:53Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
HQ component teams are responsible for triaging the issues in a number of components, planning the roadmap of issues to be worked on and should be consulted as part of the peer review process for all issues relating to their components. &lt;br /&gt;
&lt;br /&gt;
The current list of component teams is:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Andrew, Mick, Simey, Shamim, Jun, Dongsheng, Huong&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Accessibility, Administration, Automated functional tests (behat), Calendar, Email, Forum, Groups, HTML Editor (Atto), HTML Editor (TinyMCE), Installation, Logging, Privacy, Questions, Quiz, RSS, Security Alert, Unit tests, User Tours&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Adrian, Mihail, Peter, Jake, Mathew&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Assignment, Assignment (2.2), Backup, Backup: IMS-CC, Blocks, Blog, Book, Competencies, Database activity module, External, Tool (IMS-LTI), Filepicker, Glossary, IMS-CP resource type, Lesson, LTI provider, Other, Ratings, Reports, Repositories, Resource, SCORM&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Carlos, Sara, Amaia, Victor, Ferran&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Badges, Activity completion, Caching, Cohorts, Content bank, Course, Course completion, Dashboard (My home), Enrolments, Feedback, Global search, H5P, HTML and CSS, Libraries, Licensing, Maths filters, phpdoc, Plagiarism, Portfolio, Roles / Access, Survey, Survey 2, Tags, Tasks, Themes, Unknown, User management, Wiki (2.x), Workshop&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Helen, David&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Documentation, Hub, Language, Translation&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=HQ_Planning_2.9&amp;diff=64117</id>
		<title>HQ Planning 2.9</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=HQ_Planning_2.9&amp;diff=64117"/>
		<updated>2024-04-30T16:00:46Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
This page lists the projects we are initially planning to work on for the Moodle 2.9 dev cycle. The goal for this cycle is to work on 2 major projects in parallel, and give these projects enough time to become fully mature and stable, and only then to choose some smaller projects to plan, spec and build depending on the time remaining. &lt;br /&gt;
&lt;br /&gt;
== Navigation improvements ==&lt;br /&gt;
&lt;br /&gt;
Specification: [[Navigation overhaul specification]]&lt;br /&gt;
&lt;br /&gt;
Summary - the linked specification above details a major overhaul of the navigation in Moodle. It is intended to be worked on over several release cycles. The scope for this cycle is to work on the pages that should sit in the &amp;quot;User context&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Work already completed:&lt;br /&gt;
* [[Navigation_overhaul_specification#A_user_menu|User Menu]]&lt;br /&gt;
* [[Navigation_overhaul_specification#Revisiting_&#039;My_home&#039;_page|Revisiting &#039;My home&#039; page]]&lt;br /&gt;
&lt;br /&gt;
Work in scope for this release cycle:&lt;br /&gt;
* [[Navigation_overhaul_specification#User_context|Consistent user context page layout]]&lt;br /&gt;
* [[Navigation_overhaul_specification#User_preferences_page|User preferences page]]&lt;br /&gt;
* [[Navigation_overhaul_specification#A_new_profile_page|A new profile page]]&lt;br /&gt;
* [[Navigation_overhaul_specification#My_grades|A new &amp;quot;My grades&amp;quot; page]]&lt;br /&gt;
* [[Navigation_overhaul_specification#Handling_of_course_profiles|Handling of course profiles]]&lt;br /&gt;
* [[Navigation_overhaul_specification#Navigation_block_2|Remove &amp;quot;My profile&amp;quot; node from navigation block (And remove my profile settings)]]&lt;br /&gt;
&lt;br /&gt;
Phases:&lt;br /&gt;
* Mockup&lt;br /&gt;
** Build a full clickable mockup (no code) simulating the final result of all pages affected by the work in scope for this release cycle.&lt;br /&gt;
** Promote the mockup in the forums, with Martin and others to get their early input on the changes.&lt;br /&gt;
** Iterate the mockup based on suggestions from Martin and the community&lt;br /&gt;
* Update specifications&lt;br /&gt;
** Based on the feedback from the mockup, update the Navigation overhaul specification with design changes and technical details required to begin work&lt;br /&gt;
* Implementation&lt;br /&gt;
** Create an Epic and an initial set of tasks to complete for this project. This list of tasks should include internal (complete feature) reviews within the team and performance reviews&lt;br /&gt;
** Work on the issues in the Epic until they are 100% complete&lt;br /&gt;
&lt;br /&gt;
== Outcomes improvements ==&lt;br /&gt;
&lt;br /&gt;
== More projects ==&lt;br /&gt;
More projects will be added here, but not until we are satisfied that one of the projects listed above is fully complete and we have the time/resources to work on an additional project.&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Acceptance_testing/Migrating_from_Behat_2.5_to_3.x_in_Moodle&amp;diff=64116</id>
		<title>Acceptance testing/Migrating from Behat 2.5 to 3.x in Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Acceptance_testing/Migrating_from_Behat_2.5_to_3.x_in_Moodle&amp;diff=64116"/>
		<updated>2024-04-30T15:59:31Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
&lt;br /&gt;
== Migrating from Behat 2.5 to 3.x in Moodle ==&lt;br /&gt;
&lt;br /&gt;
[http://docs.behat.org/en/v3.0/ Behat 3] brings a lot of extensibility and modularity  for the price of backward compatibility break. This guide describes several issues you might face when updating your plugin acceptance test to the latest Moodle 3.1@dev version.&lt;br /&gt;
&lt;br /&gt;
=== Config variables ===&lt;br /&gt;
====behat_profiles====&lt;br /&gt;
Most of the configuration for a behat profile can be set in $CFG-&amp;gt;behat_profiles. This configuration parameter is available since Moodle 2.9.6, Moodle 3.0.4, and Moodle 3.1.&lt;br /&gt;
&lt;br /&gt;
Here is a quick example that changes the browser from the default firefox to chrome on Linux systems (note that you have to have the [http://www.seleniumhq.org/download/ Chrome web driver installed] in your system path)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;behat_profiles = [&lt;br /&gt;
    &#039;default&#039; =&amp;gt; [&lt;br /&gt;
        &#039;browser&#039; =&amp;gt; &#039;chrome&#039;,&lt;br /&gt;
        &#039;extensions&#039; =&amp;gt; [&lt;br /&gt;
            &#039;Behat\MinkExtension&#039; =&amp;gt; [&lt;br /&gt;
                &#039;selenium2&#039; =&amp;gt; [&lt;br /&gt;
                    &#039;browser&#039; =&amp;gt; &#039;chrome&#039;,&lt;br /&gt;
                ]&lt;br /&gt;
            ]&lt;br /&gt;
        ]&lt;br /&gt;
    ]&lt;br /&gt;
];&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The settings available here include the browser name, tags, webdriver configuration, and capabilities:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;behat_profiles = array(&lt;br /&gt;
   &#039;phantomjs&#039; =&amp;gt; array(&lt;br /&gt;
       &#039;browser&#039; =&amp;gt; &#039;phantomjs&#039;,&lt;br /&gt;
       &#039;tags&#039; =&amp;gt; &#039;~@_file_upload&amp;amp;&amp;amp;~@_alert&amp;amp;&amp;amp;~@_bug_phantomjs&#039;,&lt;br /&gt;
       &#039;wd_host&#039; =&amp;gt; &#039;http://127.0.0.1:4443/wd/hub&#039;,&lt;br /&gt;
       &#039;capabilities&#039; =&amp;gt; array(&lt;br /&gt;
           &#039;platform&#039; =&amp;gt; &#039;Linux&#039;,&lt;br /&gt;
           &#039;version&#039; =&amp;gt; 2.1&lt;br /&gt;
       )&lt;br /&gt;
   )&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In certain situations more advanced configuration is required - for example specification of a proxy server to use. This configuration must be specified in $CFG-&amp;gt;behat_config.&lt;br /&gt;
Note: If a value is specified in both behat_config, and behat_profiles, the version in behat_profiles will take precedence&lt;br /&gt;
&lt;br /&gt;
==== behat_config ====&lt;br /&gt;
Structure of $CFG-&amp;gt;behat_config has been modified and you should now use&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;behat_config = array(&lt;br /&gt;
   &#039;phantomjs&#039; =&amp;gt; array(&lt;br /&gt;
      &#039;suites&#039; =&amp;gt; array (&lt;br /&gt;
          &#039;default&#039; =&amp;gt; array(&lt;br /&gt;
              &#039;filters&#039; =&amp;gt; array(&lt;br /&gt;
                 &#039;tags&#039; =&amp;gt; &#039;~@_file_upload&amp;amp;&amp;amp;~@_alert&amp;amp;&amp;amp;~@_bug_phantomjs&#039;&lt;br /&gt;
              ),&lt;br /&gt;
           ),&lt;br /&gt;
       ),&lt;br /&gt;
       &#039;extensions&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;Behat\MinkExtension&#039; =&amp;gt; array(&lt;br /&gt;
                  &#039;selenium2&#039; =&amp;gt; array(&lt;br /&gt;
                      &#039;browser&#039; =&amp;gt; &#039;phantomjs&#039;,&lt;br /&gt;
                      &#039;wd_host&#039; =&amp;gt; &amp;quot;http://127.0.0.1:4443/wd/hub&amp;quot;&lt;br /&gt;
                  )&lt;br /&gt;
              )&lt;br /&gt;
          )&lt;br /&gt;
     ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
=== Formats and outputs ===&lt;br /&gt;
html and failed outputs are not maintained by behat. We are planning to include [https://github.com/dutchiexl/BehatHtmlFormatterPlugin BehatHTMLFormatter plugin] maintained by Neal Vanmeert and write our custom failed formatter. Changes required to use formatter and outputs are&lt;br /&gt;
====Single option per formatter====&lt;br /&gt;
Multiple formats should be sent as separate options with respective output option&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
     vendor/bin/behat --config /PATH/FOR/BEHAT_DATAROOT/behatrun/behat/behat.yml --format=moodle_progress --out=/PATH/TO/SAVE/progress.txt --format=moodle_screenshot --out=/PATH/TO/SAVE/SCREENSHOT_DIR&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Terminal output is std====&lt;br /&gt;
For output to terminal use std&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
      vendor/bin/behat --config /PATH/FOR/BEHAT_DATAROOT/behatrun/behat/behat.yml --format=moodle_progress --out=std&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Formatter can be used once====&lt;br /&gt;
One formatter is supported for each run. Means if you want to output progress to file and terminal then it is not supported. You need to use 2 different formatter like moodle_progress and progress&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
      vendor/bin/behat --config /PATH/FOR/BEHAT_DATAROOT/behatrun/behat/behat.yml --format=moodle_progress --out=std --format=progress --out=/PATH/TO/SAVE/progress.txt&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Custom formatters====&lt;br /&gt;
Following custom formatter are supported&lt;br /&gt;
# &#039;&#039;&#039;moodle_progress&#039;&#039;&#039;: Prints Moodle branch information and dots for each step.&lt;br /&gt;
# &#039;&#039;&#039;moodle_list&#039;&#039;&#039;: List all scenarios.&lt;br /&gt;
# &#039;&#039;&#039;moodle_stepcount&#039;&#039;&#039;: List all features with total steps in each feature file. Used for parallel run.&lt;br /&gt;
# &#039;&#039;&#039;moodle_screenshot&#039;&#039;&#039;: Take screenshot and core dump of each step. With following options you can dump either or both.&lt;br /&gt;
## --format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;image&amp;quot;}&#039;**: will dump image only&lt;br /&gt;
## --format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html&amp;quot;}&#039;**: will dump html only.&lt;br /&gt;
## --format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html,image&amp;quot;}&#039;**: will dump both.&lt;br /&gt;
## --format-settings &#039;{&amp;quot;formats&amp;quot;: &amp;quot;html&amp;quot;, &amp;quot;dir_permissions&amp;quot;: &amp;quot;0777&amp;quot;}&#039;**&lt;br /&gt;
&lt;br /&gt;
=== Running test ===&lt;br /&gt;
====Rerun option doesn&#039;t accept filepath====&lt;br /&gt;
Rerun should be used without the filepath, as the failed scenarios are now cached by behat and rerun.&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
vendor/bin/behat --config /PATH/FOR/BEHAT_DATAROOT/behatrun/behat/behat.yml&lt;br /&gt;
exitcode=${PIPESTATUS[0]}&lt;br /&gt;
if [ &amp;quot;${exitcode}&amp;quot; -ne 0 ]; then&lt;br /&gt;
  vendor/bin/behat --config /PATH/FOR/BEHAT_DATAROOT/behatrun/behat/behat.yml --rerun&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
====Rerun for parallel run====&lt;br /&gt;
Rerun file is cached with a unique key which is generated using input arguments. As in parallel run they all are same, the rerun file gets overwritten by the last failing run. To avoid this:&lt;br /&gt;
# Add 3 profiles in your config for each run say: firefox_1, firefox_2, firefox_3 for 3 parallel runs&lt;br /&gt;
# use --profile=&amp;quot;firefox_{runprocess} --replace=&amp;quot;{runprocess}&amp;quot; options for run.php&lt;br /&gt;
::: NOTE: [https://github.com/Behat/Behat/issues/859 Behat issue] have been waiting for this to be resolved by including basepath to generate the unique key.&lt;br /&gt;
&lt;br /&gt;
====Exit code for parallel run is bitmasked====&lt;br /&gt;
Exit code is now &#039;&#039;&#039;bitmasked&#039;&#039;&#039; contains pass/fail information of each run in every bit (starting from 0th bit). Example: If you have 3 parallel runs, out of which Run 1 and 3 failed. Then exit code will be 5 (0b0101). This will help to identify which runs need to be executed again for avoiding random failures.&lt;br /&gt;
:: If you want to use specific path where failed scenarios should be saved for rerun then you can set the following config:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$CFG-&amp;gt;behat_config = array(&lt;br /&gt;
    &#039;default&#039; =&amp;gt; array(&lt;br /&gt;
        &#039;testers&#039; =&amp;gt; array(&lt;br /&gt;
            &#039;rerun_cache&#039; =&amp;gt; &#039;/home/rajesh/Desktop/rerun&#039;&lt;br /&gt;
        ),&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Failed output ===&lt;br /&gt;
&#039;&#039;&#039;Failed output is different&#039;&#039;&#039;: Failed output display step and line in file where it failed and not the scenario line number.&lt;br /&gt;
&lt;br /&gt;
=== Changes required in context file ===&lt;br /&gt;
====Custom chained steps support====&lt;br /&gt;
Chained steps are not supported by Behat 3. We have added support for custom chained step via moodle-behat-extension, but planning to depreciate this in future. To make your context backward compatible you should replace chained steps with the api calls in your context. Example the following chained steps&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$steps = array(&lt;br /&gt;
            new Given(&#039;I click on &amp;quot;&#039; . get_string(&#039;login&#039;) . &#039;&amp;quot; &amp;quot;link&amp;quot; in the &amp;quot;.logininfo&amp;quot; &amp;quot;css_element&amp;quot;&#039;),		&lt;br /&gt;
            new Given(&#039;I set the field &amp;quot;&#039; . get_string(&#039;username&#039;) . &#039;&amp;quot; to &amp;quot;&#039; . $this-&amp;gt;escape($username) . &#039;&amp;quot;&#039;),		&lt;br /&gt;
            new Given(&#039;I set the field &amp;quot;&#039; . get_string(&#039;password&#039;) . &#039;&amp;quot; to &amp;quot;&#039;. $this-&amp;gt;escape($username) . &#039;&amp;quot;&#039;),		&lt;br /&gt;
            new Given(&#039;I press &amp;quot;&#039; . get_string(&#039;login&#039;) . &#039;&amp;quot;&#039;)		&lt;br /&gt;
        );&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
can be replaced with&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
// Click on login link.&lt;br /&gt;
$this-&amp;gt;execute(&#039;behat_general::i_click_on_in_the&#039;,&lt;br /&gt;
    array(get_string(&#039;login&#039;), &#039;link&#039;, &#039;.logininfo&#039;, &#039;css_element&#039;));&lt;br /&gt;
// Enter username and password.&lt;br /&gt;
$this-&amp;gt;execute(&#039;behat_forms::i_set_the_field_to&#039;, array(&#039;Username&#039;, $this-&amp;gt;escape($username)));&lt;br /&gt;
$this-&amp;gt;execute(&#039;behat_forms::i_set_the_field_to&#039;, array(&#039;Password&#039;, $this-&amp;gt;escape($username)));&lt;br /&gt;
// Press log in button.&lt;br /&gt;
$this-&amp;gt;execute(&#039;behat_forms::press_button&#039;, get_string(&#039;login&#039;));&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====TableNode==== &lt;br /&gt;
Table Node class has changed and requires following modifications:&lt;br /&gt;
# TableNode constructor has changed, and it requires least empty array(). &lt;br /&gt;
# addRow() api is deprecated, if you are modifying rows then save that in an array and create a new TableNode()&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$rows = $options-&amp;gt;getRows();&lt;br /&gt;
$newrows = array();&lt;br /&gt;
foreach ($rows as $k =&amp;gt; $data) {&lt;br /&gt;
    $newrows[$k] = strtr($data, &amp;quot;äåö&amp;quot;, &amp;quot;aao&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
$modifiedtable = = new TableNode($newrows);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Named selectors are depreciated====&lt;br /&gt;
Named selector is deprecated, you should either use &#039;&#039;&#039;named_exact&#039;&#039;&#039; or &#039;&#039;&#039;named_partial&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$this-&amp;gt;find(&#039;named_partial&#039;, array(&#039;link&#039;, get_string(&#039;hide&#039;)), $nohideexception, $activitynode);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Behat]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=AMOS_manual&amp;diff=64115</id>
		<title>AMOS manual</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=AMOS_manual&amp;diff=64115"/>
		<updated>2024-04-30T15:57:14Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
This page is now located in the user docs: [[:en:AMOS manual|AMOS manual]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=gsoc2014_proposal_jayesh&amp;diff=64114</id>
		<title>gsoc2014 proposal jayesh</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=gsoc2014_proposal_jayesh&amp;diff=64114"/>
		<updated>2024-04-30T15:56:30Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: Note about intent to not migrate this page to moodledev.io&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Infobox Project&lt;br /&gt;
|name = New Question Type&lt;br /&gt;
|state = In Progress&lt;br /&gt;
|tracker = &lt;br /&gt;
|discussion = [https://moodle.org/mod/forum/discuss.php?d=259503 Forum Discussion]&lt;br /&gt;
|assignee = [https://moodle.org/user/view.php?id=1580475&amp;amp;course=5 Jayesh Anandani]&lt;br /&gt;
|documentation = &lt;br /&gt;
}}&lt;br /&gt;
&amp;lt;span class=&amp;quot;small-info-right&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;b&amp;gt;GSOC&amp;lt;/b&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;text-big new&amp;quot;&amp;gt; &#039;14&amp;lt;/span&amp;gt;&lt;br /&gt;
&amp;lt;/span&amp;gt;&lt;br /&gt;
==Personal Information==&lt;br /&gt;
&lt;br /&gt;
Full name: Jayesh Anandani&lt;br /&gt;
&lt;br /&gt;
Email: jayeshanandani@gmail.com&lt;br /&gt;
&lt;br /&gt;
University: U.V. Patel College of Engineering.&lt;br /&gt;
&lt;br /&gt;
Graduation Date: June 2014&lt;br /&gt;
&lt;br /&gt;
Major: Computer Engineering&lt;br /&gt;
&lt;br /&gt;
Location: Ahmedabad,Gujarat,India&lt;br /&gt;
&lt;br /&gt;
Time-zone: UTC+5.30&lt;br /&gt;
&lt;br /&gt;
IRC nick: jcool&lt;br /&gt;
&lt;br /&gt;
CV/Resume URL: http://in.linkedin.com/in/jayeshanandani&lt;br /&gt;
&lt;br /&gt;
Open Source experience: I started my open source journey with Moodle. It has been 1 year since I started to explore about open source. I continue to contribute to Moodle and currently started development with Cakephp and Drupal.&lt;br /&gt;
&lt;br /&gt;
==Project Information==&lt;br /&gt;
&lt;br /&gt;
===Project Description:===&lt;br /&gt;
&lt;br /&gt;
The project aims to create some new question types and make enhancements to the existing ones to make it more easy for Teachers to create a Question.&lt;br /&gt;
&lt;br /&gt;
====Question Types====&lt;br /&gt;
&lt;br /&gt;
1. &#039;&#039;&#039;Ordering Question Type:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The Ordering question type is based on OU&#039;s qtype_ddwtos. The thing with OU’s qtype_ddwtos is it does not grant partial marks for out of order answers. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1.) Student gets order right as per the actual answer. In this case default marks are awarded to students.&lt;br /&gt;
&lt;br /&gt;
eg: 1,2,3,4 =&amp;gt; Full marks.  &lt;br /&gt;
&lt;br /&gt;
2.) Students gets order a little different from actual answer. In this case no marks are awarded to students.&lt;br /&gt;
&lt;br /&gt;
eg:  4,1,2,3=&amp;gt;0 marks &lt;br /&gt;
&lt;br /&gt;
The Ordering question type will allow students to score partial marks even if their response is out of order.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1.) Student gets order right as per the actual answer. In this case default marks are awarded to students.&lt;br /&gt;
&lt;br /&gt;
eg: 1,2,3,4 =&amp;gt; 4 marks (Default marks set by teacher)&lt;br /&gt;
&lt;br /&gt;
2.) Students gets order a little different from actual answer. In this case partial marks are awarded to students.&lt;br /&gt;
&lt;br /&gt;
eg:  4,1,2,3=&amp;gt;3 marks (Partial marks will be deducted as per set by teacher.Partial marks are 1 in this case)&lt;br /&gt;
&lt;br /&gt;
3.) Students gets order entirely different from actual answer. In this case no marks are allocated.&lt;br /&gt;
&lt;br /&gt;
eg: 4,3,1,2=&amp;gt;2 marks (2 elements are out of order so 2*partial marks will be deducted)&lt;br /&gt;
&lt;br /&gt;
4.) Students gets order entirely different from actual answer. In this case no marks are allocated.&lt;br /&gt;
&lt;br /&gt;
eg: 4,3,2,1=&amp;gt;0 marks &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question Editing form:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create/Edit Question UI&lt;br /&gt;
&lt;br /&gt;
The image above shows question form for Ordering question type. The form provides various options for teachers.They can be listed as:&lt;br /&gt;
&lt;br /&gt;
1. A teacher can provide choices as shown in question form there by allocating default marks and partial marks separately. &lt;br /&gt;
&lt;br /&gt;
2. The order of answer will be the order in which teacher enters choices. Teacher can also select on how to display choices. Choices can be displayed either vertically or horizontally.&lt;br /&gt;
&lt;br /&gt;
3. There will be option for shuffling the answer apart from which it will include options like multiple feedback and multiple tries. &lt;br /&gt;
&lt;br /&gt;
4. The default marks will be provided to students if the order of answer matches exactly with the actual order. In case the order of answers given by student is different from actual order , then according to answer provided the partial marks will be deducted from default marks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question that user will see:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Question View&lt;br /&gt;
&lt;br /&gt;
The image above shows preview of Ordering question type. In this case students have been allocated 4 choices which they need to reroder and arrange as per Question text. The order in which boxes are rearranged is taken as order of answer and marks are awarded accordingly.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database for Question type&#039;&#039;&#039;:  Database&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. &#039;&#039;&#039;Search Question Type:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The main idea behind this question type is to highlight the words from given question.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example:&#039;&#039;&#039; Find the verb in : He ran too fast. &lt;br /&gt;
&lt;br /&gt;
Student just need to click on “ran” word and submit. The system will automatically grade the answers.&lt;br /&gt;
&lt;br /&gt;
If they accidently click on another word and want to get that word unselected, they need to press clear button which will undo their last selection. If they want everything selected to be cleared they need to click on clear all button.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question Editing form:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create/Edit Question Form&lt;br /&gt;
&lt;br /&gt;
The image above shows question form for Search question type. The form provides various options for teachers.They can be listed as:&lt;br /&gt;
&lt;br /&gt;
1. A teacher just needs to enter the question. The answers will be wrapped in delimiter that teacher selects. &lt;br /&gt;
&lt;br /&gt;
2. A teacher can select delimiter from the options provided. &lt;br /&gt;
&lt;br /&gt;
3. A teacher can also use combined feedback and multiple tries for their question if they wish too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question that user will see:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Question View&lt;br /&gt;
&lt;br /&gt;
The image above shows preview of Search Question type that students will see. They just need to click on word and the word will get highlighted. If they want to undo the last selection they can click on clear button which will undo their last selection. If they wish to undo all changes made they can click on clear all which will clear all their selections. System will automatically grade the question according to the words highlighted.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database for Question type:&#039;&#039;&#039;  Database&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. &#039;&#039;&#039;DDClassify Question Type:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This question type will help teachers to create groups in questions as per their requirement. Here students will have a set of words that they need to drag into different areas to classify them. The order in which words are dragged and dropped will of be no importance.Students responses will be processed on basis of response in each group.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question Editing form:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create/Edit Question Form&lt;br /&gt;
&lt;br /&gt;
The image shows question form for DDClassify. The teacher can add groups and provide options for same. Marks for each group can also be defined along with default marks. Default marks will be awarded if all groups are correct and group marks will be deducted from default marks if a students gets one group wrong.&lt;br /&gt;
&lt;br /&gt;
This question type will also have facility for multiple tries and combine feedback.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question that user will see:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Question view&lt;br /&gt;
&lt;br /&gt;
Image shows how question will be seen by students. Students will be shown various groups as per created by teacher. Options for all groups will be shown below. The order in which options are dragged and dropped in to each group depends upon settings made by teacher while creating the form. If student’s get all answers in all groups correct then they will be awarded with default marks or else partial marks will be deducted from default marks as per the user’s answer. Partial marks are deducted when a student has answered a group in a wrong manner. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database for Question type:&#039;&#039;&#039;  Table-1   Table-2   Table-3&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. &#039;&#039;&#039;Image Puzzle Question Type:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This question type is based on Image puzzle Question type developed by Itamar Tzadok.This question type was developed way back in 2012 and it was great work done.&lt;br /&gt;
&lt;br /&gt;
I tried and tested the same on latest versions of Moodle but it wasn&#039;t working. It wasn&#039;t able to render image that teachers insert while creating question&lt;br /&gt;
&lt;br /&gt;
I plan to make some enhancements to this question type which will include working of it on latest Moodle versions, provide missing functionalities like: Feedback settings,import export and it will have additional feature called Interactive settings. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question Editing form:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Create/Edit Question Form&lt;br /&gt;
&lt;br /&gt;
The image above shows question form for Image Puzzle question type. The form provides various options for teachers.They can be listed as:&lt;br /&gt;
&lt;br /&gt;
1. A teacher can select an image to insert,define defaults marks and hint marks.Hint marks are defined in order to deduct marks from default marks if students uses the hint provided by the teacher.&lt;br /&gt;
&lt;br /&gt;
2. A teacher can select size of the image that will be shown to students.&lt;br /&gt;
&lt;br /&gt;
3. A teacher can select into how many rows and cols must the image be divided into. There is a drop-down provided for that which provides options for Easy, Medium and Hard which will automatically break image into columns and rows. The value for this options will be fixed and cannot be altered by teachers. If he/she wish to specify number of columns and rows manually they can use the textbox to enter the value if their choice. In such case the drop down will be disabled. &lt;br /&gt;
&lt;br /&gt;
4. A teacher can also provide the facility of Interactive hints. The hints entered by teachers will be visible to students on their question screen. When the students want to use the hints they will click on button to view hints and hints set by teachers will be visible to them. &lt;br /&gt;
&lt;br /&gt;
5. A teacher can also use combined feedback and multiple tries for their question if they wish too.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question that user will see:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
1. Question View shows how question will look like when it is displayed to students.&lt;br /&gt;
&lt;br /&gt;
2.  Partial Correct Answer: If students are able to arrange some of pieces in right order then they will be awarded with partial marks.&lt;br /&gt;
&lt;br /&gt;
3. Correct Answer: If students are able to arrange all pieces in right order then they will be awarded with full marks.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database for Question type:&#039;&#039;&#039;  Database&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. &#039;&#039;&#039;DD_Marker Question Type:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This question type is based on OU&#039;s qtype_ddmarker. The thing with OU’s qtype_ddmarker is it does not fetch location for the markers placed on image automatically.In order to move the marker to a particular location teacher need to specify the location of the marker manually. &lt;br /&gt;
&lt;br /&gt;
The enhancement of this question type will allow teachers to move marker throughout the image by mouse. The type of marker the teacher selects and the position at which the marker is placed , system will automatically fetch location of that marker and fill the coordinates text box for the same. Teacher can manually edit the coordinates if they want to or they can just move around marker to get a perfect location.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Question Editing form:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The question form will remain same as it was before.It will involve code change which will help teacher to move markers with the help of mouse.&lt;br /&gt;
&lt;br /&gt;
Question that user will see:&lt;br /&gt;
&lt;br /&gt;
It resembles to the view that ddmarker renders.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Database for Question type:&#039;&#039;&#039; It will remain same.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expected Deliverables==&lt;br /&gt;
&lt;br /&gt;
Timeline (break down by every week of GSoC):&lt;br /&gt;
&lt;br /&gt;
19 May: Start working with Search Question type.&lt;br /&gt;
&lt;br /&gt;
26 May: Test the working of Search Question type and start with Ordering Question type.&lt;br /&gt;
&lt;br /&gt;
02 June: Test the working of Ordering Question type and start with DDClassify Question type.&lt;br /&gt;
&lt;br /&gt;
09 June: Test the working of DDClassify Question type.Release beta version of all 3 question types for review from Moodlers.&lt;br /&gt;
&lt;br /&gt;
16 June: Start documentation for all 3 question types,solve bugs if any and improve on question types as per suggestion from Moodlers.&lt;br /&gt;
&lt;br /&gt;
23 June: Mid term submission&lt;br /&gt;
&lt;br /&gt;
30 June: Start working on Image Puzzle question type.&lt;br /&gt;
&lt;br /&gt;
07 July:  Test the working of Image Puzzle question type and start working on modification of Drag and drop marker Question type.&lt;br /&gt;
&lt;br /&gt;
14 July: Test the working of revised Drag and drop marker Question type.Scrub the code and make sure it’s error free.&lt;br /&gt;
&lt;br /&gt;
21 July: Release the first beta version of Image Puzzle Question type and revised Drag and drop marker Question type code to get reviews from Moodlers.&lt;br /&gt;
&lt;br /&gt;
28 July: Look around for some new functionalities.&lt;br /&gt;
&lt;br /&gt;
04 Aug: Start writing documentation about the question types developed and its working.&lt;br /&gt;
&lt;br /&gt;
11 Aug: Prepare for Final submission. Review code again to make sure it follows Moodle coding standards.&lt;br /&gt;
&lt;br /&gt;
18 Aug: Final submission&lt;br /&gt;
&lt;br /&gt;
==Bugs==&lt;br /&gt;
Provided patches for: MDL-26120 , MDL-39054, MDL-39029, MDL-39155, MDL-43265, MDL-39074, MDL-39527&lt;br /&gt;
&lt;br /&gt;
Issues Created:&lt;br /&gt;
MDL-40271, MDL-39527, MDL-39716, MDL-39074, CONTRIB-4870, CONTRIB-4864&lt;br /&gt;
&lt;br /&gt;
Duplicates found:&lt;br /&gt;
&lt;br /&gt;
MDL-37478, MDL-37110, MDL-23456&lt;br /&gt;
&lt;br /&gt;
==Work/Internship experience==&lt;br /&gt;
&lt;br /&gt;
===Experience from past Google Summer of Code===&lt;br /&gt;
I was intern at Google Summer of Code 2013 under Moodle. It was my first Google Summer of Code and it was excellent one.Choosing a project (Self-Assessment activity using Question Bank) beyond my capabilities was a good choice made as I worked hard for open source, linux, and got very much used to the world of open source.If a few months back somebody asked me about open source I could only manage to reply free software with source.I knew something like it existed but nothing more than that.The world of Open Source was like a parallel universe, I knew it was there but nothing beyond that. Also I learned how to manage my code using git, and from that time onwards I used git for almost all my daily tasks. Things ended happily, as I completed my project before time and I also carried out many tests in order to ensure its quality, and also got good reviews from the community. I still actively maintain the module I developed.&lt;br /&gt;
&lt;br /&gt;
===Current Google Summer of Code===&lt;br /&gt;
I have got past experience in Moodle and it will be easy for me to develop a new project as I am familiar with coding standards of Moodle. Along with that this project requires some knowledge on how question engine and Moodle forms works. As my last year project I had used question engine and Moodle forms to develop the project, I am pretty much familiar with working of same.&lt;br /&gt;
&lt;br /&gt;
==Time per week==&lt;br /&gt;
I will be able to dedicate 60+hours a week. As my graduation is near to end I don’t have any work left. I will be free all day long and will focus only on projects. There are no other summer plans.&lt;br /&gt;
&lt;br /&gt;
==About Me==&lt;br /&gt;
I am a 4th year Computer Engineering student at U.V Patel College Of Engineering. I love to play cricket and badminton.&lt;br /&gt;
“Never give up on what you really want to do. The person with big dreams is more powerful than the one with all the facts.”&lt;br /&gt;
I program in my free time and have a fairly good understanding of C, PHP, HTML, CSS and can paddle around with Java and Python.&lt;br /&gt;
&lt;br /&gt;
==Why Moodle==&lt;br /&gt;
I always have loved the whole idea of teaching and sharing knowledge. Since I started my engineering my primary field of interest was programming and playing around with the web. &lt;br /&gt;
Moodle provides me the perfect platform to showcase my two interests through the idea &amp;quot;E-learning&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Credits ==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mentors&#039;&#039;&#039;: [https://moodle.org/user/profile.php?id=8026&amp;amp;course=5 Jean-Michel Vedrine] &amp;amp; [https://moodle.org/user/view.php?id=93821&amp;amp;course=5 Tim Hunt].&lt;br /&gt;
&lt;br /&gt;
== Forum Discussions ==&lt;br /&gt;
&lt;br /&gt;
[https://moodle.org/mod/forum/discuss.php?d=259503 Forum Discussion]&lt;br /&gt;
&lt;br /&gt;
== Daily Blog ==&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[GSOC/2014|Moodle GSoC projects for 2014]]&lt;br /&gt;
* [[GSOC|Moodle GSoC Overview page]]&lt;br /&gt;
* [https://docs.moodle.org/dev/Projects_for_new_developers#New_question_types Orignal Idea]&lt;br /&gt;
&lt;br /&gt;
[[Category:GSOC]]&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=The_OU_PMatch_algorithm&amp;diff=64106</id>
		<title>The OU PMatch algorithm</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=The_OU_PMatch_algorithm&amp;diff=64106"/>
		<updated>2024-04-19T14:47:16Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:WillNotMigrate}}&lt;br /&gt;
{{Note|The Open University&#039;s Pattern Match question type is available from [https://moodle.org/plugins/qtype_pmatch the Moodle plugins database].}}&lt;br /&gt;
&lt;br /&gt;
This is an algorithm that the OU hopes to turn into a Moodle question type.&lt;br /&gt;
&lt;br /&gt;
The code for the existing Java implementation can be seen at https://openmark.dev.java.net/source/browse/openmark/trunk/src/om/helper/PMatch.java?view=markup.&lt;br /&gt;
&lt;br /&gt;
The following attempts to be a logical description of the algorithm. That is, it describes what the result of matching an expression against a string. It does not describe the best way to determine that result efficiently. Implementing these rules in full generality is very hard to do efficiently. It is more important that common expressions can be matched efficiently against typical strings, than that complex edge cases perform well.&lt;br /&gt;
&lt;br /&gt;
A small selection of typical pmatch expressions can be seen at the end of the document, in the [[#A small selection of unit tests|section on unit test cases]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Inputs==&lt;br /&gt;
&lt;br /&gt;
The algorithm takes three inputs. Typically it takes a particular string (that is, a student&#039;s response) and matches it against a number of different pmatch expressions using a particular set of options.&lt;br /&gt;
&lt;br /&gt;
===Overall match options===&lt;br /&gt;
&lt;br /&gt;
; ignorecase : (boolean)&lt;br /&gt;
; sentencedividers : (list of char) defaults to just &#039;.&#039;&lt;br /&gt;
; worddividers : (list of char) defaults to all the characters that match \s from PCRE (http://www.php.net/manual/en/regexp.reference.escape.php).&lt;br /&gt;
; checkspellings : (boolean)&lt;br /&gt;
; extradictionarywords : (list of words) defaults to the list (i.e. ie. e.g. eg. etc.) You will note from this list that dictionary words can include sentence or word dividers, and in this case, they characters do not function as divider characters.&lt;br /&gt;
&lt;br /&gt;
===The string to match===&lt;br /&gt;
&lt;br /&gt;
A string of Unicode characters.&lt;br /&gt;
&lt;br /&gt;
===A pmatch expression===&lt;br /&gt;
&lt;br /&gt;
See below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Parsing the input string==&lt;br /&gt;
&lt;br /&gt;
1. If ignorecase is true, convert the string to lower case using a unicode-aware algorithm (textlib in Moodle).&lt;br /&gt;
&lt;br /&gt;
2. Search the string for extradictionarywords, and mark any sentencedividers and worddividers characters within those words, so they are no longer considered to be divider characters. Also mark any &#039;.&#039; characters that appear between two digits as non-dividers. They are assumed to be decimal points.&lt;br /&gt;
&lt;br /&gt;
3. The whole response is treated as a single string. Any sentencedividers are only considered in proximity checks. Following (2) the positions of sentence dividers should now be known.&lt;br /&gt;
&lt;br /&gt;
4. Trim any worddividers characters from each of those strings, and split them on runs of consecutive worddividers.&lt;br /&gt;
&lt;br /&gt;
Thus the input string has been converted to a list of lists of words.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Checking spellings==&lt;br /&gt;
&lt;br /&gt;
It is assumed we have access to some dictionary (Moodle provides aspell). Words in the parsed input string can be checked against that dictionary and the extradictionarywords from the options. Words that are in neither the dictionary nor extradictionarywords can be reported as misspelled words.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Expression syntax and meaning==&lt;br /&gt;
&lt;br /&gt;
Before evaluating a pmatch expression, all runs of consecutive white-space should be replaced by a single space. (That is preg_replace(&#039;/\s+/&#039;, &#039; &#039;, $expression);) In addition, white-space is ignored either side of the &#039;(&#039; and &#039;)&#039; of &#039;not&#039;, &#039;all&#039;, &#039;any&#039; and &#039;match*&#039;, and either side of the &#039;,&#039; in &#039;all&#039; and &#039;any&#039;.&lt;br /&gt;
&lt;br /&gt;
I describe the algorithm in a top-down way. You may prefer to read the description from the bottom up.&lt;br /&gt;
&lt;br /&gt;
A pmatch expression, when applied to a string, evaluates to a boolean. The expression can be made up from the following parts:&lt;br /&gt;
&lt;br /&gt;
===not===&lt;br /&gt;
&lt;br /&gt;
 not( &amp;lt;pmatch_expression&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
is a pmatch expression that is true if &amp;lt;pmatch_expression&amp;gt; is false, and false if &amp;lt;pmatch_expression&amp;gt; is true.&lt;br /&gt;
&lt;br /&gt;
===all===&lt;br /&gt;
&lt;br /&gt;
 all( &amp;lt;pmatch_expression1&amp;gt; , &amp;lt;pmatch_expression2&amp;gt; , ... )&lt;br /&gt;
&lt;br /&gt;
is a pmatch expression that is true if all of &amp;lt;pmatch_expression1&amp;gt; , &amp;lt;pmatch_expression2&amp;gt; and so on are true. Accepts two or more sub-expressions.&lt;br /&gt;
&lt;br /&gt;
===any===&lt;br /&gt;
&lt;br /&gt;
 any( &amp;lt;pmatch_expression1&amp;gt; , &amp;lt;pmatch_expression2&amp;gt; , ... )&lt;br /&gt;
&lt;br /&gt;
is a pmatch expression that is true if any one of &amp;lt;pmatch_expression1&amp;gt; , &amp;lt;pmatch_expression2&amp;gt; and so on are true. Accepts two or more sub-expressions.&lt;br /&gt;
&lt;br /&gt;
===match_...===&lt;br /&gt;
&lt;br /&gt;
 match_&#039;&#039;options&#039;&#039;( &amp;lt;word_sequence&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
or&lt;br /&gt;
&lt;br /&gt;
 match( &amp;lt;word_sequence&amp;gt; )&lt;br /&gt;
&lt;br /&gt;
is true if, using the specified options, the &amp;lt;word_sequence&amp;gt; matches the string. This is defined below.&lt;br /&gt;
&lt;br /&gt;
Recognised options:&lt;br /&gt;
; c : allow any number of extra characters in a word in the string.&lt;br /&gt;
; m2 : allow two misspellings of the following types when the word_with_wildcards contains 8 or more non-wildcard characters. For shorter word_with_wildcards, treat as &#039;&#039;&#039;m&#039;&#039;&#039;.&lt;br /&gt;
; m : allow any one misspelling of the following types.&lt;br /&gt;
; mx : allow one extra character in the word in the string when matching against a word_with_wildcards, providing the word_with_wildcards contains 3 or more non-wildcard characters.&lt;br /&gt;
; mf : allow one fewer character in the word in the string when matching against a word_with_wildcards, providing the word_with_wildcards contains 4 or more non-wildcard characters.&lt;br /&gt;
; mr : allow one letter in the word in the string to differ from the equivalent letter in the word_with_wildcards, providing the word_with_wildcards contains 4 or more non-wildcard characters.&lt;br /&gt;
; mt : allow two neighbouring letters in the word in the string to be transposed when matching against a word_with_wildcards, providing the word_with_wildcards contains 4 or more non-wildcard characters.&lt;br /&gt;
; o : allow the words in the string to be an any order. See the definition of the &#039; &#039; (space) joiner below.&lt;br /&gt;
; w : allow the string to contain extra words in addition to the ones matched by the expression.&lt;br /&gt;
; p0, p1, p2, p3 or p4 : set the proximity for the &#039;_&#039; joiner below. The default is 2 if no p&#039;&#039;n&#039;&#039; option is given.&lt;br /&gt;
&lt;br /&gt;
Different options can be run together in any order. For example match_omfxp2w. In the case where there are no options, the _ must be omitted.&lt;br /&gt;
&lt;br /&gt;
c cannot be used at the same time as any m option.&lt;br /&gt;
&lt;br /&gt;
==Matching word_sequences==&lt;br /&gt;
&lt;br /&gt;
This is the fundamental part of the pmatch algorithm.&lt;br /&gt;
&lt;br /&gt;
===word_sequence===&lt;br /&gt;
&lt;br /&gt;
A word_sequence comprises one or more word_alternatives separated by joiners.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;word_alternative1&amp;gt; &amp;lt;joiner1&amp;gt; &amp;lt;word_alternative2&amp;gt; &amp;lt;joiner2&amp;gt; &amp;lt;word_alternative3&amp;gt;...&lt;br /&gt;
&lt;br /&gt;
The word_sequence matches the string if each word_alternative can be made to match a different word or words in the string in such a way that satisfies the constraints imposed by the joiners. In addition, if the &#039;w&#039; match option is not given, all words in the string must be matched by one of the word_alternatives.&lt;br /&gt;
&lt;br /&gt;
There are two possible joiners:&lt;br /&gt;
&lt;br /&gt;
; &#039; &#039; : (space) Both the word_alternatives must be present in the string. If the &#039;o&#039; option is not given, then the last word matched by the first word_alternative must come before the first word matched by the second word_alternative.&lt;br /&gt;
; &#039;_&#039; : Both the word_alternatives must be present in the string. The last word matched by the first word_alternative must come before the first word matched by the second word_alternative (even if the &#039;o&#039; option is used). There must be no more than &#039;proximity&#039; other words between the last word matched by the first word_alternative and the first word matched by the second word_alternative. All the words matched by both word_alternatives must be within the same sentence.&lt;br /&gt;
&lt;br /&gt;
===word_alternative===&lt;br /&gt;
&lt;br /&gt;
A word_alternative comprises one or more word_patterns, separated by &#039;|&#039; characters.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;word_pattern1&amp;gt; &#039;|&#039; &amp;lt;word_pattern2&amp;gt; ...&lt;br /&gt;
&lt;br /&gt;
A word alternative matches a word or words in the string if any one of the word_patterns matches that set of words.&lt;br /&gt;
&lt;br /&gt;
There may be more than one way for the word_alternative to match a word or words the string. All possible matches must be considered when trying to find a way to make a word_sequence match a string.&lt;br /&gt;
&lt;br /&gt;
===word_pattern===&lt;br /&gt;
&lt;br /&gt;
A word pattern is either a&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;word_with_wildcards&amp;gt;&lt;br /&gt;
&lt;br /&gt;
or a&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;bracket_expression&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===bracket_expression===&lt;br /&gt;
&lt;br /&gt;
A bracket expression two or more simple_alternatives separated by joiners enclosed in square brackets.&lt;br /&gt;
&lt;br /&gt;
 &#039;[&#039; &amp;lt;simple_alternative1&amp;gt; &amp;lt;joiner1&amp;gt; &amp;lt;simple_alternative2&amp;gt; ... &#039;]&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A bracket_expression matches a set of words in the string, providing each simple_alternative matches a different word in the string. The joiners mean the same as in a word_sequence with two exceptions:&lt;br /&gt;
# we are now joining simple_alternatives rather than word_alternatives, and&lt;br /&gt;
# If there is a &#039;_&#039; joiner before or after the word_alternative of which this bracket_expression is a part, then the &#039; &#039; joiner must match the simple_alternatives in order. That is, the &#039;o&#039; option is disabled within bracket_expressions when they are part of a proximity match.&lt;br /&gt;
&lt;br /&gt;
===simple_alternative===&lt;br /&gt;
&lt;br /&gt;
A simple alternative is one or more word_with_wildcards separated by &#039;|&#039; characters.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;word_with_wildcards1&amp;gt; &#039;|&#039; &amp;lt;word_with_wildcards2&amp;gt; ...&lt;br /&gt;
&lt;br /&gt;
A simple_alternative matches a particular word in the string providing one or more of the word_with_wildcards do.&lt;br /&gt;
&lt;br /&gt;
===word_with_wildcards===&lt;br /&gt;
&lt;br /&gt;
This is a sequence of ordinary characters with * and ? wildcards. * stands for any string of zero or more characters. ? stands for any single character.&lt;br /&gt;
&lt;br /&gt;
If the ignorecase option is true, then all the characters in the word_with_wildcards are converted to lower case when the expression is parsed (using a Unicode-safe conversion function like Moodle&#039;s textlib).&lt;br /&gt;
&lt;br /&gt;
Characters that have a special meaning in pmatch (&#039;(&#039;, &#039;)&#039;, &#039; &#039;, &#039;_&#039;, &#039;|&#039;, &#039;[&#039;, &#039;]&#039;, &#039;?&#039;, &#039;*&#039; and &#039;\&#039;) can be matched as literal characters by escaping them with a \ in the word_with_wildcards.&lt;br /&gt;
&lt;br /&gt;
A word_with_wildcards matches a word in the string providing there is some transformation of the word in the string according to the permitted m and c options that makes the word match the pattern.&lt;br /&gt;
&lt;br /&gt;
One word_with_wildcards may match any number of words in the string. All possible matches must be considered.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Suggested PHP API==&lt;br /&gt;
&lt;br /&gt;
This seems like a natural design to me, based on the typical usage of testing one string against several expressions.&lt;br /&gt;
&lt;br /&gt;
Note the methods for validating expressions that the teacher types into the editing form when creating questions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Options that control the overall way the matching is done.&lt;br /&gt;
 */&lt;br /&gt;
class pmatch_options {&lt;br /&gt;
    /** @var boolean */&lt;br /&gt;
    public $ignorecase;&lt;br /&gt;
&lt;br /&gt;
    /** @var string of sentence divider characters. */&lt;br /&gt;
    public $sentencedividers = &#039;.&#039;;&lt;br /&gt;
&lt;br /&gt;
    /** @var string of word diveder characters. */&lt;br /&gt;
    public $worddividers = &amp;quot; \f\n\r\t&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @var array of words to recognise. These words may include sentence or&lt;br /&gt;
     * word divider characters.&lt;br /&gt;
     */&lt;br /&gt;
    public $extradictionarywords = array(&#039;e.g.&#039;, &#039;eg.&#039;, &#039;etc.&#039;, &#039;i.e.&#039;, &#039;ie.&#039;);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Represents a string that is ready for matching, and provides the method to&lt;br /&gt;
 * match expressions against it.&lt;br /&gt;
 */&lt;br /&gt;
class pmatch_parsed_string {&lt;br /&gt;
    /**&lt;br /&gt;
     * Constructor.&lt;br /&gt;
     * @param string $string the string to match against.&lt;br /&gt;
     * @param pmatch_options $options the options to use.&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct($string, pmatch_options $options);&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Test this string with a given pmatch expression.&lt;br /&gt;
     * @param pmatch_expression $expression the expression to use.&lt;br /&gt;
     * @return boolean whether this string matches the expression.&lt;br /&gt;
     */&lt;br /&gt;
    public function matches(pmatch_expression $expression);&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return boolean returns true if any word is misspelt.&lt;br /&gt;
     */&lt;br /&gt;
    public function is_spelt_correctly();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return array all the distinct misspelt words.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_spelling_errors();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return pmatch_options the options that were used to construct this object.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_options();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Represents a pmatch_expression.&lt;br /&gt;
 */&lt;br /&gt;
class pmatch_expression {&lt;br /&gt;
    /**&lt;br /&gt;
     * &lt;br /&gt;
     * @param string $string the string to match against.&lt;br /&gt;
     * @param pmatch_options $options the options to use.&lt;br /&gt;
     */&lt;br /&gt;
    public function __construct($string, pmatch_options $options);&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return boolean returns false if the string passed to the constructor&lt;br /&gt;
     * could not be parsed as a valid pmatch expression.&lt;br /&gt;
     */&lt;br /&gt;
    public function is_valid();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return string description of the syntax error in the expression string&lt;br /&gt;
     * if is_valid returned false. Otherwise returns an empty string.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_parse_error();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return pmatch_options the options that were used to construct this object.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_options();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return string the expression, exactly as it was passed to the constructor.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_original_expression_string();&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * @return string a nicely formatted version of the expression.&lt;br /&gt;
     */&lt;br /&gt;
    public function get_formatted_expression_string();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Simple usage example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
$matchoptions = new pmatch_options();&lt;br /&gt;
$string = new pmatch_parsed_string(&#039;Oil is lighter&#039;, $matchoptions);&lt;br /&gt;
if (!$string-&amp;gt;is_spelt_correctly()) {&lt;br /&gt;
    // Do something.&lt;br /&gt;
}&lt;br /&gt;
$expression = new pmatch_expression(&#039;&lt;br /&gt;
    all(&lt;br /&gt;
        any(&lt;br /&gt;
            match_mw(great*|high|higher|more|bigger|heavier|heavy dens*|[specific gravity]|sg than_water),&lt;br /&gt;
            match_mw(dens*|[specific gravity]|sg great*|high|higher|more|bigger|heavier|heavy than_water),&lt;br /&gt;
            match_mw(dens* water &amp;lt; dens* oil),&lt;br /&gt;
        ),&lt;br /&gt;
        not(match_w(than_oil))&lt;br /&gt;
    )&lt;br /&gt;
&#039;, $matchoptions);&lt;br /&gt;
if (!$expression-&amp;gt;is_valid()) {&lt;br /&gt;
    // Do something.&lt;br /&gt;
}&lt;br /&gt;
$matches = $string-&amp;gt;matches($expression);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==A small selection of unit tests==&lt;br /&gt;
&lt;br /&gt;
These should serve to clarify the some of the rules above. They assume the suggested API above.&lt;br /&gt;
&lt;br /&gt;
Note that these are a tiny subset of all the tests I would write if I had to implement this algorithm.&lt;br /&gt;
&lt;br /&gt;
Also note that there are far too many tests here that assert true, without corresponding tests that are similar but assert false.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
class pmatch_test {&lt;br /&gt;
    protected function match($string, $expression, $options = null) {&lt;br /&gt;
        if (is_null($options)) {&lt;br /&gt;
            $options = new pmatch_options();&lt;br /&gt;
        }&lt;br /&gt;
        $string = new pmatch_parsed_string($string, $options);&lt;br /&gt;
        $expression = new pmatch_expression($expression, $options);&lt;br /&gt;
        return $string-&amp;gt;matches($expression);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function test_pmatch() {&lt;br /&gt;
        // Tests from the original pmatch documentation.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom dick harry&#039;, &#039;match(tom dick harry)&#039;); // This is the exact match.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;thomas&#039;, &#039;match_c(tom)&#039;); // Extra characters are allowed anywhere within the word.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom dick and harry&#039;, &#039;match_w(dick)&#039;); // Extra words are allowed anywhere within the sentence.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;harry dick tom&#039;, &#039;match_o(tom dick harry)&#039;); // Any order of words is allowed.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;rick&#039;, &#039;match_m(dick)&#039;); // One character in the word can differ.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;rick and harry and tom&#039;, &#039;match_mow(tom dick harry)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;dick and harry and thomas&#039;, &#039;match_cow(tom dick harry)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;arthur harry and sid&#039;, &#039;match_mow(tom|dick|harry)&#039;); // Any of tom or dick or harry will be matched.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tomy harry and sid&#039;, &#039;match_mow(tom|dick harry|sid)&#039;); // The pattern requires either tom or dick AND harry or sid.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom was mesmerised by maud&#039;, &#039;match_mow([tom maud]|[sid jane])&#039;); // The pattern requires either (tom and maud) or (sid and jane).&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;rick&#039;, &#039;match(?ick)&#039;); // The first character can be anything.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;harold&#039;, &#039;match(har*)&#039;); // Any sequence of characters can follow &#039;har&#039;.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom married maud sid married jane&#039;, &#039;match_mow(tom_maud)&#039;); // Only one word is between tom and maud.&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;maud married tom sid married jane&#039;, &#039;match_mow(tom_maud)&#039;); // The proximity control also specifies word order and over-rides the &#039;o&#039; matching option.&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tom married maud sid married jane&#039;, &#039;match_mow(tom_jane)&#039;); // Only two words are allowed between tom and jane.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom married maud&#039;, &#039;match_mow(tom|thomas marr&amp;amp; maud)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;maud marries thomas&#039;, &#039;match_mow(tom|thomas marr&amp;amp; maud)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tom is to marry maud&#039;, &#039;match_mow(tom|thomas marr&amp;amp; maud)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tempratur&#039;, &#039;match_m2ow(temperature)&#039;); // Two characters are missing.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;temporatur&#039;, &#039;match_m2ow(temperature)&#039;); // Two characters are incorrect; one has been replaced and one is missing.&lt;br /&gt;
&lt;br /&gt;
        // These tests come from questions Tim had to ask Phil when writing this specification.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;cat toad frog&#039;, &#039;match(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;cat newt frog&#039;, &#039;match(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;cat dog&#039;, &#039;match(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;cat dog&#039;, &#039;match(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;x cat x x toad frog x&#039;, &#039;match_w(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;x cat newt x x x x x frog x&#039;, &#039;match_w(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;x cat x x dog x&#039;, &#039;match_w(cat_[toad|newt frog]|dog)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;A C B D&#039;, &#039;match([A B]_[C D])&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;B C A D&#039;, &#039;match_o([A B]_[C D])&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;A x x x x B C D&#039;, &#039;match_ow([A B]_[C D])&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;B x x x x A C D&#039;, &#039;match_ow([A B]_[C D])&#039;); // _ requires the words in [] to match in order.&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;A B C&#039;, &#039;match_ow([A B]_[B C])&#039;);&lt;br /&gt;
&lt;br /&gt;
        // Tests of the misspelling rules.&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;test&#039;, &#039;match(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tes&#039;, &#039;match(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;testt&#039;, &#039;match(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tent&#039;, &#039;match(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tets&#039;, &#039;match(test)&#039;);&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;test&#039;, &#039;match_mf(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertTrue(&#039;tes&#039;, &#039;match_mf(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;testt&#039;, &#039;match_mf(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tent&#039;, &#039;match_mf(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;tets&#039;, &#039;match_mf(test)&#039;);&lt;br /&gt;
        $this-&amp;gt;assertFalse(&#039;te&#039;, &#039;match_mf(tes)&#039;);&lt;br /&gt;
&lt;br /&gt;
        // and so on.&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=TinyMCE&amp;diff=64105</id>
		<title>TinyMCE</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=TinyMCE&amp;diff=64105"/>
		<updated>2024-04-19T14:46:19Z</updated>

		<summary type="html">&lt;p&gt;Andrewnicols: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:obsolete}}&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
&lt;br /&gt;
TinyMCE  is an opensource javascript text editor from Moxiecode released under the LGPL licence. TinyMCE &#039;&#039;was&#039;&#039; the default text editor from Moodle 2.0 to Moodle 2.6.&lt;br /&gt;
From Moodle 2.7 onwards, it is replaced by [[Atto]]. In previous Moodle versions, it maybe used a replacement for the [[HTML editor]].&lt;br /&gt;
&lt;br /&gt;
==TinyMCE spell check==&lt;br /&gt;
TinyMCE has Google Spell (default), Pspell or PSpellShell as its spell checking engines. The engine can be changed for a Moodle site in &#039;&#039;Site administration &amp;gt; Plugins &amp;gt; Text editors&amp;gt; TinyMCE or via Text editors&amp;gt; Manage and the settings link.&lt;br /&gt;
&lt;br /&gt;
== Tips and Tricks ==&lt;br /&gt;
&lt;br /&gt;
=== Use as a plugin ===&lt;br /&gt;
In pre 2.0 Moodles, some plugins are Moodle-specific and need to be maintained separately. &lt;br /&gt;
&lt;br /&gt;
*Tip: TinyMCE plugins code should be compressed using a [http://javascriptcompressor.com java script compressor].&lt;br /&gt;
&lt;br /&gt;
===Generate PDF files from HTML toolbar===&lt;br /&gt;
Creates an icon for PDF files.&lt;br /&gt;
*[http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=1627  Generate PDF files from HTML] is a Modules and plugins database page for downloads and more information.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [http://www.youtube.com/watch?v=xJE6UhqnyjU HTML editor in Moodle 2.0 video]&lt;br /&gt;
*[http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=1119 Integration: TinyMCE integration]  in the Modules and plugins database for pre 2.0 sites&lt;br /&gt;
*[http://tinymce.moxiecode.com/ tinyMCE homepage]&lt;br /&gt;
*[http://moodle.org/mod/forum/discuss.php?d=107550 Moodle 1.9 + TinyMCE - clean port]&lt;br /&gt;
&lt;br /&gt;
[[Category:HTML editor]]&lt;/div&gt;</summary>
		<author><name>Andrewnicols</name></author>
	</entry>
</feed>