LLMS_Quiz_Attempt::get_siblings( array $args = array(), string $return = 'attempts' )

Get sibling attempts


Parameters Parameters

$args

(array) (Optional) List of args to be passed as params of the quiz attempts query. See LLMS_Query_Quiz_Attempt and LLMS_Database_Query for the list of args. By default the per_page param is set to 1000.

Default value: array()

$return

(string) (Optional) Type of return [ids|attempts]. Default 'attempts'.

Default value: 'attempts'


Top ↑

Return Return

(int[]|LLMS_Quiz_Attempt[]) Type depends on value of $return.


Top ↑

Source Source

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

	public function get_siblings( $args = array(), $return = 'attempts' ) {

		$defaults = array(
			'per_page' => 1000,
		);

		$args  = wp_parse_args( $args, $defaults );
		$query = new LLMS_Query_Quiz_Attempt(
			array_merge(
				$args,
				array(
					'student_id' => $this->get( 'student_id' ),
					'quiz_id'    => $this->get( 'quiz_id' ),
				)
			)
		);

		return 'ids' === $return ? wp_list_pluck( $query->get_results(), 'id' ) : $query->get_attempts();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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