public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Function attempts to move the marker for the question selection to the previous item
		 * or next item when paging questions.
		 *
		 * @param String $jumpMode If 'next' move forwards, if 'previous' move back by one question.
		 */
Function attempts to move the marker for the question selection to the previous item
or next item when paging questions.

@param String $jumpMode If 'next' move forwards, if 'previous' move back by one question.
Function attempts to move the marker for the question selection to the previous item or next item when paging questions . @param String $jumpMode If ' next ' move forwards if ' previous ' move back by one question .
public function fetch_paging_getQuestion_moveQuestionMarker( $jumpMode ) {
			if ( empty( $this->unitQuizProgress ) || ( 'latest' == $this->unitQuizProgress->quiz_is_latest && 'retake_waiting' == $this->unitQuizProgress->quiz_next_step_type ) ) {
				$this->check_quizzes_canWeContinue_checkAnswersFromPaging( array() );
				$this->unitQuizProgress->quiz_paging_next_q = 0;
			}
			if ( ! empty( $this->unitQuizProgress ) ) {
				$newIndex = $oldIndex = $this->unitQuizProgress->quiz_paging_next_q;
				if ( strpos( WPCW_arrays_getValue( $_POST, 'quiz_question' ), 'multi' ) == true ) {
					preg_match_all( '!\d+!', WPCW_arrays_getValue( $_POST, 'quiz_question' ), $matches );
					$questionID = $matches[0][1];
				}
				if ( isset( $questionID ) && ! $this->unitQuizProgress->quiz_data[ $questionID ]['possible_answers'] ) {
					$potentialAnswers = array();
					$quizQuestion     = str_replace( array( '[', ']' ), '', WPCW_arrays_getValue( $_POST, 'quiz_question' ) );
					$quizAnswersName  = str_replace( array( '[', ']' ), '', WPCW_arrays_getValue( $_POST, 'quiz_answers_name' ) );
					$quizAnswers      = WPCW_arrays_getValue( $_POST, 'quiz_answers' );
					foreach ( $quizAnswers as $key => $value ) {
						$potentialAnswers[ $key ] = $value['value'];
					}
					$potentialAnswers = array( $quizQuestion => '', $quizAnswersName => $potentialAnswers );
					$this->check_quizzes_canWeContinue_checkAnswersFromPaging( $potentialAnswers, true );
				}
				if ( 'next' == $jumpMode ) {
					$newIndex = $this->check_paging_find_next_unanswered_question();
				} 
				elseif ( $this->unitQuizProgress->quiz_paging_next_q > 0 ) {
					-- $newIndex;
				}
				if ( $oldIndex != $newIndex ) {
					$this->update_paging_getQuestion_saveQuestionMarker( $newIndex );
				}
			} 
		}
public function fetch_paging_getQuestion_moveQuestionMarker ( $ jumpMode ) { if ( empty ( $ this -> unitQuizProgress ) || ( 'latest' == $ this -> unitQuizProgress -> quiz_is_latest && 'retake_waiting' == $ this -> unitQuizProgress -> quiz_next_step_type ) ) { $ this -> check_quizzes_canWeContinue_checkAnswersFromPaging ( array ( ) ) ; $ this -> unitQuizProgress -> quiz_paging_next_q = 0 ; } if ( ! empty ( $ this -> unitQuizProgress ) ) { $ newIndex = $ oldIndex = $ this -> unitQuizProgress -> quiz_paging_next_q ; if ( strpos ( WPCW_arrays_getValue ( $ _POST , 'quiz_question' ) , 'multi' ) == true ) { preg_match_all ( '!\d+!' , WPCW_arrays_getValue ( $ _POST , 'quiz_question' ) , $ matches ) ; $ questionID = $ matches [ 0 ] [ 1 ] ; } if ( isset ( $ questionID ) && ! $ this -> unitQuizProgress -> quiz_data [ $ questionID ] [ 'possible_answers' ] ) { $ potentialAnswers = array ( ) ; $ quizQuestion = str_replace ( array ( '[' , ']' ) , '' , WPCW_arrays_getValue ( $ _POST , 'quiz_question' ) ) ; $ quizAnswersName = str_replace ( array ( '[' , ']' ) , '' , WPCW_arrays_getValue ( $ _POST , 'quiz_answers_name' ) ) ; $ quizAnswers = WPCW_arrays_getValue ( $ _POST , 'quiz_answers' ) ; foreach ( $ quizAnswers as $ key => $ value ) { $ potentialAnswers [ $ key ] = $ value [ 'value' ] ; } $ potentialAnswers = array ( $ quizQuestion => '' , $ quizAnswersName => $ potentialAnswers ) ; $ this -> check_quizzes_canWeContinue_checkAnswersFromPaging ( $ potentialAnswers , true ) ; } if ( 'next' == $ jumpMode ) { $ newIndex = $ this -> check_paging_find_next_unanswered_question ( ) ; } elseif ( $ this -> unitQuizProgress -> quiz_paging_next_q > 0 ) { -- $ newIndex ; } if ( $ oldIndex != $ newIndex ) { $ this -> update_paging_getQuestion_saveQuestionMarker ( $ newIndex ) ; } } }
Function attempts to move the marker for the question selection to the previous item
 or next item when paging questions.
Function attempts to move the marker for the question selection to the previous item or next item when paging questions .
// No quiz progress so far, so create it. // Set index to first question // Store the old index // Moving to next question //check for next unanswered question and set the index // Moving to previous question - Only attempt to move the marker if it's already > 0. // We've detected a change, so move it. // end of check for question marker