<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/404/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mike1989</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/404/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Mike1989"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/Special:Contributions/Mike1989"/>
	<updated>2026-05-10T14:51:36Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57080</id>
		<title>MRBS block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57080"/>
		<updated>2009-06-02T14:32:09Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* Installation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MRBS Block==&lt;br /&gt;
&lt;br /&gt;
The MRBS block integrates the MRBS project (http://sourceforge.net/projects/mrbs/) by using Moodle functions to authenticate. While initially designed to work with Moodle 1.6 as a single sign on integration, later work made the MRBS project a contributed Moodle block. &lt;br /&gt;
&lt;br /&gt;
Stephen Bourget was kind enough to work on some changes to prepare the MRBS block to take advantage of roles and for use with Moodle 1.7 and beyond. Furthermore, a recently discovered SQL injection vulnerability in the MRBS application was patched. As a result, the MRBS integration/block is no longer supported or maintained for versions prior to Moodle 1.7.&lt;br /&gt;
&lt;br /&gt;
As with any customization, it is recommended that you have a good backup of your Moodle site before attempting to install contributed code. While those contributing code make every effort to provide the best code that they can, using contributed code nevertheless entails a certain degree of risk as contributed code is not as carefully reviewed and/or tested as the Moodle core code.   &lt;br /&gt;
&lt;br /&gt;
MRBS is useful for scheduling a variety of resources.  More information about MRBS can be obtained at http://mrbs.sourceforge.net/. As distributed here it is setup for periods; however, this can easily be changed to times by modifying the config.inc.php file.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
* Code - Copy the files into your Moodle blocks folder ($CFG-&amp;gt;dirroot/blocks)&lt;br /&gt;
* Database - Login in as a Moodle Administrator and go to the Administration notifications page to create the MRBS tables&lt;br /&gt;
* Capabilities - The MRBS block is primarily intended for use on the Moodle front page. Privileges to use the scheduler are currently based on three custom defined capabilities: &lt;br /&gt;
&lt;br /&gt;
# block/mrbs:administermrbs&lt;br /&gt;
# block/mrbs:editmrbs&lt;br /&gt;
# block/mrbs:viewmrbs &lt;br /&gt;
&lt;br /&gt;
** While these capabilities are created automatically, the system roles are not. As such, it is recommended that you create three system wide roles by:&lt;br /&gt;
&lt;br /&gt;
# Login as the Site administrator&lt;br /&gt;
# Go to the Site Administration block&lt;br /&gt;
# Click on Users -&amp;gt; Permissions -&amp;gt; Define Roles&lt;br /&gt;
# Click on the &#039;Add a new role&#039; pushbutton&lt;br /&gt;
# Fill in the Name, Short name, and description fields with MRBS Administrator, MRBS Scheduler, or MRBS Viewer depending on the role you are creating. &lt;br /&gt;
# Under Permissions set the capability to allow for the respective role (i.e. block/mrbs:administermrbs for the MRBS Administrator role, block/mrbs:editmrbs for the MRBS Scheduler role, and block/mrbs:viewmrbs for the MRBS Viewer role). &lt;br /&gt;
# Scroll down to the bottom and click on the &#039;Add a new role&#039; (or &#039;Save changes&#039; if editing the role) pushbutton. &lt;br /&gt;
# Once the roles are created, go to Site Administration block, click on Frontpage -&amp;gt; Frontpage roles and assign users to the appropriate/desired roles. &lt;br /&gt;
&lt;br /&gt;
** Typically, teachers get assigned as MRBS Schedulers and students as MRBS Viewers. Keep in mind that no assignment is equivalent to MRBS Viewers. Site administrators have the option of making the MRBS Calendar viewable to guests and non-logged in users. To force users to login in order to view the MRBS Calendar:&lt;br /&gt;
# Login as the site administrator&lt;br /&gt;
# Go to the Site Administration block under Security -&amp;gt; Site Policies &lt;br /&gt;
# Enable the &#039;Force users to login&#039; setting&lt;br /&gt;
&lt;br /&gt;
===Suggested configuration rules===&lt;br /&gt;
Not following these suggestions will not totally break mrbs, but will prevent some features working optimally.&lt;br /&gt;
&lt;br /&gt;
* Where bookings are for courses, the booking name should match the shortname of the course&lt;br /&gt;
* Rooms should be described such that:&lt;br /&gt;
** All teaching rooms include the word &#039;teaching&#039; in their description&lt;br /&gt;
** IT teaching rooms should have &#039;Teaching IT&#039; in their description&lt;br /&gt;
** Teaching rooms that are not suitable for general teaching (i.e. tech workshops) should have &#039;special&#039; in their names.&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
&lt;br /&gt;
Thanks to the generosity of translators, the MRBS Block is available in:&lt;br /&gt;
*English (en_utf8)&lt;br /&gt;
*Spanish (es_utf8)&lt;br /&gt;
*German (de_utf8) &lt;br /&gt;
** Installation instructions in German are available at: https://docs.moodle.org/de/blocks/mrbs#.C3.84ndern_der_MRBS_Texte&lt;br /&gt;
&lt;br /&gt;
If you would like to supply translations for other languages, please create an issue in the tracker and attach a zip file of the language files.&lt;br /&gt;
&lt;br /&gt;
===Extra Moodle MRBS Features===&lt;br /&gt;
* [[MRBS_block/import|Import timetable]]&lt;br /&gt;
* [[MRBS_block/forcebook|Force booking]]&lt;br /&gt;
* [[MRBS_block/usertt|User timetables]]&lt;br /&gt;
&lt;br /&gt;
===Contributor/Maintainer===&lt;br /&gt;
The MRBS Block was contributed and is maintained by Anthony Borrow.&lt;br /&gt;
More information about the MRBS Block is available at: http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=734&lt;br /&gt;
&lt;br /&gt;
Mike Worth has done significant work on new features for the MRBS block, and has taken on the role of co-maintainer. More details about these new features are available at: http://moodle.org/mod/forum/discuss.php?d=121753&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block/usertt&amp;diff=57077</id>
		<title>MRBS block/usertt</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block/usertt&amp;diff=57077"/>
		<updated>2009-06-02T14:21:00Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: This feature allows users to view a personal timetable.  == How do I get to it?== As standard, there are no links to this page; the idea is that you create  a &amp;#039;My Timetable&amp;#039; link on one of...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This feature allows users to view a personal timetable.&lt;br /&gt;
&lt;br /&gt;
== How do I get to it?==&lt;br /&gt;
As standard, there are no links to this page; the idea is that you create  a &#039;My Timetable&#039; link on one of your own menus (probably either in a theme or html block, but can be anywhere). &lt;br /&gt;
&lt;br /&gt;
* A link pointing to [yourmoodle]/blocks/mrbs/web/userweek.php will give any user their own timetable.&lt;br /&gt;
* [yourmoodle]/blocks/mrbs/web/userweek.php?user=[userid] (where userid is the users id(not idnumber)) will link directly to another users timetable. Only users with the block/mrbs/viewalltt capability are permitted to view other users&#039; timetables.&lt;br /&gt;
&lt;br /&gt;
== Which bookings are displayed? ==&lt;br /&gt;
There are two classes of bookings that are displayed on this page:&lt;br /&gt;
# Bookings that belong to the user&lt;br /&gt;
# Bookings which correspond to moodle courses (via the shortname) which the user is enrolled on as a student.&lt;br /&gt;
&lt;br /&gt;
The second of these sounds a bit complicated, but as long as your booking names match up to your course shortnames then it will all work.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57076</id>
		<title>MRBS block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57076"/>
		<updated>2009-06-02T14:11:34Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* Extra Moodle MRBS Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MRBS Block==&lt;br /&gt;
&lt;br /&gt;
The MRBS block integrates the MRBS project (http://sourceforge.net/projects/mrbs/) by using Moodle functions to authenticate. While initially designed to work with Moodle 1.6 as a single sign on integration, later work made the MRBS project a contributed Moodle block. &lt;br /&gt;
&lt;br /&gt;
Stephen Bourget was kind enough to work on some changes to prepare the MRBS block to take advantage of roles and for use with Moodle 1.7 and beyond. Furthermore, a recently discovered SQL injection vulnerability in the MRBS application was patched. As a result, the MRBS integration/block is no longer supported or maintained for versions prior to Moodle 1.7.&lt;br /&gt;
&lt;br /&gt;
As with any customization, it is recommended that you have a good backup of your Moodle site before attempting to install contributed code. While those contributing code make every effort to provide the best code that they can, using contributed code nevertheless entails a certain degree of risk as contributed code is not as carefully reviewed and/or tested as the Moodle core code.   &lt;br /&gt;
&lt;br /&gt;
MRBS is useful for scheduling a variety of resources.  More information about MRBS can be obtained at http://mrbs.sourceforge.net/. As distributed here it is setup for periods; however, this can easily be changed to times by modifying the config.inc.php file.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
* Code - Copy the files into your Moodle blocks folder ($CFG-&amp;gt;dirroot/blocks)&lt;br /&gt;
* Database - Login in as a Moodle Administrator and go to the Administration notifications page to create the MRBS tables&lt;br /&gt;
* Capabilities - The MRBS block is primarily intended for use on the Moodle front page. Privileges to use the scheduler are currently based on three custom defined capabilities: &lt;br /&gt;
&lt;br /&gt;
# block/mrbs:administermrbs&lt;br /&gt;
# block/mrbs:editmrbs&lt;br /&gt;
# block/mrbs:viewmrbs &lt;br /&gt;
&lt;br /&gt;
** While these capabilities are created automatically, the system roles are not. As such, it is recommended that you create three system wide roles by:&lt;br /&gt;
&lt;br /&gt;
# Login as the Site administrator&lt;br /&gt;
# Go to the Site Administration block&lt;br /&gt;
# Click on Users -&amp;gt; Permissions -&amp;gt; Define Roles&lt;br /&gt;
# Click on the &#039;Add a new role&#039; pushbutton&lt;br /&gt;
# Fill in the Name, Short name, and description fields with MRBS Administrator, MRBS Scheduler, or MRBS Viewer depending on the role you are creating. &lt;br /&gt;
# Under Permissions set the capability to allow for the respective role (i.e. block/mrbs:administermrbs for the MRBS Administrator role, block/mrbs:editmrbs for the MRBS Scheduler role, and block/mrbs:viewmrbs for the MRBS Viewer role). &lt;br /&gt;
# Scroll down to the bottom and click on the &#039;Add a new role&#039; (or &#039;Save changes&#039; if editing the role) pushbutton. &lt;br /&gt;
# Once the roles are created, go to Site Administration block, click on Frontpage -&amp;gt; Frontpage roles and assign users to the appropriate/desired roles. &lt;br /&gt;
&lt;br /&gt;
** Typically, teachers get assigned as MRBS Schedulers and students as MRBS Viewers. Keep in mind that no assignment is equivalent to MRBS Viewers. Site administrators have the option of making the MRBS Calendar viewable to guests and non-logged in users. To force users to login in order to view the MRBS Calendar:&lt;br /&gt;
# Login as the site administrator&lt;br /&gt;
# Go to the Site Administration block under Security -&amp;gt; Site Policies &lt;br /&gt;
# Enable the &#039;Force users to login&#039; setting&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
&lt;br /&gt;
Thanks to the generosity of translators, the MRBS Block is available in:&lt;br /&gt;
*English (en_utf8)&lt;br /&gt;
*Spanish (es_utf8)&lt;br /&gt;
*German (de_utf8) &lt;br /&gt;
** Installation instructions in German are available at: https://docs.moodle.org/de/blocks/mrbs#.C3.84ndern_der_MRBS_Texte&lt;br /&gt;
&lt;br /&gt;
If you would like to supply translations for other languages, please create an issue in the tracker and attach a zip file of the language files.&lt;br /&gt;
&lt;br /&gt;
===Extra Moodle MRBS Features===&lt;br /&gt;
* [[MRBS_block/import|Import timetable]]&lt;br /&gt;
* [[MRBS_block/forcebook|Force booking]]&lt;br /&gt;
* [[MRBS_block/usertt|User timetables]]&lt;br /&gt;
&lt;br /&gt;
===Contributor/Maintainer===&lt;br /&gt;
The MRBS Block was contributed and is maintained by Anthony Borrow.&lt;br /&gt;
More information about the MRBS Block is available at: http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=734&lt;br /&gt;
&lt;br /&gt;
Mike Worth has done significant work on new features for the MRBS block, and has taken on the role of co-maintainer. More details about these new features are available at: http://moodle.org/mod/forum/discuss.php?d=121753&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block/import&amp;diff=57074</id>
		<title>MRBS block/import</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block/import&amp;diff=57074"/>
		<updated>2009-06-02T13:33:22Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This feature works in a similar way to flatfile enrolement; it is enabled by configuring a file location in the module settings. Once there is a location set, that location will be checked every time cron runs and if a file is found it will be processed.&lt;br /&gt;
&lt;br /&gt;
All existing imported bookings will be deleted from the database before the new import is processed- this is done so that a timetable can be imported regularly, ensuring that mrbs is kept up to date. Any imported bookings that have been edited will not be deleted and will not be re-imported, however any deleted bookings will be re-imported.&lt;br /&gt;
&lt;br /&gt;
The file should be a csv file, without a header row, containing the following fields:&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Start time&lt;br /&gt;
!End time&lt;br /&gt;
!Date of first session&lt;br /&gt;
!Weekpattern&lt;br /&gt;
!Room name&lt;br /&gt;
!Username&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|hh:mm format, if periods are used then see the section below&lt;br /&gt;
|hh:mm format, if periods are used then see the section below&lt;br /&gt;
|YYYY/MM/DD format&lt;br /&gt;
|This field enables a session to be repeated weekly, missing out weeks for holidays etc. To make a single booking just put 1 in this field, otherwise enter a string of 1s and spaces (each 1 representing a booking, each space representing a week without a booking). This string can be as long as required.&lt;br /&gt;
|must be the same as that held in the mrbs_room table&lt;br /&gt;
|this field is used to link the booking to a moodle user. It is not case sensitive and will not cause an error if no matching user is found (however if this is the case then only mrbs admins will be able to edit the booking)&lt;br /&gt;
|the name for the booking to have. If you want to take advantage of some other features then you should set this to the shortname of the course the booking is for (if there is a moodle course for it)&lt;br /&gt;
|a description for the booking&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Times when periods are enabled====&lt;br /&gt;
MRBS stores period times as minutes past midnight, 00:00 is the time period1 starts, 00:01 is the time period1 ends and period 2 starts etc.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block/forcebook&amp;diff=57073</id>
		<title>MRBS block/forcebook</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block/forcebook&amp;diff=57073"/>
		<updated>2009-06-02T13:13:51Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: The block/mrbs:forcebook capability empowers certain users to book rooms even if they are already occupied. Any bookings currently in those rooms are automatically moved to the most suitab...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The block/mrbs:forcebook capability empowers certain users to book rooms even if they are already occupied. Any bookings currently in those rooms are automatically moved to the most suitable empty room.&lt;br /&gt;
&lt;br /&gt;
The force book checkbox can be selected any time a booking is made/edited (assuming correct permissions); it will override the &#039;only allow choice of free rooms&#039; feature and will reload the complete rooms list so that an occupied room can be selected. When such a booking is made, the booking will be moved according to the criteria listed below. The users who own the bookings will be notified via email about the movement of their booking. If there are any errors with moving the booking (e.g. there are no suitable rooms available) then an error is displayed and an email is sent to the mrbs admin.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Room Selection Criteria ==&lt;br /&gt;
&lt;br /&gt;
* Only rooms with &#039;teaching&#039; in their description will be considered&lt;br /&gt;
* If the booking name matches a course shortname, only rooms with enough capacity for all the students will be considered&lt;br /&gt;
* Rooms with &#039;special&#039; in the description will only be considered if they are within the same area&lt;br /&gt;
* Only rooms that are not occupied at the relevant time will be considered&lt;br /&gt;
&lt;br /&gt;
Of these rooms, the most order of preference is:&lt;br /&gt;
# Rooms with matching descriptions and in the same area&lt;br /&gt;
# Rooms with matching descriptions&lt;br /&gt;
# Rooms in the same area&lt;br /&gt;
# Any other rooms&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block/import&amp;diff=57072</id>
		<title>MRBS block/import</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block/import&amp;diff=57072"/>
		<updated>2009-06-02T12:56:25Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: This feature works in a similar way to flatfile enrolement; it is enabled by configuring a file location in the module settings. Once there is a location set, that location will be checked...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This feature works in a similar way to flatfile enrolement; it is enabled by configuring a file location in the module settings. Once there is a location set, that location will be checked every time cron runs and if a file is found it will be processed.&lt;br /&gt;
&lt;br /&gt;
The file should be a csv file, without a header row, containing the following fields:&lt;br /&gt;
{| class=&amp;quot;nicetable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Start time&lt;br /&gt;
!End time&lt;br /&gt;
!Date of first session&lt;br /&gt;
!Weekpattern&lt;br /&gt;
!Room name&lt;br /&gt;
!Username&lt;br /&gt;
!Name&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|hh:mm format, if periods are used then see the section below&lt;br /&gt;
|hh:mm format, if periods are used then see the section below&lt;br /&gt;
|YYYY/MM/DD format&lt;br /&gt;
|This field enables a session to be repeated weekly, missing out weeks for holidays etc. To make a single booking just put 1 in this field, otherwise enter a string of 1s and spaces (each 1 representing a booking, each space representing a week without a booking). This string can be as long as required.&lt;br /&gt;
|must be the same as that held in the mrbs_room table&lt;br /&gt;
|this field is used to link the booking to a moodle user. It is not case sensitive and will not cause an error if no matching user is found (however if this is the case then only mrbs admins will be able to edit the booking)&lt;br /&gt;
|the name for the booking to have. If you want to take advantage of some other features then you should set this to the shortname of the course the booking is for (if there is a moodle course for it)&lt;br /&gt;
|a description for the booking&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====Times when periods are enabled====&lt;br /&gt;
MRBS stores period times as minutes past midnight, 00:00 is the time period1 starts, 00:01 is the time period1 ends and period 2 starts etc.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57052</id>
		<title>MRBS block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=57052"/>
		<updated>2009-06-02T11:36:08Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: Adding docs for my new features&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MRBS Block==&lt;br /&gt;
&lt;br /&gt;
The MRBS block integrates the MRBS project (http://sourceforge.net/projects/mrbs/) by using Moodle functions to authenticate. While initially designed to work with Moodle 1.6 as a single sign on integration, later work made the MRBS project a contributed Moodle block. &lt;br /&gt;
&lt;br /&gt;
Stephen Bourget was kind enough to work on some changes to prepare the MRBS block to take advantage of roles and for use with Moodle 1.7 and beyond. Furthermore, a recently discovered SQL injection vulnerability in the MRBS application was patched. As a result, the MRBS integration/block is no longer supported or maintained for versions prior to Moodle 1.7.&lt;br /&gt;
&lt;br /&gt;
As with any customization, it is recommended that you have a good backup of your Moodle site before attempting to install contributed code. While those contributing code make every effort to provide the best code that they can, using contributed code nevertheless entails a certain degree of risk as contributed code is not as carefully reviewed and/or tested as the Moodle core code.   &lt;br /&gt;
&lt;br /&gt;
MRBS is useful for scheduling a variety of resources.  More information about MRBS can be obtained at http://mrbs.sourceforge.net/. As distributed here it is setup for periods; however, this can easily be changed to times by modifying the config.inc.php file.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
* Code - Copy the files into your Moodle blocks folder ($CFG-&amp;gt;dirroot/blocks)&lt;br /&gt;
* Database - Login in as a Moodle Administrator and go to the Administration notifications page to create the MRBS tables&lt;br /&gt;
* Capabilities - The MRBS block is primarily intended for use on the Moodle front page. Privileges to use the scheduler are currently based on three custom defined capabilities: &lt;br /&gt;
&lt;br /&gt;
# block/mrbs:administermrbs&lt;br /&gt;
# block/mrbs:editmrbs&lt;br /&gt;
# block/mrbs:viewmrbs &lt;br /&gt;
&lt;br /&gt;
** While these capabilities are created automatically, the system roles are not. As such, it is recommended that you create three system wide roles by:&lt;br /&gt;
&lt;br /&gt;
# Login as the Site administrator&lt;br /&gt;
# Go to the Site Administration block&lt;br /&gt;
# Click on Users -&amp;gt; Permissions -&amp;gt; Define Roles&lt;br /&gt;
# Click on the &#039;Add a new role&#039; pushbutton&lt;br /&gt;
# Fill in the Name, Short name, and description fields with MRBS Administrator, MRBS Scheduler, or MRBS Viewer depending on the role you are creating. &lt;br /&gt;
# Under Permissions set the capability to allow for the respective role (i.e. block/mrbs:administermrbs for the MRBS Administrator role, block/mrbs:editmrbs for the MRBS Scheduler role, and block/mrbs:viewmrbs for the MRBS Viewer role). &lt;br /&gt;
# Scroll down to the bottom and click on the &#039;Add a new role&#039; (or &#039;Save changes&#039; if editing the role) pushbutton. &lt;br /&gt;
# Once the roles are created, go to Site Administration block, click on Frontpage -&amp;gt; Frontpage roles and assign users to the appropriate/desired roles. &lt;br /&gt;
&lt;br /&gt;
** Typically, teachers get assigned as MRBS Schedulers and students as MRBS Viewers. Keep in mind that no assignment is equivalent to MRBS Viewers. Site administrators have the option of making the MRBS Calendar viewable to guests and non-logged in users. To force users to login in order to view the MRBS Calendar:&lt;br /&gt;
# Login as the site administrator&lt;br /&gt;
# Go to the Site Administration block under Security -&amp;gt; Site Policies &lt;br /&gt;
# Enable the &#039;Force users to login&#039; setting&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
&lt;br /&gt;
Thanks to the generosity of translators, the MRBS Block is available in:&lt;br /&gt;
*English (en_utf8)&lt;br /&gt;
*Spanish (es_utf8)&lt;br /&gt;
*German (de_utf8) &lt;br /&gt;
** Installation instructions in German are available at: https://docs.moodle.org/de/blocks/mrbs#.C3.84ndern_der_MRBS_Texte&lt;br /&gt;
&lt;br /&gt;
If you would like to supply translations for other languages, please create an issue in the tracker and attach a zip file of the language files.&lt;br /&gt;
&lt;br /&gt;
===Extra Moodle MRBS Features===&lt;br /&gt;
* [[MRBS_block/import|Import timetable]]&lt;br /&gt;
* [[MRBS_block/forcebook|Force booking]]&lt;br /&gt;
&lt;br /&gt;
===Contributor/Maintainer===&lt;br /&gt;
The MRBS Block was contributed and is maintained by Anthony Borrow.&lt;br /&gt;
More information about the MRBS Block is available at: http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=734&lt;br /&gt;
&lt;br /&gt;
Mike Worth has done significant work on new features for the MRBS block, and has taken on the role of co-maintainer. More details about these new features are available at: http://moodle.org/mod/forum/discuss.php?d=121753&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=56992</id>
		<title>MRBS block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=56992"/>
		<updated>2009-06-01T15:18:07Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* MRBS Block */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MRBS Block==&lt;br /&gt;
&lt;br /&gt;
The MRBS block integrates the MRBS project (http://sourceforge.net/projects/mrbs/) by using Moodle functions to authenticate. While initially designed to work with Moodle 1.6 as a single sign on integration, later work made the MRBS project a contributed Moodle block. &lt;br /&gt;
&lt;br /&gt;
Stephen Bourget was kind enough to work on some changes to prepare the MRBS block to take advantage of roles and for use with Moodle 1.7 and beyond. Furthermore, a recently discovered SQL injection vulnerability in the MRBS application was patched. As a result, the MRBS integration/block is no longer supported or maintained for versions prior to Moodle 1.7.&lt;br /&gt;
&lt;br /&gt;
As with any customization, it is recommended that you have a good backup of your Moodle site before attempting to install contributed code. While those contributing code make every effort to provide the best code that they can, using contributed code nevertheless entails a certain degree of risk as contributed code is not as carefully reviewed and/or tested as the Moodle core code.   &lt;br /&gt;
&lt;br /&gt;
MRBS is useful for scheduling a variety of resources.  More information about MRBS can be obtained at http://mrbs.sourceforge.net/. As distributed here it is setup for periods; however, this can easily be changed to times by modifying the config.inc.php file.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
* Code - Copy the files into your Moodle blocks folder ($CFG-&amp;gt;dirroot/blocks)&lt;br /&gt;
* Database - Login in as a Moodle Administrator and go to the Administration notifications page to create the MRBS tables&lt;br /&gt;
* Capabilities - The MRBS block is primarily intended for use on the Moodle front page. Privileges to use the scheduler are currently based on three custom defined capabilities: &lt;br /&gt;
&lt;br /&gt;
# block/mrbs:administermrbs&lt;br /&gt;
# block/mrbs:editmrbs&lt;br /&gt;
# block/mrbs:viewmrbs &lt;br /&gt;
&lt;br /&gt;
** While these capabilities are created automatically, the system roles are not. As such, it is recommended that you create three system wide roles by:&lt;br /&gt;
&lt;br /&gt;
# Login as the Site administrator&lt;br /&gt;
# Go to the Site Administration block&lt;br /&gt;
# Click on Users -&amp;gt; Permissions -&amp;gt; Define Roles&lt;br /&gt;
# Click on the &#039;Add a new role&#039; pushbutton&lt;br /&gt;
# Fill in the Name, Short name, and description fields with MRBS Administrator, MRBS Scheduler, or MRBS Viewer depending on the role you are creating. &lt;br /&gt;
# Under Permissions set the capability to allow for the respective role (i.e. block/mrbs:administermrbs for the MRBS Administrator role, block/mrbs:editmrbs for the MRBS Scheduler role, and block/mrbs:viewmrbs for the MRBS Viewer role). &lt;br /&gt;
# Scroll down to the bottom and click on the &#039;Add a new role&#039; (or &#039;Save changes&#039; if editing the role) pushbutton. &lt;br /&gt;
# Once the roles are created, go to Site Administration block, click on Frontpage -&amp;gt; Frontpage roles and assign users to the appropriate/desired roles. &lt;br /&gt;
&lt;br /&gt;
** Typically, teachers get assigned as MRBS Schedulers and students as MRBS Viewers. Keep in mind that no assignment is equivalent to MRBS Viewers. Site administrators have the option of making the MRBS Calendar viewable to guests and non-logged in users. To force users to login in order to view the MRBS Calendar:&lt;br /&gt;
# Login as the site administrator&lt;br /&gt;
# Go to the Site Administration block under Security -&amp;gt; Site Policies &lt;br /&gt;
# Enable the &#039;Force users to login&#039; setting&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
&lt;br /&gt;
Thanks to the generosity of translators, the MRBS Block is available in:&lt;br /&gt;
*English (en_utf8)&lt;br /&gt;
*Spanish (es_utf8)&lt;br /&gt;
*German (de_utf8) &lt;br /&gt;
** Installation instructions in German are available at: https://docs.moodle.org/de/blocks/mrbs#.C3.84ndern_der_MRBS_Texte&lt;br /&gt;
&lt;br /&gt;
If you would like to supply translations for other languages, please create an issue in the tracker and attach a zip file of the language files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Contributor/Maintainer===&lt;br /&gt;
The MRBS Block was contributed and is maintained by Anthony Borrow.&lt;br /&gt;
More information about the MRBS Block is available at: http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=734&lt;br /&gt;
&lt;br /&gt;
Mike Worth has done significant work on new features for the MRBS block, and has taken on the role of co-maintainer. More details about these new features are available at: http://moodle.org/mod/forum/discuss.php?d=121753&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=56991</id>
		<title>MRBS block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=MRBS_block&amp;diff=56991"/>
		<updated>2009-06-01T15:12:02Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* Contributor/Maintainer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==MRBS Block==&lt;br /&gt;
&lt;br /&gt;
The MRBS block integrates the MRBS project (http://sourceforge.net/projects/mrbs/) by using settings in the Moodle config.php to authenticate against the mdl_user file as its external database and thus allows for single sign on (SSO). While initially designed to work with Moodle 1.6 as a single sign on integration, later work made the MRBS project a contributed Moodle block. Stephen Bourget was kind enough to work on some changes to prepare the MRBS block to take advantage of roles and for use with Moodle 1.7 and beyond. Furthermore, a recently discovered SQL injection vulnerability in the MRBS application was patched. As a result, the MRBS integration/block is no longer supported or maintained for versions prior to Moodle 1.7. The MRBS block currently requires MySQL; however, I have added an issue in the tracker (http://tracker.moodle.org/browse/CONTRIB-340) to provide Postgresql support. &lt;br /&gt;
&lt;br /&gt;
As with any customization, it is recommended that you have a good backup of your Moodle site before attempting to install contributed code. While those contributing code make every effort to provide the best code that they can, using contributed code nevertheless entails a certain degree of risk as contributed code is not as carefully reviewed and/or tested as the Moodle core code.   &lt;br /&gt;
&lt;br /&gt;
MRBS is useful for scheduling a variety of resources.  More information about MRBS can be obtained at http://mrbs.sourceforge.net/. As distributed here it is setup for periods; however, this can easily be changed to times by modifying the config.inc.php file.&lt;br /&gt;
&lt;br /&gt;
===Installation===&lt;br /&gt;
* Code - Copy the files into your Moodle blocks folder ($CFG-&amp;gt;dirroot/blocks)&lt;br /&gt;
* Database - Login in as a Moodle Administrator and go to the Administration notifications page to create the MRBS tables&lt;br /&gt;
* Capabilities - The MRBS block is primarily intended for use on the Moodle front page. Privileges to use the scheduler are currently based on three custom defined capabilities: &lt;br /&gt;
&lt;br /&gt;
# block/mrbs:administermrbs&lt;br /&gt;
# block/mrbs:editmrbs&lt;br /&gt;
# block/mrbs:viewmrbs &lt;br /&gt;
&lt;br /&gt;
** While these capabilities are created automatically, the system roles are not. As such, it is recommended that you create three system wide roles by:&lt;br /&gt;
&lt;br /&gt;
# Login as the Site administrator&lt;br /&gt;
# Go to the Site Administration block&lt;br /&gt;
# Click on Users -&amp;gt; Permissions -&amp;gt; Define Roles&lt;br /&gt;
# Click on the &#039;Add a new role&#039; pushbutton&lt;br /&gt;
# Fill in the Name, Short name, and description fields with MRBS Administrator, MRBS Scheduler, or MRBS Viewer depending on the role you are creating. &lt;br /&gt;
# Under Permissions set the capability to allow for the respective role (i.e. block/mrbs:administermrbs for the MRBS Administrator role, block/mrbs:editmrbs for the MRBS Scheduler role, and block/mrbs:viewmrbs for the MRBS Viewer role). &lt;br /&gt;
# Scroll down to the bottom and click on the &#039;Add a new role&#039; (or &#039;Save changes&#039; if editing the role) pushbutton. &lt;br /&gt;
# Once the roles are created, go to Site Administration block, click on Frontpage -&amp;gt; Frontpage roles and assign users to the appropriate/desired roles. &lt;br /&gt;
&lt;br /&gt;
** Typically, teachers get assigned as MRBS Schedulers and students as MRBS Viewers. Keep in mind that no assignment is equivalent to MRBS Viewers. Site administrators have the option of making the MRBS Calendar viewable to guests and non-logged in users. To force users to login in order to view the MRBS Calendar:&lt;br /&gt;
# Login as the site administrator&lt;br /&gt;
# Go to the Site Administration block under Security -&amp;gt; Site Policies &lt;br /&gt;
# Enable the &#039;Force users to login&#039; setting&lt;br /&gt;
&lt;br /&gt;
===Languages===&lt;br /&gt;
&lt;br /&gt;
Thanks to the generosity of translators, the MRBS Block is available in:&lt;br /&gt;
*English (en_utf8)&lt;br /&gt;
*Spanish (es_utf8)&lt;br /&gt;
*German (de_utf8) &lt;br /&gt;
** Installation instructions in German are available at: https://docs.moodle.org/de/blocks/mrbs#.C3.84ndern_der_MRBS_Texte&lt;br /&gt;
&lt;br /&gt;
If you would like to supply translations for other languages, please create an issue in the tracker and attach a zip file of the language files.&lt;br /&gt;
&lt;br /&gt;
===To Do List===&lt;br /&gt;
&lt;br /&gt;
*Postgresql support&lt;br /&gt;
&lt;br /&gt;
===Contributor/Maintainer===&lt;br /&gt;
The MRBS Block was contributed and is maintained by Anthony Borrow.&lt;br /&gt;
More information about the MRBS Block is available at: http://moodle.org/mod/data/view.php?d=13&amp;amp;rid=734&lt;br /&gt;
&lt;br /&gt;
Mike Worth has done significant work on new features for the MRBS block, and has taken on the role of co-maintainer. More details about these new features are available at: http://moodle.org/mod/forum/discuss.php?d=121753&lt;br /&gt;
&lt;br /&gt;
[[Category:Contributed code]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55810</id>
		<title>CSV user relationships block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55810"/>
		<updated>2009-05-15T14:33:32Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This block allows user relationships(that is one user assigned a role in another user&#039;s context) to be created/kept up to date via csv files. It was written for personal tutors, but would work equally well for parents.&lt;br /&gt;
&lt;br /&gt;
It can be operated in two modes:&lt;br /&gt;
&lt;br /&gt;
manual upload- any user with the block/tutorlink:use capability (by default, only admins) can upload a file to process&lt;br /&gt;
&lt;br /&gt;
automatic- a file location is configured, then the block automatically checks this location. If a file is found, it is processed and results emailed to the administrator.&lt;br /&gt;
&lt;br /&gt;
==Correct File Format==&lt;br /&gt;
The files to be processed should be in CSV format (hopefully no surprises there). They may consist of any number of rows, each with three fields: tutor idnumber,tutee idnumber, action; it is important to note that the idnumbers are expected to be populated from an external database, they are not the id field in the user table. Action can be add or del, with add creating relationships and del deleting relationships. None of the fields should be delimited.&lt;br /&gt;
&lt;br /&gt;
Including relationships that already exist in moodle in the file will not cause problems, as this block will skip over those records.&lt;br /&gt;
&lt;br /&gt;
==Manual upload==&lt;br /&gt;
The file is created, then a user with the block/tutorlink:use capability (by default, only admins) adds the block to a course (or the front page, other users will not be able to see the block) then just uploads the file;  popup will appear with the results.&lt;br /&gt;
&lt;br /&gt;
==Automatic processing==&lt;br /&gt;
The cronfile setting must be set to an absolute location on the server&#039;s filesystem, once this is done any file put into that location will be processed. It is recommended that a file is automatically produced my an MIS then automatically transferred to the moodle server via scp or similar- this results in relationships being kept up to date with no human intervention. Once a file has been processed, it is renamed to the current date to [originalfilename].yyyymmdd and the results are emailed to the primary administrator (the user with the r lowest id in the role_assignment table for their administrator assignment).&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55808</id>
		<title>CSV user relationships block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55808"/>
		<updated>2009-05-15T14:32:35Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This block allows user relationships(that is one user assigned a role in another user&#039;s context) to be created/kept up to date via csv files. It was written for personal tutors, but would work equally well for parents.&lt;br /&gt;
&lt;br /&gt;
It can be operated in two modes:&lt;br /&gt;
&lt;br /&gt;
manual upload- any user with the block/tutorlink:use capability (by default, only admins) can upload a file to process&lt;br /&gt;
automatic- a file location is configured, then the block automatically checks this location. If a file is found, it is processed and results emailed to the administrator.&lt;br /&gt;
&lt;br /&gt;
==Correct File Format==&lt;br /&gt;
The files to be processed should be in CSV format (hopefully no surprises there). They may consist of any number of rows, each with three fields: tutor idnumber,tutee idnumber, action; it is important to note that the idnumbers are expected to be populated from an external database, they are not the id field in the user table. Action can be add or del, with add creating relationships and del deleting relationships. None of the fields should be delimited.&lt;br /&gt;
&lt;br /&gt;
Including relationships that already exist in moodle in the file will not cause problems, as this block will skip over those records.&lt;br /&gt;
&lt;br /&gt;
==Manual upload==&lt;br /&gt;
The file is created, then a user with the block/tutorlink:use capability (by default, only admins) adds the block to a course (or the front page, other users will not be able to see the block) then just uploads the file;  popup will appear with the results.&lt;br /&gt;
&lt;br /&gt;
==Automatic processing==&lt;br /&gt;
The cronfile setting must be set to an absolute location on the server&#039;s filesystem, once this is done any file put into that location will be processed. It is recommended that a file is automatically produced my an MIS then automatically transferred to the moodle server via scp or similar- this results in relationships being kept up to date with no human intervention. Once a file has been processed, it is renamed to the current date to [originalfilename].yyyymmdd and the results are emailed to the primary administrator (the user with the r lowest id in the role_assignment table for their administrator assignment).&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55807</id>
		<title>CSV user relationships block</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=CSV_user_relationships_block&amp;diff=55807"/>
		<updated>2009-05-15T14:32:07Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: This block allows user relationships(that is one user assigned a role in another user&amp;#039;s context) to be created/kept up to date via csv files. It was written for personal tutors, but would ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This block allows user relationships(that is one user assigned a role in another user&#039;s context) to be created/kept up to date via csv files. It was written for personal tutors, but would work equally well for parents.&lt;br /&gt;
&lt;br /&gt;
It can be operated in two modes:&lt;br /&gt;
&lt;br /&gt;
    * manual upload- any user with the block/tutorlink:use capability (by default, only admins) can upload a file to process&lt;br /&gt;
    * automatic- a file location is configured, then the block automatically checks this location. If a file is found, it is processed and results emailed to the administrator.&lt;br /&gt;
&lt;br /&gt;
==Correct File Format==&lt;br /&gt;
The files to be processed should be in CSV format (hopefully no surprises there). They may consist of any number of rows, each with three fields: tutor idnumber,tutee idnumber, action; it is important to note that the idnumbers are expected to be populated from an external database, they are not the id field in the user table. Action can be add or del, with add creating relationships and del deleting relationships. None of the fields should be delimited.&lt;br /&gt;
&lt;br /&gt;
Including relationships that already exist in moodle in the file will not cause problems, as this block will skip over those records.&lt;br /&gt;
&lt;br /&gt;
==Manual upload==&lt;br /&gt;
The file is created, then a user with the block/tutorlink:use capability (by default, only admins) adds the block to a course (or the front page, other users will not be able to see the block) then just uploads the file;  popup will appear with the results.&lt;br /&gt;
&lt;br /&gt;
==Automatic processing==&lt;br /&gt;
The cronfile setting must be set to an absolute location on the server&#039;s filesystem, once this is done any file put into that location will be processed. It is recommended that a file is automatically produced my an MIS then automatically transferred to the moodle server via scp or similar- this results in relationships being kept up to date with no human intervention. Once a file has been processed, it is renamed to the current date to [originalfilename].yyyymmdd and the results are emailed to the primary administrator (the user with the r lowest id in the role_assignment table for their administrator assignment).&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=53369</id>
		<title>mod/termreview/view</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=53369"/>
		<updated>2009-03-27T13:38:26Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added mention of new viewall page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block.&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has write review capability and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for [[mod/termreview/tutor|tutor groups and normal classes]]:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is [[mod/termreview/referrals|referrals]]- they must be created and selected in the review options form.&lt;br /&gt;
&lt;br /&gt;
==Viewing all reviews==&lt;br /&gt;
If the user either doesn&#039;t have write review capability or the review is closed, but does have view all reviews capability they will be presented with a dropdown list of students, selecting the student will display their review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;br /&gt;
&lt;br /&gt;
There is also a view all link displayed; clicking on this just gives all the reviews in that activity on one page&lt;br /&gt;
&lt;br /&gt;
==Viewing own review==&lt;br /&gt;
If the user only has the view own review capability they will (suprise, suprise!) just get their own review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/alis&amp;diff=53368</id>
		<title>mod/termreview/alis</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/alis&amp;diff=53368"/>
		<updated>2009-03-27T13:36:55Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added termreview documentation overview link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ALIS (Advanced Level Information System) data is used to calculate minimum target grades for students based on their average GCSE score and past statistics for the relevant course.&lt;br /&gt;
&lt;br /&gt;
Latest data can be downloaded from [https://css.cemcentre.org/ALIS/Site/reports/default.aspx?reptype=6 here] (subscription required). Simply copy in all the required gradients and intercepts.&lt;br /&gt;
&lt;br /&gt;
By inserting this data and [[mod/termreview/uploadquals|uploading entry qualifications]] minimum target grades are automatically calculated for reviews. It will only reliably work for the standard A level scale as it is, but I&#039;m sure could easily be modified to work with others.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/uploadquals&amp;diff=53367</id>
		<title>mod/termreview/uploadquals</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/uploadquals&amp;diff=53367"/>
		<updated>2009-03-27T13:36:51Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added termreview documentation overview link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Average GCSE scores are used, along with [[mod/termreview/alis|alis data]] to calculate minimum target grades.&lt;br /&gt;
&lt;br /&gt;
Using this page should be ronseal- simply follow the instructions at the top.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=53366</id>
		<title>mod/termreview/restore</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=53366"/>
		<updated>2009-03-27T13:36:47Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added termreview documentation overview link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is availible to managers and allows reviews that have been deleted from course pages to be either fully deleted from the database or restored to the course page(with all data intact).&lt;br /&gt;
&lt;br /&gt;
Usage should be ronseal- there is a list of reviews that have been deleted off their respective course pages with links to delete or restore.&lt;br /&gt;
&lt;br /&gt;
If there are a large amount of reviews to restore, this can be done with the [[mod/termreview/distribute|distribute tool]]&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/distribute&amp;diff=53364</id>
		<title>mod/termreview/distribute</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/distribute&amp;diff=53364"/>
		<updated>2009-03-27T13:36:43Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added termreview documentation overview link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page allows a single &#039;parent review&#039; (just a review on the front page) to be distrubuted to many courses. It works in a similar way to the &#039;assign roles&#039; pages (that&#039;s where I stole the code from, before modifying it).&lt;br /&gt;
&lt;br /&gt;
Selecting courses in the right hand list and adding then will add a copy of the parent review to the courses as child reviews, if the reviews already exist but have been deleted off their course page, this will restore and update them.&lt;br /&gt;
Selecting them in the left hand list and removing them will do the same as deleting them off a course page (their data will still be retained, to fully remove them use the [[mod/termreview/restore|restore/delete]] page.&lt;br /&gt;
Using the update button will copy the configuration from the parent review to all the reviews listed in the left hand box.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=53361</id>
		<title>mod/termreview/view</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=53361"/>
		<updated>2009-03-27T13:36:39Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: added termreview documentation overview link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block.&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has write review capability and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for [[mod/termreview/tutor|tutor groups and normal classes]]:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is [[mod/termreview/referrals|referrals]]- they must be created and selected in the review options form.&lt;br /&gt;
&lt;br /&gt;
==Viewing all reviews==&lt;br /&gt;
If the user either doesn&#039;t have write review capability or the review is closed, but does have view all reviews capability they will be presentec with a dropdown list of students, selecting the student will display their review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;br /&gt;
&lt;br /&gt;
==Viewing own review==&lt;br /&gt;
If the user only has the view own review capability they will (suprise, suprise!) just get their own review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
*[https://docs.moodle.org/en/mod/termreview termreview documentation overview]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=blocks/quickfindlist&amp;diff=53194</id>
		<title>blocks/quickfindlist</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=blocks/quickfindlist&amp;diff=53194"/>
		<updated>2009-03-24T15:51:55Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* Configuration options: */  typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This block allows users to be found quickly by use of javascript searching.&lt;br /&gt;
&lt;br /&gt;
When it is first added to a page, it displays an error that it has not been configured; before it will work you must click the edit button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuration options: ===&lt;br /&gt;
&lt;br /&gt;
The first option is the role the the searched users are to have; if the block is in a course it will find users with that role assigned in that course (not inherited), if it is on the front page/my moodle it will search for users with that role anywhere.&lt;br /&gt;
&lt;br /&gt;
The second option is optional; it allows the list to link to a page other than the users&#039; profiles, for example setting it to &amp;quot;http://your.moodle.site/blog/index.php?userid=&amp;quot; would make all the links point to the users&#039; blogs.&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
To use it just start typing any part of the users name into the box, as you type the list of names will appear and be narrowed down. Once you can see the user you want to find just click on their name.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=blocks/quickfindlist&amp;diff=52357</id>
		<title>blocks/quickfindlist</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=blocks/quickfindlist&amp;diff=52357"/>
		<updated>2009-03-10T14:41:44Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: Created page for this block&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This block allows users to be found quickly by use of javascript searching.&lt;br /&gt;
&lt;br /&gt;
When it is first added to a page, it displays an error that it has not been configured; before it will work you must click the edit button.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Configuration options: ===&lt;br /&gt;
&lt;br /&gt;
The first option is the role the the searched users are to have; if the block is in a course it will find users with that role assigned in that course (not inherited), if it is on the front page/my moodle it will search for users with that role anywhere.&lt;br /&gt;
&lt;br /&gt;
The second option is optional; it allows the list to link to a page other than the users&#039; profiles, for example setting it to &amp;quot;http://your.moodle.site/blog/index.php?userid=&amp;quot; would make all the links opint to the users&#039; blogs.&lt;br /&gt;
&lt;br /&gt;
===Usage===&lt;br /&gt;
&lt;br /&gt;
To use it just start typing any part of the users name into the box, as you type the list of names will appear and be narrowed down. Once you can see the user you want to find just click on their name.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=Development:Blocks&amp;diff=49600</id>
		<title>Development:Blocks</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=Development:Blocks&amp;diff=49600"/>
		<updated>2009-01-28T11:01:44Z</updated>

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

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block.&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has write review capability and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for [[mod/termreview/tutor|tutor groups and normal classes]]:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is [[mod/termreview/referrals|referrals]]- they must be created and selected in the review options form.&lt;br /&gt;
&lt;br /&gt;
==Viewing all reviews==&lt;br /&gt;
If the user either doesn&#039;t have write review capability or the review is closed, but does have view all reviews capability they will be presentec with a dropdown list of students, selecting the student will display their review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;br /&gt;
&lt;br /&gt;
==Viewing own review==&lt;br /&gt;
If the user only has the view own review capability they will (suprise, suprise!) just get their own review. If the course is a [[mod/termreview/tutor|tutor group]] all the class teacher reviews will also be displayed.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=48036</id>
		<title>mod/termreview/view</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=48036"/>
		<updated>2008-12-11T11:10:26Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: /* Writing Reviews */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block.&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has write review capability and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for [[mod/termreview/tutor|tutor groups and normal classes]]:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is [[mod/termreview/referrals|referrals]]- they must be created and selected in the review options form.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/distribute&amp;diff=48033</id>
		<title>mod/termreview/distribute</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/distribute&amp;diff=48033"/>
		<updated>2008-12-11T10:59:19Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: This page allows a single &amp;#039;parent review&amp;#039; (just a review on the front page) to be distrubuted to many courses. It works in a similar way to the &amp;#039;assign roles&amp;#039; pages (that&amp;#039;s where I stole t...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page allows a single &#039;parent review&#039; (just a review on the front page) to be distrubuted to many courses. It works in a similar way to the &#039;assign roles&#039; pages (that&#039;s where I stole the code from, before modifying it).&lt;br /&gt;
&lt;br /&gt;
Selecting courses in the right hand list and adding then will add a copy of the parent review to the courses as child reviews, if the reviews already exist but have been deleted off their course page, this will restore and update them.&lt;br /&gt;
Selecting them in the left hand list and removing them will do the same as deleting them off a course page (their data will still be retained, to fully remove them use the [[mod/termreview/restore|restore/delete]] page.&lt;br /&gt;
Using the update button will copy the configuration from the parent review to all the reviews listed in the left hand box.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=48032</id>
		<title>mod/termreview/restore</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=48032"/>
		<updated>2008-12-11T10:56:29Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is availible to managers and allows reviews that have been deleted from course pages to be either fully deleted from the database or restored to the course page(with all data intact).&lt;br /&gt;
&lt;br /&gt;
Usage should be ronseal- there is a list of reviews that have been deleted off their respective course pages with links to delete or restore.&lt;br /&gt;
&lt;br /&gt;
If there are a large amount of reviews to restore, this can be done with the [[mod/termreview/distribute|distribute tool]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=48031</id>
		<title>mod/termreview/restore</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/restore&amp;diff=48031"/>
		<updated>2008-12-11T10:49:43Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: This page is availible to managers and allows reviews that have been deleted from course pages to be either fully deleted from the database or restored to the course page(with all data int...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is availible to managers and allows reviews that have been deleted from course pages to be either fully deleted from the database or restored to the course page(with all data intact).&lt;br /&gt;
&lt;br /&gt;
Usage should be ronseal- there is a list of reviews that have been deleted off their respective course pages with links to delete or restore.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/uploadquals&amp;diff=48029</id>
		<title>mod/termreview/uploadquals</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/uploadquals&amp;diff=48029"/>
		<updated>2008-12-11T10:44:21Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: Average GCSE scores are used, along with alis data to calculate minimum target grades.  Using this page should be ronseal- simply follow the instructions at the top...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Average GCSE scores are used, along with [[mod/termreview/alis|alis data]] to calculate minimum target grades.&lt;br /&gt;
&lt;br /&gt;
Using this page should be ronseal- simply follow the instructions at the top.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/alis&amp;diff=48028</id>
		<title>mod/termreview/alis</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/alis&amp;diff=48028"/>
		<updated>2008-12-11T10:42:43Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: New page: ALIS (Advanced Level Information System) data is used to calculate minimum target grades for students based on their average GCSE score and past statistics for the relevant course.  Latest...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;ALIS (Advanced Level Information System) data is used to calculate minimum target grades for students based on their average GCSE score and past statistics for the relevant course.&lt;br /&gt;
&lt;br /&gt;
Latest data can be downloaded from [https://css.cemcentre.org/ALIS/Site/reports/default.aspx?reptype=6 here] (subscription required). Simply copy in all the required gradients and intercepts.&lt;br /&gt;
&lt;br /&gt;
By inserting this data and [[mod/termreview/uploadquals|uploading entry qualifications]] minimum target grades are automatically calculated for reviews. It will only reliably work for the standard A level scale as it is, but I&#039;m sure could easily be modified to work with others.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=47991</id>
		<title>mod/termreview/view</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=47991"/>
		<updated>2008-12-10T16:26:53Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block.&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has editing rights and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for tutor groups and normal classes:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is referrals- they must be created and selected in the review options form.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=47990</id>
		<title>mod/termreview/view</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=mod/termreview/view&amp;diff=47990"/>
		<updated>2008-12-10T16:26:23Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: Started writing docs for my termreview mod. Going home now- will continue later&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is the main page of the termreview block; while it is called view, .&lt;br /&gt;
&lt;br /&gt;
==Writing Reviews==&lt;br /&gt;
If the user has editing rights and the review is open they will actually get a form to complete the review for all the students of the course; the page is slightly different for tutor groups and normal classes:&lt;br /&gt;
&lt;br /&gt;
===Normal Classes===&lt;br /&gt;
&lt;br /&gt;
To select a student, simply select their name from the dropdown list- their review page will automatically load, complete with their attendance/punctuality(assuming attendance block is installed) and the course total from the gradebook and their average GCSE score (previous reviews for this class will also be displayed at the bottom of the page).&lt;br /&gt;
&lt;br /&gt;
Assuming ALIS data has been properly configured, the target grade field will automatically be filled in with what should be an appropriate grade (but it is fully changeable). Filling in the data for the everything else should be ronseal.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Tutor Groups===&lt;br /&gt;
&lt;br /&gt;
Again selecting a student is just a case of selecting their name from the dropdown list. As well as displaying the attendance and punctuality for the tutor group, a summary of all the class teachers reviews will be displayed. The only non-ronseal part is referrals- they must be created and selected in the review options form.&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=Development:lib/formslib.php_Form_Definition&amp;diff=46678</id>
		<title>Development:lib/formslib.php Form Definition</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=Development:lib/formslib.php_Form_Definition&amp;diff=46678"/>
		<updated>2008-11-13T10:50:09Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: Making it more clear that a couple of hidden fields must be included (took me a couple of days to work this out)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Formslib}}&lt;br /&gt;
==definition()==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The definition of the elements to be included in the form, their &#039;types&#039; (PARAM_*), helpbuttons included, etc is all included in a function you must define in your class &#039;definition();&#039;&lt;br /&gt;
&lt;br /&gt;
definition() is used to define the elements in the form and &#039;&#039;&#039;this definition will be used for validating data submitted as well as for printing the form.&#039;&#039;&#039; For select and checkbox type elements only data that could have been selected will be allowed. And only data that corresponds to a form element in the defintion will be accepted as submitted data.&lt;br /&gt;
&lt;br /&gt;
The definition() should include all elements that are going to be used on form, some elements may be removed or tweaked later in definition_after_data(). Please do not create conditional elements in definition(), the definition() should not directly depend on the submitted data.&lt;br /&gt;
&lt;br /&gt;
===Required fields===&lt;br /&gt;
If the moodleform_mod method standard_coursemodule_elements() is not used there are a couple of hidden fields that must be included in order for get_data() to work. These are:&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;_qf__[formname]_form&#039;, 1);//NB there are 2 underscores before formname&lt;br /&gt;
        $sesskey = sesskey();&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;sesskey&#039;, $sesskey);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Use Fieldsets to group Form Elements==&lt;br /&gt;
&lt;br /&gt;
You use code like this to open a fieldset with a legend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;header&#039;, &#039;nameforyourheaderelement&#039;, get_string(&#039;titleforlegened&#039;, &#039;modulename&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can&#039;t yet nest these visible fieldsets unfortunately. But in fact groups of elements are wrapped in invisible fieldsets.&lt;br /&gt;
&lt;br /&gt;
You close a fieldset with moodle_form&#039;s closeHeaderBefore method. You tell closeHeaderBefore the element before you wish to end the fieldset. A fieldset is automatically closed if you open a new one. You need to use this code only if you want to close a fieldset and the subsequent form elements are not to be enclosed by a visible fieldset (they are still enclosed with an invisibe one with no legend) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;closeHeaderBefore(&#039;buttonar&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==addElement==&lt;br /&gt;
&lt;br /&gt;
Use the addElement method to add an element to a form. The first few arguments are always the same. The first param is the type of the element to add. The second is the elementname to use which is normally the html name of the element in the form. The third is often the text for the label for the element.&lt;br /&gt;
&lt;br /&gt;
Some examples are below :&lt;br /&gt;
===button===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;button&#039;, &#039;intro&#039;, get_string(&amp;quot;buttonlabel&amp;quot;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A button element. If you want a submit or cancel button see &#039;submit&#039; element. &lt;br /&gt;
&lt;br /&gt;
===checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;ratingtime&#039;, get_string(&#039;ratingtime&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a simple checkbox. The third param for this element is the label to display on the left side of the form. You can also supply a string as a fourth param to specify a label that will appear on the right of the element. Checkboxes and radio buttons can be grouped and have individual labels on their right.&lt;br /&gt;
&lt;br /&gt;
====advcheckbox====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;advcheckbox&#039;, &#039;ratingtime&#039;, get_string(&#039;ratingtime&#039;, &#039;forum&#039;), &#039;Label displayed after checkbox&#039;, array(&#039;group&#039; =&amp;gt; 1), array(0, 1));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Similar to the checkbox above, but with a couple of important improvements:&lt;br /&gt;
&lt;br /&gt;
#The 5th parameter is a normal $attributes array, normally used to set HTML attributes for the &amp;lt;input&amp;gt; element. However, a special value of &#039;group&#039; can be given, which will add a class name to the element, and enable its grouping for a [[Development:lib/formslib.php_add_checkbox_controller|checkbox controller]]&lt;br /&gt;
#The 6th parameter is an array of values that will be associated with the checked/unchecked state of the checkbox. With a normal checkbox you cannot choose that value, and in fact an unchecked checkbox will not even be sent with the form data.&lt;br /&gt;
&lt;br /&gt;
===choosecoursefile===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;choosecoursefile&#039;, &#039;mediafile&#039;, get_string(&#039;mediafile&#039;, &#039;lesson&#039;), array(&#039;courseid&#039;=&amp;gt;$COURSE-&amp;gt;id));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose a file from the course files area. The fourth option is a list of options for the element. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
array(&#039;courseid&#039;=&amp;gt;null,//if it is null (default then use global $COURSE&lt;br /&gt;
 &#039;height&#039;=&amp;gt;500,// height of the popup window&lt;br /&gt;
 &#039;width&#039;=&amp;gt;750, // width of the popup window&lt;br /&gt;
&#039;options&#039;=&amp;gt;&#039;none&#039;);//options string for the pop up window &lt;br /&gt;
                   //eg. &#039;menubar=0,location=0,scrollbars,resizable&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===date_selector===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;date_selector&#039;, &#039;assesstimefinish&#039;, get_string(&#039;to&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a date selector. You can select a Day, Month and Year using a group of select boxes. The fourth param here is an array of options. The defaults for the options are :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;array(&#039;startyear&#039;=&amp;gt;1970, &#039;stopyear&#039;=&amp;gt;2020,&lt;br /&gt;
                    &#039;timezone&#039;=&amp;gt;99, &#039;applydst&#039;=&amp;gt;true, &#039;optional&#039;=&amp;gt;false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can override these defaults by supplying an array as fourth param with one or more keys with a value to override the default. You can supply a fifth param of attributes here as well.&lt;br /&gt;
&lt;br /&gt;
===date_time_selector===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;date_time_selector&#039;, &#039;assesstimestart&#039;, get_string(&#039;from&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a group of select boxes to select a date (Day Month and Year) and time (Hour and Minute). When submitted, submitted data is processed and a timestamp is passed to $form-&amp;gt;get_data(); the fourth param here is an array of options. The defaults for the options are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;array(&#039;startyear&#039;=&amp;gt;1970, &#039;stopyear&#039;=&amp;gt;2020,&lt;br /&gt;
                    &#039;timezone&#039;=&amp;gt;99, &#039;applydst&#039;=&amp;gt;true, &#039;step&#039;=&amp;gt;5);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can override these defaults by supplying an array as fourth param with one or more keys with a value to override the default. You can supply a fifth param of attributes here as well.&lt;br /&gt;
&lt;br /&gt;
===file===&lt;br /&gt;
&lt;br /&gt;
File upload input box with browse button. In the form definition type&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;file&#039;, &#039;attachment&#039;, get_string(&#039;attachment&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after form submission and validation use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            if ($data = $mform-&amp;gt;get_data()) {&lt;br /&gt;
              ...&lt;br /&gt;
              $mform-&amp;gt;save_files($destination_directory);&lt;br /&gt;
              ...&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need advanced settings such as required file, different max upload size or name of uploaded file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
            $this-&amp;gt;set_upload_manager(new upload_manager(&#039;attachment&#039;, true, false, $COURSE, false, 0, true, true, false));&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;file&#039;, &#039;attachment&#039;, get_string(&#039;attachment&#039;, &#039;forum&#039;));&lt;br /&gt;
            $mform-&amp;gt;addRule(&#039;attachment&#039;, null, &#039;required&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            if ($data = $mform-&amp;gt;get_data()) {&lt;br /&gt;
              ...&lt;br /&gt;
              $mform-&amp;gt;save_files($destination_directory);&lt;br /&gt;
              $newfilename = $mform-&amp;gt;get_new_filename();&lt;br /&gt;
              ...&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When porting old code it is also possible to use the upload manager directly for processing of uploaded files.&lt;br /&gt;
&lt;br /&gt;
Please note that if using set_upload_manager() it must be before addElement(&#039;file&#039;,..).&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
File uploading was rewritten in 2.0. Please see inline docs for now. This page will be updated when the new API stabilises.&lt;br /&gt;
&lt;br /&gt;
===filepicker===&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
General replacement of &#039;&#039;file&#039;&#039; element.&lt;br /&gt;
&lt;br /&gt;
===hidden===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;reply&#039;, &#039;yes&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A hidden element. Set the element name (in this case &#039;&#039;&#039;reply&#039;&#039;&#039;) to the stated value (in this case &#039;&#039;&#039;yes&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
===htmleditor &amp;amp; format===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;htmleditor&#039;, &#039;text&#039;, get_string(&#039;choicetext&#039;, &#039;choice&#039;));&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;text&#039;, PARAM_RAW);&lt;br /&gt;
	$mform-&amp;gt;addRule(&#039;text&#039;, null, &#039;required&#039;, null, &#039;client&#039;);&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;format&#039;, &#039;format&#039;, get_string(&#039;format&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can supply a fourth param to htmleditor of an array of options :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
array(&#039;canUseHtmlEditor&#039;=&amp;gt;&#039;detect&#039;,&#039;rows&#039;=&amp;gt;10, &#039;cols&#039;=&amp;gt;65, &lt;br /&gt;
&#039;width&#039;=&amp;gt;0,&#039;height&#039;=&amp;gt;0, &#039;course&#039;=&amp;gt;0);&lt;br /&gt;
//options same as print_textarea params&lt;br /&gt;
//use rows and cols options to control htmleditor size.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===modgrade===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;modgrade&#039;, &#039;scale&#039;, get_string(&#039;grade&#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a custom element for selecting a grade for any activity module. The fourth argument is whether to include an option for no grade which has a value 0. This select box does include scales. The default is true, include no grade option.&lt;br /&gt;
&lt;br /&gt;
A helpbutton is automatically added.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===password===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;password&#039;, &#039;password&#039;, get_string(&#039;label&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A password element. Fourth param is an array or string of attributes.&lt;br /&gt;
&lt;br /&gt;
===passwordunmask===&lt;br /&gt;
{{Moodle 1.9}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;passwordunmask&#039;, &#039;password&#039;, get_string(&#039;label&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A password element with option to show the password in plaintext. Fourth param is an array or string of attributes.&lt;br /&gt;
&lt;br /&gt;
===radio===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $radioarray=array();&lt;br /&gt;
        $radioarray[] = &amp;amp;MoodleQuickForm::createElement(&#039;radio&#039;, &#039;yesno&#039;, &#039;&#039;, get_string(&#039;yes&#039;), 1, $attributes);&lt;br /&gt;
        $radioarray[] = &amp;amp;MoodleQuickForm::createElement(&#039;radio&#039;, &#039;yesno&#039;, &#039;&#039;, get_string(&#039;no&#039;), 0, $attributes);&lt;br /&gt;
        $mform-&amp;gt;addGroup($radioarray, &#039;radioar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Second param names the radio button and should be the same for each button in the group in order to toggle correctly. Third param would be the label for the form element but is generally ignored as this element will always be in a group which has it&#039;s own label. Fourth param is a string, a label to be displayed on the right of the element. The fifth is the value for this radio button. $attributes can be a string or an array of attributes.&lt;br /&gt;
&lt;br /&gt;
It is possible to add help to individual radio buttons but this requires a custom template to be defined for the group elements. See MDL-15571.&lt;br /&gt;
&lt;br /&gt;
====setDefault====&lt;br /&gt;
&lt;br /&gt;
To set the default for a radio button group as above use the following :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;yesno&#039;, 0);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would make the default &#039;no&#039;.&lt;br /&gt;
&lt;br /&gt;
===select===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;select&#039;, &#039;type&#039;, get_string(&#039;forumtype&#039;, &#039;forum&#039;), $FORUM_TYPES, $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fourth param for this element is an array of options for the select box. The keys are the values for the option and the value of the array is the text for the option. The fifth param $attributes is optional, see text element for description of attributes param.&lt;br /&gt;
&lt;br /&gt;
====multi-select====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $select = &amp;amp;$mform-&amp;gt;addElement(&#039;select&#039;, &#039;colors&#039;, get_string(&#039;colors&#039;), array(&#039;red&#039;, &#039;blue&#039;, &#039;green&#039;), $attributes);&lt;br /&gt;
        $select-&amp;gt;setMultiple(true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===selectyesno===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;selectyesno&#039;, &#039;maxbytes&#039;, get_string(&#039;maxattachmentsize&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want a yes / no select box this one automatically translates itself and has value 1 for yes and 0 for no.&lt;br /&gt;
&lt;br /&gt;
===static===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;static&#039;, &#039;description&#039;, get_string(&#039;description&#039;, &#039;exercise&#039;),&lt;br /&gt;
                  get_string(&#039;descriptionofexercise&#039;, &#039;exercise&#039;, $COURSE-&amp;gt;students));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a static element. It should be used with care it is used to display a static piece of text with a label. The third param is the label and the fourth is the static text itself.&lt;br /&gt;
&lt;br /&gt;
===submit, reset and cancel===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        //normally you use add_action_buttons instead of this code&lt;br /&gt;
        $buttonarray=array();&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;submit&#039;, &#039;submitbutton&#039;, get_string(&#039;savechanges&#039;));&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;reset&#039;, &#039;resetbutton&#039;, get_string(&#039;revert&#039;));&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;cancel&#039;);&lt;br /&gt;
        $mform-&amp;gt;addGroup($buttonarray, &#039;buttonar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
        $mform-&amp;gt;closeHeaderBefore(&#039;buttonar&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &#039;Submit&#039; type element is a submit type form element which will submit the form. A &#039;Reset&#039; will not submit the form but will reset any changes the user has made to form contents. A &#039;Cancel&#039; element cancels form submission. You need to have a branch in your code before you check for get_data() to check if submission has been cancelled with is_cancelled(); See the example on the usage page.&lt;br /&gt;
&lt;br /&gt;
You should name your submit and reset buttons &#039;submitbutton&#039; and &#039;resetbutton&#039; or something similar (not &#039;submit&#039; and &#039;reset&#039;). This avoids problems in JavaScript of collisions between form element names and names of JavaScript methods of the form object.&lt;br /&gt;
&lt;br /&gt;
====add_action_buttons($cancel = true, $submitlabel=null);====&lt;br /&gt;
&lt;br /&gt;
You will normally use this helper function which is a method of moodleform to add all the &#039;action&#039; buttons to the end of your form. A boolean parameter allow you to specify whether to include a cancel button and specify the label for your submit button (pass the result of get_string). Default for the submit button label is get_string(&#039;savechanges&#039;).&lt;br /&gt;
&lt;br /&gt;
===text===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;name&#039;, get_string(&#039;forumname&#039;, &#039;forum&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For a simple text element. Your fourth parameter here can be a string or array of attributes for the text element. The following are equivalent :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $attributes=&#039;size=&amp;quot;20&amp;quot;&#039;;&lt;br /&gt;
        $attributes=array(&#039;size&#039;=&amp;gt;&#039;20&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Generally you are encouraged to use CSS instead of using attributes for styling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A format element can be used as a format select box. It will be non-selectable if you&#039;re using an html editor.&lt;br /&gt;
&lt;br /&gt;
The third param for this element is $useHtmlEditor and it defaults to null in which case an html editor is used if the browser and user profile support it.&lt;br /&gt;
&lt;br /&gt;
===textarea===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;textarea&#039;, &#039;introduction&#039;, get_string(&amp;quot;introtext&amp;quot;, &amp;quot;survey&amp;quot;), &#039;wrap=&amp;quot;virtual&amp;quot; rows=&amp;quot;20&amp;quot; cols=&amp;quot;50&amp;quot;&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A textarea element. If you want an htmleditor use htmleditor element. Fourth element here is a string or array of attributes.&lt;br /&gt;
&lt;br /&gt;
==addGroup==&lt;br /&gt;
&lt;br /&gt;
A &#039;group&#039; in formslib is just a group of elements that will have a label and will be included on one line. &lt;br /&gt;
&lt;br /&gt;
For example typical code to include a submit and cancel button on the same line : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $buttonarray=array();&lt;br /&gt;
        $buttonarray[] =&amp;amp; $mform-&amp;gt;createElement(&#039;submit&#039;, &#039;submitbutton&#039;, get_string(&#039;savechanges&#039;));&lt;br /&gt;
        $buttonarray[] =&amp;amp; $mform-&amp;gt;createElement(&#039;submit&#039;, &#039;cancel&#039;, get_string(&#039;cancel&#039;));&lt;br /&gt;
        $mform-&amp;gt;addGroup($buttonarray, &#039;buttonar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You use the same arguments for createElement as you do for addElement. Any label for the element in the third argument is normally ignored (but not in the case of the submit buttons above where the third argument is not for a label but is the text for the button).&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of putting a date_selector (which is itself a group of elements) and a checkbox on the same line, note that you can disable every element in the group using the group name &#039;availablefromgroup&#039; but it doesn&#039;t disable the controlling element the &#039;availablefromenabled&#039; checkbox:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $availablefromgroup=array();&lt;br /&gt;
	$availablefromgroup[] =&amp;amp; $mform-&amp;gt;createElement(&#039;date_selector&#039;, &#039;availablefrom&#039;, &#039;&#039;);&lt;br /&gt;
	$availablefromgroup[] =&amp;amp; $mform-&amp;gt;createElement(&#039;checkbox&#039;, &#039;availablefromenabled&#039;, &#039;&#039;, get_string(&#039;enable&#039;));&lt;br /&gt;
        $mform-&amp;gt;addGroup($availablefromgroup, &#039;availablefromgroup&#039;, get_string(&#039;availablefromdate&#039;, &#039;data&#039;), &#039;&amp;amp;nbsp;&#039;, false);&lt;br /&gt;
        $mform-&amp;gt;disabledIf(&#039;availablefromgroup&#039;, &#039;availablefromenabled&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==setHelpButton==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;setHelpButton(&#039;lessondefault&#039;, array(&#039;lessondefault&#039;, get_string(&#039;lessondefault&#039;, &#039;lesson&#039;), &#039;lesson&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First param is an elementname and the second param is an array of params that are passed to helpbutton in weblib.php. Params are :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * @param string $page  The keyword that defines a help page&lt;br /&gt;
 * @param string $title The title of links, rollover tips, alt tags etc&lt;br /&gt;
 *           &#039;Help with&#039; (or the language equivalent) will be prefixed and &#039;...&#039; will be stripped.&lt;br /&gt;
 * @param string $module Which module is the page defined in&lt;br /&gt;
 * @param mixed $image Use a help image for the link?  (true/false/&amp;quot;both&amp;quot;)&lt;br /&gt;
 * @param boolean $linktext If true, display the title next to the help icon.&lt;br /&gt;
 * @param string $text If defined then this text is used in the page, and&lt;br /&gt;
 *           the $page variable is ignored.&lt;br /&gt;
 * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page.&lt;br /&gt;
 * @param string $imagetext The full text for the helpbutton icon. If empty use default help.gif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Make sure you don&#039;t set boolean $return to false. &lt;br /&gt;
&lt;br /&gt;
You need to do use this method after addElement();&lt;br /&gt;
&lt;br /&gt;
==setDefault==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;select&#039;, &#039;grade&#039;, get_string(&#039;gradeforsubmission&#039;, &#039;exercise&#039;), $grades);&lt;br /&gt;
        $mform-&amp;gt;setHelpButton(&#039;grade&#039;, array(&#039;grade&#039;, get_string(&#039;gradeforsubmission&#039;, &#039;exercise&#039;), &#039;exercise&#039;));&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;grade&#039;, 100);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the default of the form value with setDefault($elementname, $value); where elementname is the elementname whose default you want to set and $value is the default to set. We set the defaults for the form in definition(). This default is what is used if no data is loaded into the form with set_data(); eg. on display of the form for an &#039;add&#039; rather than &#039;update&#039; function.&lt;br /&gt;
&lt;br /&gt;
==disabledIf==&lt;br /&gt;
&lt;br /&gt;
For any element or groups of element in a form you can conditionally disable the group or individual element depending on conditions.&lt;br /&gt;
&lt;br /&gt;
You can use $mform-&amp;gt;disabledIf($elementName, $dependentOn, $condition = &#039;notchecked&#039;, $value=null)&lt;br /&gt;
&lt;br /&gt;
* elementname can be a group. If you specify a group all elements in the group will be disabled (if dependentOn is in elementname group that is ignored and not disabled). These are the element names you&#039;ve used as the first argument in addElement or addGroup.&lt;br /&gt;
* dependentOn is the actual name of the element as it will appear in html. This can be different to the name used in addGroup particularly but also addElement where you&#039;re adding a complex element like a date_selector. Check the html of your page. You typically make the depedentOn a checkbox or select box.&lt;br /&gt;
* $condition will be notchecked, checked, selected, eq or if it is anything else then we test for neq.&lt;br /&gt;
* If $condition is eq or neq then we check the value of the dependentOn field and check for equality (==) or nonequality (!=) in js&lt;br /&gt;
* If $condition is checked or notchecked then we check to see if a checkbox is checked or not.&lt;br /&gt;
* If $condition is selected then we check to see if a particular option is selected from a dropdown list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: I am not sure this section is complete. I just found and added one missing case, but there may be others--[[User:Tim Hunt|Tim Hunt]] 06:04, 15 October 2007 (CDT)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==setType==&lt;br /&gt;
&lt;br /&gt;
PARAM_* types are used to specify how a submitted variable should be cleaned. These should be used for get parameters such as id, course etc. which are used to load a page and also with setType(); method. Every form element should have a type specified except select, radio box and checkbox elements, these elements do a good job of cleaning themselves (only specified options are allowed as user input).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Most Commonly Used PARAM_* Types===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used PARAM_* types and their proper uses. More types can be seen in moodlelib.php starting around line 100.&lt;br /&gt;
&lt;br /&gt;
* PARAM_CLEAN is deprecated and you should try to use a more specific type.&lt;br /&gt;
* PARAM_TEXT should be used for cleaning data that is expected to be plain text. It will strip all html tags. But will still let tags for multilang support through.&lt;br /&gt;
* PARAM_NOTAGS should be used for cleaning data that is expected to be plain text. It will strip *all* html type tags. It will still *not* let tags for multilang support through. This should be used for instance for email addresses where no multilang support is appropriate.&lt;br /&gt;
* PARAM_RAW means no cleaning whatsoever, it is used mostly for data from the html editor. Data from the editor is later cleaned before display using format_text() function. PARAM_RAW can also be used for data that is validated by some other way or printed by p() or s().&lt;br /&gt;
* PARAM_INT should be used for integers.&lt;br /&gt;
* PARAM_ACTION is an alias of PARAM_ALPHA and is used for hidden fields specifying form actions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [http://web.archive.org/web/20080214041550/http://www.midnighthax.com/quickform.php PEAR HTML QuickForm Getting Started Guide by Keith Edmunds of Midnighthax.com (via archive.org as original now dead)]&lt;br /&gt;
&lt;br /&gt;
[[Category:Formslib]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/404/en/index.php?title=Development:lib/formslib.php_Form_Definition&amp;diff=46626</id>
		<title>Development:lib/formslib.php Form Definition</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/404/en/index.php?title=Development:lib/formslib.php_Form_Definition&amp;diff=46626"/>
		<updated>2008-11-12T11:33:12Z</updated>

		<summary type="html">&lt;p&gt;Mike1989: Changed reference link to archive.org cache as live one dead&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Formslib}}&lt;br /&gt;
==definition()==&lt;br /&gt;
&lt;br /&gt;
The definition of the elements to be included in the form, their &#039;types&#039; (PARAM_*), helpbuttons included, etc is all included in a function you must define in your class &#039;definition();&#039;&lt;br /&gt;
&lt;br /&gt;
definition() is used to define the elements in the form and &#039;&#039;&#039;this definition will be used for validating data submitted as well as for printing the form.&#039;&#039;&#039; For select and checkbox type elements only data that could have been selected will be allowed. And only data that corresponds to a form element in the defintion will be accepted as submitted data.&lt;br /&gt;
&lt;br /&gt;
The definition() should include all elements that are going to be used on form, some elements may be removed or tweaked later in definition_after_data(). Please do not create conditional elements in definition(), the definition() should not directly depend on the submitted data.&lt;br /&gt;
&lt;br /&gt;
==Use Fieldsets to group Form Elements==&lt;br /&gt;
&lt;br /&gt;
You use code like this to open a fieldset with a legend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
//-------------------------------------------------------------------------------&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;header&#039;, &#039;nameforyourheaderelement&#039;, get_string(&#039;titleforlegened&#039;, &#039;modulename&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can&#039;t yet nest these visible fieldsets unfortunately. But in fact groups of elements are wrapped in invisible fieldsets.&lt;br /&gt;
&lt;br /&gt;
You close a fieldset with moodle_form&#039;s closeHeaderBefore method. You tell closeHeaderBefore the element before you wish to end the fieldset. A fieldset is automatically closed if you open a new one. You need to use this code only if you want to close a fieldset and the subsequent form elements are not to be enclosed by a visible fieldset (they are still enclosed with an invisibe one with no legend) :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;closeHeaderBefore(&#039;buttonar&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==addElement==&lt;br /&gt;
&lt;br /&gt;
Use the addElement method to add an element to a form. The first few arguments are always the same. The first param is the type of the element to add. The second is the elementname to use which is normally the html name of the element in the form. The third is often the text for the label for the element.&lt;br /&gt;
&lt;br /&gt;
Some examples are below :&lt;br /&gt;
===button===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;button&#039;, &#039;intro&#039;, get_string(&amp;quot;buttonlabel&amp;quot;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A button element. If you want a submit or cancel button see &#039;submit&#039; element. &lt;br /&gt;
&lt;br /&gt;
===checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;ratingtime&#039;, get_string(&#039;ratingtime&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a simple checkbox. The third param for this element is the label to display on the left side of the form. You can also supply a string as a fourth param to specify a label that will appear on the right of the element. Checkboxes and radio buttons can be grouped and have individual labels on their right.&lt;br /&gt;
&lt;br /&gt;
====advcheckbox====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;advcheckbox&#039;, &#039;ratingtime&#039;, get_string(&#039;ratingtime&#039;, &#039;forum&#039;), &#039;Label displayed after checkbox&#039;, array(&#039;group&#039; =&amp;gt; 1), array(0, 1));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Similar to the checkbox above, but with a couple of important improvements:&lt;br /&gt;
&lt;br /&gt;
#The 5th parameter is a normal $attributes array, normally used to set HTML attributes for the &amp;lt;input&amp;gt; element. However, a special value of &#039;group&#039; can be given, which will add a class name to the element, and enable its grouping for a [[Development:lib/formslib.php_add_checkbox_controller|checkbox controller]]&lt;br /&gt;
#The 6th parameter is an array of values that will be associated with the checked/unchecked state of the checkbox. With a normal checkbox you cannot choose that value, and in fact an unchecked checkbox will not even be sent with the form data.&lt;br /&gt;
&lt;br /&gt;
===choosecoursefile===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;choosecoursefile&#039;, &#039;mediafile&#039;, get_string(&#039;mediafile&#039;, &#039;lesson&#039;), array(&#039;courseid&#039;=&amp;gt;$COURSE-&amp;gt;id));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Choose a file from the course files area. The fourth option is a list of options for the element. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
array(&#039;courseid&#039;=&amp;gt;null,//if it is null (default then use global $COURSE&lt;br /&gt;
 &#039;height&#039;=&amp;gt;500,// height of the popup window&lt;br /&gt;
 &#039;width&#039;=&amp;gt;750, // width of the popup window&lt;br /&gt;
&#039;options&#039;=&amp;gt;&#039;none&#039;);//options string for the pop up window &lt;br /&gt;
                   //eg. &#039;menubar=0,location=0,scrollbars,resizable&#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===date_selector===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;date_selector&#039;, &#039;assesstimefinish&#039;, get_string(&#039;to&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a date selector. You can select a Day, Month and Year using a group of select boxes. The fourth param here is an array of options. The defaults for the options are :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;array(&#039;startyear&#039;=&amp;gt;1970, &#039;stopyear&#039;=&amp;gt;2020,&lt;br /&gt;
                    &#039;timezone&#039;=&amp;gt;99, &#039;applydst&#039;=&amp;gt;true, &#039;optional&#039;=&amp;gt;false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can override these defaults by supplying an array as fourth param with one or more keys with a value to override the default. You can supply a fifth param of attributes here as well.&lt;br /&gt;
&lt;br /&gt;
===date_time_selector===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;date_time_selector&#039;, &#039;assesstimestart&#039;, get_string(&#039;from&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a group of select boxes to select a date (Day Month and Year) and time (Hour and Minute). When submitted, submitted data is processed and a timestamp is passed to $form-&amp;gt;get_data(); the fourth param here is an array of options. The defaults for the options are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;array(&#039;startyear&#039;=&amp;gt;1970, &#039;stopyear&#039;=&amp;gt;2020,&lt;br /&gt;
                    &#039;timezone&#039;=&amp;gt;99, &#039;applydst&#039;=&amp;gt;true, &#039;step&#039;=&amp;gt;5);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You can override these defaults by supplying an array as fourth param with one or more keys with a value to override the default. You can supply a fifth param of attributes here as well.&lt;br /&gt;
&lt;br /&gt;
===file===&lt;br /&gt;
&lt;br /&gt;
File upload input box with browse button. In the form definition type&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;file&#039;, &#039;attachment&#039;, get_string(&#039;attachment&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
after form submission and validation use&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            if ($data = $mform-&amp;gt;get_data()) {&lt;br /&gt;
              ...&lt;br /&gt;
              $mform-&amp;gt;save_files($destination_directory);&lt;br /&gt;
              ...&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you need advanced settings such as required file, different max upload size or name of uploaded file&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
            $this-&amp;gt;set_upload_manager(new upload_manager(&#039;attachment&#039;, true, false, $COURSE, false, 0, true, true, false));&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;file&#039;, &#039;attachment&#039;, get_string(&#039;attachment&#039;, &#039;forum&#039;));&lt;br /&gt;
            $mform-&amp;gt;addRule(&#039;attachment&#039;, null, &#039;required&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            if ($data = $mform-&amp;gt;get_data()) {&lt;br /&gt;
              ...&lt;br /&gt;
              $mform-&amp;gt;save_files($destination_directory);&lt;br /&gt;
              $newfilename = $mform-&amp;gt;get_new_filename();&lt;br /&gt;
              ...&lt;br /&gt;
            }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When porting old code it is also possible to use the upload manager directly for processing of uploaded files.&lt;br /&gt;
&lt;br /&gt;
Please note that if using set_upload_manager() it must be before addElement(&#039;file&#039;,..).&lt;br /&gt;
&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
File uploading was rewritten in 2.0. Please see inline docs for now. This page will be updated when the new API stabilises.&lt;br /&gt;
&lt;br /&gt;
===filepicker===&lt;br /&gt;
{{Moodle 2.0}}&lt;br /&gt;
General replacement of &#039;&#039;file&#039;&#039; element.&lt;br /&gt;
&lt;br /&gt;
===hidden===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;reply&#039;, &#039;yes&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A hidden element. Set the element name (in this case &#039;&#039;&#039;reply&#039;&#039;&#039;) to the stated value (in this case &#039;&#039;&#039;yes&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
===htmleditor &amp;amp; format===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;htmleditor&#039;, &#039;text&#039;, get_string(&#039;choicetext&#039;, &#039;choice&#039;));&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;text&#039;, PARAM_RAW);&lt;br /&gt;
	$mform-&amp;gt;addRule(&#039;text&#039;, null, &#039;required&#039;, null, &#039;client&#039;);&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;format&#039;, &#039;format&#039;, get_string(&#039;format&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
You can supply a fourth param to htmleditor of an array of options :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
array(&#039;canUseHtmlEditor&#039;=&amp;gt;&#039;detect&#039;,&#039;rows&#039;=&amp;gt;10, &#039;cols&#039;=&amp;gt;65, &lt;br /&gt;
&#039;width&#039;=&amp;gt;0,&#039;height&#039;=&amp;gt;0, &#039;course&#039;=&amp;gt;0);&lt;br /&gt;
//options same as print_textarea params&lt;br /&gt;
//use rows and cols options to control htmleditor size.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===modgrade===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;modgrade&#039;, &#039;scale&#039;, get_string(&#039;grade&#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is a custom element for selecting a grade for any activity module. The fourth argument is whether to include an option for no grade which has a value 0. This select box does include scales. The default is true, include no grade option.&lt;br /&gt;
&lt;br /&gt;
A helpbutton is automatically added.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===password===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;password&#039;, &#039;password&#039;, get_string(&#039;label&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A password element. Fourth param is an array or string of attributes.&lt;br /&gt;
&lt;br /&gt;
===passwordunmask===&lt;br /&gt;
{{Moodle 1.9}}&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;passwordunmask&#039;, &#039;password&#039;, get_string(&#039;label&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A password element with option to show the password in plaintext. Fourth param is an array or string of attributes.&lt;br /&gt;
&lt;br /&gt;
===radio===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $radioarray=array();&lt;br /&gt;
        $radioarray[] = &amp;amp;MoodleQuickForm::createElement(&#039;radio&#039;, &#039;yesno&#039;, &#039;&#039;, get_string(&#039;yes&#039;), 1, $attributes);&lt;br /&gt;
        $radioarray[] = &amp;amp;MoodleQuickForm::createElement(&#039;radio&#039;, &#039;yesno&#039;, &#039;&#039;, get_string(&#039;no&#039;), 0, $attributes);&lt;br /&gt;
        $mform-&amp;gt;addGroup($radioarray, &#039;radioar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Second param names the radio button and should be the same for each button in the group in order to toggle correctly. Third param would be the label for the form element but is generally ignored as this element will always be in a group which has it&#039;s own label. Fourth param is a string, a label to be displayed on the right of the element. The fifth is the value for this radio button. $attributes can be a string or an array of attributes.&lt;br /&gt;
&lt;br /&gt;
It is possible to add help to individual radio buttons but this requires a custom template to be defined for the group elements. See MDL-15571.&lt;br /&gt;
&lt;br /&gt;
====setDefault====&lt;br /&gt;
&lt;br /&gt;
To set the default for a radio button group as above use the following :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;yesno&#039;, 0);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This would make the default &#039;no&#039;.&lt;br /&gt;
&lt;br /&gt;
===select===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;select&#039;, &#039;type&#039;, get_string(&#039;forumtype&#039;, &#039;forum&#039;), $FORUM_TYPES, $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The fourth param for this element is an array of options for the select box. The keys are the values for the option and the value of the array is the text for the option. The fifth param $attributes is optional, see text element for description of attributes param.&lt;br /&gt;
&lt;br /&gt;
====multi-select====&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $select = &amp;amp;$mform-&amp;gt;addElement(&#039;select&#039;, &#039;colors&#039;, get_string(&#039;colors&#039;), array(&#039;red&#039;, &#039;blue&#039;, &#039;green&#039;), $attributes);&lt;br /&gt;
        $select-&amp;gt;setMultiple(true);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===selectyesno===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;selectyesno&#039;, &#039;maxbytes&#039;, get_string(&#039;maxattachmentsize&#039;, &#039;forum&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you want a yes / no select box this one automatically translates itself and has value 1 for yes and 0 for no.&lt;br /&gt;
&lt;br /&gt;
===static===&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
         $mform-&amp;gt;addElement(&#039;static&#039;, &#039;description&#039;, get_string(&#039;description&#039;, &#039;exercise&#039;),&lt;br /&gt;
                  get_string(&#039;descriptionofexercise&#039;, &#039;exercise&#039;, $COURSE-&amp;gt;students));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is a static element. It should be used with care it is used to display a static piece of text with a label. The third param is the label and the fourth is the static text itself.&lt;br /&gt;
&lt;br /&gt;
===submit, reset and cancel===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        //normally you use add_action_buttons instead of this code&lt;br /&gt;
        $buttonarray=array();&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;submit&#039;, &#039;submitbutton&#039;, get_string(&#039;savechanges&#039;));&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;reset&#039;, &#039;resetbutton&#039;, get_string(&#039;revert&#039;));&lt;br /&gt;
        $buttonarray[] = &amp;amp;$mform-&amp;gt;createElement(&#039;cancel&#039;);&lt;br /&gt;
        $mform-&amp;gt;addGroup($buttonarray, &#039;buttonar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
        $mform-&amp;gt;closeHeaderBefore(&#039;buttonar&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A &#039;Submit&#039; type element is a submit type form element which will submit the form. A &#039;Reset&#039; will not submit the form but will reset any changes the user has made to form contents. A &#039;Cancel&#039; element cancels form submission. You need to have a branch in your code before you check for get_data() to check if submission has been cancelled with is_cancelled(); See the example on the usage page.&lt;br /&gt;
&lt;br /&gt;
You should name your submit and reset buttons &#039;submitbutton&#039; and &#039;resetbutton&#039; or something similar (not &#039;submit&#039; and &#039;reset&#039;). This avoids problems in JavaScript of collisions between form element names and names of JavaScript methods of the form object.&lt;br /&gt;
&lt;br /&gt;
====add_action_buttons($cancel = true, $submitlabel=null);====&lt;br /&gt;
&lt;br /&gt;
You will normally use this helper function which is a method of moodleform to add all the &#039;action&#039; buttons to the end of your form. A boolean parameter allow you to specify whether to include a cancel button and specify the label for your submit button (pass the result of get_string). Default for the submit button label is get_string(&#039;savechanges&#039;).&lt;br /&gt;
&lt;br /&gt;
===text===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;name&#039;, get_string(&#039;forumname&#039;, &#039;forum&#039;), $attributes);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For a simple text element. Your fourth parameter here can be a string or array of attributes for the text element. The following are equivalent :&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $attributes=&#039;size=&amp;quot;20&amp;quot;&#039;;&lt;br /&gt;
        $attributes=array(&#039;size&#039;=&amp;gt;&#039;20&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
Generally you are encouraged to use CSS instead of using attributes for styling.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A format element can be used as a format select box. It will be non-selectable if you&#039;re using an html editor.&lt;br /&gt;
&lt;br /&gt;
The third param for this element is $useHtmlEditor and it defaults to null in which case an html editor is used if the browser and user profile support it.&lt;br /&gt;
&lt;br /&gt;
===textarea===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;addElement(&#039;textarea&#039;, &#039;introduction&#039;, get_string(&amp;quot;introtext&amp;quot;, &amp;quot;survey&amp;quot;), &#039;wrap=&amp;quot;virtual&amp;quot; rows=&amp;quot;20&amp;quot; cols=&amp;quot;50&amp;quot;&#039;);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A textarea element. If you want an htmleditor use htmleditor element. Fourth element here is a string or array of attributes.&lt;br /&gt;
&lt;br /&gt;
==addGroup==&lt;br /&gt;
&lt;br /&gt;
A &#039;group&#039; in formslib is just a group of elements that will have a label and will be included on one line. &lt;br /&gt;
&lt;br /&gt;
For example typical code to include a submit and cancel button on the same line : &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $buttonarray=array();&lt;br /&gt;
        $buttonarray[] =&amp;amp; $mform-&amp;gt;createElement(&#039;submit&#039;, &#039;submitbutton&#039;, get_string(&#039;savechanges&#039;));&lt;br /&gt;
        $buttonarray[] =&amp;amp; $mform-&amp;gt;createElement(&#039;submit&#039;, &#039;cancel&#039;, get_string(&#039;cancel&#039;));&lt;br /&gt;
        $mform-&amp;gt;addGroup($buttonarray, &#039;buttonar&#039;, &#039;&#039;, array(&#039; &#039;), false);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You use the same arguments for createElement as you do for addElement. Any label for the element in the third argument is normally ignored (but not in the case of the submit buttons above where the third argument is not for a label but is the text for the button).&lt;br /&gt;
&lt;br /&gt;
Here&#039;s an example of putting a date_selector (which is itself a group of elements) and a checkbox on the same line, note that you can disable every element in the group using the group name &#039;availablefromgroup&#039; but it doesn&#039;t disable the controlling element the &#039;availablefromenabled&#039; checkbox:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $availablefromgroup=array();&lt;br /&gt;
	$availablefromgroup[] =&amp;amp; $mform-&amp;gt;createElement(&#039;date_selector&#039;, &#039;availablefrom&#039;, &#039;&#039;);&lt;br /&gt;
	$availablefromgroup[] =&amp;amp; $mform-&amp;gt;createElement(&#039;checkbox&#039;, &#039;availablefromenabled&#039;, &#039;&#039;, get_string(&#039;enable&#039;));&lt;br /&gt;
        $mform-&amp;gt;addGroup($availablefromgroup, &#039;availablefromgroup&#039;, get_string(&#039;availablefromdate&#039;, &#039;data&#039;), &#039;&amp;amp;nbsp;&#039;, false);&lt;br /&gt;
        $mform-&amp;gt;disabledIf(&#039;availablefromgroup&#039;, &#039;availablefromenabled&#039;);&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==setHelpButton==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
            $mform-&amp;gt;setHelpButton(&#039;lessondefault&#039;, array(&#039;lessondefault&#039;, get_string(&#039;lessondefault&#039;, &#039;lesson&#039;), &#039;lesson&#039;));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
First param is an elementname and the second param is an array of params that are passed to helpbutton in weblib.php. Params are :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 * @param string $page  The keyword that defines a help page&lt;br /&gt;
 * @param string $title The title of links, rollover tips, alt tags etc&lt;br /&gt;
 *           &#039;Help with&#039; (or the language equivalent) will be prefixed and &#039;...&#039; will be stripped.&lt;br /&gt;
 * @param string $module Which module is the page defined in&lt;br /&gt;
 * @param mixed $image Use a help image for the link?  (true/false/&amp;quot;both&amp;quot;)&lt;br /&gt;
 * @param boolean $linktext If true, display the title next to the help icon.&lt;br /&gt;
 * @param string $text If defined then this text is used in the page, and&lt;br /&gt;
 *           the $page variable is ignored.&lt;br /&gt;
 * @param boolean $return If true then the output is returned as a string, if false it is printed to the current page.&lt;br /&gt;
 * @param string $imagetext The full text for the helpbutton icon. If empty use default help.gif&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Make sure you don&#039;t set boolean $return to false. &lt;br /&gt;
&lt;br /&gt;
You need to do use this method after addElement();&lt;br /&gt;
&lt;br /&gt;
==setDefault==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;select&#039;, &#039;grade&#039;, get_string(&#039;gradeforsubmission&#039;, &#039;exercise&#039;), $grades);&lt;br /&gt;
        $mform-&amp;gt;setHelpButton(&#039;grade&#039;, array(&#039;grade&#039;, get_string(&#039;gradeforsubmission&#039;, &#039;exercise&#039;), &#039;exercise&#039;));&lt;br /&gt;
        $mform-&amp;gt;setDefault(&#039;grade&#039;, 100);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Set the default of the form value with setDefault($elementname, $value); where elementname is the elementname whose default you want to set and $value is the default to set. We set the defaults for the form in definition(). This default is what is used if no data is loaded into the form with set_data(); eg. on display of the form for an &#039;add&#039; rather than &#039;update&#039; function.&lt;br /&gt;
&lt;br /&gt;
==disabledIf==&lt;br /&gt;
&lt;br /&gt;
For any element or groups of element in a form you can conditionally disable the group or individual element depending on conditions.&lt;br /&gt;
&lt;br /&gt;
You can use $mform-&amp;gt;disabledIf($elementName, $dependentOn, $condition = &#039;notchecked&#039;, $value=null)&lt;br /&gt;
&lt;br /&gt;
* elementname can be a group. If you specify a group all elements in the group will be disabled (if dependentOn is in elementname group that is ignored and not disabled). These are the element names you&#039;ve used as the first argument in addElement or addGroup.&lt;br /&gt;
* dependentOn is the actual name of the element as it will appear in html. This can be different to the name used in addGroup particularly but also addElement where you&#039;re adding a complex element like a date_selector. Check the html of your page. You typically make the depedentOn a checkbox or select box.&lt;br /&gt;
* $condition will be notchecked, checked, selected, eq or if it is anything else then we test for neq.&lt;br /&gt;
* If $condition is eq or neq then we check the value of the dependentOn field and check for equality (==) or nonequality (!=) in js&lt;br /&gt;
* If $condition is checked or notchecked then we check to see if a checkbox is checked or not.&lt;br /&gt;
* If $condition is selected then we check to see if a particular option is selected from a dropdown list.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: I am not sure this section is complete. I just found and added one missing case, but there may be others--[[User:Tim Hunt|Tim Hunt]] 06:04, 15 October 2007 (CDT)&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==setType==&lt;br /&gt;
&lt;br /&gt;
PARAM_* types are used to specify how a submitted variable should be cleaned. These should be used for get parameters such as id, course etc. which are used to load a page and also with setType(); method. Every form element should have a type specified except select, radio box and checkbox elements, these elements do a good job of cleaning themselves (only specified options are allowed as user input).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Most Commonly Used PARAM_* Types===&lt;br /&gt;
&lt;br /&gt;
These are the most commonly used PARAM_* types and their proper uses. More types can be seen in moodlelib.php starting around line 100.&lt;br /&gt;
&lt;br /&gt;
* PARAM_CLEAN is deprecated and you should try to use a more specific type.&lt;br /&gt;
* PARAM_TEXT should be used for cleaning data that is expected to be plain text. It will strip all html tags. But will still let tags for multilang support through.&lt;br /&gt;
* PARAM_NOTAGS should be used for cleaning data that is expected to be plain text. It will strip *all* html type tags. It will still *not* let tags for multilang support through. This should be used for instance for email addresses where no multilang support is appropriate.&lt;br /&gt;
* PARAM_RAW means no cleaning whatsoever, it is used mostly for data from the html editor. Data from the editor is later cleaned before display using format_text() function. PARAM_RAW can also be used for data that is validated by some other way or printed by p() or s().&lt;br /&gt;
* PARAM_INT should be used for integers.&lt;br /&gt;
* PARAM_ACTION is an alias of PARAM_ALPHA and is used for hidden fields specifying form actions.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
* [http://web.archive.org/web/20080214041550/http://www.midnighthax.com/quickform.php PEAR HTML QuickForm Getting Started Guide by Keith Edmunds of Midnighthax.com (via archive.org as original now dead)]&lt;br /&gt;
&lt;br /&gt;
[[Category:Formslib]]&lt;/div&gt;</summary>
		<author><name>Mike1989</name></author>
	</entry>
</feed>