Tsugi

Question
in package

One quiz question in the format-neutral Quiz1 model.

Table of Contents

Properties

$answers  : array<string|int, Answer>
$case_sensitive  : bool
$feedback  : string
$id  : int|null
$points  : int
$prompt  : string
$quiz_id  : int|null
$sample_solution  : string
$sequence  : int
$title  : string
$type  : string

Methods

applyExtra()  : mixed
extraArray()  : array<string, mixed>
Extra JSON stored on the question row.
isBlankHtml()  : mixed
nonEmptyAnswers()  : array<string|int, Answer>
validate()  : array<string|int, string>
validateAcceptedStrings()  : array<string|int, string>
validateChoice()  : array<string|int, string>
validateTrueFalse()  : array<string|int, string>

Properties

$case_sensitive

public bool $case_sensitive = false

Pattern match only; FIB is never case-sensitive in CC.

$sample_solution

public string $sample_solution = ''

Essay sample solution (optional).

Methods

applyExtra()

public applyExtra(mixed $json) : mixed
Parameters
$json : mixed

extraArray()

Extra JSON stored on the question row.

public extraArray() : array<string, mixed>
Return values
array<string, mixed>

isBlankHtml()

public static isBlankHtml(mixed $html) : mixed
Parameters
$html : mixed

nonEmptyAnswers()

public nonEmptyAnswers() : array<string|int, Answer>
Return values
array<string|int, Answer>

validate()

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

Validation error messages.

validateAcceptedStrings()

private validateAcceptedStrings(mixed $empty_message) : array<string|int, string>
Parameters
$empty_message : mixed
Return values
array<string|int, string>

validateChoice()

private validateChoice(mixed $multiple) : array<string|int, string>
Parameters
$multiple : mixed
Return values
array<string|int, string>

validateTrueFalse()

private validateTrueFalse() : array<string|int, string>
Return values
array<string|int, string>

        
On this page

Search results