LLMS_Quiz_Attempt_Question::get_answer_array()
Get answer(s) as an array
Return Return
(array)
Source Source
File: includes/models/model.llms.quiz.attempt.question.php
public function get_answer_array() {
$ret = array();
$question = $this->get_question();
$answers = $this->get( 'answer' );
if ( $answers ) {
if ( $question->supports( 'choices' ) && $question->supports( 'grading', 'auto' ) ) {
foreach ( $answers as $aid ) {
$choice = $question->get_choice( $aid );
$ret[] = $choice ? $choice->get_choice() : _x( '[Deleted]', 'Selected quiz choice has been deleted.', 'lifterlms' );
}
} else {
$ret = $answers;
}
}
return apply_filters( 'llms_quiz_attempt_question_get_answer_array', $ret, $answers, $question, $this );
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.27.0 | Unknown. |
| 3.16.15 | Introduced. |