public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Converts the encoded database answers into an array of answers.
 *
 * @since 1.0.0
 *
 * @param string $rawDatabaseAnswers The raw answers that need to be decoded.
 *
 * @return array A list of the decoded answers.
 */
Converts the encoded database answers into an array of answers.

@param string $rawDatabaseAnswers The raw answers that need to be decoded.

@return array A list of the decoded answers.
Converts the encoded database answers into an array of answers . @param string $rawDatabaseAnswers The raw answers that need to be decoded . @return array A list of the decoded answers .
function WPCW_quizzes_decodeAnswers( $rawDatabaseAnswers ) {
	if ( ! $rawDatabaseAnswers ) {
		return false;
	}
	$answerData = unserialize( $rawDatabaseAnswers );
	if ( ! empty( $answerData ) ) {
		foreach ( $answerData as $idx => $innerData ) {
			$answerData[ $idx ]['answer'] = base64_decode( $answerData[ $idx ]['answer'] );
		}
		return $answerData;
	} else {
		return array();
	}
}
function WPCW_quizzes_decodeAnswers ( $ rawDatabaseAnswers ) { if ( ! $ rawDatabaseAnswers ) { return false ; } $ answerData = unserialize ( $ rawDatabaseAnswers ) ; if ( ! empty ( $ answerData ) ) { foreach ( $ answerData as $ idx => $ innerData ) { $ answerData [ $ idx ] [ 'answer' ] = base64_decode ( $ answerData [ $ idx ] [ 'answer' ] ) ; } return $ answerData ; } else { return array ( ) ; } }
Converts the encoded database answers into an array of answers.
Converts the encoded database answers into an array of answers .
// Unserialize the array to a PHP array // Decode each answer in the array // Decode to exactly the same space in the array.