dozent_get_attempts_count_by_quiz( null $quiz_id = null )

Count all attempts by Quiz


Description

Example usage:

$total_attempts = dozent_get_attempts_count_by_quiz( $quiz_id );

Parameters

$quiz_id

(null) (Optional) Quiz ID

Default value: null


Return

(int|string|null)


Source

File: includes/quiz-functions.php

	function dozent_get_attempts_count_by_quiz( $quiz_id = null ) {
		global $wpdb;

		$count = 0;
		if ( $quiz_id ) {
			return $wpdb->get_var( "SELECT COUNT(id) FROM {$wpdb->dozent_quiz_attempts} WHERE quiz_id = {$quiz_id} " );
		}

		return $count;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.