public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/functions.php
/**
 * Get the quiz results data for the specified user and list of quizzes.
 *
 * @param integer $userID The ID of the user to get the progress data for.
 * @param string  $quizIDListForSQL The SQL that contains an SQL list of quiz IDs.
 *
 * @return array A list of the quiz progress for the specified user.
 */
Get the quiz results data for the specified user and list of quizzes.
@param integer $userID The ID of the user to get the progress data for.
@param string  $quizIDListForSQL The SQL that contains an SQL list of quiz IDs.

@return array A list of the quiz progress for the specified user.
Get the quiz results data for the specified user and list of quizzes . @param integer $userID The ID of the user to get the progress data for . @param string $quizIDListForSQL The SQL that contains an SQL list of quiz IDs . @return array A list of the quiz progress for the specified user .
function WPCW_quizzes_getQuizResultsForUser( $userID, $quizIDListForSQL ) {
	global $wpdb, $wpcwdb;
	$wpdb->show_errors();
	$SQL = $wpdb->prepare( "
		SELECT * FROM $wpcwdb->user_progress_quiz
		WHERE quiz_id IN $quizIDListForSQL
		  AND user_id = %d
		  AND quiz_is_latest = 'latest'
	", $userID );
	$quizResults = $wpdb->get_results( $SQL );
	$quizData    = array();
	if ( $quizResults ) {
		foreach ( $quizResults as $aResult ) {
			$quizData[ $aResult->quiz_id ] = $aResult;
		}
	}
	return $quizData;
}
function WPCW_quizzes_getQuizResultsForUser ( $ userID , $ quizIDListForSQL ) { global $ wpdb , $ wpcwdb ; $ wpdb -> show_errors ( ) ; $ SQL = $ wpdb -> prepare ( " 
		SELECT * FROM  $ wpcwdb -> user_progress_quiz 
		WHERE quiz_id IN  $ quizIDListForSQL 
		  AND user_id = %d
		  AND quiz_is_latest = 'latest'
	 " , $ userID ) ; $ quizResults = $ wpdb -> get_results ( $ SQL ) ; $ quizData = array ( ) ; if ( $ quizResults ) { foreach ( $ quizResults as $ aResult ) { $ quizData [ $ aResult -> quiz_id ] = $ aResult ; } } return $ quizData ; }
Get the quiz results data for the specified user and list of quizzes.
Get the quiz results data for the specified user and list of quizzes .
// Convert list into quid_id => object