public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Function to get the details of a question (to ensure it exists).
 *
 * @since 1.0.0
 *
 * @param integer $questionID The ID of the question to get the details for.
 * @param boolean $getTagsToo If true, then get the list of these tags too.
 *
 * @return object The details of the question as an object.
 */
Function to get the details of a question (to ensure it exists).

@param integer $questionID The ID of the question to get the details for.
@param boolean $getTagsToo If true, then get the list of these tags too.

@return object The details of the question as an object.
Function to get the details of a question ( to ensure it exists ) . @param integer $questionID The ID of the question to get the details for . @param boolean $getTagsToo If true then get the list of these tags too . @return object The details of the question as an object .
function WPCW_questions_getQuestionDetails( $questionID, $getTagsToo = false ) {
	if ( ! $questionID ) {
		return false;
	}
	global $wpcwdb, $wpdb;
	$wpdb->show_errors();
	$SQL = $wpdb->prepare( "SELECT *
			FROM $wpcwdb->quiz_qs
			WHERE question_id = %d
			", $questionID );
	$obj = $wpdb->get_row( $SQL );
	if ( $obj && $getTagsToo ) {
		$obj->tags = $wpdb->get_results( $wpdb->prepare( "
			SELECT qt.*
			FROM $wpcwdb->question_tag_mapping qtm
				LEFT JOIN $wpcwdb->question_tags qt ON qtm.tag_id = qt.question_tag_id
			WHERE question_id = %d
			ORDER BY question_tag_name ASC
		", $obj->question_id ) );
	}
	return $obj;
}
function WPCW_questions_getQuestionDetails ( $ questionID , $ getTagsToo = false ) { if ( ! $ questionID ) { return false ; } global $ wpcwdb , $ wpdb ; $ wpdb -> show_errors ( ) ; $ SQL = $ wpdb -> prepare ( " SELECT *
			FROM  $ wpcwdb -> quiz_qs 
			WHERE question_id = %d
			 " , $ questionID ) ; $ obj = $ wpdb -> get_row ( $ SQL ) ; if ( $ obj && $ getTagsToo ) { $ obj -> tags = $ wpdb -> get_results ( $ wpdb -> prepare ( " 
			SELECT qt.*
			FROM  $ wpcwdb -> question_tag_mapping  qtm
				LEFT JOIN  $ wpcwdb -> question_tags  qt ON qtm.tag_id = qt.question_tag_id
			WHERE question_id = %d
			ORDER BY question_tag_name ASC
		 " , $ obj -> question_id ) ) ; } return $ obj ; }
Function to get the details of a question (to ensure it exists).
Function to get the details of a question ( to ensure it exists ) .
// Also grab any tags that this question has.