MDL-38344 Calendar: converted name field in event table to text

There is no limitation on length of event name in RFC-2445, so changing type
for name from char to text.
MDL-38702 theme_mymobile: Replaced missing theme setting to disable CSS Optimiser.

The missing setting was a regression casued by MDL-33357.
MDL-38700 course: add tests for moveto_module()

* Test visibility when moving around hidden sections
* Test for visiblity changes when moving around in the same sections.
MDL-38700 course: only change visibility if a module moves to a different section
MDL-38713 course: correctly set visibleold on mod creation

Remove uncessary set of visibleold in the form
MDL-38711 qtype_multianswer: missing setType param
MDL-38712 mod_glossary: fix missing PARAM type
MDL-38715 SCORM fix missing calls to setType and remove old call to setMaxFileSize
MDL-38455 form: More consistency in section states

- A short form of 2 sections has collapsible sections;
- The second section is expanded by default if the form has 2 sections;
- The collapsed state by setExpanded can override the state in which
  the section was when it was submitted by the user;
- A header containing a required field or one that has an error
  will never be collapsed.
MDL-26956 (1) Library: Move search SQL function to datalib

This function used to be in the user selector, but it is useful in
other areas where we want to search for users as it handles a number
of search options (including extra fields, etc.) and returns SQL
which can be included in a joined query.

A unit test has been added to check the results of these searches.
MDL-26956 (2) Forms: Function to render form to string

Previously it was only possible to display the form immediately as
HTML output. You had to wrap in an output buffer in order to put
it in a renderer. This new function does the output buffer for you.
MDL-26956 (3) Enrol: Add filter options to enrolments screen
MDL-38538 question unit tests: improve things a bit.

1. Split the question_attempt tests into one class per file.
2. Imporve the API to give tests more control, and to test more of the
   important code. Some of this is not used here, but it is about to be.
MDL-38538 question auto-save back end.

1. Autosave works in some ways just like a normal save. We ultimately
call $behaviour->process_save() to do the work, and create a new step to
hold the data.

2. However, we come in through a completely different route through the
API, starting with separate auto-save methods. This keeps the auto-save
changes mostly separate, and so reduced the chance of breaking existing
working code.

3. When the time comes to store the auto-save step in the database, we
save it using a negative sequence number.

This is a clever trick that not only distinguises these steps, but also
avoids unique key errors when an auto-save and a real action happen
simultaneously. (There are unit tests for these tricky edge cases.)

4. When we load the data back from the database, most of the time the
auto-save steps are loaded back as if they were a real save, and so the
auto-saved data is used when the question is then rendered.

5. However, before we process another action, we remove the auto-saved
step, so it does not appear in the final history.
MDL-38538 quiz auto-save front end.

1. There is a new admin setting to control whether this feature is
enabled. The admin can set the auto-save frequency to 1, 2 or 5 minutes,
or disable it.

2. When autosave is enabled, there is code in the quiz that monitors the
main quiz form, and does an ajax save call at the given frequency when
changes are being made by the student.

3. The ajax saves go to a new script that calls the question engine to
do the work.

4. To avoid simultaneous autosave + submit and finish, the auto-save
system shuts down shortly before time expires in a timed quiz.
MDL-38790 Repositories: missing call to setType in 'My private files' form
MDL-35603 - Backup - Course import selector notice

* added new config option to determine length of courses returned by import
* added text indicator if there are more than X number of courses, similar to how the restore course list currently works
MDL-38825 behat: fix composer install url
Merge branch 'MDL-38702_master' of git://github.com/lazydaisy/moodle
Merge branch 'MDL-38538_clean' of git://github.com/timhunt/moodle