Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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: 4 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