Tsugi

Quiz1
in package

Format-neutral quiz: title, instructions, ordered questions.

QTI and GIFT are interchange formats only. This object is what Tsugi edits, validates, and later imports into.

Table of Contents

Properties

$context_id  : int
$due  : string|null
Null when this quiz has no link. Otherwise YYYY-MM-DD, or empty when the link has no due date.
$id  : int|null
$instructions  : string
$link_id  : int|null
$link_key  : string|null
lti_link.link_key for this quiz. Null when the quiz has no link.
$published  : int|null
Null when never published. Otherwise lti_link.published (0 or 1).
$question_count  : int|null
$questions  : array<string|int, Question>
$title  : string
$user_id  : int

Methods

isValid()  : mixed
orderedQuestions()  : array<string|int, Question>
Questions in deterministic display order.
pointsPossible()  : mixed
Sum of question points (Canvas assessment_meta points_possible).
validate()  : array<string|int, string>

Properties

$context_id

public int $context_id = 0

$due

Null when this quiz has no link. Otherwise YYYY-MM-DD, or empty when the link has no due date.

public string|null $due = null

$instructions

public string $instructions = ''
public int|null $link_id

lti_link.link_id once this quiz has a link.

lti_link.link_key for this quiz. Null when the quiz has no link.

public string|null $link_key = null

Set by load(); export reads it. Not derived from quiz_id.

$published

Null when never published. Otherwise lti_link.published (0 or 1).

public int|null $published

$question_count

public int|null $question_count

Set on list views without loading questions.

$title

public string $title = ''

$user_id

public int $user_id = 0

Methods

isValid()

public isValid() : mixed

orderedQuestions()

Questions in deterministic display order.

public orderedQuestions() : array<string|int, Question>
Return values
array<string|int, Question>

pointsPossible()

Sum of question points (Canvas assessment_meta points_possible).

public pointsPossible() : mixed

validate()

public validate() : array<string|int, string>
Return values
array<string|int, string> —

Validation error messages (empty = valid).


        
On this page

Search results