public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Get the question number that we need to show to the user next.
		 *
		 * @return Integer The index of the question that we need to show next.
		 */
Get the question number that we need to show to the user next.
@return Integer The index of the question that we need to show next.
Get the question number that we need to show to the user next . @return Integer The index of the question that we need to show next .
public function fetch_paging_getQuestionIndex() {
			if ( ! $this->unitQuizProgress || empty( $this->unitQuizDetails->questions ) ) {
				return 0;
			}
			$questionIndexWeThinkWeNeed = $this->unitQuizProgress->quiz_paging_next_q;
			if ( $questionIndexWeThinkWeNeed < 0 ) {
				return 0;
			}
			if ( $questionIndexWeThinkWeNeed < count( $this->unitQuizDetails->questions ) ) {
				return $questionIndexWeThinkWeNeed;
			}
			if ( empty( $this->unitQuizProgress_incompleteQs ) ) {
				return 0;
			}
			return key( $this->unitQuizProgress_incompleteQs );
		}
public function fetch_paging_getQuestionIndex ( ) { if ( ! $ this -> unitQuizProgress || empty ( $ this -> unitQuizDetails -> questions ) ) { return 0 ; } $ questionIndexWeThinkWeNeed = $ this -> unitQuizProgress -> quiz_paging_next_q ; if ( $ questionIndexWeThinkWeNeed < 0 ) { return 0 ; } if ( $ questionIndexWeThinkWeNeed < count ( $ this -> unitQuizDetails -> questions ) ) { return $ questionIndexWeThinkWeNeed ; } if ( empty ( $ this -> unitQuizProgress_incompleteQs ) ) { return 0 ; } return key ( $ this -> unitQuizProgress_incompleteQs ) ; }
Get the question number that we need to show to the user next.
Get the question number that we need to show to the user next .
// Not got any progress so far, so need to show the first question. // Just need to validate that the question fits within the range of questions available. // Need first question // < is used because we know this should be 0-indexed. // Trying to access a question outside the range. Mostly likely we've got to the last // question, so now need to go through incomplete questions.