\QuizAnswerHelper

Quiz answer Helper

Add your application-wide methods in the class below, your helpers will inherit them.

Summary

Methods
Properties
Constants
answer()
singleChoice()
multipleChoice()
singleWord()
textArea()
multipleWord()
$helpers
No constants found
_error()
_getChoiceOptionElement()
$_answerFunc
N/A
No private methods found
No private properties found
N/A

Properties

$helpers

$helpers : array

Other helpers used by FormHelper

Type

array

$_answerFunc

$_answerFunc : array

Answer html create by question type

Type

array

Methods

answer()

answer(array  $question, boolean  $readonly = false) : string

回答作成

Parameters

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

回答HTML

singleChoice()

singleChoice(string  $index, string  $fieldName, array  $question, boolean  $readonly) : string

択一選択回答作成

Parameters

string $index

回答データのPOST用dataのインデックス値

string $fieldName

フィールド名

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

択一選択肢回答のHTML

multipleChoice()

multipleChoice(string  $index, string  $fieldName, array  $question, boolean  $readonly) : string

複数選択回答作成

Parameters

string $index

回答データのPOST用dataのインデックス値

string $fieldName

フィールド名

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

複数選択肢回答のHTML

singleWord()

singleWord(string  $index, string  $fieldName, array  $question, boolean  $readonly) : string

単語回答作成

Parameters

string $index

回答データのPOST用dataのインデックス値

string $fieldName

フィールド名

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

複数選択肢回答のHTML

textArea()

textArea(string  $index, string  $fieldName, array  $question, boolean  $readonly) : string

長文テキスト回答作成

Parameters

string $index

回答データのPOST用dataのインデックス値

string $fieldName

フィールド名

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

複数選択肢回答のHTML

multipleWord()

multipleWord(string  $index, string  $fieldName, array  $question, boolean  $readonly) : string

複数単語回答作成

Parameters

string $index

回答データのPOST用dataのインデックス値

string $fieldName

フィールド名

array $question

質問データ

boolean $readonly

読み取り専用

Returns

string —

複数選択肢回答のHTML

_error()

_error(string  $fieldName) : string

エラーメッセージ表示要素作成

Parameters

string $fieldName

フィールド名

Returns

string —

エラーメッセージ表示要素のHTML

_getChoiceOptionElement()

_getChoiceOptionElement(array  $choices) : string

選択肢要素作成

Parameters

array $choices

選択肢データ

Returns

string —

選択肢要素のHTML