Because of a bug in Workshop upgrade code, multiple workshop course_modules can
potentially point to a single workshop instance. The chance is pretty low as in most cases,
the upgrade failed. But under certain circumstances, workshop could be upgraded with
this data integrity issue. We want to detect it now and let the admin know.
The patch changes workshop_upgrade_module_instances() so that it
processes old workshop records ordered by their id and it keeps the
instances id by using import_record() instead of insert_record().
Thanks to this, there is no mapping of workshop ids needed so the
function workshop_upgrade_workshop_id_mappings() is dropped and all
callers use plain workshop record.
The protected method get_allocations_recordset() is a relict from
earlier development phases of Workshop module. Removing it as it
confuses recent Eloy's recordset usage detection tool.
There was a bug as these users were ignored only as squares but not as
circles. This patch makes sure that no new allocation are added to
not-grouped users in visible group mode. However, the options 'Remove current
allocations' and 'Add self-assessments' apply to them intentionally.
Also, the user is warned if there are some not-grouped users found in a
workshop in visible groups mode or separate groups mode.
The patch wraps that foreach ($circles as $circleid => $circle)
loop by yet another one for() loop. Reviews are allocated iteratively
now. During the first iteration, we try to make sure that at least one
circle link exists. During the second iteration, we try to allocate two,
etc. Circles are shuffled at the beginning of each iteration.
This is supposed to improve the randomness of the allocation.
The patch also fixes shuffle_assoc() implementation. The previous
implementation actually did not work at all. Also, that removed called
to shuffle_assoc() was redundant here.
As reported by Trudy Koedooder at http://moodle.org/mod/forum/discuss.php?d=161322
there can be some orphaned grade records without the referenced
assessment. It threw upgrade error. Such grades are now just ignored
during the upgrade.
Major tasks undertaken in this patch:
* New format_text argument, overflowdiv.
* New page layout Report.
* Review of all format_text calls.
* Added support for the report layout to all themes.
* Changed forum post display from tables to divs.