dozent_get_attempts_count_by_course( null $course_id = null )

Count all attempts by course


Description

Example usage:

$total_attempts = dozent_get_attempts_count_by_course( $course_id );

Parameters

$course_id

(null) (Optional) Course ID

Default value: null


Return

(int|string|null)


Source

File: includes/quiz-functions.php

	function dozent_get_attempts_count_by_course( $course_id = null ) {
		global $wpdb;

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

		return $count;
	}


Changelog

Changelog
Version Description
DozentLMS 1.0.0 Introduced.