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.

Class: gradebookservices_test  - X-Ref

Unit tests for lti gradebookservices.

test_lti_add_coupled_lineitem()   X-Ref


test_lti_add_coupled_lineitem_default_subreview()   X-Ref


test_lti_add_standalone_lineitem()   X-Ref


test_get_launch_parameters_coupled()   X-Ref


test_get_launch_parameters_coupled_subreview_override()   X-Ref


test_get_launch_parameters_coupled_subreview_override_default()   X-Ref


test_get_launch_parameters_decoupled()   X-Ref


test_is_user_gradable_in_course()   X-Ref


assert_lineitems(object $course, int $typeid,string $label, ?object $ltiinstance, ?string $resourceid, ?string $tag,?string $subreviewurl = null, ?string $subreviewparams = null)   X-Ref
Asserts a matching gradebookservices record exist with the matching tag and resourceid.

param: object $course current course
param: int $typeid Type id of the tool
param: string $label Label of the line item
param: object|null $ltiinstance lti instance related to that line item
param: string|null $resourceid resourceid the line item should have
param: string|null $tag tag the line item should have
param: string|null $subreviewurl submission review url
param: string|null $subreviewparams submission review custom params

create_graded_lti(int $typeid, object $course, ?string $resourceid, ?string $tag,?string $subreviewurl = null, ?string $subreviewparams = null)   X-Ref
Inserts a graded lti instance, which should create a grade_item and gradebookservices record.

param: int $typeid Type ID of the LTI Tool.
param: object $course course where to add the lti instance.
param: string|null $resourceid resource id
param: string|null $tag tag
param: string|null $subreviewurl submission review url
param: string|null $subreviewparams submission review custom params
return: object lti instance created

create_notgraded_lti(int $typeid, object $course)   X-Ref
Inserts an lti instance that is not graded.

param: int $typeid Type Id of the LTI Tool.
param: object $course course where to add the lti instance.
return: object lti instance created

create_standalone_lineitem(int $courseid, int $typeid, ?string $resourceid,?string $tag, int $ltiinstanceid = null)   X-Ref
Inserts a standalone lineitem (gradeitem, gradebookservices entries).

param: int $courseid Id of the course where the standalone line item will be added.
param: int $typeid of the LTI Tool
param: string|null $resourceid resource id
param: string|null $tag tag
param: int|null $ltiinstanceid Id of the LTI instance the standalone line item will be related to.

create_type()   X-Ref
Creates a new LTI Tool Type.