public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Return the number of quizzes that are pending grading or need unblocking for a user.
 *
 * @since 1.0.0
 *
 * @return integer The total number of quizzes that need attention.
 */
Return the number of quizzes that are pending grading or need unblocking for a user.

@return integer The total number of quizzes that need attention.
Return the number of quizzes that are pending grading or need unblocking for a user . @return integer The total number of quizzes that need attention .
function WPCW_quizzes_getCoursesNeedingAttentionCount() {
	global $wpdb, $wpcwdb;
	$wpdb->show_errors();
	$current_user = wp_get_current_user();
	if ( is_admin() && ! user_can( $current_user, 'manage_wpcw_settings' ) ) {
		return $wpdb->get_var( "SELECT COUNT(*) FROM $wpcwdb->user_progress_quiz upq
			LEFT JOIN $wpcwdb->quiz q ON q.quiz_id = upq.quiz_id
			WHERE quiz_is_latest = 'latest'
			AND (quiz_needs_marking > 0 OR quiz_next_step_type = 'quiz_fail_no_retakes')
			AND quiz_author = $current_user->ID;" );
	}
	return $wpdb->get_var( "
		SELECT COUNT(*)
		FROM $wpcwdb->user_progress_quiz
		WHERE quiz_is_latest = 'latest'
		AND (quiz_needs_marking > 0 OR quiz_next_step_type = 'quiz_fail_no_retakes');" );
}
function WPCW_quizzes_getCoursesNeedingAttentionCount ( ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ current_user = wp_get_current_user ( ) ; if ( is_admin ( ) && ! user_can ( $ current_user , 'manage_wpcw_settings' ) ) { return $ wpdb -> get_var ( " SELECT COUNT(*) FROM  $ wpcwdb -> user_progress_quiz  upq
			LEFT JOIN  $ wpcwdb -> quiz  q ON q.quiz_id = upq.quiz_id
			WHERE quiz_is_latest = 'latest'
			AND (quiz_needs_marking > 0 OR quiz_next_step_type = 'quiz_fail_no_retakes')
			AND quiz_author =  $ current_user -> ID ; " ) ; } return $ wpdb -> get_var ( " 
		SELECT COUNT(*)
		FROM  $ wpcwdb -> user_progress_quiz 
		WHERE quiz_is_latest = 'latest'
		AND (quiz_needs_marking > 0 OR quiz_next_step_type = 'quiz_fail_no_retakes'); " ) ; }
Return the number of quizzes that are pending grading or need unblocking for a user.
Return the number of quizzes that are pending grading or need unblocking for a user .
// Globals // Current User // Check permissions and only show notifications from the authors quizes