pluginHelper->get_results_tabs(); ?>

get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE result_id = %d", $result_id ) ); // Prepare plugin helper. $quiz_id = intval( $results_data->quiz_id ); $mlwQuizMasterNext->pluginHelper->prepare_quiz( $quiz_id ); $previous_results = $wpdb->get_var( "SELECT result_id FROM {$wpdb->prefix}mlw_results WHERE result_id = (SELECT MAX(result_id) FROM {$wpdb->prefix}mlw_results WHERE deleted = 0 AND result_id < $result_id)" ); $next_results = $wpdb->get_var( "SELECT result_id FROM {$wpdb->prefix}mlw_results WHERE result_id = (SELECT MIN(result_id) FROM {$wpdb->prefix}mlw_results WHERE deleted = 0 AND result_id > $result_id)" ); // If there is previous or next results, show buttons. echo '
'; if ( ! is_null( $previous_results ) && $previous_results ) { echo "View Previous Results "; } if ( ! is_null( $next_results ) && $next_results ) { echo " View Next Results"; } echo '
'; // Get template for admin results. $settings = (array) get_option( 'qmn-settings' ); if ( isset( $settings['results_details_template'] ) ) { $template = htmlspecialchars_decode( $settings['results_details_template'], ENT_QUOTES ); } else { $template = "

Quiz Results for %QUIZ_NAME%

%CONTACT_ALL%

Name Provided: %USER_NAME%

Business Provided: %USER_BUSINESS%

Phone Provided: %USER_PHONE%

Email Provided: %USER_EMAIL%

Score Received: %AMOUNT_CORRECT%/%TOTAL_QUESTIONS% or %CORRECT_SCORE%% or %POINT_SCORE% points

Answers Provided:

The user took %TIMER% to complete quiz.

Comments entered were: %COMMENT_SECTION%

The answers were as follows:

%QUESTIONS_ANSWERS%"; } // Prepare responses array. if ( is_serialized( $results_data->quiz_results ) && is_array( @unserialize( $results_data->quiz_results ) ) ) { $results = unserialize($results_data->quiz_results); if ( ! isset( $results["contact"] ) ) { $results["contact"] = array(); } } else { $template = str_replace( "%QUESTIONS_ANSWERS%" , $results_data->quiz_results, $template); $template = str_replace( "%TIMER%" , '', $template); $template = str_replace( "%COMMENT_SECTION%" , '', $template); $results = array( 0, array(), '', 'contact' => array() ); } // Prepare full results array. $results_array = array( 'quiz_id' => $results_data->quiz_id, 'quiz_name' => $results_data->quiz_name, 'quiz_system' => $results_data->quiz_system, 'user_name' => $results_data->name, 'user_business' => $results_data->business, 'user_email' => $results_data->email, 'user_phone' => $results_data->phone, 'user_id' => $results_data->user, 'timer' => $results[0], 'time_taken' => $results_data->time_taken, 'total_points' => $results_data->point_score, 'total_score' => $results_data->correct_score, 'total_correct' => $results_data->correct, 'total_questions' => $results_data->total, 'comments' => $results[2], 'question_answers_array' => $results[1], 'contact' => $results["contact"], 'results' => $results, ); // Pass through template variable filter $template = apply_filters( 'mlw_qmn_template_variable_results_page', $template, $results_array ); $template = str_replace( "\n" , "
", $template ); echo $template; // Hook for below admin results do_action( 'qsm_below_admin_results', $results_array ); } /** * Generates the results details tab in the quiz results page * * @return void * @since 4.4.0 */ function qsm_results_details_tab() { global $mlwQuizMasterNext; $mlwQuizMasterNext->pluginHelper->register_results_settings_tab( __( "Results", 'quiz-master-next' ), "qsm_generate_results_details_tab" ); } add_action( "plugins_loaded", 'qsm_results_details_tab' ); ?>