MDL-32164 Add string for file encoding

AMOS BEGIN
  CPY [encoding,tool_uploaduser],[fileencoding,mod_data]
AMOS END
MDL-32214 quiz regrading: with many attempts, PHP runs out of memory
MDL-31789: Allowing context object to be passed to JS using json_encode()

Classes with magic properties such as context do not pass through json_encode().
The solution is to implement iterator in such classes and convert what we
feed to json_encode to array using 'foreach' before we pass it to json_encode():
- class context implements IteratorAggregate
- added function convert_to_array() that converts anything to array
- before calling json_encode we convert the argument to array
MDL-32220 question import: files sometimes stored in the wrong context.

Sadly, this involves a small API change, but I don't believe anyone was
using the argument I had to remove (because we were sometimes passing a
wrong value, and there is not way to compute the right value at that
point in the code.)

Also sadly, the code to compute the context we are importing into is now
rather spaghetti-like, but it works.

Conflicts:

	question/format/examview/format.php
	question/format/learnwise/format.php
	question/format/webct/format.php
MDL-32246 question export: should cope with unrecognised qtypes.

If a question is of an unrecognised type, then we just omit it from the export.
MDL-32239 question bank: wrong cap checks editing/viewing quesitions

None of these problems affect the default roles. They only occur when
the permissions have been edited to allow restricted subsets of the
question capabilities.

In some cases, things that the restriced subset of capabilities should
have allowed were blocked by errors. In other cases, users were allowed
to do more than they should bave been due to failures to check the
right capabilities in the right places.

For full details, see the bug report.

Two of the bugs were previously reported separately as MDL-26395 and
MDL-27232.
MDL-32240 quiz editing: check permissions questions are added.

We also check permissions when removing questions from the quiz, so that
we do not let users make mistakes they cannot immediately undo.

Conflicts:

	mod/quiz/editlib.php
MDL-32256 quiz_cron() now returns true as expected by the current API
MDL-32258 database module does not have any data_cron() function to execute
MDL-32201 question export: use qformat_xml::write_answer in base class

Without this, images in answers were not being written to the export
file for questions using extra_answer_fields.
MDL-32039 qeupgradehelper: fix typos in the lang strings
MDL-32264 theme_standard: Fixed multi-day calendar event border issue
MDL-32018 mod_wiki: Improved form definitions to ensure they consistent and secure
MDL-32018 mod_wiki: Fixed formatting of the page title so that is is consistent and secure
MDL-32018 mod_wiki: Fixed up whitespace after peer-review
MDL-31631 navigation: Removed caching of activities and sections arrays in favour of relying on cminfo caching
MDL-29678 navigation: Navigation AJAX require_login calls no longer set wantsurl or redirect
MDL-29678 lib: Require login now overrides  to false for AJAX scripts
MDL-30784 - lib - Patch provided by Jason Hardin to provide detection for Android Tablets to allow the theme engine to provide the tablet theme
Automatically generated installer lang files