LLMS_Quiz_Attempt_Question::get_answer_array()

Get answer(s) as an array


Return Return

(array)


Top ↑

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 );
 
}


Top ↑

Changelog Changelog

Changelog
Version Description
3.27.0 Unknown.
3.16.15 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.