public/wordpress/wp-content/plugins/wp-courseware/includes/legacy/admin/functions.php
/**
 * Handle saving questions to the database.
 *
 * @since 1.0.0
 *
 * @param array $questionData The question data that we wish to save.
 *
 * @return boolean If true, then it was successfully updated.
 */
Handle saving questions to the database.

@param array $questionData The question data that we wish to save.

@return boolean If true, then it was successfully updated.
Handle saving questions to the database . @param array $questionData The question data that we wish to save . @return boolean If true then it was successfully updated .
function WPCW_handler_Save_Question( $questionData = array() ) {
	if ( empty ( $questionData ) ) {
		return false;
	}
	global $wpdb, $wpcwdb;
	$defaultQuestionData = array(
		'question_id'                  => '',
		'question_type'                => '',
		'question_question'            => '',
		'question_answers'             => '',
		'question_data_answers'        => '',
		'question_correct_answer'      => '',
		'question_answer_type'         => '',
		'question_answer_hint'         => '',
		'question_answer_explanation'  => '',
		'question_image'               => '',
		'question_answer_file_types'   => '',
		'question_usage_count'         => '',
		'question_expanded_count'      => '',
		'question_multi_random_enable' => '',
		'question_multi_random_count'  => '',
	);
	$questionData = wp_parse_args( $questionData, $defaultQuestionData );
	$wpdb->query( arrayToSQLInsert( $wpcwdb->quiz_qs, $questionData ) );
	$questionId = $wpdb->insert_id;
	return $questionId;
}
function WPCW_handler_Save_Question ( $ questionData = array ( ) ) { if ( empty ( $ questionData ) ) { return false ; } global $ wpdb , $ wpcwdb ; $ defaultQuestionData = array ( 'question_id' => '' , 'question_type' => '' , 'question_question' => '' , 'question_answers' => '' , 'question_data_answers' => '' , 'question_correct_answer' => '' , 'question_answer_type' => '' , 'question_answer_hint' => '' , 'question_answer_explanation' => '' , 'question_image' => '' , 'question_answer_file_types' => '' , 'question_usage_count' => '' , 'question_expanded_count' => '' , 'question_multi_random_enable' => '' , 'question_multi_random_count' => '' , ) ; $ questionData = wp_parse_args ( $ questionData , $ defaultQuestionData ) ; $ wpdb -> query ( arrayToSQLInsert ( $ wpcwdb -> quiz_qs , $ questionData ) ) ; $ questionId = $ wpdb -> insert_id ; return $ questionId ; }
Handle saving questions to the database.
Handle saving questions to the database .
// Global // Array Details // Merge // Question Data // Get Question Id // Return