LLMS_Student_Quizzes::count_attempts_by_quiz( int $quiz_id )

Retrieve # of quiz attempts for a quiz


Description Description


Parameters Parameters

$quiz_id

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

$args

(array) (Required) additional args to pass to LLMS_Query_Quiz_Attempt


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->found_results;

	}

Top ↑

Changelog 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.





Permalink: