public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/classes/unitfrontend.php
/**
		 * Loads any answers that we have for this user so that we can show them back to the user on the form. Updated
		 * the internal $this->unchecked_QuizAnswersToGrade object.
		 *
		 * @param Array $quizAnswerData The answer data (which may be serialized)
		 */
Loads any answers that we have for this user so that we can show them back to the user on the form. Updated
the internal $this->unchecked_QuizAnswersToGrade object.

@param Array $quizAnswerData The answer data (which may be serialized)
Loads any answers that we have for this user so that we can show them back to the user on the form . Updated the internal $this - > unchecked_QuizAnswersToGrade object . @param Array $quizAnswerData The answer data ( which may be serialized )
public function fetch_quizzes_loadRawAnswersSoFarForThisQuiz( $quizAnswerData ) {
			$this->unchecked_QuizAnswersToGrade = array(
				'answer_list'       => array(),
				'wrong_answer_list' => array(),
				'error_answer_list' => array(),
				'all_answer_list'   => array(),
			);
			if ( $quizAnswerData ) {
				$extractedAnswerList         = array();
				$extractedPossibleAnswerList = array();
				$savedData                   = maybe_unserialize( $quizAnswerData );
				if ( ! empty( $savedData ) ) {
					foreach ( $savedData as $thisQuestionID => $thisQuestionDetails ) {
						$extractedAnswerList[ $thisQuestionID ]         = WPCW_arrays_getValue( $thisQuestionDetails, 'their_answer_raw' );
						$extractedPossibleAnswerList[ $thisQuestionID ] = WPCW_arrays_getValue( $thisQuestionDetails, 'possible_answers' );
						if ( WPCW_arrays_getValue( $thisQuestionDetails, 'is_incomplete' ) == 1 ) {
							$extractedAnswerList[ $thisQuestionID ] = null;
						}
					}
					$this->unchecked_QuizAnswersToGrade['answer_list']     = $extractedAnswerList;
					$this->unchecked_QuizAnswersToGrade['all_answer_list'] = $extractedPossibleAnswerList;
				}
			} 
		}
public function fetch_quizzes_loadRawAnswersSoFarForThisQuiz ( $ quizAnswerData ) { $ this -> unchecked_QuizAnswersToGrade = array ( 'answer_list' => array ( ) , 'wrong_answer_list' => array ( ) , 'error_answer_list' => array ( ) , 'all_answer_list' => array ( ) , ) ; if ( $ quizAnswerData ) { $ extractedAnswerList = array ( ) ; $ extractedPossibleAnswerList = array ( ) ; $ savedData = maybe_unserialize ( $ quizAnswerData ) ; if ( ! empty ( $ savedData ) ) { foreach ( $ savedData as $ thisQuestionID => $ thisQuestionDetails ) { $ extractedAnswerList [ $ thisQuestionID ] = WPCW_arrays_getValue ( $ thisQuestionDetails , 'their_answer_raw' ) ; $ extractedPossibleAnswerList [ $ thisQuestionID ] = WPCW_arrays_getValue ( $ thisQuestionDetails , 'possible_answers' ) ; if ( WPCW_arrays_getValue ( $ thisQuestionDetails , 'is_incomplete' ) == 1 ) { $ extractedAnswerList [ $ thisQuestionID ] = null ; } } $ this -> unchecked_QuizAnswersToGrade [ 'answer_list' ] = $ extractedAnswerList ; $ this -> unchecked_QuizAnswersToGrade [ 'all_answer_list' ] = $ extractedPossibleAnswerList ; } } }
Loads any answers that we have for this user so that we can show them back to the user on the form.
Loads any answers that we have for this user so that we can show them back to the user on the form .
// Load the answer list from the saved data in the database into the unchecked answer // list (ID => answer) for the rest of the code to handle the marking. // By default, copy what we have // Handle incomplete questions. // Copy the extracted data. // end of quiz answer data check.