LLMS_Student_Quizzes::count_attempts_by_quiz( int $quiz_id )

Retrieve the number of quiz attempts for a quiz


Parameters Parameters

$quiz_id

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


Top ↑

Return Return

(int)


Top ↑

Source Source

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

	public function count_attempts_by_quiz( $quiz_id ) {

		$query = new LLMS_Query_Quiz_Attempt(
			array(
				'student_id' => $this->get_id(),
				'quiz_id'    => $quiz_id,
				'per_page'   => 1,
			)
		);

		return $query->get_found_results();

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Don't access LLMS_Query_Quiz_Attempt properties directly.
3.16.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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