Class to represent a platform resource link. More...
Public Member Functions | |
| __construct () | |
| Class constructor. | |
| initialize () | |
| Initialise the resource link. | |
| initialise () | |
| Initialise the resource link. | |
| bool | save () |
| Save the resource link to the database. | |
| bool | delete () |
| Delete the resource link from the database. | |
| ToolConsumer | getConsumer () |
| Get tool consumer. | |
| int null | getConsumerId () |
| Get tool consumer ID. | |
| setConsumerId ($consumerId) | |
| Set tool consumer ID. | |
| Platform | getPlatform () |
| Get platform. | |
| int null | getPlatformId () |
| Get platform ID. | |
| setPlatformId ($platformId) | |
| Set platform ID. | |
| Context null | getContext () |
| Get context. | |
| int null | getContextId () |
| Get context record ID. | |
| setContext ($context) | |
| Set context. | |
| setContextId ($contextId) | |
| Set context ID. | |
| string | getKey () |
| Get consumer key. | |
| string | getId () |
| Get resource link ID. | |
| int null | getRecordId () |
| Get resource link record ID. | |
| setRecordId ($id) | |
| Set resource link record ID. | |
| DataConnector null | getDataConnector () |
| Get the data connector. | |
| string | getSetting ($name, $default='') |
| Get a setting value. | |
| setSetting ($name, $value=null) | |
| Set a setting value. | |
| array | getSettings () |
| Get an array of all setting values. | |
| setSettings ($settings) | |
| Set an array of all setting values. | |
| bool | saveSettings () |
| Save setting values. | |
| bool | hasOutcomesService () |
| Check if an Outcomes service is available. | |
| bool | hasMembershipsService () |
| Check if a Memberships service is available. | |
| bool | hasSettingService () |
| Check if the Setting extension service is available. | |
| bool | hasLineItemService () |
| Check if the Line Item service is available. | |
| bool | hasScoreService () |
| Check if the Score service is available. | |
| bool | hasResultService () |
| Check if the Result service is available. | |
| bool | hasAssessmentControlService () |
| Check if the Assessment Control service is available. | |
| bool | doOutcomesService ($action, $ltiOutcome, $userResult) |
| Perform an Outcomes service request. | |
| mixed | doMembershipsService ($withGroups=false) |
| Perform a Memberships extension service request. | |
| mixed | doSettingService ($action, $value=null) |
| Perform a Setting service request. | |
| bool | hasToolSettingsService () |
| Check if the Tool Settings service is available. | |
| mixed | getToolSettings ($mode=Service\ToolSettings::MODE_CURRENT_LEVEL, $simple=true) |
| Get Tool Settings. | |
| bool | setToolSettings ($settings=array()) |
| Set Tool Settings. | |
| bool | hasMembershipService () |
| Check if the Membership service is supported. | |
| mixed | getMembership () |
| Get Membership. | |
| mixed | getMemberships ($withGroups=false) |
| Get Memberships. | |
| UserResult[] | getUserResultSourcedIDs ($localOnly=false, $idScope=null) |
| Obtain an array of UserResult objects for users with a result sourcedId. | |
| ResourceLinkShare[] | getShares () |
| Get an array of ResourceLinkShare objects for each resource link which is sharing this context. | |
| LineItem[] bool | getLineItems ($resourceId=null, $tag=null, $limit=null) |
| Get line items. | |
| bool | createLineItem ($lineItem) |
| Create a new line item. | |
| Outcome[] bool | getOutcomes ($limit=null) |
| Get all outcomes. | |
| string bool | doAssessmentControlAction ($assessmentControlAction, $user, $attemptNumber) |
| Perform an Assessment Control action. | |
Static Public Member Functions | |
| static ResourceLink | fromConsumer ($consumer, $ltiResourceLinkId, $tempId=null) |
| Class constructor from consumer. | |
| static ResourceLink | fromPlatform ($platform, $ltiResourceLinkId, $tempId=null) |
| Class constructor from platform. | |
| static ResourceLink | fromContext ($context, $ltiResourceLinkId, $tempId=null) |
| Class constructor from context. | |
| static ResourceLink | fromRecordId ($id, $dataConnector) |
| Load the resource link from the database. | |
Static Public Member Functions inherited from ApiHook | |
| static void | registerApiHook ($hookName, $familyCode, $className) |
| Register the availability of an API hook. | |
Public Attributes | |
| const | EXT_READ = 1 |
| Read action. | |
| const | EXT_WRITE = 2 |
| Write (create/update) action. | |
| const | EXT_DELETE = 3 |
| Delete action. | |
| const | EXT_CREATE = 4 |
| Create action. | |
| const | EXT_UPDATE = 5 |
| Update action. | |
| const | EXT_TYPE_DECIMAL = 'decimal' |
| Decimal outcome type. | |
| const | EXT_TYPE_PERCENTAGE = 'percentage' |
| Percentage outcome type. | |
| const | EXT_TYPE_RATIO = 'ratio' |
| Ratio outcome type. | |
| const | EXT_TYPE_LETTER_AF = 'letteraf' |
| Letter (A-F) outcome type. | |
| const | EXT_TYPE_LETTER_AF_PLUS = 'letterafplus' |
| Letter (A-F) with optional +/- outcome type. | |
| const | EXT_TYPE_PASS_FAIL = 'passfail' |
| Pass/fail outcome type. | |
| const | EXT_TYPE_TEXT = 'freetext' |
| Free text outcome type. | |
| string null | $title = null |
| Context title. | |
| string null | $ltiResourceLinkId = null |
| Resource link ID as supplied in the last connection request. | |
| array null | $groupSets = null |
| User group sets (null if the platform does not support the groups enhancement) | |
| array null | $groups = null |
| User groups (null if the platform does not support the groups enhancement) | |
| HttpMessage null | $lastServiceRequest = null |
| HttpMessage object for last service request. | |
| string null | $extRequest = null |
| Request for last service request. | |
| array null | $extRequestHeaders = null |
| Request headers for last service request. | |
| string null | $extResponse = null |
| Response from last service request. | |
| array null | $extResponseHeaders = null |
| Response header from last service request. | |
| string null | $primaryResourceLinkId = null |
| Primary key value for resource link being shared (if any). | |
| bool null | $shareApproved = null |
| Whether the sharing request has been approved by the primary resource link. | |
| int null | $created = null |
| Timestamp for when the object was created. | |
| int null | $updated = null |
| Timestamp for when the object was last updated. | |
Additional Inherited Members | |
Static Public Attributes inherited from ApiHook | |
| static | $USER_ID_HOOK = "UserId" |
| User Id hook name. | |
| static | $CONTEXT_ID_HOOK = "ContextId" |
| Context Id hook name. | |
| static | $GROUPS_SERVICE_HOOK = "Groups" |
| Course Groups service hook name. | |
| static | $MEMBERSHIPS_SERVICE_HOOK = "Memberships" |
| Memberships service hook name. | |
| static | $OUTCOMES_SERVICE_HOOK = "Outcomes" |
| Outcomes service hook name. | |
| static | $TOOL_SETTINGS_SERVICE_HOOK = "ToolSettings" |
| Tool Settings service hook name. | |
| static | $ACCESS_TOKEN_SERVICE_HOOK = "AccessToken" |
| Access Token service hook name. | |
Class to represent a platform resource link.
| bool createLineItem | ( | $lineItem | ) |
Create a new line item.
| LineItem | $lineItem | Line item object |
| bool delete | ( | ) |
Delete the resource link from the database.
References ResourceLink\initialize().
| string bool doAssessmentControlAction | ( | $assessmentControlAction, | |
| $user, | |||
| $attemptNumber | |||
| ) |
Perform an Assessment Control action.
| AssessmentControlAction | $assessmentControlAction | Assessment control object |
| User | $user | User object |
| int | $attemptNumber | Number of attempt |
| mixed doMembershipsService | ( | $withGroups = false | ) |
Perform a Memberships extension service request.
The userResult table is updated with any user objects with lis_result_sourcedid values.
| bool | $withGroups | True is group information is to be requested as well |
| bool doOutcomesService | ( | $action, | |
| $ltiOutcome, | |||
| $userResult | |||
| ) |
Perform an Outcomes service request.
| int | $action | The action type constant |
| Outcome | $ltiOutcome | Outcome object |
| UserResult | $userResult | UserResult object |
| mixed doSettingService | ( | $action, | |
$value = null |
|||
| ) |
Perform a Setting service request.
| int | $action | The action type constant |
| string | $value | The setting value (optional, default is null) |
|
static |
Class constructor from consumer.
| ToolConsumer | $consumer | Consumer object |
| string | $ltiResourceLinkId | Resource link ID value |
| string | $tempId | Temporary Resource link ID value (optional, default is null) |
|
static |
Class constructor from context.
| Context | $context | Context object |
| string | $ltiResourceLinkId | Resource link ID value |
| string | $tempId | Temporary Resource link ID value (optional, default is null) |
References ResourceLink\$ltiResourceLinkId.
|
static |
Class constructor from platform.
| Platform | $platform | Platform object |
| string | $ltiResourceLinkId | Resource link ID value |
| string | $tempId | Temporary Resource link ID value (optional, default is null) |
|
static |
Load the resource link from the database.
| int | $id | Record ID of resource link |
| DataConnector | $dataConnector | Database connection object |
References ResourceLink\$ltiResourceLinkId.
| ToolConsumer getConsumer | ( | ) |
Get tool consumer.
| int null getConsumerId | ( | ) |
Get tool consumer ID.
References ResourceLink\getPlatform(), and Util\logDebug().
| Context null getContext | ( | ) |
Get context.
Referenced by ResourceLink\hasSettingService().
| int null getContextId | ( | ) |
Get context record ID.
Referenced by ResourceLink\hasSettingService().
| DataConnector null getDataConnector | ( | ) |
Get the data connector.
Referenced by ResourceLink\getLineItems().
| string getId | ( | ) |
Get resource link ID.
| string getKey | ( | ) |
Get consumer key.
References Context\getRecordId().
| LineItem[] bool getLineItems | ( | $resourceId = null, |
|
$tag = null, |
|||
$limit = null |
|||
| ) |
Get line items.
| string | null | $resourceId | Tool resource ID |
| string | null | $tag | Tag |
| int | null | $limit | Limit of line items to be returned in each request, null for service default |
References ResourceLink\getDataConnector(), and DataConnector\getUserResultSourcedIDsResourceLink().
| mixed getMembership | ( | ) |
Get Membership.
References ResourceLink\hasMembershipsService(), and Util\logDebug().
| mixed getMemberships | ( | $withGroups = false | ) |
Get Memberships.
| bool | $withGroups | True is group information is to be requested as well |
| Outcome[] bool getOutcomes | ( | $limit = null | ) |
Get all outcomes.
| int | null | $limit | Limit of outcomes to be returned in each request, null for service default |
| Platform getPlatform | ( | ) |
Get platform.
Referenced by ResourceLink\getConsumerId(), ResourceLink\hasLineItemService(), and ResourceLink\hasMembershipsService().
| int null getPlatformId | ( | ) |
Get platform ID.
| int null getRecordId | ( | ) |
Get resource link record ID.
| string getSetting | ( | $name, | |
$default = '' |
|||
| ) |
Get a setting value.
| string | $name | Name of setting |
| string | $default | Value to return if the setting does not exist (optional, default is an empty string) |
Referenced by ResourceLink\hasAssessmentControlService(), ResourceLink\hasMembershipService(), ResourceLink\hasMembershipsService(), ResourceLink\hasResultService(), ResourceLink\hasScoreService(), and ResourceLink\hasSettingService().
| array getSettings | ( | ) |
Get an array of all setting values.
| ResourceLinkShare[] getShares | ( | ) |
Get an array of ResourceLinkShare objects for each resource link which is sharing this context.
| mixed getToolSettings | ( | $mode = Service\ToolSettings::MODE_CURRENT_LEVEL, |
|
$simple = true |
|||
| ) |
Get Tool Settings.
| int | $mode | Mode for request (optional, default is current level only) |
| bool | $simple | True if all the simple media type is to be used (optional, default is true) |
| UserResult[] getUserResultSourcedIDs | ( | $localOnly = false, |
|
$idScope = null |
|||
| ) |
Obtain an array of UserResult objects for users with a result sourcedId.
The array may include users from other resource links which are sharing this resource link. It may also be optionally indexed by the user ID of a specified scope.
| bool | $localOnly | True if only users from this resource link are to be returned, not users from shared resource links (optional, default is false) |
| int | $idScope | Scope to use for ID values (optional, default is null for platform default) |
| bool hasAssessmentControlService | ( | ) |
Check if the Assessment Control service is available.
References Result\$SCOPE, and ResourceLink\getSetting().
| bool hasLineItemService | ( | ) |
Check if the Line Item service is available.
References ResourceLink\getPlatform().
| bool hasMembershipService | ( | ) |
Check if the Membership service is supported.
References ResourceLink\getSetting().
| bool hasMembershipsService | ( | ) |
Check if a Memberships service is available.
References Result\$SCOPE, Score\$SCOPE, ResourceLink\getPlatform(), and ResourceLink\getSetting().
Referenced by ResourceLink\getMembership().
| bool hasOutcomesService | ( | ) |
Check if an Outcomes service is available.
| bool hasResultService | ( | ) |
Check if the Result service is available.
References Score\$SCOPE, and ResourceLink\getSetting().
| bool hasScoreService | ( | ) |
Check if the Score service is available.
References ResourceLink\getSetting().
| bool hasSettingService | ( | ) |
Check if the Setting extension service is available.
References ResourceLink\getContext(), ResourceLink\getContextId(), and ResourceLink\getSetting().
| bool hasToolSettingsService | ( | ) |
Check if the Tool Settings service is available.
| initialise | ( | ) |
| bool save | ( | ) |
Save the resource link to the database.
| bool saveSettings | ( | ) |
Save setting values.
| setConsumerId | ( | $consumerId | ) |
Set tool consumer ID.
| int | $consumerId | Tool Consumer ID for this resource link. |
References Util\logDebug().
| setContext | ( | $context | ) |
Set context.
| Context | $context | Context for this resource link. |
| setContextId | ( | $contextId | ) |
Set context ID.
| int | $contextId | Context ID for this resource link. |
| setPlatformId | ( | $platformId | ) |
Set platform ID.
| int | $platformId | Platform ID for this resource link. |
| setRecordId | ( | $id | ) |
Set resource link record ID.
| int | $id | Record ID for this resource link. |
| setSetting | ( | $name, | |
$value = null |
|||
| ) |
Set a setting value.
| string | $name | Name of setting |
| string | $value | Value to set, use an empty value to delete a setting (optional, default is null) |
| setSettings | ( | $settings | ) |
Set an array of all setting values.
| array | $settings | Associative array of setting values |
| bool setToolSettings | ( | $settings = array() | ) |
Set Tool Settings.
| array | $settings | An associative array of settings (optional, default is none) |
| int null $created = null |
Timestamp for when the object was created.
$created
| string null $extRequest = null |
Request for last service request.
$extRequest
| array null $extRequestHeaders = null |
Request headers for last service request.
$extRequestHeaders
| string null $extResponse = null |
Response from last service request.
$extResponse
| array null $extResponseHeaders = null |
Response header from last service request.
$extResponseHeaders
| array null $groups = null |
User groups (null if the platform does not support the groups enhancement)
A group is represented by an associative array with the following elements:
$groups
| array null $groupSets = null |
User group sets (null if the platform does not support the groups enhancement)
A group set is represented by an associative array with the following elements:
$groupSets
| HttpMessage null $lastServiceRequest = null |
HttpMessage object for last service request.
$lastServiceRequest
| string null $ltiResourceLinkId = null |
Resource link ID as supplied in the last connection request.
$ltiResourceLinkId
Referenced by ResourceLink\fromContext(), and ResourceLink\fromRecordId().
| string null $primaryResourceLinkId = null |
Primary key value for resource link being shared (if any).
$primaryResourceLinkId
| bool null $shareApproved = null |
Whether the sharing request has been approved by the primary resource link.
$shareApproved
| string null $title = null |
Context title.
$title
| int null $updated = null |
Timestamp for when the object was last updated.
$updated