Tsugi

Lti11TestLaunch
in package

A signed LTI 1.1 test launch for a tool this course can already see.

Resource link is sent now. Content item, privacy, and course scoped stay in the same list so a later test can sign those message types too.

Table of Contents

Methods

choices()  : array<int, array{type: string, label: string, ready: bool}>
Launches this tool registered, in test-page order.
courseResourceLink()  : array{endpoint: string, parameters: array}
Resource link for a lesson item. The item is the link. The deployment is the launch.
defaultType()  : string|null
The launch to open when the test page does not name one.
documentTargetForLesson()  : string
LTI launch_presentation_document_target for a lesson open choice.
embedsInline()  : bool
Embedded inline keeps the lesson navigation. Modal, same page, and new page do not.
hasResourceLink()  : bool
This course can launch the deployment as a resource link.
launch()  : array{title: string, endpoint: string, message_type: string, label: string, role: string, ready: bool, parameters: array}
Sign one test launch, or report that this message type is not sent yet.
launches()  : array<string, array{label: string, wire: ?string, ready: bool}>
Internal message type, the words on the test page, the LTI 1.1 wire value, and whether this test can sign it.
lessonChoices()  : array<int, array{id: int, title: string, lti_version: string, launch: string, send_name: bool, send_email: bool, send_grade: bool, placements: array>}>
Deployments this course can place on a lesson.
parentFrameId()  : string
Iframe id a Tsugi tool posts back in lti.frameResize.
privacy()  : array{send_name: bool, send_email: bool}
Whether this deployment is allowed to receive names and email.
role()  : string
Instructor or Learner. An empty value is Instructor.
contextRow()  : array{context_id: string, title: string, label: string}
db()  : PDOX
hasMessage()  : bool
includeGrade()  : bool
The deployment's score scope is the grant. A lesson may still decline it.
keyRow()  : array{guid: string, name: string}
outcomeLinkId()  : int
The lesson author creates this row. A launch does not.
outcomeParameters()  : array<string, string>
LTI 1.1 fields the tool uses to post a grade back to this course.
outcomePlacementSecret()  : string
outcomeResultId()  : int
prefix()  : string
privacyFromClaims()  : array{send_name: bool, send_email: bool}
resourceLinkParameters()  : array<string, string>
userRow()  : array{full: string, given: string, family: string, email: string}

Methods

choices()

Launches this tool registered, in test-page order.

public static choices(int $contextId, int $registrationId) : array<int, array{type: string, label: string, ready: bool}>
Parameters
$contextId : int
$registrationId : int
Return values
array<int, array{type: string, label: string, ready: bool}>

Resource link for a lesson item. The item is the link. The deployment is the launch.

public static courseResourceLink(int $contextId, int $toolDeploymentId, int $userId, string $resourceLinkId, string $resourceLinkTitle, string $returnUrl[, string $role = 'Learner' ][, string $userKey = '' ][, bool|null $sendName = null ][, bool|null $sendEmail = null ][, string $launchUrl = '' ][, string $documentTarget = '' ][, string $elementId = '' ][, bool|null $sendGrade = null ][, bool $gradeColumnMissing = false ]) : array{endpoint: string, parameters: array}
Parameters
$contextId : int
$toolDeploymentId : int
$userId : int
$resourceLinkId : string
$resourceLinkTitle : string
$returnUrl : string
$role : string = 'Learner'

Instructor or Learner

$userKey : string = ''

Opaque user id sent to the tool. Empty uses the numeric user id.

$sendName : bool|null = null

Null follows the tool privacy grant. False omits the name.

$sendEmail : bool|null = null

Null follows the tool privacy grant. False omits the email.

$launchUrl : string = ''

Lesson item launch URL. Empty uses the registration URL.

$documentTarget : string = ''

window, iframe, or frame. Empty omits the parameter.

$elementId : string = ''

Parent iframe id for lti.frameResize. Empty lets signing assign one.

$sendGrade : bool|null = null

Null follows the score scope. False omits the outcome service.

$gradeColumnMissing : bool = false

True when this launch has no lti_link. Sending a grade then fails.

Return values
array{endpoint: string, parameters: array}

defaultType()

The launch to open when the test page does not name one.

public static defaultType(array<int, array{type: string, label: string, ready: bool}> $choices) : string|null
Parameters
$choices : array<int, array{type: string, label: string, ready: bool}>
Return values
string|null

documentTargetForLesson()

LTI launch_presentation_document_target for a lesson open choice.

public static documentTargetForLesson(string $lessonTarget) : string

Same page and new page own the browser window. Modal and in-page use an iframe. An empty value omits the parameter.

Parameters
$lessonTarget : string
Return values
string

embedsInline()

Embedded inline keeps the lesson navigation. Modal, same page, and new page do not.

public static embedsInline(string $lessonTarget) : bool
Parameters
$lessonTarget : string
Return values
bool

This course can launch the deployment as a resource link.

public static hasResourceLink(int $contextId, int $toolDeploymentId) : bool
Parameters
$contextId : int
$toolDeploymentId : int
Return values
bool

launch()

Sign one test launch, or report that this message type is not sent yet.

public static launch(int $contextId, int $registrationId, int $userId, string $messageType, string $returnUrl[, string $role = 'Instructor' ]) : array{title: string, endpoint: string, message_type: string, label: string, role: string, ready: bool, parameters: array}
Parameters
$contextId : int
$registrationId : int
$userId : int
$messageType : string
$returnUrl : string
$role : string = 'Instructor'

Instructor or Learner

Return values
array{title: string, endpoint: string, message_type: string, label: string, role: string, ready: bool, parameters: array}

launches()

Internal message type, the words on the test page, the LTI 1.1 wire value, and whether this test can sign it.

public static launches() : array<string, array{label: string, wire: ?string, ready: bool}>
Return values
array<string, array{label: string, wire: ?string, ready: bool}>

lessonChoices()

Deployments this course can place on a lesson.

public static lessonChoices(int $contextId) : array<int, array{id: int, title: string, lti_version: string, launch: string, send_name: bool, send_email: bool, send_grade: bool, placements: array>}>

The option id is tool_deployment_id. A registration with no deployment in scope for the course is not listed. An LTI 1.1 deployment is listed when it has a resource link. An LTI 1.3 deployment is listed when a message can be placed in a lesson. The author picks that message before a launch URL is stored.

Parameters
$contextId : int
Return values
array<int, array{id: int, title: string, lti_version: string, launch: string, send_name: bool, send_email: bool, send_grade: bool, placements: array>}>

parentFrameId()

Iframe id a Tsugi tool posts back in lti.frameResize.

public static parentFrameId(string $resourceLinkId) : string
Parameters
$resourceLinkId : string
Return values
string

privacy()

Whether this deployment is allowed to receive names and email.

public static privacy(int $contextId, int $toolDeploymentId) : array{send_name: bool, send_email: bool}
Parameters
$contextId : int
$toolDeploymentId : int
Return values
array{send_name: bool, send_email: bool}

role()

Instructor or Learner. An empty value is Instructor.

public static role(string $role) : string
Parameters
$role : string
Return values
string

contextRow()

private static contextRow(int $contextId, int $keyId) : array{context_id: string, title: string, label: string}
Parameters
$contextId : int
$keyId : int
Return values
array{context_id: string, title: string, label: string}

hasMessage()

private static hasMessage(int $registrationId, string $messageType) : bool
Parameters
$registrationId : int
$messageType : string
Return values
bool

includeGrade()

The deployment's score scope is the grant. A lesson may still decline it.

private static includeGrade(array<string, mixed> $tool, bool|null $sendGrade) : bool
Parameters
$tool : array<string, mixed>
$sendGrade : bool|null
Return values
bool

keyRow()

private static keyRow(int $keyId) : array{guid: string, name: string}
Parameters
$keyId : int
Return values
array{guid: string, name: string}

outcomeLinkId()

The lesson author creates this row. A launch does not.

private static outcomeLinkId(int $contextId, string $resourceLinkId, string $title) : int

The tool secret stays on the registration.

Parameters
$contextId : int
$resourceLinkId : string
$title : string
Return values
int

outcomeParameters()

LTI 1.1 fields the tool uses to post a grade back to this course.

private static outcomeParameters(array<string, mixed> $tool, int $contextId, int $userId, string $resourceLinkId, string $title) : array<string, string>

The link is this lesson's resource link. The callback is signed with the same key and secret as the launch.

Parameters
$tool : array<string, mixed>
$contextId : int
$userId : int
$resourceLinkId : string
$title : string
Return values
array<string, string>

outcomePlacementSecret()

private static outcomePlacementSecret(int $linkId) : string
Parameters
$linkId : int
Return values
string

outcomeResultId()

private static outcomeResultId(int $linkId, int $userId) : int
Parameters
$linkId : int
$userId : int
Return values
int

privacyFromClaims()

private static privacyFromClaims(array<int, string> $claims) : array{send_name: bool, send_email: bool}
Parameters
$claims : array<int, string>
Return values
array{send_name: bool, send_email: bool}

resourceLinkParameters()

private static resourceLinkParameters(array{registration_id: int, key_id: int, title: string, lti11_key: string, lti11_secret: string, lti11_url: string} $tool, int $contextId, int $userId, string $returnUrl, string $wireType, string $role[, string|null $resourceLinkId = null ][, string|null $resourceLinkTitle = null ][, string $resourceLinkDescription = 'Test launch' ][, string $userKey = '' ][, bool|null $sendName = null ][, bool|null $sendEmail = null ][, mixed $documentTarget = '' ]) : array<string, string>
Parameters
$tool : array{registration_id: int, key_id: int, title: string, lti11_key: string, lti11_secret: string, lti11_url: string}
$contextId : int
$userId : int
$returnUrl : string
$wireType : string
$role : string
$resourceLinkId : string|null = null
$resourceLinkTitle : string|null = null
$resourceLinkDescription : string = 'Test launch'
$userKey : string = ''
$sendName : bool|null = null
$sendEmail : bool|null = null
$documentTarget : mixed = ''
Return values
array<string, string>

userRow()

private static userRow(int $userId, int $keyId) : array{full: string, given: string, family: string, email: string}
Parameters
$userId : int
$keyId : int
Return values
array{full: string, given: string, family: string, email: string}

        
On this page

Search results