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
$answers
public
array<string|int, Answer>
$answers
= array()
$case_sensitive
public
bool
$case_sensitive
= false
Pattern match only; FIB is never case-sensitive in CC.
$feedback
public
string
$feedback
= ''
$id
public
int|null
$id
$points
public
int
$points
= 1
$prompt
public
string
$prompt
= ''
$quiz_id
public
int|null
$quiz_id
$sample_solution
public
string
$sample_solution
= ''
Essay sample solution (optional).
$sequence
public
int
$sequence
= 1
$title
public
string
$title
= ''
$type
public
string
$type
= ''
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>