Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are 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: 3 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