Warning: This method has been deprecated.

LLMS_Quiz::get_total_attempts_by_user( int $user_id = null )

Get total attempts by user


Description Description


Parameters Parameters

$user_id

(int) (Optional) a WP_User ID, if not supplied uses current user

Default value: null


Top ↑

Return Return

(int)


Top ↑

Source Source

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

	public function get_total_attempts_by_user( $user_id = null ) {

		llms_deprecated_function( 'LLMS_Quiz::get_total_attempts_by_user()', '3.16.0', 'LLMS_Student::quizzes()->count_attempts_by_quiz( $quiz_id )' );

		$student = llms_get_student( $user_id );
		if ( ! $student ) {
			return 0;
		}

		return $student->quizzes()->count_attempts_by_quiz( $this->get( 'id' ) );

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.16.0 This method has been deprecated.
1.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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





Permalink: