LLMS_Student_Quizzes::get_attempts_by_quiz( int $quiz_id, array $args = array() )

Retrieve quiz attempts

Parameters Parameters


(int) (Required) WP Post ID of the quiz.


(array) (Optional) Additional args to pass to LLMS_Query_Quiz_Attempt.

Default value: array()

Top ↑

Return Return


Top ↑

Source Source

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

	public function get_attempts_by_quiz( $quiz_id, $args = array() ) {

		$args = wp_parse_args(
				'student_id' => $this->get_id(),
				'quiz_id'    => $quiz_id,

		$query = new LLMS_Query_Quiz_Attempt( $args );

		if ( $query->has_results() ) {
			return $query->get_attempts();

		return array();


Top ↑

Changelog Changelog

Version Description
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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