LTI Integration Library 5.1.4
PHP class library for building LTI integrations
 
Loading...
Searching...
No Matches
LineItem Class Reference

Class to represent a line-item. More...

Public Member Functions

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

Static Public Member Functions

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

Public Attributes

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

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
Licence: http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3

Constructor & Destructor Documentation

◆ __construct()

__construct ( Platform $platform,
string $label,
int|float $pointsPossible )

Class constructor.

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

Member Function Documentation

◆ delete()

bool delete ( )

Delete the line-item on the platform.

Returns
bool True if successful

◆ deleteOutcome()

bool deleteOutcome ( User $user)

Delete the outcome for a user.

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

◆ fromEndpoint()

static LineItem bool 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

◆ getOutcomes()

Outcome[] bool 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

◆ getPlatform()

Platform getPlatform ( )

Get platform.

Returns
Platform Platform object for this line-item.

◆ readOutcome()

Outcome null bool 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

◆ save()

bool save ( )

Save the line-item to the platform.

Returns
bool True if successful

◆ submitOutcome()

bool submitOutcome ( Outcome $ltiOutcome,
User $user )

Submit the outcome for a user.

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