Browse: Home / Classes / WpProQuiz_Model_Question /

WpProQuiz_Model_Question::getAnswerData

WpProQuiz_Model_Question::getAnswerData( bool $serialize = false )

Returns Answer Data for the Question Model.


Description #

TODO: Refactor to enforce return types.


Parameters #

$serialize

(bool) (Optional) Whether to serialize the returned data. Defaults to false.

Default value: false


Return #

(WpProQuiz_Model_AnswerTypes[]|string|null|mixed) - Array of Answer Models (optionally serialized) - null if there is an issue unserializing saved Answer Data - If an empty string is saved to the Question as Answer Data in the Database, serialized null (N;) will be returned when $serialize is true. - Note: An empty array (optionally serialized) is normally returned rather than null. This is because normally an empty array is what is saved in the database as Answer Data by default. - mixed is to satisfy static analysis


Source #

File: includes/lib/wp-pro-quiz/lib/model/WpProQuiz_Model_Question.php


Changelog #

Changelog
Version Description
4.17.0 Added a default return for the Essay/Open Answer type.
1.2.6 Introduced.