Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Provides support for the conversion of moodle1 backup to the moodle2 format

Copyright: 2011 David Mudrak <david@moodle.com>
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 187 lines (7 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class


Class: moodle1_workshopform_rubric_handler  - X-Ref

Conversion handler for the rubric grading strategy data

on_elements_start()   X-Ref
Prepare to gather legacy elements info for a new workshop instance


process_legacy_element(array $data, array $raw)   X-Ref
Processes one <ELEMENT>

param: array $data legacy element data
param: array $raw raw element data

process_legacy_rubric($data, $raw)   X-Ref
Processes one <RUBRIC>


on_elements_end()   X-Ref
Processes gathered elements and rubrics


convert_legacy_criterion_elements()   X-Ref
Processes gathered elements coming from the legacy criterion strategy

Legacy criterion strategy is converted to a rubric with single rubric item
and the layout set to 'list'.

convert_legacy_rubric_elements()   X-Ref
Processes gathered elements coming from the legacy rubric strategy


workshopform_rubric_upgrade_rubric_level(stdclass $old, $newdimensionid)   X-Ref
Transforms given record into an object to be saved into workshopform_rubric_levels

This is used during Rubric 1.9 -> Rubric 2.0 conversion

param: stdClass $old legacy record from joined workshop_elements_old + workshop_rubrics_old
param: int $newdimensionid id of the new workshopform_rubric dimension record to be linked to
return: stdclass to be saved in workshopform_rubric_levels

workshopform_rubric_upgrade_weight($oldweight)   X-Ref
Given old workshop element weight, returns the weight multiplier

Negative weights are not supported any more and are replaced with weight = 0.
Legacy workshop did not store the raw weight but the index in the array
of weights (see $WORKSHOP_EWEIGHTS in workshop 1.x). workshop 2.0 uses
integer weights only (0-16) so all previous weights are multiplied by 4.

param: $oldweight index in legacy $WORKSHOP_EWEIGHTS
return: int new weight