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
129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 | 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. |