LLMS_Student_Quizzes::get_all( int[]|Int $quiz = array() )

Retrieve quiz data for a student and optionally filter by quiz_id(s)


Parameters Parameters

$quiz

(int[]|Int) (Optional) Array or single WP_Post ID for quizzes to retrieve attempts for.

Default value: array()


Top ↑

Return Return

(LLMS_Quiz_Attempt[]) Array of quiz attempts for the requested quiz or quizzes.


Top ↑

Source Source

File: includes/models/model.llms.student.quizzes.php

	public function get_all( $quiz = array() ) {

		$query = new LLMS_Query_Quiz_Attempt(
			array(
				'quiz_id'    => $quiz,
				'per_page'   => 5000,
				'student_id' => $this->get( 'id' ),
			)
		);

		/**
		 * Filters the list of quiz attempts for a student
		 *
		 * @since Unknown
		 *
		 * @param int[]|Int $quiz Array or single WP_Post ID for quizzes to retrieve attempts for.
		 */
		return apply_filters( 'llms_student_get_quiz_data', $query->get_attempts(), $quiz );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.21.2 Retrieve only attempts for the initialized student.
3.9.0
3.16.11 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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