Tsugi

Fingerprint
in package

Canonical content hash for one cartridge resource.

Files hash as bytes. Links / LTI / topics hash a stable extract so XML whitespace and titles do not change identity.

Table of Contents

Methods

hashString()  : string
hrefIsQti()  : mixed
Question file attached to a quiz, including Canvas non_cc_assessments.
isLti()  : mixed
isQti()  : mixed
isTopic()  : mixed
isWebContent()  : mixed
isWebLink()  : mixed
localKind()  : string
ltiKey()  : string
resource()  : string
topicKey()  : string
webLinkHref()  : string
webLinkKey()  : string
webLinkWindowTarget()  : string
firstAttr()  : string
firstLocalText()  : string
needsXml()  : mixed
xmlDom()  : DOMDocument

Methods

hashString()

public static hashString(string $bytes) : string
Parameters
$bytes : string
Return values
string

hrefIsQti()

Question file attached to a quiz, including Canvas non_cc_assessments.

public static hrefIsQti(mixed $href) : mixed

A standalone file of this shape is an item bank, not a quiz.

Parameters
$href : mixed

isLti()

public static isLti(mixed $type) : mixed
Parameters
$type : mixed

isQti()

public static isQti(mixed $type) : mixed
Parameters
$type : mixed

isTopic()

public static isTopic(mixed $type) : mixed
Parameters
$type : mixed

isWebContent()

public static isWebContent(mixed $type) : mixed
Parameters
$type : mixed
public static isWebLink(mixed $type) : mixed
Parameters
$type : mixed

localKind()

public static localKind(string $type, string $href) : string
Parameters
$type : string
$href : string
Return values
string

ltiKey()

public static ltiKey(string $xml) : string
Parameters
$xml : string
Return values
string

resource()

public static resource(Package $pkg, array<string, mixed> $resource) : string
Parameters
$pkg : Package
$resource : array<string, mixed>
Return values
string —

sha256 hex

topicKey()

public static topicKey(string $xml) : string
Parameters
$xml : string
Return values
string

webLinkHref()

public static webLinkHref(string $xml) : string
Parameters
$xml : string
Return values
string

webLinkKey()

public static webLinkKey(string $xml) : string
Parameters
$xml : string
Return values
string

webLinkWindowTarget()

public static webLinkWindowTarget(string $xml) : string
Parameters
$xml : string
Return values
string

firstAttr()

private static firstAttr(DOMDocument $dom, mixed $localName, mixed $attr) : string
Parameters
$dom : DOMDocument
$localName : mixed
$attr : mixed
Return values
string

firstLocalText()

private static firstLocalText(DOMDocument $dom, mixed $localName) : string
Parameters
$dom : DOMDocument
$localName : mixed
Return values
string

needsXml()

private static needsXml(mixed $type) : mixed
Parameters
$type : mixed

xmlDom()

private static xmlDom(string $xml, string $what) : DOMDocument
Parameters
$xml : string
$what : string
Return values
DOMDocument

        
On this page

Search results