CartridgeValidator
in package
Structural checks for a Quiz1 Common Cartridge 1.2 package.
Development aid — not a full XSD validator and not a production feature.
Table of Contents
Constants
- FORBIDDEN_CC11 : mixed = array('imsccv1p1', 'ccv1p1', 'imscc_xmlv1p1', '...
- CC 1.1 tokens that must not appear in Quiz1 cartridge XML.
Methods
- format() : mixed
- validate() : array{ok: bool, lines: string[], errors: string[]}
- fail() : mixed
- hasErrorPrefix() : mixed
- qtiMeta() : mixed
Constants
FORBIDDEN_CC11
CC 1.1 tokens that must not appear in Quiz1 cartridge XML.
public
mixed
FORBIDDEN_CC11
= array('imsccv1p1', 'ccv1p1', 'imscc_xmlv1p1', 'imswl_xmlv1p1', 'imsdt_v1p1', '<schemaversion>1.1.0</schemaversion>')
Content Packaging imscp_v1p1 and QTI item profiles (v0p1) are allowed.
Methods
format()
public
static format(array<string|int, mixed> $result) : mixed
Parameters
- $result : array<string|int, mixed>
validate()
public
static validate(mixed $imsccPath) : array{ok: bool, lines: string[], errors: string[]}
Parameters
- $imsccPath : mixed
Return values
array{ok: bool, lines: string[], errors: string[]}fail()
private
static fail(array<string|int, mixed> $lines, array<string|int, mixed> $errors, mixed $step, mixed $message) : mixed
Parameters
- $lines : array<string|int, mixed>
- $errors : array<string|int, mixed>
- $step : mixed
- $message : mixed
hasErrorPrefix()
private
static hasErrorPrefix(array<string|int, mixed> $errors, mixed $prefix) : mixed
Parameters
- $errors : array<string|int, mixed>
- $prefix : mixed
qtiMeta()
private
static qtiMeta(DOMXPath $xp, mixed $ctx, mixed $label) : mixed
Parameters
- $xp : DOMXPath
- $ctx : mixed
- $label : mixed