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.

Differences Between: [Versions 310 and 401] [Versions 311 and 401] [Versions 39 and 401] [Versions 400 and 401]

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: 246 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.