ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
class.ilLTIConsumerGradeService.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
30 {
32  public const GRADESERVICE_READ = 1;
33 
35  public const GRADESERVICE_FULL = 2;
36 
38  public const SCOPE_GRADESERVICE_LINEITEM = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem';
39 
41  public const SCOPE_GRADESERVICE_LINEITEM_READ = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly';
42 
44  public const SCOPE_GRADESERVICE_RESULT_READ = 'https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly';
45 
47  public const SCOPE_GRADESERVICE_SCORE = 'https://purl.imsglobal.org/spec/lti-ags/scope/score';
48 
49 
53  public function __construct()
54  {
56  $this->id = 'gradebookservice';
57  $this->name = 'ilLTIConsumerGradeService';
58  }
59 
63  public function getResources(): array
64  {
65  // The containers should be ordered in the array after their elements.
66  // Lineitems should be after lineitem.
67  if (empty($this->resources)) {
68  $this->resources = array();
69  $this->resources[] = new ilLTIConsumerGradeServiceLineItem($this);
70  $this->resources[] = new ilLTIConsumerGradeServiceLineItems($this);
71  $this->resources[] = new ilLTIConsumerGradeServiceResults($this);
72  $this->resources[] = new ilLTIConsumerGradeServiceScores($this);
73  }
74  return $this->resources;
75  }
76 
81  public function getPermittedScopes(): array
82  {
83  $scopes = array();
84  $scopes[] = self::SCOPE_GRADESERVICE_LINEITEM;
85  $scopes[] = self::SCOPE_GRADESERVICE_LINEITEM_READ;
86  $scopes[] = self::SCOPE_GRADESERVICE_RESULT_READ;
87  $scopes[] = self::SCOPE_GRADESERVICE_SCORE;
88  return $scopes;
89  }
90 
94  public function getScopes(): array
95  {
96  return [
97  self::SCOPE_GRADESERVICE_LINEITEM_READ,
98  self::SCOPE_GRADESERVICE_RESULT_READ,
99  self::SCOPE_GRADESERVICE_SCORE,
100  self::SCOPE_GRADESERVICE_LINEITEM
101  ];
102  }
103 }
const SCOPE_GRADESERVICE_LINEITEM_READ
Scope for full access to Lineitem service.
getResources()
Get the resources for this service.
getScopes()
Get the scopes defined by this service.
const GRADESERVICE_READ
Read-only access to Gradebook services.
$scopes
Definition: ltitoken.php:96
const SCOPE_GRADESERVICE_SCORE
Scope for access to Score service.
const SCOPE_GRADESERVICE_LINEITEM
Scope for full access to Lineitem service.
const SCOPE_GRADESERVICE_RESULT_READ
Scope for access to Result service.
__construct(Container $dic, ilPlugin $plugin)
getPermittedScopes()
Get the scope(s) permitted for this service.
array $resources
Instances of the resources associated with this service.
const GRADESERVICE_FULL
Full access to Gradebook services.