{"id":644,"date":"2023-10-22T12:23:36","date_gmt":"2023-10-22T12:23:36","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=644"},"modified":"2023-10-22T12:23:37","modified_gmt":"2023-10-22T12:23:37","slug":"quiz-master-next","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/quiz-master-next\/","title":{"rendered":"Quiz Master Next Shortcodes"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Quiz Master Next Shortcodes<\/strong> to your WordPress website, including their <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Quiz Master Next Plugin shortcodes not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Quiz Master Next Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/quiz-master-next\/assets\/icon-128x128.png?rev=1876099\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/quiz-master-next\" target=\"_blank\" rel=\"noopener\">\n                        Quiz And Survey Master &#8211; Best Quiz, Exam and Survey Plugin for WordPress                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Quiz And Survey Master is the ultimate WordPress plugin for creating engaging quizzes, exams, and surveys. With this plugin, you can easily create interactive content to engage your audience.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2605\u2606<\/span> (1217)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 40000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: 5.4            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[mlw_quizmaster]<\/li><li>[qsm_result]<\/li><li>[qsm_link]<\/li><li>[qsm_recent_quizzes]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Quiz Master Next [mlw_quizmaster] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Quiz Master Next shortcode is used to display a quiz on a webpage. It retrieves a specified quiz and its questions from the database, prepares the quiz for display, and enqueues necessary scripts and styles.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[mlw_quizmaster]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible mlw_quizmaster shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>quiz<\/code> &#8211; specifies the ID of the quiz to be displayed<\/li>\n<li><code>question_amount<\/code> &#8211; limits the number of questions in the quiz<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; Display a quiz using its ID<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[mlw_quizmaster quiz=1 \/]<\/code><\/pre>\n\n\n<p><strong>Advanced example<\/strong> &#8211; Display a quiz using its ID and limit the number of questions displayed<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[mlw_quizmaster quiz=1 question_amount=10 \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[mlw_quizmaster]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'mlw_quizmaster', array( $this, 'display_shortcode' ) );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction display_shortcode( $atts ) {\n\t\t$shortcode_args  = shortcode_atts(\n\t\t\tarray(\n\t\t\t\t&#039;quiz&#039;            =&gt; 0,\n\t\t\t\t&#039;question_amount&#039; =&gt; 0,\n\t\t\t),\n\t\t\t$atts\n\t\t);\n\t\t$quiz            = intval( $shortcode_args&#91;&#039;quiz&#039;] );\n\t\t$question_amount = intval( $shortcode_args&#91;&#039;question_amount&#039;] );\n\n\t\tob_start();\n\t\tglobal $wpdb, $mlwQuizMasterNext;\n\t\tif ( isset( $_GET&#91;&#039;result_id&#039;] ) &amp;&amp; &#039;&#039; !== $_GET&#91;&#039;result_id&#039;] ) {\n\t\t\t$result_unique_id = sanitize_text_field( wp_unslash( $_GET&#91;&#039;result_id&#039;] ) );\n\t\t\t$result           = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT `result_id`, `quiz_id` FROM {$wpdb-&gt;prefix}mlw_results WHERE unique_id = %s&quot;, $result_unique_id ), ARRAY_A );\n\t\t\tif ( ! empty( $result ) &amp;&amp; isset( $result&#91;&#039;result_id&#039;] ) ) {\n\t\t\t\t$mlwQuizMasterNext-&gt;pluginHelper-&gt;prepare_quiz( $result&#91;&#039;quiz_id&#039;] );\n\t\t\t\t$qmn_quiz_options = $mlwQuizMasterNext-&gt;quiz_settings-&gt;get_quiz_options();\n\n\t\t\t\t\/\/ If quiz options isn&#039;t found, stop function.\n\t\t\t\tif ( is_null( $qmn_quiz_options ) || 1 == $qmn_quiz_options-&gt;deleted ) {\n\t\t\t\t\treturn __( &#039;This quiz is no longer available.&#039;, &#039;quiz-master-next&#039; );\n\t\t\t\t}\n\n\t\t\t\twp_enqueue_style( &#039;qmn_quiz_common_style&#039;, $this-&gt;common_css, array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\twp_style_add_data( &#039;qmn_quiz_common_style&#039;, &#039;rtl&#039;, &#039;replace&#039; );\n\t\t\t\twp_enqueue_style( &#039;dashicons&#039; );\n\t\t\t\twp_enqueue_script( &#039;jquery&#039; );\n\t\t\t\twp_enqueue_script( &#039;jquery-ui-tooltip&#039; );\n\t\t\t\twp_enqueue_script( &#039;qsm_quiz&#039;, QSM_PLUGIN_JS_URL . &#039;\/qsm-quiz.js&#039;, array( &#039;wp-util&#039;, &#039;underscore&#039;, &#039;jquery&#039;, &#039;jquery-ui-tooltip&#039; ), $mlwQuizMasterNext-&gt;version, false );\n\t\t\t\twp_enqueue_script( &#039;qsm_common&#039;, QSM_PLUGIN_JS_URL . &#039;\/qsm-common.js&#039;, array(), $mlwQuizMasterNext-&gt;version, true );\n\t\t\t\t$disable_mathjax = isset( $qmn_quiz_options-&gt;disable_mathjax ) ? $qmn_quiz_options-&gt;disable_mathjax : &#039;&#039;;\n\t\t\t\tif ( 1 != $disable_mathjax ) {\n\t\t\t\t\twp_enqueue_script( &#039;math_jax&#039;, $this-&gt;mathjax_url, false, $this-&gt;mathjax_version, true );\n\t\t\t\t\twp_add_inline_script( &#039;math_jax&#039;, self::$default_MathJax_script, &#039;before&#039; );\n\t\t\t\t}\n\n\t\t\t\t$result_id      = $result&#91;&#039;result_id&#039;];\n\t\t\t\t$return_display = do_shortcode( &#039;&#91;qsm_result id=&quot;&#039; . $result_id . &#039;&quot;]&#039; );\n\t\t\t\t$return_display = str_replace( &#039;%FB_RESULT_ID%&#039;, $result_unique_id, $return_display );\n\t\t\t} else {\n\t\t\t\t$return_display = &#039;Result id is wrong!&#039;;\n\t\t\t}\n\t\t\t$return_display .= ob_get_clean();\n\t\t} else {\n\t\t\tglobal $qmn_allowed_visit;\n\t\t\tglobal $qmn_json_data;\n\t\t\t$qmn_json_data     = array();\n\t\t\t$qmn_allowed_visit = true;\n\t\t\t$success           = $mlwQuizMasterNext-&gt;pluginHelper-&gt;prepare_quiz( $quiz );\n\t\t\tif ( false === $success ) {\n\t\t\t\treturn __( &#039;It appears that this quiz is not set up correctly&#039;, &#039;quiz-master-next&#039; );\n\t\t\t}\n\n\t\t\tglobal $mlw_qmn_quiz;\n\t\t\t$mlw_qmn_quiz = $quiz;\n\t\t\t$return_display   = &#039;&#039;;\n\t\t\t$qmn_quiz_options = $mlwQuizMasterNext-&gt;quiz_settings-&gt;get_quiz_options();\n\t\t\t\/\/ Legacy variable.\n\t\t\t\/**\n\t\t\t * Filter Quiz Options before Quiz Display\n\t\t\t *\/\n\t\t\t$qmn_quiz_options = apply_filters( &#039;qsm_shortcode_quiz_options&#039;, $qmn_quiz_options );\n\n\t\t\t\/\/ If quiz options isn&#039;t found, stop function.\n\t\t\tif ( is_null( $qmn_quiz_options ) || 1 == $qmn_quiz_options-&gt;deleted ) {\n\t\t\t\treturn __( &#039;This quiz is no longer available.&#039;, &#039;quiz-master-next&#039; );\n\t\t\t}\n\n\t\t\t\/\/ If quiz options isn&#039;t found, stop function.\n\t\t\tif ( is_null( $qmn_quiz_options ) || empty( $qmn_quiz_options-&gt;quiz_name ) ) {\n\t\t\t\treturn __( &#039;It appears that this quiz is not set up correctly&#039;, &#039;quiz-master-next&#039; );\n\t\t\t}\n\n\t\t\t\/\/ Loads Quiz Template.\n\t\t\twp_enqueue_style( &#039;qmn_quiz_animation_style&#039;, QSM_PLUGIN_CSS_URL . &#039;\/animate.css&#039;, array(), $mlwQuizMasterNext-&gt;version );\n\t\t\twp_enqueue_style( &#039;qmn_quiz_common_style&#039;, $this-&gt;common_css, array(), $mlwQuizMasterNext-&gt;version );\n\t\t\twp_style_add_data( &#039;qmn_quiz_common_style&#039;, &#039;rtl&#039;, &#039;replace&#039; );\n\t\t\twp_enqueue_style( &#039;dashicons&#039; );\n\t\t\t\/\/ The quiz_stye is misspelled because it has always been misspelled and fixing it would break many sites :(.\n\t\t\tif ( &#039;default&#039; == $qmn_quiz_options-&gt;theme_selected ) {\n\t\t\t\t$return_display .= &#039;&lt;style type=&quot;text\/css&quot;&gt;&#039; . preg_replace( &#039;#&lt;script(.*?)&gt;(.*?)&lt;\/script&gt;#is&#039;, &#039;&#039;, htmlspecialchars_decode( $qmn_quiz_options-&gt;quiz_stye ) ) . &#039;&lt;\/style&gt;&#039;;\n\t\t\t\twp_enqueue_style( &#039;qmn_quiz_style&#039;, QSM_PLUGIN_CSS_URL . &#039;\/qmn_quiz.css&#039;, array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\twp_style_add_data( &#039;qmn_quiz_style&#039;, &#039;rtl&#039;, &#039;replace&#039; );\n\t\t\t} else {\n\t\t\t\t$registered_template = $mlwQuizMasterNext-&gt;pluginHelper-&gt;get_quiz_templates( $qmn_quiz_options-&gt;theme_selected );\n\t\t\t\t\/\/ Check direct file first, then check templates folder in plugin, then check templates file in theme.\n\t\t\t\t\/\/ If all fails, then load custom styling instead.\n\t\t\t\tif ( $registered_template &amp;&amp; file_exists( ABSPATH . $registered_template&#91;&#039;path&#039;] ) ) {\n\t\t\t\t\twp_enqueue_style( &#039;qmn_quiz_template&#039;, site_url( $registered_template&#91;&#039;path&#039;] ), array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\t} elseif ( $registered_template &amp;&amp; file_exists( plugin_dir_path( __FILE__ ) . &#039;..\/..\/templates\/&#039; . $registered_template&#91;&#039;path&#039;] ) ) {\n\t\t\t\t\twp_enqueue_style( &#039;qmn_quiz_template&#039;, plugins_url( &#039;..\/..\/templates\/&#039; . $registered_template&#91;&#039;path&#039;], __FILE__ ), array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\t} elseif ( $registered_template &amp;&amp; file_exists( get_theme_file_path( &#039;\/templates\/&#039; . $registered_template&#91;&#039;path&#039;] ) ) ) {\n\t\t\t\t\twp_enqueue_style( &#039;qmn_quiz_template&#039;, get_stylesheet_directory_uri() . &#039;\/templates\/&#039; . $registered_template&#91;&#039;path&#039;], array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\t}\n\t\t\t\tif ( ! empty( $qmn_quiz_options-&gt;quiz_stye ) ) {\n\t\t\t\t\techo &quot;&lt;style type=&#039;text\/css&#039; id=&#039;qmn_quiz_template-css&#039;&gt;&quot; . wp_kses_post( htmlspecialchars_decode( $qmn_quiz_options-&gt;quiz_stye ) ) . &#039;&lt;\/style&gt;&#039;;\n\t\t\t\t}\n\t\t\t}\n\t\t\t$saved_quiz_theme = $mlwQuizMasterNext-&gt;theme_settings-&gt;get_active_quiz_theme_path( $quiz );\n\t\t\t$folder_name      = QSM_THEME_PATH . $saved_quiz_theme . &#039;\/&#039;;\n\t\t\tif ( file_exists( $folder_name . &#039;functions.php&#039; ) ) {\n\t\t\t\tinclude_once $folder_name . &#039;functions.php&#039;;\n\t\t\t}\n\t\t\tdo_action( &#039;qsm_enqueue_script_style&#039;, $qmn_quiz_options );\n\n\t\t\t\/\/ Starts to prepare variable array for filters.\n\t\t\t$qmn_array_for_variables = array(\n\t\t\t\t&#039;quiz_id&#039;     =&gt; $qmn_quiz_options-&gt;quiz_id,\n\t\t\t\t&#039;quiz_name&#039;   =&gt; $qmn_quiz_options-&gt;quiz_name,\n\t\t\t\t&#039;quiz_system&#039; =&gt; $qmn_quiz_options-&gt;system,\n\t\t\t\t&#039;user_ip&#039;     =&gt; $this-&gt;get_user_ip(),\n\t\t\t);\n\t\t\t$return_display         .= &#039;&lt;script&gt;\n                            if (window.qmn_quiz_data === undefined) {\n                                    window.qmn_quiz_data = new Object();\n                            }\n                    &lt;\/script&gt;&#039;;\n\t\t\t$qpages                  = array();\n\t\t\t$qpages_arr              = $mlwQuizMasterNext-&gt;pluginHelper-&gt;get_quiz_setting( &#039;qpages&#039;, array() );\n\t\t\tif ( ! empty( $qpages_arr ) ) {\n\t\t\t\tforeach ( $qpages_arr as $key =&gt; $qpage ) {\n\t\t\t\t\tunset( $qpage&#91;&#039;questions&#039;] );\n\t\t\t\t\tif ( isset( $qpage&#91;&#039;id&#039;] ) ) {\n\t\t\t\t\t\t$qpages&#91; $qpage&#91;&#039;id&#039;] ] = $qpage;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$correct_answer_text = sanitize_text_field( $qmn_quiz_options-&gt;quick_result_correct_answer_text );\n\t\t\t$correct_answer_text = $mlwQuizMasterNext-&gt;pluginHelper-&gt;qsm_language_support( $correct_answer_text, &quot;quiz_quick_result_correct_answer_text-{$qmn_array_for_variables&#91;&#039;quiz_id&#039;]}&quot; );\n\t\t\t$wrong_answer_text = sanitize_text_field( $qmn_quiz_options-&gt;quick_result_wrong_answer_text );\n\t\t\t$wrong_answer_text = $mlwQuizMasterNext-&gt;pluginHelper-&gt;qsm_language_support( $wrong_answer_text, &quot;quiz_quick_result_wrong_answer_text-{$qmn_array_for_variables&#91;&#039;quiz_id&#039;]}&quot; );\n\t\t\t$quiz_processing_message = $mlwQuizMasterNext-&gt;pluginHelper-&gt;qsm_language_support( $qmn_quiz_options-&gt;quiz_processing_message, &quot;quiz_quiz_processing_message-{$qmn_array_for_variables&#91;&#039;quiz_id&#039;]}&quot; );\n\t\t\t$quiz_limit_choice = $mlwQuizMasterNext-&gt;pluginHelper-&gt;qsm_language_support( $qmn_quiz_options-&gt;quiz_limit_choice, &quot;quiz_quiz_limit_choice-{$qmn_array_for_variables&#91;&#039;quiz_id&#039;]}&quot; );\n\t\t\t$qmn_json_data = array(\n\t\t\t\t&#039;quiz_id&#039;                            =&gt; $qmn_array_for_variables&#91;&#039;quiz_id&#039;],\n\t\t\t\t&#039;quiz_name&#039;                          =&gt; $qmn_array_for_variables&#91;&#039;quiz_name&#039;],\n\t\t\t\t&#039;disable_answer&#039;                     =&gt; $qmn_quiz_options-&gt;disable_answer_onselect,\n\t\t\t\t&#039;ajax_show_correct&#039;                  =&gt; $qmn_quiz_options-&gt;ajax_show_correct,\n\t\t\t\t&#039;progress_bar&#039;                       =&gt; $qmn_quiz_options-&gt;progress_bar,\n\t\t\t\t&#039;contact_info_location&#039;              =&gt; $qmn_quiz_options-&gt;contact_info_location,\n\t\t\t\t&#039;qpages&#039;                             =&gt; $qpages,\n\t\t\t\t&#039;skip_validation_time_expire&#039;        =&gt; $qmn_quiz_options-&gt;skip_validation_time_expire,\n\t\t\t\t&#039;timer_limit_val&#039;                    =&gt; $qmn_quiz_options-&gt;timer_limit,\n\t\t\t\t&#039;disable_scroll_next_previous_click&#039; =&gt; $qmn_quiz_options-&gt;disable_scroll_next_previous_click,\n\t\t\t\t&#039;disable_first_page&#039;                 =&gt; $qmn_quiz_options-&gt;disable_first_page,\n\t\t\t\t&#039;enable_result_after_timer_end&#039;      =&gt; isset( $qmn_quiz_options-&gt;enable_result_after_timer_end ) ? $qmn_quiz_options-&gt;enable_result_after_timer_end : &#039;&#039;,\n\t\t\t\t&#039;enable_quick_result_mc&#039;             =&gt; isset( $qmn_quiz_options-&gt;enable_quick_result_mc ) ? $qmn_quiz_options-&gt;enable_quick_result_mc : &#039;&#039;,\n\t\t\t\t&#039;end_quiz_if_wrong&#039;                  =&gt; isset( $qmn_quiz_options-&gt;end_quiz_if_wrong ) ? $qmn_quiz_options-&gt;end_quiz_if_wrong : 0,\n\t\t\t\t&#039;form_disable_autofill&#039;              =&gt; isset( $qmn_quiz_options-&gt;form_disable_autofill ) ? $qmn_quiz_options-&gt;form_disable_autofill : &#039;&#039;,\n\t\t\t\t&#039;disable_mathjax&#039;                    =&gt; isset( $qmn_quiz_options-&gt;disable_mathjax ) ? $qmn_quiz_options-&gt;disable_mathjax : &#039;&#039;,\n\t\t\t\t&#039;enable_quick_correct_answer_info&#039;   =&gt; isset( $qmn_quiz_options-&gt;enable_quick_correct_answer_info ) ? $qmn_quiz_options-&gt;enable_quick_correct_answer_info : 0,\n\t\t\t\t&#039;quick_result_correct_answer_text&#039;   =&gt; $correct_answer_text,\n\t\t\t\t&#039;quick_result_wrong_answer_text&#039;     =&gt; $wrong_answer_text,\n\t\t\t\t&#039;quiz_processing_message&#039;            =&gt; $quiz_processing_message,\n\t\t\t\t&#039;quiz_limit_choice&#039;                  =&gt; $quiz_limit_choice,\n\t\t\t\t&#039;not_allow_after_expired_time&#039;       =&gt; $qmn_quiz_options-&gt;not_allow_after_expired_time,\n\t\t\t\t&#039;scheduled_time_end&#039;                 =&gt; strtotime( $qmn_quiz_options-&gt;scheduled_time_end ),\n\t\t\t);\n\n\t\t\t$return_display = apply_filters( &#039;qmn_begin_shortcode&#039;, $return_display, $qmn_quiz_options, $qmn_array_for_variables, $shortcode_args );\n\n\t\t\t\/\/ Checks if we should be showing quiz or results page.\n\t\t\tif ( $qmn_allowed_visit &amp;&amp; ! isset( $_POST&#91;&#039;complete_quiz&#039;] ) &amp;&amp; ! empty( $qmn_quiz_options-&gt;quiz_name ) ) {\n\t\t\t\t$return_display .= $this-&gt;display_quiz( $qmn_quiz_options, $qmn_array_for_variables, $question_amount, $shortcode_args );\n\t\t\t} elseif ( isset( $_POST&#91;&#039;complete_quiz&#039;], $_POST&#91;&#039;qmn_quiz_id&#039;] ) &amp;&amp; &#039;confirmation&#039; == sanitize_text_field( wp_unslash( $_POST&#91;&#039;complete_quiz&#039;] ) ) &amp;&amp; sanitize_text_field( wp_unslash( $_POST&#91;&#039;qmn_quiz_id&#039;] ) ) == $qmn_array_for_variables&#91;&#039;quiz_id&#039;] ) {\n\t\t\t\t$return_display .= $this-&gt;display_results( $qmn_quiz_options, $qmn_array_for_variables );\n\t\t\t}\n\n\t\t\t$qmn_filtered_json = apply_filters( &#039;qmn_json_data&#039;, $qmn_json_data, $qmn_quiz_options, $qmn_array_for_variables, $shortcode_args );\n\t\t\t$qmn_settings_array = maybe_unserialize( $qmn_quiz_options-&gt;quiz_settings );\n\t\t\t$quiz_options = maybe_unserialize( $qmn_settings_array&#91;&#039;quiz_options&#039;] );\n\t\t\t$correct_answer_logic = ! empty( $quiz_options&#91;&#039;correct_answer_logic&#039;] ) ? $quiz_options&#91;&#039;correct_answer_logic&#039;] : &#039;&#039;;\n\t\t\t$encryption&#91;&#039;correct_answer_logic&#039;] = $correct_answer_logic;\n\t\t\t$enc_questions = array();\n\t\t\tif ( ! empty( $qpages_arr ) ) {\n\t\t\t\tforeach ( $qpages_arr as $item ) {\n\t\t\t\t\t$enc_questions = array_merge($enc_questions, $item&#91;&#039;questions&#039;]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$enc_questions = implode(&#039;,&#039;, $enc_questions);\n\t\t\t$question_array = $wpdb-&gt;get_results(\n\t\t\t\t&quot;SELECT quiz_id, question_id, answer_array, question_answer_info, question_type_new, question_settings\n\t\t\t\tFROM {$wpdb-&gt;prefix}mlw_questions\n\t\t\t\tWHERE question_id IN ($enc_questions)&quot;, ARRAY_A);\n\t\t\tforeach ( $question_array as $key =&gt; $question ) {\n\t\t\t\t$encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;question_type_new&#039;] = $question&#91;&#039;question_type_new&#039;];\n\t\t\t\t$encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;answer_array&#039;] = maybe_unserialize( $question&#91;&#039;answer_array&#039;] );\n\t\t\t\t$encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;settings&#039;] = maybe_unserialize( $question&#91;&#039;question_settings&#039;] );\n\t\t\t\t$encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;correct_info_text&#039;] = isset( $question&#91;&#039;question_answer_info&#039;] ) ? html_entity_decode( $question&#91;&#039;question_answer_info&#039;] ) : &#039;&#039;;\n\t\t\t\t$encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;correct_info_text&#039;] = $mlwQuizMasterNext-&gt;pluginHelper-&gt;qsm_language_support( $encryption&#91; $question&#91;&#039;question_id&#039;] ]&#91;&#039;correct_info_text&#039;], &quot;correctanswerinfo-{$question&#91;&#039;question_id&#039;]}&quot; );\n\t\t\t}\n\t\t\tif ( ( isset($qmn_json_data&#91;&#039;end_quiz_if_wrong&#039;]) &amp;&amp; 0 &lt; $qmn_json_data&#91;&#039;end_quiz_if_wrong&#039;] ) || ( ! empty( $qmn_json_data&#91;&#039;enable_quick_result_mc&#039;] ) &amp;&amp; 1 == $qmn_json_data&#91;&#039;enable_quick_result_mc&#039;] ) ) {\n\t\t\t\t$quiz_id = $qmn_json_data&#91;&#039;quiz_id&#039;];\n\t\t\t\t$qsm_inline_encrypt_js = &#039;\n\t\t\t\tif (encryptionKey === undefined) {\n                       var encryptionKey = {};\n                }\n                if (data === undefined) {\n                       var data = {};\n                }\n                if (jsonString === undefined) {\n                        var jsonString = {};\n                }\n                if (encryptedData === undefined) {\n                      var encryptedData = {};\n                }\n\t\t\t\t    \n\t\t\t\t    \n\t\t\t\t    \n\t\t\t\t    \n\n\t\t\t\tencryptionKey&#91;&#039;.$quiz_id.&#039;] = &quot;&#039;.hash(&#039;sha256&#039;,time().$quiz_id).&#039;&quot;;\n\t\t\t\t\n\t\t\t\tdata&#91;&#039;.$quiz_id.&#039;] = &#039;.wp_json_encode($encryption).&#039;;\n\t\t\t\tjsonString&#91;&#039;.$quiz_id.&#039;] = JSON.stringify(data&#91;&#039;.$quiz_id.&#039;]);\n\t\t\t\tencryptedData&#91;&#039;.$quiz_id.&#039;] = CryptoJS.AES.encrypt(jsonString&#91;&#039;.$quiz_id.&#039;], encryptionKey&#91;&#039;.$quiz_id.&#039;]).toString();&#039;;\n\t\t\t\twp_add_inline_script(&#039;qsm_encryption&#039;, $qsm_inline_encrypt_js, &#039;after&#039;);\n\t\t\t}\n\n\t\t\t$return_display .= &#039;&lt;script&gt;window.qmn_quiz_data&#91;&quot;&#039; . $qmn_json_data&#91;&#039;quiz_id&#039;] . &#039;&quot;] = &#039; . wp_json_encode( $qmn_filtered_json ) . &#039;\n                    &lt;\/script&gt;&#039;;\n\n\t\t\t$return_display .= ob_get_clean();\n\t\t\t$return_display  = apply_filters( &#039;qmn_end_shortcode&#039;, $return_display, $qmn_quiz_options, $qmn_array_for_variables, $shortcode_args );\n\n\t\t}\n\t\treturn $return_display;\n\t}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">quiz-master-next\/quiz-master-next\/php\/classes\/class-qmn-quiz-manager.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Quiz Master Next [qsm_result] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Quiz Master Next shortcode, &#8216;qsm_result&#8217;, is designed to display quiz results. It uses a shortcode function, &#8216;shortcode_display_result&#8217;, which retrieves the quiz results based on the result id. \n\n\n\nThis shortcode function first checks if the result id is valid. If not, it fetches the id from the URL. If the id is valid and numeric, it retrieves the corresponding quiz results from the database. \n\nIt then enqueues necessary styles and scripts, and prepares the response data, which includes details like quiz id, quiz name, user details, and quiz results. The function finally returns the quiz results in a formatted manner. If the result id is invalid, it displays an error message.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[qsm_result]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible qsm_result shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>id<\/code> &#8211; Unique identifier for the quiz result to display<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; Displays the quiz result by referencing the result ID.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_result id=1 \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to display a quiz result by referencing the result ID through a URL parameter. This allows for dynamic loading of quiz results based on the result ID present in the URL.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">Add the result id in the URL like this: www.yourwebsite.com\/your-page\/?result_id=1<\/code><\/pre>\n\n\n<p>Then use the shortcode without any id attribute in the page where you want to display the result. The shortcode will automatically fetch the result id from the URL.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_result \/]<\/code><\/pre>\n\n\n<p>Please note that this advanced usage requires your PHP code to have the functionality to retrieve the &#8216;result_id&#8217; from the URL, as shown in the related shortcode PHP code above.<\/p>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[qsm_result]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'qsm_result', array( $this, 'shortcode_display_result' ) );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction shortcode_display_result( $atts ) {\n\n\t\t$args = shortcode_atts(\n\t\t\tarray(\n\t\t\t\t&#039;id&#039; =&gt; 0,\n\t\t\t),\n\t\t\t$atts\n\t\t);\n\n\t\t$id = intval( $args&#91;&#039;id&#039;] );\n\n\t\tob_start();\n\t\tif ( 0 === $id ) {\n\t\t\t$id = (int) isset( $_GET&#91;&#039;result_id&#039;] ) ? sanitize_text_field( wp_unslash( $_GET&#91;&#039;result_id&#039;] ) ) : 0;\n\t\t}\n\t\tif ( $id &amp;&amp; is_numeric( $id ) ) {\n\t\t\tglobal $mlwQuizMasterNext;\n\t\t\tglobal $wpdb;\n\t\t\t$result_data = $wpdb-&gt;get_row( $wpdb-&gt;prepare( &quot;SELECT * FROM {$wpdb-&gt;prefix}mlw_results WHERE result_id = %d&quot;, $id ), ARRAY_A );\n\t\t\tif ( $result_data ) {\n\t\t\t\twp_enqueue_style( &#039;qmn_quiz_common_style&#039;, $this-&gt;common_css, array(), $mlwQuizMasterNext-&gt;version );\n\t\t\t\twp_style_add_data( &#039;qmn_quiz_common_style&#039;, &#039;rtl&#039;, &#039;replace&#039; );\n\t\t\t\twp_enqueue_style( &#039;dashicons&#039; );\n\t\t\t\twp_enqueue_style( &#039;qsm_primary_css&#039;, plugins_url( &#039;..\/..\/templates\/qmn_primary.css&#039;, __FILE__ ), array(), $mlwQuizMasterNext-&gt;version );\n\n\t\t\t\twp_enqueue_script( &#039;math_jax&#039;, $this-&gt;mathjax_url, false, $this-&gt;mathjax_version, true );\n\t\t\t\twp_add_inline_script( &#039;math_jax&#039;, self::$default_MathJax_script, &#039;before&#039; );\n\t\t\t\t$quiz_result   = maybe_unserialize( $result_data&#91;&#039;quiz_results&#039;] );\n\t\t\t\t$response_data = array(\n\t\t\t\t\t&#039;quiz_id&#039;                =&gt; $result_data&#91;&#039;quiz_id&#039;],\n\t\t\t\t\t&#039;quiz_name&#039;              =&gt; $result_data&#91;&#039;quiz_name&#039;],\n\t\t\t\t\t&#039;quiz_system&#039;            =&gt; $result_data&#91;&#039;quiz_system&#039;],\n\t\t\t\t\t&#039;form_type&#039;              =&gt; $result_data&#91;&#039;form_type&#039;],\n\t\t\t\t\t&#039;quiz_payment_id&#039;        =&gt; &#039;&#039;,\n\t\t\t\t\t&#039;user_ip&#039;                =&gt; $result_data&#91;&#039;user_ip&#039;],\n\t\t\t\t\t&#039;user_name&#039;              =&gt; $result_data&#91;&#039;name&#039;],\n\t\t\t\t\t&#039;user_business&#039;          =&gt; $result_data&#91;&#039;business&#039;],\n\t\t\t\t\t&#039;user_email&#039;             =&gt; $result_data&#91;&#039;email&#039;],\n\t\t\t\t\t&#039;user_phone&#039;             =&gt; $result_data&#91;&#039;phone&#039;],\n\t\t\t\t\t&#039;user_id&#039;                =&gt; $result_data&#91;&#039;user&#039;],\n\t\t\t\t\t&#039;timer&#039;                  =&gt; 0,\n\t\t\t\t\t&#039;time_taken&#039;             =&gt; $result_data&#91;&#039;time_taken&#039;],\n\t\t\t\t\t&#039;contact&#039;                =&gt; $quiz_result&#91;&#039;contact&#039;],\n\t\t\t\t\t&#039;total_points&#039;           =&gt; $result_data&#91;&#039;point_score&#039;],\n\t\t\t\t\t&#039;total_score&#039;            =&gt; $result_data&#91;&#039;correct_score&#039;],\n\t\t\t\t\t&#039;total_correct&#039;          =&gt; $result_data&#91;&#039;correct&#039;],\n\t\t\t\t\t&#039;total_questions&#039;        =&gt; $result_data&#91;&#039;total&#039;],\n\t\t\t\t\t&#039;question_answers_array&#039; =&gt; $quiz_result&#91;1],\n\t\t\t\t\t&#039;comments&#039;               =&gt; &#039;&#039;,\n\t\t\t\t\t&#039;result_id&#039;              =&gt; $id,\n\t\t\t\t);\n\t\t\t\t$data          = QSM_Results_Pages::generate_pages( $response_data );\n\t\t\t\techo wp_kses_post( htmlspecialchars_decode( $data&#91;&#039;display&#039;] ) );\n\t\t\t} else {\n\t\t\t\tesc_html_e( &#039;Invalid result id!&#039;, &#039;quiz-master-next&#039; );\n\t\t\t}\n\t\t} else {\n\t\t\tesc_html_e( &#039;Invalid result id!&#039;, &#039;quiz-master-next&#039; );\n\t\t}\n\t\t$content = ob_get_clean();\n\t\treturn $content;\n\t}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">quiz-master-next\/quiz-master-next\/php\/classes\/class-qmn-quiz-manager.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Quiz Master Next [qsm_link] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Quiz Master Next shortcode &#8216;qsm_link&#8217; generates a link to a specific quiz. It takes three parameters: &#8216;id&#8217;, &#8216;class&#8217;, and &#8216;target&#8217;. \n\n\n\nThe &#8216;id&#8217; parameter corresponds to the quiz&#8217;s ID. &#8216;class&#8217; allows for custom styling, and &#8216;target&#8217; determines how the link opens. This shortcode can be used to seamlessly integrate quizzes into posts or pages.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[qsm_link]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible qsm_link shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>id<\/code> &#8211; Unique identifier of the quiz<\/li>\n<li><code>class<\/code> &#8211; CSS class to style the quiz link<\/li>\n<li><code>target<\/code> &#8211; Controls where the quiz link opens<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A straightforward usage of the &#8216;qsm_link&#8217; shortcode to display a quiz link by referencing the ID of the quiz. The quiz link will load based on the specified ID.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_link id=1 \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to display a quiz link with a specific CSS class. This allows for custom styling of the quiz link.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_link id=1 class=\"my-custom-class\" \/]<\/code><\/pre>\n\n\n<p>Utilizing the shortcode to display a quiz link that opens in a new browser tab or window. This is achieved by defining the &#8216;target&#8217; attribute as &#8216;_blank&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_link id=1 target=\"_blank\" \/]<\/code><\/pre>\n\n\n<p>Combining multiple parameters to create a more complex shortcode. This example displays a quiz link with a custom CSS class that opens in a new browser tab or window.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_link id=1 class=\"my-custom-class\" target=\"_blank\" \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[qsm_link]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'qsm_link', 'qsm_quiz_link_shortcode' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction qsm_quiz_link_shortcode( $atts, $content = &#039;&#039; ) {\n\n\t$args = shortcode_atts(\n\t\tarray(\n\t\t\t&#039;id&#039;     =&gt; 0,\n\t\t\t&#039;class&#039;  =&gt; &#039;&#039;,\n\t\t\t&#039;target&#039; =&gt; &#039;&#039;,\n\t\t),\n\t\t$atts\n\t);\n\n\t$id = intval( $args&#91;&#039;id&#039;] );\n\t$class = $args&#91;&#039;class&#039;];\n\t$target = $args&#91;&#039;target&#039;];\n\n\t\/\/ Find the permalink by finding the post with the meta_key &#039;quiz_id&#039; of supplied quiz\n\t$permalink = &#039;&#039;;\n\t$my_query  = new WP_Query(\n\t\tarray(\n\t\t\t&#039;post_type&#039;      =&gt; &#039;qsm_quiz&#039;,\n\t\t\t&#039;meta_key&#039;       =&gt; &#039;quiz_id&#039;,\n\t\t\t&#039;meta_value&#039;     =&gt; $id,\n\t\t\t&#039;posts_per_page&#039; =&gt; 1,\n\t\t\t&#039;post_status&#039;    =&gt; &#039;publish&#039;,\n\t\t)\n\t);\n\tif ( $my_query-&gt;have_posts() ) {\n\t\twhile ( $my_query-&gt;have_posts() ) {\n\t\t\t$my_query-&gt;the_post();\n\t\t\t$permalink = get_permalink();\n\t\t}\n\t}\n\twp_reset_postdata();\n\n\t\/\/ Craft the target attribute if one is passed to shortcode\n\t$target_html = &#039;&#039;;\n\tif ( ! empty( $target ) ) {\n\t\treturn &quot;&lt;a href=&#039;&quot; . esc_url( $permalink ) . &quot;&#039; target=&#039;&quot; . esc_attr( $target ) . &quot;&#039; class=&#039;&quot; . esc_attr( $class ) . &quot;&#039;&gt;&quot; . esc_html( $content ) . &#039;&lt;\/a&gt;&#039;;\n\t} else {\n\t\treturn &quot;&lt;a href=&#039;&quot; . esc_url( $permalink ) . &quot;&#039; class=&#039;&quot; . esc_attr( $class ) . &quot;&#039;&gt;&quot; . esc_html( $content ) . &#039;&lt;\/a&gt;&#039;;\n\t}\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">quiz-master-next\/quiz-master-next\/php\/shortcodes.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Quiz Master Next [qsm_recent_quizzes] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Quiz Master Next plugin shortcode is designed to display recent quizzes on your WordPress site. \n\nIt fetches quizzes from the database and displays them in descending order. The shortcode also allows customization of the number of quizzes to display and whether to include quizzes scheduled for the future. \n\nThe output is a div structure with each quiz title and a link to take the quiz. If no quiz is found, it displays &#8216;No quiz found&#8217;.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[qsm_recent_quizzes]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible qsm_recent_quizzes shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>no_of_quizzes<\/code> &#8211; Determines the number of quizzes to display.<\/li>\n<li><code>include_future_quizzes<\/code> &#8211; Controls whether to include quizzes scheduled for future.<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; This shortcode displays the most recent quizzes up to a maximum of 10 by default.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_recent_quizzes \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Displaying the most recent 5 quizzes. If the number of quizzes is not specified, it will default to showing the 10 most recent quizzes.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_recent_quizzes no_of_quizzes=5 \/]<\/code><\/pre>\n\n\n<p>Displaying the most recent quizzes excluding future quizzes. By default, future quizzes are included. However, you can exclude them by setting the &#8216;include_future_quizzes&#8217; attribute to &#8216;no&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_recent_quizzes include_future_quizzes=no \/]<\/code><\/pre>\n\n\n<p>Displaying the most recent 5 quizzes excluding future quizzes. This example combines the two previous examples to display the most recent 5 quizzes that are not scheduled for the future.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[qsm_recent_quizzes no_of_quizzes=5 include_future_quizzes=no \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[qsm_recent_quizzes]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'qsm_recent_quizzes', 'qsm_display_recent_quizzes' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction qsm_display_recent_quizzes( $attrs ) {\n\tglobal $mlwQuizMasterNext;\n\t$no_of_quizzes          = isset( $attrs&#91;&#039;no_of_quizzes&#039;] ) ? $attrs&#91;&#039;no_of_quizzes&#039;] : 10;\n\t$include_future_quizzes = isset( $attrs&#91;&#039;include_future_quizzes&#039;] ) ? $attrs&#91;&#039;include_future_quizzes&#039;] : true;\n\tglobal $wpdb;\n\twp_enqueue_style( &#039;quizzes-list&#039;, QSM_PLUGIN_CSS_URL.&#039;\/quizzes-list.css&#039;, array(), $mlwQuizMasterNext-&gt;version );\n\n\t$quizzes = $mlwQuizMasterNext-&gt;pluginHelper-&gt;get_quizzes( false, &#039;quiz_id&#039;, &#039;DESC&#039; );\n\t$result  = &#039;&lt;div class=&quot;outer-con&quot;&gt;&#039;;\n\t$i       = 0;\n\tforeach ( $quizzes as $quiz ) {\n\t\tif ( $i &lt; $no_of_quizzes ) {\n\t\t\t$setting = maybe_unserialize( $quiz-&gt;quiz_settings );\n\t\t\t$options = maybe_unserialize( $setting&#91;&#039;quiz_options&#039;] );\n\t\t\t$start_date = strtotime( $options&#91;&#039;scheduled_time_start&#039;] );\n\t\t\t$end_date   = strtotime( $options&#91;&#039;scheduled_time_end&#039;] );\n\t\t\t$now      = strtotime( current_time( &#039;m\/d\/Y H:i&#039; ) );\n\t\t\tif ( $end_date &amp;&amp; $end_date &lt; $now ) {\n\t\t\t\tcontinue;\n\t\t\t} elseif ( $start_date &amp;&amp; $start_date &gt; $now &amp;&amp; &#039;no&#039; === $include_future_quizzes ) {\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\t$title   = $quiz-&gt;quiz_name;\n\t\t\t\t$id      = $quiz-&gt;quiz_id;\n\t\t\t\t$url     = do_shortcode( &quot;&#91;qsm_link id=&#039;$id&#039;] Take Quiz &#91;\/qsm_link]&quot; );\n\t\t\t\t$result .= &quot;&lt;div class=&#039;ind-quiz&#039;&gt;\n                                &lt;div class=&#039;quiz-heading&#039;&gt;\n                                    {$title}\n                                &lt;\/div&gt;\n                                &lt;div class=&#039;quiz-url&#039;&gt;\n                                    {$url}\n                                &lt;\/div&gt;\n                            &lt;\/div&gt;&quot;;\n\t\t\t\t$result .= &quot;&lt;div class=&#039;clear&#039;&gt;&lt;\/div&gt;&quot;;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t}\n\tif ( 0 === $i ) {\n\t\t$result .= __( &#039;No quiz found&#039;, &#039;quiz-master-next&#039; );\n\t}\n\t$result .= &#039;&lt;\/div&gt;&#039;;\n\treturn $result;\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">quiz-master-next\/quiz-master-next\/php\/shortcodes.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Quiz Master Next Plugin shortcodes<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Quiz Master Next Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Quiz Master Next Plugin shortcodes not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Quiz And Survey Master &#8211; Best Quiz, Exam and Survey Plugin for WordPress","slug":"","version":"8.1.17","author":"<a href=\"https:\/\/quizandsurveymaster.com\/\">ExpressTech<\/a>","icons":"https:\/\/ps.w.org\/quiz-master-next\/assets\/icon-128x128.png?rev=1876099","plugin_tags":"{\"lead\":\"lead\",\"quiz\":\"quiz\",\"score\":\"score\",\"survey\":\"survey\",\"test\":\"test\"}","author_profile":"https:\/\/profiles.wordpress.org\/expresstech\/","requires":"4.9","tested":"6.3.2","requires_php":"5.4","rating":96,"num_ratings":1217,"active_installs":40000,"downloaded":2128408,"last_updated":"2023-10-11 12:42pm GMT","added":"2013-09-10","homepage":"https:\/\/expresstech.io\/","short_description":"Easily create exams, generate leads, surveys and any type of quiz with our popular WordPress Quiz Plugin. Custom flows, emails and create leaderboard","description":"\"Quiz And Survey Master is the ultimate WordPress plugin for creating engaging quizzes, exams, and surveys. With this plugin, you can easily create interactive content to engage your audience.\"","shortcodes":"[\"mlw_quizmaster\",\"qsm_result\",\"qsm_link\",\"qsm_recent_quizzes\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-644","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/644","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=644"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/644\/revisions"}],"predecessor-version":[{"id":786,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/644\/revisions\/786"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=644"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=644"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=644"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}