This covers the last case where dupes could be happening in the
completion_aggr_methd table: Restoring one complete course into
an existing one, adding information. Now we always check if the
aggr_method exists before inserting it.
Some early steps in restore are using capability checks to decide how to
restore some information. But at that stage, if the course contents have
been removed and the user had perms at course level only (usually teacher)
the process can fail because some content is not restoreable due to the
lack of permissions.
Moving the restorer step to the beginning really helps is those situations
and it does not hurt at all.
Also, fixed one notice detected when testing this.
This commits cleans some code (settings and dependencies)
and one file included previous by error.
Also it disables all the IMS-CC export feature by default, being
possible to enable it under demand by setting (@ config.php):
$CFG->enablebackupconverters = true;
The 'Show description' feature is about optionally including module description on the course page. This change include the necessary infrastructure - new database field, new FEATURE constant, changes to forms to display it, new language strings for it, backup and restore, and old course conversion. (I found the places to change by searching for an existing field in course_modules).
Documentation for the field is included in install.xml and in modinfolib.
The (partially|in)?correct feedback fields acutally store their files in a file area with component 'question'. Some code, however, was written as if they were stored in the qtype_whatever area.
On contrary from a backup created in 2.0, the file gradebook.xml in the
converted MBZ can contain the course grade_item without the
corresponding grade_category record which is something restore_stepslib
did not expect. This patch fixes two places:
1) the gradebook restore does not use mapped itemid but calls
grade_category::fetch_course_category() to get the actual category to
link the course_item with
2) after_execute makes sure that the mapping actually exists before
trying to move the activities from the default root category
There were two main problems:
1. The unit tests for upgrading adaptive quiz attempts had slighly the
wrong $expectedqa, and so matching that the upgrade was doing the wrong
thing in certain situations. The main issue was that it was setting
-_try = 1 on the first step, which broke the penalty calculation when
the quiz was regraded. There were also some other subtleties with
incrementing -_try that were not right before.
2. It was possible in 2.0 and earlier for two question_states to get the
same seq_number, and restoring 2.0 backups was rashly assuming that that
was unique.