<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pramette</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/test/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pramette"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/Special:Contributions/Pramette"/>
	<updated>2026-04-21T21:45:50Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Development:Obsolete_-_Moodle_forms_library&amp;diff=19865</id>
		<title>Development:Obsolete - Moodle forms library</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Development:Obsolete_-_Moodle_forms_library&amp;diff=19865"/>
		<updated>2007-02-01T22:28:17Z</updated>

		<summary type="html">&lt;p&gt;Pramette: /* Exaples of converting existing Moodle forms */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;This was a proposal for discussion - you can see info about the development of the formslib [[Development:lib/formslib.php|here]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The OU has developed quite a nice in-house library to simplify creating Moodle editing forms. We would like to contribute it back to the community, and then as part of the accessibility work we are comissioning, get all Moodle forms modified to use it. However, before we can contribute it back, we need to get consensus withing the community that it is right for Moodle, and we need to tidy up the code a bit.&lt;br /&gt;
&lt;br /&gt;
This document outlines how the library should work after cleaning up, so the community can see whether they like it, and OU developers know what is involved in the cleanup.&lt;br /&gt;
&lt;br /&gt;
==What the system will be capable of==&lt;br /&gt;
&lt;br /&gt;
The library allows developers to create editing forms by creating a high-level representation of the form as a data-structure in memory, configuring all necessary options, and setting initial values of fields, and then the library generates the actual HTML of the form to include in the page.&lt;br /&gt;
&lt;br /&gt;
We are not planning to change significantly the way that Moodle editing forms look and function. However, by putting all the HTML (and JavaScript, CSS, ...) generation in one place, we make it much easier to make systematic improvements to accessibility, usability, client-side validation, etc. in future. Indeed, the OU&#039;s code already generates HTML that is a bit more accessible that most Moodle forms.&lt;br /&gt;
&lt;br /&gt;
By allowing developers to think at a higher level, we make their life easier, in the same way that datalib saves them from worrying about the details of SQL most of the time.&lt;br /&gt;
&lt;br /&gt;
The general way the library will work is that it will assume sensible defaults for everything to reduce the amount that has to be typed. So for a lot of input fields, you will only have to specify&lt;br /&gt;
&lt;br /&gt;
# the field type (e.g. text, think &amp;lt;input type=&amp;quot;&amp;quot; ... /&amp;gt;, However the hope would be to move towards higher-level types, such as integer, path, url, as in require_param, etc.)&lt;br /&gt;
# the field name (think &amp;lt;input name=&amp;quot;&amp;quot; ... /&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
Everything else that is needed will be derived from these using sensible defaults. We need label text? We&#039;ll look up the field name in the lang file (each form will specify which lang file to use). We need a help link? Well, use /lang/en_utf8/help$langfile/$name.html. We need a field size? Each type will have a sensible default.&lt;br /&gt;
&lt;br /&gt;
However, if you want to override any of these defaults, you can by setting that option explicitly. Because there will be lots of options, and normally you will only need to change a few, the library will use a named attribute style, so example code would look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$field = new text_field(&#039;fieldname&#039;);&lt;br /&gt;
$field-&amp;gt;set_set(&#039;size&#039;, 30);&lt;br /&gt;
$field-&amp;gt;set_set(&#039;label&#039;, &#039;lablestring&#039;);&lt;br /&gt;
&lt;br /&gt;
// or &lt;br /&gt;
&lt;br /&gt;
$field = new text_field(&#039;fieldname&#039;);&lt;br /&gt;
$field-&amp;gt;set_set(array(&#039;size&#039; =&amp;gt; 30, &#039;label&#039; =&amp;gt; &#039;lablestring&#039;));&lt;br /&gt;
&lt;br /&gt;
// or &lt;br /&gt;
&lt;br /&gt;
$field = new text_field(&#039;fieldname&#039;, array(&lt;br /&gt;
        &#039;size&#039; =&amp;gt; 30, &lt;br /&gt;
        &#039;label&#039; =&amp;gt; &#039;lablestring&#039;&lt;br /&gt;
));&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this example, &#039;lablestring&#039; would again get looked up in the lang file automatically.&lt;br /&gt;
&lt;br /&gt;
For this situation, where there are lots of options available, but most people only need to change a few, I think this style of API works better than PHP function calls with lots of optional parameters. The options available for each field type will be documented in the comment where that class is defined.&lt;br /&gt;
&lt;br /&gt;
The library is designed to make it easy to add new field types, or new options to existing field types. Indeed, that is how the library has evolved so far: a bit at a time as needed. &lt;br /&gt;
&lt;br /&gt;
New field types are just new PHP classes, and they are likely to be subclasses of a base class that only change a few things. They don&#039;t even have to be defined in the central form library. If you need an specialist field type only within one (e.g. contrib) module, you can create a new field-type subclass in that module code and use it in that modules forms without having to touch core code. And if we later want to move that field type into core, it is trivial to move the class definition.&lt;br /&gt;
&lt;br /&gt;
Since we will have to tidy up the code anyway, all the function/class/method/option names in the API are potentially changable.&lt;br /&gt;
&lt;br /&gt;
==PHP API==&lt;br /&gt;
&lt;br /&gt;
Each thing in the API will be a PHP class, these basically fall into three categories: the whole form, groupings of form fields, and individual field types. Note that the groupings are currently only used for functional reasons, like showing or hiding groups of elements. Logical groupings, that would correspond to &amp;lt;fieldset&amp;gt; tags for accessibility, are not included yet, but could be added.&lt;br /&gt;
&lt;br /&gt;
I am just going to list all the possible method calls. I will assume that it is clear what they do from their names (and I am running out of time).&lt;br /&gt;
&lt;br /&gt;
===The whole form===&lt;br /&gt;
&lt;br /&gt;
There is a class to represent a form, and most of the time you will be able to do everything you want to do by calling methods on this class, and you don&#039;t have to worry about the rest of the API.&lt;br /&gt;
&lt;br /&gt;
 $mf = new moodle_form($langfile);&lt;br /&gt;
&lt;br /&gt;
 $field = &amp;amp;$mf-&amp;gt;add($fieldtype, $fieldname, $fieldoptions, $insertbefore);&lt;br /&gt;
 $field = &amp;amp;$mf-&amp;gt;add_item($fieldobject, $insertbefore); // $insertbefore is optional. By default things are inserted at the end of the form.&lt;br /&gt;
 $field = &amp;amp;$mf-&amp;gt;remove($fieldname);&lt;br /&gt;
 $field = &amp;amp;$mf-&amp;gt;get($fieldname);&lt;br /&gt;
&lt;br /&gt;
These let you add or remove things from the form. The field you have just done stuff to is returned, but most of the time you will not bother to do anything with the return value. These method work with groups, etc. not just fields.&lt;br /&gt;
&lt;br /&gt;
 $mf-&amp;gt;set_action($url);&lt;br /&gt;
 $mf-&amp;gt;set_init_html_editor(); // There was a reason why the library can&#039;t guess this from the list of fields.&lt;br /&gt;
 $mf-&amp;gt;set_submit_caption($langstringid);&lt;br /&gt;
 $mf-&amp;gt;set_hidden($fieldname, $value);&lt;br /&gt;
 $mf-&amp;gt;set_value($fieldname, $value); // The initial value for this field. (or use the $form attribute on show()).  &lt;br /&gt;
 $mf-&amp;gt;set_error($fieldname, $message); // Error message to be displayed in red next to this field if you are doing server-side validation.&lt;br /&gt;
&lt;br /&gt;
 $mf-&amp;gt;show($action, $form);&lt;br /&gt;
&lt;br /&gt;
Show the form. $form is an object holding the default value of each field that has not already been set using set_value().&lt;br /&gt;
&lt;br /&gt;
 $mf-&amp;gt;add_xhtml($htmlphpcode, $insertbefore);&lt;br /&gt;
 $mf-&amp;gt;set_xhtml_param($name, $value);&lt;br /&gt;
&lt;br /&gt;
You can insert arbitrary bits of HTML of PHP code into the forum using this. When outputting the form, the library does &#039;&#039;&#039;eval(&#039;?&amp;gt;&#039;.$htmlphpcode.&#039;&amp;lt;?php &#039;);&#039;&#039;&#039; in a place where $form is in scope, and the variables passed in via set_xhtml_param are available from an array as $xmlform[$name].&lt;br /&gt;
&lt;br /&gt;
 $new_mf = moodle_form::loadfile($xmlfilename);&lt;br /&gt;
 $new_mf = moodle_form::loadstring($xmlstring);&lt;br /&gt;
&lt;br /&gt;
Create a whole form using the XML syntax mentioned below.&lt;br /&gt;
&lt;br /&gt;
===Fields===&lt;br /&gt;
&lt;br /&gt;
The library also has classes representing the different field types, which you can use if you want.&lt;br /&gt;
&lt;br /&gt;
 $field = new xxxx_field($name, $options_array); // where xxxx is one of the field types below.&lt;br /&gt;
 $field-&amp;gt;set($optionname, $optionvalue);&lt;br /&gt;
 $field-&amp;gt;set($optionarray); // Array of $optionname =&amp;gt; $optionvalue pairs.&lt;br /&gt;
 $optionvalue = $field-&amp;gt;get($optionname);&lt;br /&gt;
&lt;br /&gt;
 $field-&amp;gt;set_value($value); // Sets the initial value of this field.&lt;br /&gt;
&lt;br /&gt;
 $field-&amp;gt;output($form); // Print this form element. &lt;br /&gt;
&lt;br /&gt;
Normally you won&#039;t call output() directly. You will call $mf-&amp;gt;output, which will call $field-&amp;gt;output on each field for you, but you can use this yourself if you just want to print one form control anywhere you like, not as part of a form.&lt;br /&gt;
&lt;br /&gt;
===Groups===&lt;br /&gt;
&lt;br /&gt;
Groups (which will probably get renamed to conditionalshow, but I don&#039;t want to change all the examples just now) allow you to show or hide a collection of fields, depending on the setting of another field.&lt;br /&gt;
&lt;br /&gt;
groups have basically the same methods as fields, but $name is optional. $name has no function, unless you need to identify the group later for a call the $mf-&amp;gt;get($groupname);&lt;br /&gt;
&lt;br /&gt;
There are a few extra methods they have over fields:&lt;br /&gt;
&lt;br /&gt;
 $field = &amp;amp;$group-&amp;gt;add($fieldtype, $fieldname, $fieldoptions, $insertbefore);&lt;br /&gt;
 $field = &amp;amp;$group-&amp;gt;add_item($fieldobject, $insertbefore);&lt;br /&gt;
 $field = &amp;amp;$group-&amp;gt;remove($fieldname);&lt;br /&gt;
 $field = &amp;amp;$group-&amp;gt;get($fieldname);&lt;br /&gt;
&lt;br /&gt;
 $group-&amp;gt;set_condition($conditionfield, $conditionvalue);&lt;br /&gt;
&lt;br /&gt;
The elements within the group will only be visible when the field $conditionfield elsewhere in the form has value $conditionvalue. This works best when $conditionfield is a dropdown.&lt;br /&gt;
&lt;br /&gt;
Do we also want a conditionalenable group that enables/disables a bunch of fields, rather than showing or hiding them?&lt;br /&gt;
&lt;br /&gt;
===Multiples===&lt;br /&gt;
&lt;br /&gt;
This lets you do things like enter multiple usernames, as in the &#039;working example&#039; below. You would also use it on the editing form for multiple choice questions, to enter any number of answers with matching grades.&lt;br /&gt;
&lt;br /&gt;
Again, they support the same methods as fields, and also:&lt;br /&gt;
&lt;br /&gt;
 $field = &amp;amp;$multiple-&amp;gt;add($fieldtype, $fieldname, $fieldoptions, $insertbefore);&lt;br /&gt;
 $field = &amp;amp;$multiple-&amp;gt;add_item($fieldobject, $insertbefore);&lt;br /&gt;
 $field = &amp;amp;$multiple-&amp;gt;remove($fieldname);&lt;br /&gt;
 $field = &amp;amp;$multiple-&amp;gt;get($fieldname);&lt;br /&gt;
&lt;br /&gt;
 $multiple-&amp;gt;set_max($number);&lt;br /&gt;
&lt;br /&gt;
For accessibility reasons, multiples work by printing a certain number of copies into the HTML, and these are then shown or hidden by the JavaScript. This is for accessibility reasons, and so the forms work without JavaScript. max is the number of copies that are printed. It defaults to 10.&lt;br /&gt;
&lt;br /&gt;
==Field types initially supported==&lt;br /&gt;
&lt;br /&gt;
All field will support the options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;lable&#039;&#039;&#039; the field lable. This is a string that is looked up in the language file. Or, if the string starts with an &#039;=&#039; character, then this is trimmed off, and the rest of the string is used literally. Defaults to name.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;help&#039;&#039;&#039; the name of the help file to link to. Defaults to name. Setting to &#039;&#039; removes the help icon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;helpalt&#039;&#039;&#039; the langstring to use for the tooltip of the help icon.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;optional&#039;&#039;&#039; if set to &#039;yes&#039;, then adds a checkbox before the field to enable or diable it. The checkbox&#039;s name is name is constructed by taking the field name and appending &#039;enable&#039;. If you want another name, set this option to the checkbox name, instead of &#039;yes&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;needcapability&#039;&#039;&#039; this is mainly aimed at 1.7 roles and permissions. Will hide this field unless the user has the named capability. At first, this will only recognise the values admin, teacher, student, noneditingteacher, guest, and translate these into the obvious isadmin() type calls.&lt;br /&gt;
&lt;br /&gt;
More options will probably get added in future.&lt;br /&gt;
&lt;br /&gt;
===display===&lt;br /&gt;
&lt;br /&gt;
Just diplay a value with a label, the value can&#039;t be edited.&lt;br /&gt;
&lt;br /&gt;
===text===&lt;br /&gt;
&lt;br /&gt;
Text input box.&lt;br /&gt;
&lt;br /&gt;
Supports the additional options:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;required&#039;&#039;&#039; a regexp that is used for client-side validation against that regexp.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;size&#039;&#039;&#039; as in &amp;lt;input size=&amp;quot;&amp;quot; ... /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===file===&lt;br /&gt;
&lt;br /&gt;
File upload box.&lt;br /&gt;
&lt;br /&gt;
===date===&lt;br /&gt;
&lt;br /&gt;
Date, like quiz open and close dates.&lt;br /&gt;
&lt;br /&gt;
===html===&lt;br /&gt;
&lt;br /&gt;
The standard HTML editor, or just a text area, depending on the settings. (This calls print_textarea).&lt;br /&gt;
&lt;br /&gt;
===dropdown===&lt;br /&gt;
&lt;br /&gt;
A dropdown menu. This field has the additional methods:&lt;br /&gt;
&lt;br /&gt;
 $dropdown-&amp;gt;add_option($value, $label);&lt;br /&gt;
 $dropdown-&amp;gt;remove_option($value);&lt;br /&gt;
&lt;br /&gt;
$label is optional. By default: if $value is an integer, use that integer as the label, otherwise look $value up in the langfile.&lt;br /&gt;
&lt;br /&gt;
Dropdown supports the additional option:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;default&#039;&#039;&#039; which option to select by default.&lt;br /&gt;
&lt;br /&gt;
===radio===&lt;br /&gt;
&lt;br /&gt;
A set of linked radio buttons, which are defined in the same way as dropdown menu options.&lt;br /&gt;
&lt;br /&gt;
===multiselect===&lt;br /&gt;
&lt;br /&gt;
A list box where you can select multiple options, which are defined in the same way as dropdown menu options.&lt;br /&gt;
&lt;br /&gt;
Actually, I think we should change the implementation of this to use a set of checkboxes when there are fewer than about a dozen options, and automatically switch to useing a list box when there are more than that. And maybe add an optional parameter to force the listbox/checkbox decision one way or the other.&lt;br /&gt;
&lt;br /&gt;
===yesno===&lt;br /&gt;
&lt;br /&gt;
A dropdown menu with just the two options &#039;yes&#039; and &#039;no&#039;.&lt;br /&gt;
&lt;br /&gt;
===user===&lt;br /&gt;
&lt;br /&gt;
A flashy text box where you can enter user&#039;s names, and it does AJAX stuff to help you auto-complete them.&lt;br /&gt;
&lt;br /&gt;
===visible===&lt;br /&gt;
&lt;br /&gt;
This generates the standard &amp;quot;Visible to students&amp;quot; field that appears on add/update module forms.&lt;br /&gt;
&lt;br /&gt;
===groupmode===&lt;br /&gt;
&lt;br /&gt;
This generates the standard &amp;quot;Group mode&amp;quot; field that appears on add/update module forms.&lt;br /&gt;
&lt;br /&gt;
==XML form definition format==&lt;br /&gt;
&lt;br /&gt;
This provides the quickest way to create most forms. It should be clear how this translates into the PHP API calls defined above. XML elements $mf-&amp;gt;add() calls. XML attributes correspond either to required information, or to set_opt calls. Form filds, like dropdowns, that need extra information get it from child elements. See the examples below for what it looks like.&lt;br /&gt;
&lt;br /&gt;
==A working example==&lt;br /&gt;
&lt;br /&gt;
Here is an example of a form produced with the current (un-cleaned-up) version of the OU&#039;s library. The form looks like this:&lt;br /&gt;
&lt;br /&gt;
[[Image:Formproposal_Add_newsfeed_form.png]]&lt;br /&gt;
&lt;br /&gt;
There is some OU-specific stuff here, like presentation and authids, and the fact that we reveal $user-&amp;gt;username to teachers. I am assuming you can filter that out.&lt;br /&gt;
&lt;br /&gt;
More interestingly, notice that&lt;br /&gt;
&lt;br /&gt;
* The required field Name has not been filled it, so its label is red, and the create button is disabled. Below, you will see that anything typed into this field will actually be validated against a regular expression.&lt;br /&gt;
* The user field type does cool AJAX to save you typing the whole name.&lt;br /&gt;
* After you have added one user as a poster, a second box appeared where we could type a second user name. And when we finish typing here, a third box will appear.&lt;br /&gt;
&lt;br /&gt;
The XML defining the form looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;editform langfile=&#039;block_newsfeed&#039;&amp;gt;&lt;br /&gt;
     &amp;lt;text name=&#039;location&#039;/&amp;gt;&lt;br /&gt;
     &amp;lt;text name=&#039;name&#039; required=&#039;\S&#039;/&amp;gt;&lt;br /&gt;
     &amp;lt;text name=&#039;pres&#039; required=&#039;^([0-9]{2}[a-zA-Z]?)?$&#039;/&amp;gt;&lt;br /&gt;
     &amp;lt;html name=&#039;summary&#039;/&amp;gt;&lt;br /&gt;
     &amp;lt;dropdown name=&#039;type&#039;&amp;gt;&lt;br /&gt;
       &amp;lt;option value=&#039;internal&#039;&amp;gt;type_internal&amp;lt;/option&amp;gt;&lt;br /&gt;
       &amp;lt;option value=&#039;external&#039;&amp;gt;type_external&amp;lt;/option&amp;gt;&lt;br /&gt;
     &amp;lt;/dropdown &amp;gt;&lt;br /&gt;
     &amp;lt;group requiredname=&amp;quot;type&amp;quot; requiredvalue=&amp;quot;external&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;item type=&#039;text&#039; name=&#039;url&#039;/&amp;gt;&lt;br /&gt;
     &amp;lt;/group&amp;gt;&lt;br /&gt;
     &amp;lt;group requiredname=&amp;quot;type&amp;quot; requiredvalue=&amp;quot;internal&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;date name=&#039;startdate&#039;/&amp;gt;&lt;br /&gt;
         &amp;lt;dropdown name=&#039;public&#039;&amp;gt;&lt;br /&gt;
           &amp;lt;option value=&#039;1&#039;&amp;gt;access_public&amp;lt;/option&amp;gt;&lt;br /&gt;
           &amp;lt;option value=&#039;0&#039;&amp;gt;access_private&amp;lt;/option&amp;gt;&lt;br /&gt;
         &amp;lt;/dropdown &amp;gt;&lt;br /&gt;
         &amp;lt;text name=&#039;defaultauthid&#039;/&amp;gt;&lt;br /&gt;
         &amp;lt;multiple&amp;gt;&lt;br /&gt;
             &amp;lt;text name=&#039;optionalauthids&#039; required=&#039;^([A-Z0-9]+)?$&#039;/&amp;gt;&lt;br /&gt;
         &amp;lt;/multiple&amp;gt;&lt;br /&gt;
         &amp;lt;multiple&amp;gt;&lt;br /&gt;
             &amp;lt;user name=&#039;posters&#039;/&amp;gt;&lt;br /&gt;
         &amp;lt;/multiple&amp;gt;&lt;br /&gt;
         &amp;lt;multiple&amp;gt;&lt;br /&gt;
             &amp;lt;user name=&#039;approvers&#039;/&amp;gt;&lt;br /&gt;
         &amp;lt;/multiple&amp;gt;&lt;br /&gt;
     &amp;lt;/group&amp;gt;          &lt;br /&gt;
&amp;lt;/editform&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The PHP code that creates the form definition ($xf), and the object with all the current values ($form) and sets all the default values looks like this:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$xf=xml_form::load_file(&#039;editfeed.xml&#039;);&lt;br /&gt;
$xf-&amp;gt;set_init_html_editor(true);&lt;br /&gt;
$form=new stdClass;&lt;br /&gt;
$newsfeedid=optional_param(&#039;newsfeedid&#039;,0,PARAM_INT);&lt;br /&gt;
if($newsfeedid) {&lt;br /&gt;
    $nf=feed_system::$inst-&amp;gt;get_feed($newsfeedid);&lt;br /&gt;
    $form-&amp;gt;location=$nf-&amp;gt;get_folder()-&amp;gt;get_path();&lt;br /&gt;
    $xf-&amp;gt;set_hidden(&#039;newsfeedid&#039;,$newsfeedid);&lt;br /&gt;
    &lt;br /&gt;
    $form-&amp;gt;name=$nf-&amp;gt;get_name();&lt;br /&gt;
    $form-&amp;gt;pres=$nf-&amp;gt;get_pres();&lt;br /&gt;
    if($form-&amp;gt;pres==null) {&lt;br /&gt;
        $form-&amp;gt;pres=&#039;&#039;;&lt;br /&gt;
    }&lt;br /&gt;
    $form-&amp;gt;summary=$nf-&amp;gt;get_summary();&lt;br /&gt;
    if(is_a($nf,&#039;external_news_feed&#039;)) {&lt;br /&gt;
        $form-&amp;gt;type=&#039;external&#039;;&lt;br /&gt;
        $form-&amp;gt;url=$form-&amp;gt;get_url();&lt;br /&gt;
    } else {&lt;br /&gt;
        $form-&amp;gt;type=&#039;internal&#039;;&lt;br /&gt;
        $form-&amp;gt;startdate=$nf-&amp;gt;get_start_date();&lt;br /&gt;
        $form-&amp;gt;public=$nf-&amp;gt;is_public();&lt;br /&gt;
        $form-&amp;gt;defaultauthid=$nf-&amp;gt;get_default_authid();&lt;br /&gt;
        xml_form::set_multiple($form,&#039;optionalauthids&#039;,$nf-&amp;gt;get_optional_authids());&lt;br /&gt;
        xml_form::set_multiple($form,&#039;posters&#039;,$nf-&amp;gt;get_poster_usernames());&lt;br /&gt;
        xml_form::set_multiple($form,&#039;approvers&#039;,$nf-&amp;gt;get_approver_usernames());&lt;br /&gt;
        $form-&amp;gt;newsfeedid=$newsfeedid;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
} else {&lt;br /&gt;
    $folderid=required_param(&#039;folderid&#039;,PARAM_INT);&lt;br /&gt;
    $lf=feed_system::$inst-&amp;gt;get_location_folder($folderid,null);&lt;br /&gt;
    $nf=null;&lt;br /&gt;
    $xf-&amp;gt;set_submit_caption(get_string(&#039;create&#039;));&lt;br /&gt;
    $form-&amp;gt;location=$lf-&amp;gt;get_path();&lt;br /&gt;
    $xf-&amp;gt;set_hidden(&#039;newsfeedid&#039;,0);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// ... print_header and other boring bits.&lt;br /&gt;
&lt;br /&gt;
print_simple_box_start(&#039;center&#039;);&lt;br /&gt;
$xf-&amp;gt;show(basename(__FILE__), $form);&lt;br /&gt;
print_simple_box_end();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Examples of converting existing Moodle forms==&lt;br /&gt;
&lt;br /&gt;
These are four example forms that Marting Dougiamas asked to see how we would handle.&lt;br /&gt;
&lt;br /&gt;
===Add resource -&amp;gt; Link to a file or web site===&lt;br /&gt;
&lt;br /&gt;
[[Image:Formproposal_Add link resource.png]]&lt;br /&gt;
&lt;br /&gt;
I have taken the liberty of changing the way the window options work on this form. Instead of having a show/hide window settings button, and when that is turned on showing all the options for both same window and new window, I have changed it to be a same window/popup window dropdown, and depending on the setting there, showing or hiding the particular set of options. It would also be possible to use the library to generate the existing form.&lt;br /&gt;
&lt;br /&gt;
This form contains some very specific bits, namely the location field and the parameters sections. For now I have kept the existing code to generate these bits. If fields like the location field were used in other places, we could add a url field type. I don&#039;t see any future in generalising the parameters bit, though the code to generate it could be cleaned up. I just copied and pasted the existing code, and made the minimal changes.&lt;br /&gt;
&lt;br /&gt;
I&#039;ve used a multiselect for the window options. That will require a small change to the response processing code. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$mf = moodle_form::loadstring(&#039;&lt;br /&gt;
&amp;lt;editform langfile=&amp;quot;resource&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;text name=&amp;quot;name&amp;quot; help=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;htmlarea name=&amp;quot;summary&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;xhtml label=&amp;quot;location&amp;quot;&amp;gt;&amp;lt;![CDATA[&lt;br /&gt;
        echo &amp;quot;&amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;reference\&amp;quot; size=\&amp;quot;90\&amp;quot; value=\&amp;quot;$form-&amp;gt;reference\&amp;quot; alt=\&amp;quot;reference\&amp;quot; /&amp;gt;&amp;lt;br /&amp;gt;&amp;quot;;&lt;br /&gt;
        button_to_popup_window (&amp;quot;/files/index.php?id=$form-&amp;gt;course&amp;amp;amp;choose=form.reference&amp;quot;, &amp;quot;coursefiles&amp;quot;, $xmlform[&#039;strchooseafile&#039;], 500, 750, $xmlform[&#039;strchooseafile&#039;]);&lt;br /&gt;
        echo &amp;quot;&amp;lt;input type=\&amp;quot;button\&amp;quot; name=\&amp;quot;searchbutton\&amp;quot; value=\&amp;quot;$xmlform[&#039;strsearch&#039;] ...\&amp;quot; &amp;quot;.&lt;br /&gt;
             &amp;quot;onclick=\&amp;quot;return window.open(&#039;$CFG-&amp;gt;resource_websearch&#039;, &#039;websearch&#039;, &#039;menubar=1,location=1,directories=1,toolbar=1,scrollbars,resizable,width=800,height=600&#039;);\&amp;quot; /&amp;gt;\n&amp;quot;;&lt;br /&gt;
        if ($CFG-&amp;gt;resource_allowlocalfiles) {&lt;br /&gt;
            button_to_popup_window (&amp;quot;/mod/resource/type/file/localfile.php?choose=form.reference&amp;quot;, &lt;br /&gt;
            &amp;quot;localfiles&amp;quot;, get_string(&#039;localfilechoose&#039;, &#039;resource&#039;), 400, 600, &lt;br /&gt;
            get_string(&#039;localfilechoose&#039;, &#039;resource&#039;));&lt;br /&gt;
        }&lt;br /&gt;
    ]]&amp;gt;&amp;lt;/xhtml&amp;gt;&lt;br /&gt;
    &amp;lt;url name=&amp;quot;location&amp;quot; showuploadbutton=&amp;quot;1&amp;quot; showsearchbutton=&amp;quot;1&amp;quot; help=&amp;quot;&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;dropdown name=&amp;quot;windowpopup&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;option value=&#039;0&#039;&amp;gt;pagewindow&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;option value=&#039;1&#039;&amp;gt;newwindow&amp;lt;/option&amp;gt;&lt;br /&gt;
    &amp;lt;/dropdown&amp;gt;&lt;br /&gt;
    &amp;lt;group requiredname=&amp;quot;newwindow&amp;quot; requiredvalue=&amp;quot;0&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;hidden name=&amp;quot;hframepage&amp;quot; value=&amp;quot;0&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;multiselect name=&amp;quot;framepage&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
            &amp;lt;option value=&amp;quot;1&amp;quot;&amp;gt;frameifpossible&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;/multiselect&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;group requiredname=&amp;quot;newwindow&amp;quot; requiredvalue=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;multiselect name=&amp;quot;windowoptions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;/multiselect&amp;gt;&lt;br /&gt;
        &amp;lt;integer name=&amp;quot;resource_popupwidth&amp;quot; label=&amp;quot;resource_popupwidth&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;integer name=&amp;quot;resource_popupheight&amp;quot; label=&amp;quot;resource_popupheight&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
    &amp;lt;yesno name=&amp;quot;parameters&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;group requiredname=&amp;quot;newwindow&amp;quot; requiredvalue=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;xhtml&amp;gt;&amp;lt;![CDATA[&lt;br /&gt;
&amp;lt;table align=&amp;quot;center&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;tr&amp;gt;&lt;br /&gt;
            &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;?php print_string(&amp;quot;parameter&amp;quot;, &amp;quot;resource&amp;quot;) ?&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
            &amp;lt;td align=&amp;quot;center&amp;quot;&amp;gt;&amp;lt;?php print_string(&amp;quot;variablename&amp;quot;, &amp;quot;resource&amp;quot;) ?&amp;gt;&amp;lt;/td&amp;gt;&lt;br /&gt;
        &amp;lt;/tr&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;?php&lt;br /&gt;
&lt;br /&gt;
for ($i=0; $i &amp;lt; $xmlform[&#039;maxparameters&#039;]; $i++) {&lt;br /&gt;
    echo &amp;quot;&amp;lt;tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;select name=\&amp;quot;parameter$i\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;option value=\&amp;quot;-\&amp;quot;&amp;gt;-- &amp;quot;.get_string(&#039;chooseparameter&#039;, &#039;resource&#039;).&amp;quot; --&amp;lt;/option&amp;gt;\n&amp;quot;;&lt;br /&gt;
    foreach ($xmlform[&#039;parameters&#039;] as $field=&amp;gt;$fieldarr) {&lt;br /&gt;
        if ($fieldarr[&#039;value&#039;] === &amp;quot;optgroup&amp;quot;) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;optgroup label=\&amp;quot;{$fieldarr[&#039;langstr&#039;]}\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
        } elseif ($fieldarr[&#039;value&#039;] === &amp;quot;/optgroup&amp;quot;) {&lt;br /&gt;
            echo &amp;quot;&amp;lt;/optgroup&amp;gt;\n&amp;quot;;&lt;br /&gt;
        } else {&lt;br /&gt;
            echo &amp;quot;&amp;lt;option value=\&amp;quot;$field\&amp;quot;&amp;quot;;&lt;br /&gt;
            if ($xmlform[&#039;alltextfield&#039;][$i][&#039;parameter&#039;] == $field) {&lt;br /&gt;
                echo &amp;quot; selected=\&amp;quot;selected\&amp;quot;&amp;quot;;&lt;br /&gt;
            }&lt;br /&gt;
            echo &amp;quot;&amp;gt;{$fieldarr[&#039;langstr&#039;]}&amp;lt;/option&amp;gt;\n&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    echo &amp;quot;&amp;lt;/select&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;/td&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;td valign=\&amp;quot;top\&amp;quot;&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;input type=\&amp;quot;text\&amp;quot; name=\&amp;quot;parse$i\&amp;quot; value=\&amp;quot;{$xmlform[&#039;alltextfield&#039;][$i][&#039;parse&#039;]}\&amp;quot; alt=\&amp;quot;parameter$i\&amp;quot;/&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;/td&amp;gt;\n&amp;quot;;&lt;br /&gt;
    echo &amp;quot;&amp;lt;/tr&amp;gt;\n&amp;quot;;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
?&amp;gt;&lt;br /&gt;
&amp;lt;/table&amp;gt;&lt;br /&gt;
    ]]&amp;gt;&amp;lt;/xhtml&amp;gt;&lt;br /&gt;
    &amp;lt;/group&amp;gt;&lt;br /&gt;
&#039;)&lt;br /&gt;
$mf-&amp;gt;set_xhtml_param(&#039;strchooseafile&#039;, get_string(...));&lt;br /&gt;
$mf-&amp;gt;set_xhtml_param(&#039;strsearch&#039;, get_string(...));&lt;br /&gt;
&lt;br /&gt;
$mf-&amp;gt;set_xhtml_param(&#039;maxparameters&#039;, $this-&amp;gt;maxparameters);&lt;br /&gt;
$mf-&amp;gt;set_xhtml_param(&#039;parameters&#039;, $this-&amp;gt;parameters);&lt;br /&gt;
$mf-&amp;gt;set_xhtml_param(&#039;alltextfield&#039;, $alltextfield); // Assuming that this code is after the end of setup() in mod\resource\type\file\resource.class.php&lt;br /&gt;
&lt;br /&gt;
$winopt = $mf-&amp;gt;get(&#039;windowoptions&#039;);&lt;br /&gt;
foreach ($RESOURCE_WINDOW_OPTIONS as $optionname) {&lt;br /&gt;
    $defaultvalue = &amp;quot;resource_popup$optionname&amp;quot;;&lt;br /&gt;
    $form-&amp;gt;$optionname = $CFG-&amp;gt;$defaultvalue;&lt;br /&gt;
    if ($optionname != &#039;height&#039; &amp;amp;&amp;amp; $optionname != &#039;width&#039;) {&lt;br /&gt;
        $winopt-&amp;gt;add_option($optionname, &amp;quot;str$optionname&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add quiz===&lt;br /&gt;
&lt;br /&gt;
[[Image:Formproposal_Add quiz form.png]]&lt;br /&gt;
&lt;br /&gt;
To convert this form, we need to do something special for the &amp;quot;students may review&amp;quot; bit. You could either invent an new &amp;lt;optiongrid&amp;gt; type, which would be quite easy to implement. That is the option used below. Alternatively, you could use the feature for including arbitrary HTML and PHP in the form, and keep the existing code for generating this part of the form. Since the existing layout breaks when you make the browser window narrow, as in the screenshot, I would be inclined to redo it.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$mf = moodle_form::loadstring(&#039;&lt;br /&gt;
&amp;lt;editform langfile=&amp;quot;quiz&amp;quot; help=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
    &amp;lt;text name=&amp;quot;name&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;htmlarea name=&amp;quot;introduction&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;date name=&amp;quot;available&amp;quot; label=&amp;quot;quizopen&amp;quot; optional=&amp;quot;yes&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;date name=&amp;quot;due&amp;quot; label=&amp;quot;quizclose&amp;quot; optional=&amp;quot;yes&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;real name=&amp;quot;timelimit&amp;quot; lableafter=&amp;quot;minutes&amp;quot; helpalt=&amp;quot;quiztimer&amp;quot; optional=&amp;quot;yes&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;dropdown name=&amp;quot;questionsperpage&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;option value=&#039;0&#039;&amp;gt;unlimited&amp;lt;/option&amp;gt;&lt;br /&gt;
        &amp;lt;!-- other options will be added programmatically --&amp;gt;&lt;br /&gt;
    &amp;lt;/dropdown&amp;gt;&lt;br /&gt;
    &amp;lt;yesno name=&amp;quot;shufflequestions&amp;quot;/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- ... skipping the next few boring fields ... --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;optiongrid name=&amp;quot;reviewoptions&amp;quot;&amp;gt;&lt;br /&gt;
        &amp;lt;col name=&amp;quot;responses&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;col name=&amp;quot;scores&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;col name=&amp;quot;feedback&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;col name=&amp;quot;answers&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;row name=&amp;quot;immediately&amp;quot; lable=&amp;quot;reviewimmediately&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;row name=&amp;quot;open&amp;quot; lable=&amp;quot;reviewopen&amp;quot;/&amp;gt;&lt;br /&gt;
        &amp;lt;row name=&amp;quot;closed&amp;quot; lable=&amp;quot;reviewclosed&amp;quot;/&amp;gt;&lt;br /&gt;
    &amp;lt;/optiongrid&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;!-- ... skipping the next few boring fields ... --&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
    &amp;lt;groupmode/&amp;gt;&lt;br /&gt;
    &amp;lt;visible/&amp;gt;&lt;br /&gt;
&#039;)&lt;br /&gt;
$questionsperpage =&amp;amp; $mf-&amp;gt;get(&#039;questionsperpage&#039;);&lt;br /&gt;
for ($i = 1; $i &amp;lt;= 50; $i += 1) {&lt;br /&gt;
    $questionsperpage-&amp;gt;add_option($i);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This does not take into account the settings on http://&#039;&#039;example.com&#039;&#039;/moodle/admin/module.php?module=quiz, which lets the admin move certain quiz options to be hidden behind an &amp;quot;advanced&amp;quot; option. To implement this you would need to add a show/hide advanced control (I would do this as a &amp;lt;yesno name=&amp;quot;showadvanced&amp;quot;/&amp;gt;, and an empty advanced group, then use some PHP code like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$fix = 0;&lt;br /&gt;
$advgroup = $mf-&amp;gt;get_field(&#039;advanced&#039;);&lt;br /&gt;
&lt;br /&gt;
if ($CFG-&amp;gt;quiz_fix_timelimit) {&lt;br /&gt;
    $item = &amp;amp;$mf-&amp;gt;remove(&#039;timelimit&#039;);&lt;br /&gt;
    $advgroup-&amp;gt;add($item)&lt;br /&gt;
    $fix = 1;&lt;br /&gt;
}&lt;br /&gt;
// ... and so on, for all the other options. Or you could try to be clever &lt;br /&gt;
// and do this as a loop over an array of field names ... then&lt;br /&gt;
if (!$fix) {&lt;br /&gt;
    $form-&amp;gt;remove(&#039;showadvanced&#039;);&lt;br /&gt;
    $form-&amp;gt;remove(&#039;advanced&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Add database===&lt;br /&gt;
&lt;br /&gt;
[[Image:Formproposal_Add_database_form.png]]&lt;br /&gt;
&lt;br /&gt;
I won&#039;t type out full code for this example most of it is simple, and it should be clear how to do it given the above examples, just comment on a couple of things:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Entries required before viewing&#039;&#039;&#039; I assume this is only indented because the label is so long that having it all lined up would break the table layout. I think our code using CSS for layout just word-wraps long labels and keeps everything aligned, which I think is better.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Allow posts to be rated?&#039;&#039;&#039; I would put the disabled controls in a group that only appears if the checkbox is checked, so that those controls show and hide, rather than enabling or disabling. However, if we want to keep this the same as it is now, you could implemnt the conditionalenable group type.&lt;br /&gt;
&lt;br /&gt;
===Manage groups for a course===&lt;br /&gt;
&lt;br /&gt;
This sort of form is currently beyond what the form library was designed to produce. I would leave this as hand-coded HTML. In time, the form library may gain some AJAX field types for selecting students, and such like, that could usefully be within a redesigned version of this form. Since the form field types just output HTML and Javascript, it should be possible to use them within hand-crafted forms.&lt;br /&gt;
&lt;br /&gt;
[[Image:Formproposal_Groups_form.png]]&lt;br /&gt;
&lt;br /&gt;
==Questions==&lt;br /&gt;
&lt;br /&gt;
Do we need a syntax like lable=&#039;langfile:langstring&#039; for using lang strings from other lang files where necessary? &#039;&#039;&#039;yes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Where does this live. I think the main library file that people have to include should be lib/formlib.php, and that is all anyone needs to include. However, to we break each field type into its own PHP file, perhaps in a lib/formlib directory, to make it easier to add new field types in future? &#039;&#039;&#039;Probably all in one file&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Some form fields will need bits of CSS and JavaScript to work. Do we add the CSS to the standard theme, and combine all the javascript into a single library somewhere, or do we break it up into the individual field types, and recombine it dynamically at runtime? I think I favour breaking up the PHP code, but keeping all the JS and CSS in one place. &#039;&#039;&#039;Should use YUI were possible. We will still need some custom JavaScript and CSS though. Where?&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Do we use this for vaidation as well? &#039;&#039;&#039;Yes.&#039;&#039;&#039; Currently Moodle PHP files that do forms tend to look like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$var1 = require/optional_param(...);&lt;br /&gt;
// etc. for all the other form variables.&lt;br /&gt;
&lt;br /&gt;
if (data_submitted &amp;amp;&amp;amp; confirm_sesskey()) {&lt;br /&gt;
   // Try to process submitted data.&lt;br /&gt;
   if (/*processing ok*/)&lt;br /&gt;
	   // Redirect away&lt;br /&gt;
} else {&lt;br /&gt;
   // Set initial form values.&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Lots of code to output the form HTML. Of maybe include(somthing.html);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The proposal is to change this to something like&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$mf = new moodle_form();&lt;br /&gt;
// Setup $mf with the form structure&lt;br /&gt;
&lt;br /&gt;
$form = new stdClass;&lt;br /&gt;
if ($mf-&amp;gt;validate_submitted_data($form)) { // Pass by reference to get data back.&lt;br /&gt;
   // Try to process submitted data in $form&lt;br /&gt;
   if (/*processing ok*/)&lt;br /&gt;
	   // Redirect away&lt;br /&gt;
} else {&lt;br /&gt;
   // Set initial values in $form&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
$mf-&amp;gt;display($form)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Future]]&lt;/div&gt;</summary>
		<author><name>Pramette</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Roadmap&amp;diff=19864</id>
		<title>Roadmap</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Roadmap&amp;diff=19864"/>
		<updated>2007-02-01T22:26:37Z</updated>

		<summary type="html">&lt;p&gt;Pramette: /* Version 1.8 - Expected January 2007 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This roadmap collects the best information about upcoming features in Moodle.   It is not 100% certain - features may change according to available funding and developers.&lt;br /&gt;
&lt;br /&gt;
== Version 1.8 - Expected February 2007 ==&lt;br /&gt;
&lt;br /&gt;
* [[Accessibility]] - Moodle.com &lt;br /&gt;
:: Compliance with all major accessibility standards&lt;br /&gt;
* [[Moodle forms library]] - Moodle.com &lt;br /&gt;
:: All forms can now use a single API for defining forms consistently and collecting data safely.&lt;br /&gt;
* [[Multi Authentication]] - Iñaki Arenaza / Jonathan Harker (Catalyst) / Martin Langhoff (Catalyst)&lt;br /&gt;
* [[Development:Customisable user profiles|Customisable User Profiles]] - Pukunui Technology&lt;br /&gt;
::Allow fields to be added to the user profile.&lt;br /&gt;
* [[Moodle Network]] - Catalyst and Moodle.com&lt;br /&gt;
:: Setup peer Moodle installations allowing users to roam across, using comprehensive SSO and transparent remote enrolments. Administrators at the originating Moodle install can see logs of remote activity. You can also run your Moodle in &amp;quot;Hub&amp;quot; mode where any Moodle install can connect and users roam across.&lt;br /&gt;
::[[Web Services API]] for Moodle communications. The Moodle Network code includes an XML-RPC call dispatcher that can expose the whole Moodle API to trusted hosts.&lt;br /&gt;
* Groups refactor - Juliette White / Nick Freear  (OU)&lt;br /&gt;
::Groups code will be reorganised to make it more flexible for the future (see 1.9)&lt;br /&gt;
* Blog commenting &lt;br /&gt;
:: You&#039;ll be able to make comments on blogs!  In time, all comments in Moodle will be merged into the same commenting system.&lt;br /&gt;
* [[Authorize.net Payment Gateway]] enrolment plugin &lt;br /&gt;
:: Payment managers can obtain an authorization code over phone from customer&#039;s bank if the credit card of the user cannot be captured on the internet directly.&lt;br /&gt;
* SCORM 2004?&lt;br /&gt;
* New Wiki?&lt;br /&gt;
&lt;br /&gt;
== Version 1.9 - Expected April 2007 ==&lt;br /&gt;
&lt;br /&gt;
* [[Repository API]] - Open University, Moodle.com and Humboldt&lt;br /&gt;
::Abstract all file operations to an API that allows plugins for different external repositories&lt;br /&gt;
* [[Learning Design export]] - Moodle.com and Open University of The Netherlands&lt;br /&gt;
::We plan to have a very simple export for any Moodle course into IMS LD format, as a proof of concept and to help the community start learning about IMS LD.&lt;br /&gt;
* [[Development:Groups_documentation_for_module_developers|New groups]] - Open University&lt;br /&gt;
::Site-wide groups, reusable groups, and assigning activities to groups are the major improvements being developed  &lt;br /&gt;
* [[Development:Grades|Gradebook development]]&lt;br /&gt;
::The gradebook system will be revamped for performance, switching from our older &amp;quot;pull&amp;quot; model to a &amp;quot;push&amp;quot; model where all modules will now publish grades as necessary into a central table.&lt;br /&gt;
* [[Metadata]] - Moodle.com&lt;br /&gt;
::Build on the keywords in 1.6 to provide metadata for all activities and courses, linkable to standard lists of metadata such as State-based learning outcomes and curricula&lt;br /&gt;
&lt;br /&gt;
== Version 2.0 - Expected July 2007 ==&lt;br /&gt;
&lt;br /&gt;
* [[IMS Learning Design]] - Moodle.com&lt;br /&gt;
::Support for importing/exporting LD, converting Moodle activities and sequences of activities into a standard format for sharing, and importing standard sequences into Moodle courses&lt;br /&gt;
* [[Conditional activities]] - Moodle.com&lt;br /&gt;
::Allowing dependencies and forced paths through the content&lt;br /&gt;
* [[Community hub]] interfaces - Moodle.com and others&lt;br /&gt;
::Makes it easy for users to find and navigate other systems and external Moodle repositories, leveraging the Moodle Network in various ways.&lt;br /&gt;
* [[Student Information API]]&lt;br /&gt;
::API for integrating external systems for managing student information&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Note: Moodle 2.0 will require PHP 5.1 as a minimum, because of certain improvements not available in PHP 4.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version 2.1 ==&lt;br /&gt;
&lt;br /&gt;
* [[Portfolio API]]&lt;br /&gt;
::Interface Moodle activities and repositories to help produce portfolios for internal assessment AND external publication&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[Category:Future]]&lt;br /&gt;
&lt;br /&gt;
[[es:Planificación]]&lt;br /&gt;
[[fr:Planification]]&lt;/div&gt;</summary>
		<author><name>Pramette</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Online_Learning_History&amp;diff=18992</id>
		<title>Online Learning History</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Online_Learning_History&amp;diff=18992"/>
		<updated>2006-12-28T16:58:44Z</updated>

		<summary type="html">&lt;p&gt;Pramette: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Let&#039;s build up a complete history of key milestones in internet-based learning.  Each event should be a heading that includes the date.&lt;br /&gt;
&lt;br /&gt;
==1960 - PLATO ==&lt;br /&gt;
&lt;br /&gt;
PLATO (Programmed Logic for Automatic Teaching Operations) system developed at the University of Illinois at Urbana-Champaign. The system remains in operation until the mid-1990s. [http://en.wikipedia.org/wiki/PLATO_System Wikipedia background on PLATO].&lt;br /&gt;
&lt;br /&gt;
==1962 - R. Buckminster Fuller publishes &#039;&#039;Education Automation&#039;&#039; ==&lt;br /&gt;
&lt;br /&gt;
Relevant quote: &amp;quot;Get the most comprehensive generalized computer setup with network connections to process the documentaries that your faculty and graduate-student teams will manufacture objectively from the subjective gleanings of your vast new world- and universe-ranging student probers.&amp;quot; (p.85)&lt;br /&gt;
&lt;br /&gt;
==1969 - Founding of the Internet ==&lt;br /&gt;
&lt;br /&gt;
US DoD commissions ARPANET.   [http://www.zakon.org/robert/internet/timeline/ Hobbes Timeline]&lt;br /&gt;
&lt;br /&gt;
==1971 - Ivan Illich&#039;s Learning Webs ==&lt;br /&gt;
&lt;br /&gt;
Ivan Illich describes a computer-based education network in his book [http://www.preservenet.com/theory/Illich/Deschooling/chap6.html Deschooling Society]&lt;br /&gt;
&lt;br /&gt;
==1979 - USENET begins ==&lt;br /&gt;
&lt;br /&gt;
USENET established using UUCP between Duke and UNC by Tom Truscott, Jim Ellis, and Steve Bellovin. All original groups were under net.* hierarchy.   [http://www.zakon.org/robert/internet/timeline/ Hobbes Timeline]&lt;br /&gt;
&lt;br /&gt;
==1982 - Computer Assisted Learning Center (CALC) ==&lt;br /&gt;
&lt;br /&gt;
The Computer Assisted Learning Center (CALC) was founded in 1982 in Rindge, New Hampshire, as a small, offline computer-based, adult learning center. The center was based on the same premise as today: to provide affordable, quality instruction to individual learners through the use of computers. [http://www.calcampus.com/calc.htm Origins of CALCampus]&lt;br /&gt;
&lt;br /&gt;
==1984 - CSILE ==&lt;br /&gt;
CSILE, an educational knowledge media system, developed by Scardamalia &amp;amp; Bereiter at Ontario Institute for Studies in Education. ... CSILE based on Zimmerman&#039;s (1989) self-regulated learning (CSILE term is intentional learning) and constructivists&#039; view of learning. It emphasizes on building a classroom culture supportive of active knowledge construction that can extend individual intentional learning to the group level. The purpose is to make students think and reflect their thought process which provoke question asking and answering in a public forum. The ultimate goal is to get students involved in knowledge itself rather than improve one&#039;s mind, a World 3 view , which shifts from individual mastery learning to improve the quality of public collective knowledge (Scardamalia, et al., 1994). - from [http://www.edb.utexas.edu/csclstudent/Dhsiao/theories.html#csile]&lt;br /&gt;
&lt;br /&gt;
==1987 - M/EU (Mind Extension University) ==&lt;br /&gt;
In 1987, Jones launched  M/EU, a cable channel carrying varied educational programming... The advent of the Internet helped facilitate communication in these telecourses.[http://www.media-visions.com/ed-distlrn2.html]&lt;br /&gt;
&lt;br /&gt;
==1988 - Aviation Industry CBT (Computer-Based Training) Committee (AICC) ==&lt;br /&gt;
The AICC was formed out of a need for hardware standardization of CBT delivery platforms. Important milestones include: 1989 - Common platform guidelines for CBT delivery (AGR-002), 1992 - A DOS-based digital audio guideline (AGR-003) before the advent of window multimedia standards. The guideline enabled end-users to use one audio card for multiple vendors&#039; CBT courseware. Due to the huge amount of CBT legacy courseware, this guideline is still in use., 1993 - A guideline for CMI (LMS) interoperability was created. This guideline (AGR-006) resulted in the CMI systems that are able to share data with LAN-based CBT courseware from multiple vendors. 1996 - A navigation icon guideline (AGR-009) to help standardize the student user controls in CBT. 1998 - The CMI (LMS) specifications were updated to include web-based CBT (or WBT). This new web-based guideline is called AGR-010. 1999 - The CMI (LMS) specifications were updated to include a JavaScript API interface. (This the basis of the SCORM runtime environment). 2005 - The Package Exchange Notification Services (PENS) guideline (AGR-011) allows Authoring/Content Management system to seemless integrate publishing with LMS systems. [http://www.aicc.org/pages/aicc_faq.htm]&lt;br /&gt;
&lt;br /&gt;
==1992 - CAPA (Computer Assisted Personalized Approach) ==&lt;br /&gt;
The system was developed at Michigan State University and was first used in a small (92 student) physics class in the Fall of 1992.[http://web.archive.org/web/20000915112215/capa2.nscl.msu.edu/homepage/]&lt;br /&gt;
&lt;br /&gt;
==1994 - Lotus Development Corporation acquires the Human Interest Group ==&lt;br /&gt;
&lt;br /&gt;
The system evolves into the [http://www-128.ibm.com/developerworks/lotus/library/ls-elearning_evolution/ Lotus Learning Management System and Lotus Virtual Classroom], now owned by IBM.&lt;br /&gt;
&lt;br /&gt;
==1994 - Open University Virtual Summer School==&lt;br /&gt;
[http://kmi.open.ac.uk/kmi-misc/virtualsummer.html]&lt;br /&gt;
&lt;br /&gt;
In August and September 1994, a Virtual Summer School (VSS) for Open University undergraduate course D309 Cognitive Psychology enabled students to attend an experimental version of summer school &#039;electronically&#039;, i.e. from their own homes using a computer and a modem. VSS students were able to participate in group discussions, run experiments, obtain one-to-one tuition, listen to lectures, ask questions, participate as subjects in experiments, conduct literature searches, browse original journal publications, work in project teams, undertake statistical analyses, prepare and submit nicely formatted individual or joint written work, prepare plenary session presentations, and even socialize and chit-chat, all without ever leaving their homes.&lt;br /&gt;
&lt;br /&gt;
==1994/95 - CALCampus.com ==&lt;br /&gt;
&lt;br /&gt;
CALCampus was the first to develop and implement the concept of a totally online-based school through which administration, real-time classroom instruction, and materials were provided, originating with the QuantumLink campus. This was a significant departure from earlier methods of distance education because no longer was the individual distance learner isolated from the teacher and from classmates. [http://www.calcampus.com/calc.htm Origins of CALCampus]&lt;br /&gt;
&lt;br /&gt;
==1995 - Mallard web-based course management system developed at the University of Illinois ==&lt;br /&gt;
[http://www.uic.edu/depts/adn/itl/uionline/mallard.html Mallard overview]. See also CyberProf[http://web.archive.org/web/19971016101057/cyber.ccsr.uiuc.edu/cyberprof/general/homepage/Newpage/toplevel/welcome.html] (also copyrighted in 1995 from University of Illinois)&lt;br /&gt;
&lt;br /&gt;
==1995 - BSCW 1.0==&lt;br /&gt;
[http://bscw.fit.fraunhofer.de/Papers/index.html Papers and timeline are here]&lt;br /&gt;
&lt;br /&gt;
==1995 - Nicenet ICA launched to the public ==&lt;br /&gt;
http://en.wikipedia.org/wiki/Nicenet&lt;br /&gt;
&lt;br /&gt;
==1995/6 - WOLF / Learnwise ==&lt;br /&gt;
WOLF (Wolverhampton Online Learning Framework)[http://asp.wlv.ac.uk/Level4.asp?UserType=11&amp;amp;Level4=841] developed at Wolverhampton University&#039;s DELTA institute under the guidance of Stephen Molyneux. [http://en.wikipedia.org/wiki/Stephen_Molyneux] This went on to be released commercially by Granada Learning as Learnwise [http://www.learnwise.net] &lt;br /&gt;
&lt;br /&gt;
==1996 - TELSI Pro developed ==&lt;br /&gt;
&lt;br /&gt;
TELSI (Telematic Environment for Language Simulations) was a VLE developed at the University of Oulu in Finland. Development was headed by Eric Rouselle and was continued into present day &#039;&#039;Discendum Optima&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==1997 - CourseInfo releases ILN ==&lt;br /&gt;
Mid 1997 CourseInfo founded by Dan Cane and Stephen Gilfus. http://www.news.cornell.edu/chronicle/97/10.16.97/Web_company.html&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;Interactive Learning Network&amp;quot; ILN 1.5, was released and installed at several academic institutions including Cornell University, Yale Medical School and University of Pittsburgh. The ILN was the first e-learning system of it&#039;s kind to leverage and install on top of a relational database MySqL.  http://www.cquest.utoronto.ca/env/aera/aera-lists/aera-c/97-11/0123.html&lt;br /&gt;
&lt;br /&gt;
==1997 - Manhattan Virtual Classroom in use ==&lt;br /&gt;
&lt;br /&gt;
Manhattan was in use at this time at Western New England College, and included [http://manhattan.sourceforge.net/?What_is_it%3F handouts, assignments, forums etc]&lt;br /&gt;
&lt;br /&gt;
==1997 (about) - Pioneer developed by MEDC (University of Paisley) ==&lt;br /&gt;
&lt;br /&gt;
Pioneer was an online learning environment developed initially for colleges in Scotland. Pioneer was web-based and featured:&lt;br /&gt;
&lt;br /&gt;
online course materials (published by the lecturers themselves)&lt;br /&gt;
integral email to allow communications between students and tutors&lt;br /&gt;
forum tools&lt;br /&gt;
chat tools&lt;br /&gt;
timeatable&lt;br /&gt;
&lt;br /&gt;
The main driver for Pioneer was Jackie Galbraith.&lt;br /&gt;
&lt;br /&gt;
When MEDC was closed, the Pioneer development team moved to SCET in 1998 taking Pioneer with them when it became SCETPioneer.&lt;br /&gt;
&lt;br /&gt;
SCETPioneer was used by Glasgow Colleges and a number of other colleges in Scotland.&lt;br /&gt;
&lt;br /&gt;
SCET merged with the SCCC and became [http://www.ltscotland.org.uk Learning and Teaching Scotland]&lt;br /&gt;
&lt;br /&gt;
==1997 - Deployment of Nathan Bodington VLE ==&lt;br /&gt;
&lt;br /&gt;
Development of Nathan Bodington VLE at Leeds University begins from the Bionet TLTP project &lt;br /&gt;
&lt;br /&gt;
[http://bodington.org/history.php History of Bodington]&lt;br /&gt;
&lt;br /&gt;
[http://en.wikipedia.org/wiki/History_of_virtual_learning_environments Dates of Bodington development appear here]&lt;br /&gt;
&lt;br /&gt;
==1997 - WebCT 1.0 was released==&lt;br /&gt;
[http://www.webct.com/service/viewcontentframe?contentID=5653208 Powerpoint presentation]&lt;br /&gt;
&lt;br /&gt;
==1997 - Blackboard was founded ==&lt;br /&gt;
[http://www.blackboard.com/company/history.aspx]&lt;br /&gt;
&lt;br /&gt;
==1998 - Martin Dougiamas begins preliminary work on Moodle ==&lt;br /&gt;
[http://lsn.curtin.edu.au/tlf/tlf1999/dougiamas.html This paper contains some early thoughts]&lt;br /&gt;
&lt;br /&gt;
==1998 - Blackboard released its first software product ==&lt;br /&gt;
An online learning application, Blackboard&#039;s CourseInfo, developed at Cornell University by the CourseInfo team.[http://www.blackboard.com/company/history.aspx]&lt;br /&gt;
&lt;br /&gt;
==1998 - Nicenet ICA2 is launched ==&lt;br /&gt;
Nicenet provides Internet Classroom Assistant (ICA2) with web-based conferencing, personal messaging, document sharing, scheduling and link/resource sharing to a variety of learning environments.  http://www.nicenet.org/ica/ica_info.cfm&lt;br /&gt;
&lt;br /&gt;
==1998 - CNAMS 1.0 is released ==&lt;br /&gt;
The Cisco Networking Academy Management System (CNAMS) is released to faciliate communication and course management of the largest blended learning initiative of its time, the Cisco Networking Academy. It includes tools to maintain rosters, gradebooks, forums, as well as a scalable, robust assessment engine. &lt;br /&gt;
&lt;br /&gt;
== 1999 == &lt;br /&gt;
&lt;br /&gt;
*Martin trials early prototypes of Moodle.  Martin&#039;s paper, [http://lsn.curtin.edu.au/tlf/tlf2000/dougiamas.html Improving the effectiveness of tools for Internet based education,] details one case study and includes screenshots&lt;br /&gt;
*Desire2Learn founded in Canada&lt;br /&gt;
&lt;br /&gt;
==2000 - Claroline project was initiated ==&lt;br /&gt;
&lt;br /&gt;
The Claroline project was initiated in 2000 at the Catholic University of Louvain (Belgium) by Thomas De Praetere and was financially supported by the Louvain Foundation.&lt;br /&gt;
&lt;br /&gt;
[http://www.claroline.net/ claroline.net]&lt;br /&gt;
&lt;br /&gt;
[http://www.claroline.net/credits.htm dates and credits]&lt;br /&gt;
&lt;br /&gt;
==2000 - Manhattan 1.0 is released ==&lt;br /&gt;
&lt;br /&gt;
In October of 2000, Manhattan Virtual Campus was released in its entirety on the Internet for free under the GNU General Public License. http://manhattan.sourceforge.net&lt;br /&gt;
&lt;br /&gt;
==2001, November - Moodle.com runs Moodle==&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=1 See this announcement]&lt;br /&gt;
&lt;br /&gt;
==2002 Multiple Events ==&lt;br /&gt;
*August - Moodle 1.0 is released&lt;br /&gt;
*Summer - Seque Project releases first version of its elearning software&lt;br /&gt;
*September - Site@School released&lt;br /&gt;
&lt;br /&gt;
==2004, January - Sakai Project is formed from several college and university projects ==&lt;br /&gt;
&lt;br /&gt;
==2006, June - Moodle 1.6 is released ==&lt;br /&gt;
&lt;br /&gt;
==2006, July 26 - Blackboard announces Patent 6,988,138 ==&lt;br /&gt;
&lt;br /&gt;
[http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&amp;amp;Sect2=HITOFF&amp;amp;d=PALL&amp;amp;p=1&amp;amp;u=%2Fnetahtml%2FPTO%2Fsrchnum.htm&amp;amp;r=1&amp;amp;f=G&amp;amp;l=50&amp;amp;s1=6,988,138.PN.&amp;amp;OS=PN/6,988,138&amp;amp;RS=PN/6,988,138 This patent], filed on June 30, 2000 (with pending and related applications dating as early as June 1999) and issued on January 17, 2006, contains very extensive claims pertaining to every aspect of online course delivery.  The breadth of this patent would seemingly give Blackboard the ability to enforce this intellectual property against other producers of online course delivery systems.&lt;br /&gt;
&lt;br /&gt;
==See Also ==&lt;br /&gt;
&lt;br /&gt;
http://www.google.com/Top/Computers/Software/Online_Training/Delivery_and_Management_Systems/&lt;br /&gt;
&lt;br /&gt;
http://www.google.com/Top/Reference/Education/Instructional_Technology/Course_Website_Software/&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/History_of_virtual_learning_environments&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Computer-assisted_language_learning CALI History in this&lt;br /&gt;
&lt;br /&gt;
http://en.wikipedia.org/wiki/Online_learning#See_also&lt;br /&gt;
&lt;br /&gt;
[http://www.eric.ed.gov/ERICWebPortal/Home.portal?_nfpb=true&amp;amp;ERICExtSearch_SearchValue_0=ED412357&amp;amp;ERICExtSearch_SearchType_0=kw&amp;amp;_pageLabel=RecordDetails&amp;amp;objectId=0900000b8012429a&amp;amp;accno=ED412357  Foundations of Distance Education]&lt;br /&gt;
&lt;br /&gt;
[http://kolea.kcc.hawaii.edu/tcc/tcc_conf97/tcon/0001.html 1997 Conference: Trends &amp;amp; Issues in Online Instruction]&lt;br /&gt;
&lt;br /&gt;
http://www.usdla.org/html/journal/SEP01_Issue/article01.html&lt;br /&gt;
mentions: Unix courses @ Nova University early 70s and National Technological University (NTU)&lt;br /&gt;
&lt;br /&gt;
[[es:Historia de la Formación Online]]&lt;br /&gt;
[[fr:Histoire de la Formation en ligne]]&lt;/div&gt;</summary>
		<author><name>Pramette</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/test/index.php?title=Meta_course&amp;diff=14565</id>
		<title>Meta course</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/test/index.php?title=Meta_course&amp;diff=14565"/>
		<updated>2006-08-18T15:59:29Z</updated>

		<summary type="html">&lt;p&gt;Pramette: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Metacourses&#039;&#039;&#039; are courses which take their enrolments from other courses i.e. for every course &#039;enrolled&#039; on the metacourse, all students in the course are also enrolled in the metacourse.&lt;br /&gt;
&lt;br /&gt;
Each time a student enrols on (or unenrols from) a course, s/he is enrolled/unenrolled from any metacourse(s) associated with it (although it doesn&#039;t happen immediately - it may take an hour to show up).&lt;br /&gt;
&lt;br /&gt;
Please note that metacourse enrolments do not preserve groups.&lt;br /&gt;
&lt;br /&gt;
==Metacourse setup==&lt;br /&gt;
Teachers are able to choose whether a course is a metacourse via the &amp;quot;Is this a metacourse?&amp;quot; (yes/no) menu option in the [[Settings|course settings]]. If a meta course is chosen, the [[Students|students]] page changes from listing/searching for students to listing/searching for courses.&lt;br /&gt;
&lt;br /&gt;
==Metacourse usage==&lt;br /&gt;
Metacourses may be used in a variety of ways:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Scenario 1:&#039;&#039;&#039; X is a metacourse with Course 1 through 4 as normal courses with standard student enrollments. Students enrolling on these courses are automatically enrolled onto Metacourse X. This would be used, for example, when every student gets to choose one option from Courses 1-4 but Metacourse X is compulsory for all students taking one of those four options. &lt;br /&gt;
&lt;br /&gt;
[[Image:Metacourses1.png|Standard Metacourse Usage]]&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;Scenario 2:&#039;&#039;&#039; Metacourses 1-4 are linked to Y which is a normal course. Students enrolling on Course Y are automatically enrolled on Metacourses  1-4. This would be used, for example, when all five courses are intended to have exactly the same students. &lt;br /&gt;
&lt;br /&gt;
[[Image:Metacourses2.png|Upsidedown Metacourse Usage]]&lt;br /&gt;
&lt;br /&gt;
In both diagrams you can see students being enrolled normally into standard courses and then the entire student list of a course being added to the Metacourse.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=48901 Metacourses?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Enrolment]]&lt;br /&gt;
&lt;br /&gt;
[[es:Metacourses]]&lt;br /&gt;
[[fr:Metacourses]]&lt;/div&gt;</summary>
		<author><name>Pramette</name></author>
	</entry>
</feed>