public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Check if we have a timer that has expired. Assumes that we've already checked for an active timer.
		 */
Check if we have a timer that has expired. Assumes that we've already checked for an active timer.
Check if we have a timer that has expired . Assumes that we ' ve already checked for an active timer .
public function check_timers_doWeHaveAnActiveTimer_thatHasExpired() {
			if ( ! empty( $this->unitQuizProgress ) && 'complete' == $this->unitQuizProgress->quiz_paging_status ) {
				return;
			}
			$timerDetails_secondsLeft = $allowedTime = 60 * $this->unitQuizDetails->quiz_timer_mode_limit;
						$timeSoFar = strtotime( $this->unitQuizProgress->quiz_started_date );
			$timeNow   = current_time( 'timestamp' );
			if ( $timeSoFar > 0 ) {
				$timerDetails_secondsLeft = $allowedTime - ( $timeNow - $timeSoFar );
			}
			return ( $timerDetails_secondsLeft <= 0 );
		}
public function check_timers_doWeHaveAnActiveTimer_thatHasExpired ( ) { if ( ! empty ( $ this -> unitQuizProgress ) && 'complete' == $ this -> unitQuizProgress -> quiz_paging_status ) { return ; } $ timerDetails_secondsLeft = $ allowedTime = 60 * $ this -> unitQuizDetails -> quiz_timer_mode_limit ; $ timeSoFar = strtotime ( $ this -> unitQuizProgress -> quiz_started_date ) ; $ timeNow = current_time ( 'timestamp' ) ; if ( $ timeSoFar > 0 ) { $ timerDetails_secondsLeft = $ allowedTime - ( $ timeNow - $ timeSoFar ) ; } return ( $ timerDetails_secondsLeft <= 0 ) ; }
Check if we have a timer that has expired.
Check if we have a timer that has expired .
// We've already sorted this. // Total time in seconds for this quiz // What time do we have left?
 // We've started the quiz when the time so far is > 0 // Check the number of seconds that are left. If the time left is negative // then the quiz has expired, so we need to mark the quiz as expired before carrying on.