LLMS_Quiz_Attempt_Question::get_correct_answer_array()
Get correct answer(s) as an array
Return Return
(array)
Source Source
File: includes/models/model.llms.quiz.attempt.question.php
public function get_correct_answer_array() { $ret = array(); $question = $this->get_question(); $type = $question->get_auto_grade_type(); if ( 'choices' === $type ) { foreach ( $question->get_correct_choice() as $aid ) { $choice = $question->get_choice( $aid ); $ret[] = $choice->get_choice(); } } elseif ( 'conditional' === $type ) { $ret = $question->get_conditional_correct_value(); } return apply_filters( 'llms_quiz_attempt_question_get_correct_answer_array', $ret, $question, $this ); }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.16.15 | Introduced. |