LLMS_Quiz_Attempt::get_question_objects( boolean $cache = true, boolean $filter_removed = false )

Retrieve an array of attempt question objects


Parameters Parameters

$cache

(boolean) (Optional) If true, save data to to the object for future gets. Default true. Cached questions won't take into account the $filte_removed parameter.

Default value: true

$filter_removed

(boolean) (Optional) If true, removed questions will be filtered out. Default false.

Default value: false


Top ↑

Return Return

(array)


Top ↑

Source Source

File: includes/models/model.llms.quiz.attempt.php

	 * @return array
	 */
	public function get_question_objects( $cache = true, $filter_removed = false ) {

		$questions = array();
		foreach ( $this->get_questions( $cache ) as $qdata ) {
			$question = new LLMS_Quiz_Attempt_Question( $qdata );
			if ( ! $filter_removed || $question->get_question() instanceof LLMS_Question ) {
				$questions[] = $question;
			}
		}
		return $questions;


Top ↑

Changelog Changelog

Changelog
Version Description
5.3.0 Add a parameter to filter out removed questions.
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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