LTI Integration Library 4.10.3
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
LineItem.php
1<?php
2
3namespace ceLTIc\LTI;
4
6
15{
16
22 public $label = null;
23
29 public $pointsPossible = 1;
30
36 public $ltiResourceLinkId = null;
37
43 public $resourceId = null;
44
50 public $tag = null;
51
57 public $submitFrom = null;
58
64 public $submitUntil = null;
65
71 public $endpoint = null;
72
78 public $submissionReview = null;
79
85 private $platform = null;
86
94 public function __construct($platform, $label, $pointsPossible)
95 {
96 $this->platform = $platform;
97 $this->label = $label;
98 $this->pointsPossible = $pointsPossible;
99 }
100
106 public function getPlatform()
107 {
108 return $this->platform;
109 }
110
116 public function save()
117 {
118 $service = new Service\LineItem($this->platform, $this->endpoint);
119 return $service->saveLineItem($this);
120 }
121
127 public function delete()
128 {
129 $service = new Service\LineItem($this->platform, $this->endpoint);
130 return $service->deleteLineItem($this);
131 }
132
140 public function getOutcomes($limit = null)
141 {
142 $resultService = new Service\Result($this->platform, $this->endpoint);
143 return $resultService->getAll();
144 }
145
153 public function readOutcome($user)
154 {
155 $resultService = new Service\Result($this->platform, $this->endpoint);
156 return $resultService->get($user);
157 }
158
167 public function submitOutcome($ltiOutcome, $user)
168 {
169 $scoreService = new Service\Score($this->platform, $this->endpoint);
170 return $scoreService->submit($ltiOutcome, $user);
171 }
172
180 public function deleteOutcome($user)
181 {
182 $ltiOutcome = new Outcome();
183 $scoreService = new Service\Score($this->platform, $this->endpoint);
184 return $scoreService->submit($ltiOutcome, $user);
185 }
186
195 public static function fromEndpoint($platform, $endpoint)
196 {
197 return Service\LineItem::getLineItem($platform, $endpoint);
198 }
199
200}
Class to represent a line-item.
Definition LineItem.php:15
$submissionReview
Submission review.
Definition LineItem.php:78
$submitUntil
Outcome end submit timestamp.
Definition LineItem.php:64
__construct($platform, $label, $pointsPossible)
Class constructor.
Definition LineItem.php:94
$endpoint
Line-item endpoint.
Definition LineItem.php:71
deleteOutcome($user)
Delete the outcome for a user.
Definition LineItem.php:180
$label
Label value.
Definition LineItem.php:22
$submitFrom
Outcome start submit timestamp.
Definition LineItem.php:57
$pointsPossible
Points possible value.
Definition LineItem.php:29
readOutcome($user)
Retrieve the outcome for a user.
Definition LineItem.php:153
submitOutcome($ltiOutcome, $user)
Submit the outcome for a user.
Definition LineItem.php:167
static fromEndpoint($platform, $endpoint)
Retrieve a line-item definition.
Definition LineItem.php:195
$ltiResourceLinkId
LTI Resource Link ID with which the line item is associated.
Definition LineItem.php:36
$resourceId
Tool resource ID associated with the line-item.
Definition LineItem.php:43
getOutcomes($limit=null)
Retrieve all outcomes.
Definition LineItem.php:140
getPlatform()
Get platform.
Definition LineItem.php:106
save()
Save the line-item to the platform.
Definition LineItem.php:116
Class to represent an outcome.
Definition Outcome.php:13
Class to implement the Result service.
Definition Result.php:17
Class to implement the Score service.
Definition Score.php:17
Class to implement a service.
Definition Service.php:19