ILIAS  release_8 Revision v8.23
ILIAS\LTI\ToolProvider\LineItem Class Reference

Class to represent a line item. More...

+ Collaboration diagram for ILIAS\LTI\ToolProvider\LineItem:

Public Member Functions

 __construct (Platform $platform, string $label, int $pointsPossible)
 Class constructor. More...
 
 getPlatform ()
 Get platform. More...
 
 save ()
 Save the line item to the platform. More...
 
 delete ()
 Delete the line item on the platform. More...
 
 getOutcomes (int $limit=null)
 Retrieve all outcomes. More...
 
 readOutcome (User $user)
 Retrieve the outcome for a user. More...
 
 submitOutcome (Outcome $ltiOutcome, User $user)
 Submit the outcome for a user. More...
 
 deleteOutcome (User $user)
 Delete the outcome for a user. More...
 

Static Public Member Functions

static fromEndpoint (Platform $platform, string $endpoint)
 Retrieve a line item definition. More...
 

Data Fields

string $label = null
 Label value. More...
 
int $pointsPossible = 1
 Points possible value. More...
 
string $ltiResourceLinkId = null
 LTI Resource Link ID with which the line item is associated. More...
 
string $resourceId = null
 Tool resource ID associated with the line item. More...
 
string $tag = null
 Tag value. More...
 
int $submitFrom = null
 Outcome start submit timestamp. More...
 
int $submitUntil = null
 Outcome end submit timestamp. More...
 
string $endpoint = null
 Line item endpoint. More...
 

Private Attributes

Platform $platform = null
 Platform for this line item. More...
 

Detailed Description

Class to represent a line item.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com

Definition at line 30 of file LineItem.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\LTI\ToolProvider\LineItem::__construct ( Platform  $platform,
string  $label,
int  $pointsPossible 
)

Class constructor.

Parameters
Platform$platformPlatform object
string$labelLabel
int$pointsPossiblePoints possible value

Definition at line 101 of file LineItem.php.

References ILIAS\LTI\ToolProvider\LineItem\$label, ILIAS\LTI\ToolProvider\LineItem\$platform, and ILIAS\LTI\ToolProvider\LineItem\$pointsPossible.

102  {
103  $this->platform = $platform;
104  $this->label = $label;
105  $this->pointsPossible = $pointsPossible;
106  }
Platform $platform
Platform for this line item.
Definition: LineItem.php:93
int $pointsPossible
Points possible value.
Definition: LineItem.php:44
string $label
Label value.
Definition: LineItem.php:37

Member Function Documentation

◆ delete()

ILIAS\LTI\ToolProvider\LineItem::delete ( )

Delete the line item on the platform.

Returns
bool True if successful

Definition at line 134 of file LineItem.php.

References $service.

134  : bool
135  {
136  $service = new Service\LineItem($this->platform, $this->endpoint);
137  return $service->deleteLineItem($this);
138  }
$service
Definition: ltiservices.php:43

◆ deleteOutcome()

ILIAS\LTI\ToolProvider\LineItem::deleteOutcome ( User  $user)

Delete the outcome for a user.

Parameters
User$userUser object
Returns
bool True if successful, otherwise false

Definition at line 179 of file LineItem.php.

179  : bool
180  {
181  $ltiOutcome = new Outcome();
182  $scoreService = new Service\Score($this->platform, $this->endpoint);
183  return $scoreService->submit($ltiOutcome, $user);
184  }

◆ fromEndpoint()

static ILIAS\LTI\ToolProvider\LineItem::fromEndpoint ( Platform  $platform,
string  $endpoint 
)
static

Retrieve a line item definition.

Parameters
Platform$platformPlatform object
string$endpointID value
Returns
LineItem|bool LineItem object or false on error

Definition at line 192 of file LineItem.php.

193  {
194  return Service\LineItem::getLineItem($platform, $endpoint);
195  }
Platform $platform
Platform for this line item.
Definition: LineItem.php:93
string $endpoint
Line item endpoint.
Definition: LineItem.php:86

◆ getOutcomes()

ILIAS\LTI\ToolProvider\LineItem::getOutcomes ( int  $limit = null)

Retrieve all outcomes.

Parameters
int | null$limitLimit of outcomes to be returned in each request, null for service default
Returns
Outcome[]|bool Array of outcome objects, or false on error

Definition at line 145 of file LineItem.php.

146  {
147  $resultService = new Service\Result($this->platform, $this->endpoint);
148  return $resultService->getAll();
149  }

◆ getPlatform()

ILIAS\LTI\ToolProvider\LineItem::getPlatform ( )

Get platform.

Returns
Platform Platform object for this line item.

Definition at line 113 of file LineItem.php.

References ILIAS\LTI\ToolProvider\LineItem\$platform.

Referenced by ILIAS\LTI\ToolProvider\Service\LineItem\createLineItem(), ILIAS\LTI\ToolProvider\Service\LineItem\getAll(), and ILIAS\LTI\ToolProvider\Service\LineItem\saveLineItem().

113  : ?Platform
114  {
115  return $this->platform;
116  }
Platform $platform
Platform for this line item.
Definition: LineItem.php:93
+ Here is the caller graph for this function:

◆ readOutcome()

ILIAS\LTI\ToolProvider\LineItem::readOutcome ( User  $user)

Retrieve the outcome for a user.

Parameters
User$userUser object
Returns
Outcome|null|bool Outcome object, or null if none, or false on error

Definition at line 156 of file LineItem.php.

157  {
158  $resultService = new Service\Result($this->platform, $this->endpoint);
159  return $resultService->get($user);
160  }

◆ save()

ILIAS\LTI\ToolProvider\LineItem::save ( )

Save the line item to the platform.

Returns
bool True if successful

Definition at line 123 of file LineItem.php.

References $service.

123  : bool
124  {
125  $service = new Service\LineItem($this->platform, $this->endpoint);
126  return $service->saveLineItem($this);
127  }
$service
Definition: ltiservices.php:43

◆ submitOutcome()

ILIAS\LTI\ToolProvider\LineItem::submitOutcome ( Outcome  $ltiOutcome,
User  $user 
)

Submit the outcome for a user.

Parameters
Outcome$ltiOutcomeOutcome object
User$userUser object
Returns
bool True if successful

Definition at line 168 of file LineItem.php.

168  : bool
169  {
170  $scoreService = new Service\Score($this->platform, $this->endpoint);
171  return $scoreService->submit($ltiOutcome, $user);
172  }

Field Documentation

◆ $endpoint

string ILIAS\LTI\ToolProvider\LineItem::$endpoint = null

◆ $label

string ILIAS\LTI\ToolProvider\LineItem::$label = null

Label value.

Definition at line 37 of file LineItem.php.

Referenced by ILIAS\LTI\ToolProvider\LineItem\__construct().

◆ $ltiResourceLinkId

string null ILIAS\LTI\ToolProvider\LineItem::$ltiResourceLinkId = null

LTI Resource Link ID with which the line item is associated.

Definition at line 51 of file LineItem.php.

Referenced by ILIAS\LTI\ToolProvider\Service\LineItem\getAll().

◆ $platform

Platform null ILIAS\LTI\ToolProvider\LineItem::$platform = null
private

◆ $pointsPossible

int ILIAS\LTI\ToolProvider\LineItem::$pointsPossible = 1

Points possible value.

Definition at line 44 of file LineItem.php.

Referenced by ILIAS\LTI\ToolProvider\LineItem\__construct().

◆ $resourceId

string null ILIAS\LTI\ToolProvider\LineItem::$resourceId = null

Tool resource ID associated with the line item.

Definition at line 58 of file LineItem.php.

Referenced by ILIAS\LTI\ToolProvider\Service\LineItem\getAll().

◆ $submitFrom

int null ILIAS\LTI\ToolProvider\LineItem::$submitFrom = null

Outcome start submit timestamp.

Definition at line 72 of file LineItem.php.

◆ $submitUntil

int null ILIAS\LTI\ToolProvider\LineItem::$submitUntil = null

Outcome end submit timestamp.

Definition at line 79 of file LineItem.php.

◆ $tag

string null ILIAS\LTI\ToolProvider\LineItem::$tag = null

Tag value.

Definition at line 65 of file LineItem.php.

Referenced by ILIAS\LTI\ToolProvider\Service\LineItem\getAll().


The documentation for this class was generated from the following file: