public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Check if user has any attempts left.
		 */
Check if user has any attempts left.
Check if user has any attempts left .
public function fetch_quizzes_getRemainingAttempts() {
			if ( - 1 == $this->unitQuizDetails->quiz_attempts_allowed ) {
				return - 1;
			}
			if ( ! $this->unitQuizProgress ) {
				return $this->unitQuizDetails->quiz_attempts_allowed;
			}
			if ( $this->unitQuizProgress->attempt_count >= $this->unitQuizDetails->quiz_attempts_allowed ) {
				return 0;
			}
			return $this->unitQuizDetails->quiz_attempts_allowed - $this->unitQuizProgress->attempt_count;
		}
public function fetch_quizzes_getRemainingAttempts ( ) { if ( - 1 == $ this -> unitQuizDetails -> quiz_attempts_allowed ) { return - 1 ; } if ( ! $ this -> unitQuizProgress ) { return $ this -> unitQuizDetails -> quiz_attempts_allowed ; } if ( $ this -> unitQuizProgress -> attempt_count >= $ this -> unitQuizDetails -> quiz_attempts_allowed ) { return 0 ; } return $ this -> unitQuizDetails -> quiz_attempts_allowed - $ this -> unitQuizProgress -> attempt_count ; }
Check if user has any attempts left.
Check if user has any attempts left .
// Got unlimited attempts remaining. // Got no progress yet, so return raw count of possible attempts. // Had too many attempts, return 0. // Return the difference.