ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ilLTIConsumerGradeService.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
31 {
33  public const GRADESERVICE_READ = 1;
34 
36  public const GRADESERVICE_FULL = 2;
37 
39  public const SCOPE_GRADESERVICE_LINEITEM = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem';
40 
42  public const SCOPE_GRADESERVICE_LINEITEM_READ = 'https://purl.imsglobal.org/spec/lti-ags/scope/lineitem.readonly';
43 
45  public const SCOPE_GRADESERVICE_RESULT_READ = 'https://purl.imsglobal.org/spec/lti-ags/scope/result.readonly';
46 
48  public const SCOPE_GRADESERVICE_SCORE = 'https://purl.imsglobal.org/spec/lti-ags/scope/score';
49 
50 
54  public function __construct()
55  {
57  $this->id = 'gradebookservice';
58  $this->name = 'ilLTIConsumerGradeService';
59  }
60 
64  public function getResources(): array
65  {
66  // The containers should be ordered in the array after their elements.
67  // Lineitems should be after lineitem.
68  if (empty($this->resources)) {
69  $this->resources = array();
70  $this->resources[] = new ilLTIConsumerGradeServiceLineItem($this);
71  $this->resources[] = new ilLTIConsumerGradeServiceLineItems($this);
72  $this->resources[] = new ilLTIConsumerGradeServiceResults($this);
73  $this->resources[] = new ilLTIConsumerGradeServiceScores($this);
74  }
75  return $this->resources;
76  }
77 
82  public function getPermittedScopes(): array
83  {
84  $scopes = array();
85  $scopes[] = self::SCOPE_GRADESERVICE_LINEITEM;
86  $scopes[] = self::SCOPE_GRADESERVICE_LINEITEM_READ;
87  $scopes[] = self::SCOPE_GRADESERVICE_RESULT_READ;
88  $scopes[] = self::SCOPE_GRADESERVICE_SCORE;
89  return $scopes;
90  }
91 
95  public function getScopes(): array
96  {
97  return [
98  self::SCOPE_GRADESERVICE_LINEITEM_READ,
99  self::SCOPE_GRADESERVICE_RESULT_READ,
100  self::SCOPE_GRADESERVICE_SCORE,
101  self::SCOPE_GRADESERVICE_LINEITEM
102  ];
103  }
104 }
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:99
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.