public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Updating the internal $unitQuizProgress_incompleteQs variable, work out the list of
		 * incomplete questions that the user has yet to have completed.
		 */
Updating the internal $unitQuizProgress_incompleteQs variable, work out the list of
incomplete questions that the user has yet to have completed.
Updating the internal $unitQuizProgress_incompleteQs variable work out the list of incomplete questions that the user has yet to have completed .
public function updateInternalVariable_quizzes_getIncompleteQuestions() {
			$this->unitQuizProgress_incompleteQs = array();
						if ( empty( $this->unitQuizDetails ) ) {
				return;
			}
						if ( ! empty( $this->unitQuizProgress ) && ! empty( $this->unitQuizProgress->quiz_data ) ) {
				$indexOfQuestion = 0;
				foreach ( $this->unitQuizProgress->quiz_data as $thisQuestionID => $thisAnswerDetails ) {
					if ( $thisAnswerDetails['is_incomplete'] == 1 ) {
						$this->unitQuizProgress_incompleteQs[ $indexOfQuestion ] = $thisQuestionID;
					}
					++ $indexOfQuestion; 
				}
			} 
			else {
				if ( ! empty( $this->unitQuizDetails->questions ) ) {
					$indexOfQuestion = 0;
					foreach ( $this->unitQuizDetails->questions as $thisQuestionID => $questionObj ) {
						$this->unitQuizProgress_incompleteQs[ $indexOfQuestion ++ ] = $thisQuestionID;
					}
				}
			}
		}
public function updateInternalVariable_quizzes_getIncompleteQuestions ( ) { $ this -> unitQuizProgress_incompleteQs = array ( ) ; if ( empty ( $ this -> unitQuizDetails ) ) { return ; } if ( ! empty ( $ this -> unitQuizProgress ) && ! empty ( $ this -> unitQuizProgress -> quiz_data ) ) { $ indexOfQuestion = 0 ; foreach ( $ this -> unitQuizProgress -> quiz_data as $ thisQuestionID => $ thisAnswerDetails ) { if ( $ thisAnswerDetails [ 'is_incomplete' ] == 1 ) { $ this -> unitQuizProgress_incompleteQs [ $ indexOfQuestion ] = $ thisQuestionID ; } ++ $ indexOfQuestion ; } } else { if ( ! empty ( $ this -> unitQuizDetails -> questions ) ) { $ indexOfQuestion = 0 ; foreach ( $ this -> unitQuizDetails -> questions as $ thisQuestionID => $ questionObj ) { $ this -> unitQuizProgress_incompleteQs [ $ indexOfQuestion ++ ] = $ thisQuestionID ; } } } }
Updating the internal $unitQuizProgress_incompleteQs variable, work out the list of
 incomplete questions that the user has yet to have completed.
Updating the internal $unitQuizProgress_incompleteQs variable work out the list of incomplete questions that the user has yet to have completed .
// Always have an empty array // Not got any quiz data?
 // Got any existing progress data?
 // Found a question that's not complete, so add to the list of incomplete questions in // the order that it appears. Maps ID => ordering. // Stores 0-based index of the question // No progress data, so just use the raw list of questions to create a list of ID => ordering. // Stores 0-based index of the question