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.

This file contains the upgrade code to upgrade from mod_assignment to mod_assign

Copyright: 2012 NetSpot {@link http://www.netspot.com.au}
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 416 lines (20 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

assign_upgrade_manager:: (2 methods):
  upgrade_assignment()
  duplicate_course_module()


Class: assign_upgrade_manager  - X-Ref

Class to manage upgrades from mod_assignment to mod_assign

upgrade_assignment($oldassignmentid, & $log)   X-Ref
This function converts all of the base settings for an instance of
the old assignment to the new format. Then it calls each of the plugins
to see if they can help upgrade this assignment.

param: int $oldassignmentid (don't rely on the old assignment type even being installed)
param: string $log This string gets appended to during the conversion process
return: bool true or false

duplicate_course_module(stdClass $cm, $moduleid, $newinstanceid)   X-Ref
Create a duplicate course module record so we can create the upgraded
assign module alongside the old assignment module.

param: stdClass $cm The old course module record
param: int $moduleid The id of the new assign module
param: int $newinstanceid The id of the new instance of the assign module
return: mixed stdClass|bool The new course module record or FALSE