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.

Differences Between: [Versions 310 and 311] [Versions 311 and 401] [Versions 311 and 402] [Versions 311 and 403] [Versions 39 and 311]

This file contains the class for restore of this gradebookservices plugin

Author: Dirk Singels, Diego del Blanco, Claude Vervoort
Copyright: 2017 Cengage Learning http://www.cengage.com
License: http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
File Size: 244 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

restore_ltiservice_gradebookservices_subplugin:: (5 methods):
  define_lti_subplugin_structure()
  process_ltiservice_gradebookservices_lineitem()
  find_proxy_id()
  find_typeid()
  after_restore_lti()


Class: restore_ltiservice_gradebookservices_subplugin  - X-Ref

Restore subplugin class.

Provides the necessary information
needed to restore the lineitems related with the lti activity (coupled),
and all the uncoupled ones from the course.

define_lti_subplugin_structure()   X-Ref
Returns the subplugin structure to attach to the XML element.

return: restore_path_element[] array of elements to be processed on restore.

process_ltiservice_gradebookservices_lineitem($data)   X-Ref
Processes one lineitem

param: mixed $data
return: void

find_proxy_id($data)   X-Ref
If the toolproxy is not in the mapping (or it is 0)
we try to find the toolproxyid.
If none is found, then we set it to 0.

param: mixed $data
return: integer $newtoolproxyid

find_typeid($data, $courseid)   X-Ref
If the typeid is not in the mapping or it is 0, (it should be most of the times)
we will try to find the better typeid that matches with the lineitem.
If none is found, then we set it to 0.

param: stdClass $data
param: int $courseid
return: int The item type id

after_restore_lti()   X-Ref
We call the after_restore_lti to update the grade_items id's that we didn't know in the moment of creating
the gradebookservices rows.