LLMS_Quiz_Attempt_Question::get_correct_answer_array()

Get correct answer(s) as an array


Return Return

(array)


Top ↑

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

	}


Top ↑

Changelog Changelog

Changelog
Version Description
3.16.15 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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