public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Does this quiz contain any random questions.
 *
 * @since 1.0.0
 *
 * @param object $quizDetails The quiz details to check.
 *
 * @return Boolean True if there are random questions, false otherwise.
 */
Does this quiz contain any random questions.

@param object $quizDetails The quiz details to check.

@return Boolean True if there are random questions, false otherwise.
Does this quiz contain any random questions . @param object $quizDetails The quiz details to check . @return Boolean True if there are random questions false otherwise .
function WPCW_quizzes_randomQuestions_fullyExpand( $quizDetails ) {
	if ( empty( $quizDetails->questions ) ) {
		return $quizDetails->questions;
	}
	$newQuizList = array();
	foreach ( $quizDetails->questions as $questionID => $singleQuestion ) {
		if ( 'random_selection' == $singleQuestion->question_type ) {
			$tagDetails = WPCW_quiz_RandomSelection::decodeTagSelection( $singleQuestion->question_question );
			$expandedQuestions = WPCW_quiz_RandomSelection::questionSelection_getRandomQuestionsFromTags( $tagDetails );
			if ( ! empty( $expandedQuestions ) ) {
				$newQuizList += $expandedQuestions;
			}
		} else { 
			$newQuizList[ $questionID ] = $singleQuestion;
		}
	}
	return $newQuizList;
}
function WPCW_quizzes_randomQuestions_fullyExpand ( $ quizDetails ) { if ( empty ( $ quizDetails -> questions ) ) { return $ quizDetails -> questions ; } $ newQuizList = array ( ) ; foreach ( $ quizDetails -> questions as $ questionID => $ singleQuestion ) { if ( 'random_selection' == $ singleQuestion -> question_type ) { $ tagDetails = WPCW_quiz_RandomSelection :: decodeTagSelection ( $ singleQuestion -> question_question ) ; $ expandedQuestions = WPCW_quiz_RandomSelection :: questionSelection_getRandomQuestionsFromTags ( $ tagDetails ) ; if ( ! empty ( $ expandedQuestions ) ) { $ newQuizList += $ expandedQuestions ; } } else { $ newQuizList [ $ questionID ] = $ singleQuestion ; } } return $ newQuizList ; }
Does this quiz contain any random questions.
Does this quiz contain any random questions .
// Just need the first question to confirm if this is the case. // Got a random selection, so we need to get all question variations. // Need tags for this question // Ignore limits, just get all questions // Normal question - just return it.