Quiz And Survey Master (Formerly Quiz Master Next) - Version 7.1.14

Version Description

(March 25, 2021) = * Bug: Fixed security and Vulnerability issues. * Bug: Fixed the inability to recognize correct answer for Question type Paragraph. * Bug: Fixed the issue of question not displaying when randomizing questions by category. * Bug: Fixed the issue of [latex] shortcode not working on retake quiz. * Enhancement: Added the feature to Unlink questions from quiz. * Enhancement: UI improvements for Quiz Editor.

Download this release

Release Info

Developer expresstech
Plugin Icon 128x128 Quiz And Survey Master (Formerly Quiz Master Next)
Version 7.1.14
Comparing to
See all releases

Code changes from version 7.1.13 to 7.1.14

css/admin-dashboard.css CHANGED
@@ -359,7 +359,7 @@
359
  background: url(../assets/down-1.png) no-repeat !important;
360
  background-size: cover !important;
361
  }
362
- #accordion ui-accordion-header:focus {
363
  outline:0 !important;
364
  border: none !important;
365
  }
359
  background: url(../assets/down-1.png) no-repeat !important;
360
  background-size: cover !important;
361
  }
362
+ #accordion .ui-accordion-header:focus {
363
  outline:0 !important;
364
  border: none !important;
365
  }
css/qsm-admin-question.css CHANGED
@@ -5,6 +5,63 @@
5
  align-items: center;
6
  }
7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8
  @media screen and (min-width:700px) {
9
  .question-controls {
10
  flex-direction: row;
5
  align-items: center;
6
  }
7
 
8
+ #delete-question-button{
9
+ background-color:#dc3232;
10
+ float: right;
11
+ }
12
+
13
+ #unlink-question-button{
14
+ float: right;
15
+ margin-left: 5px;
16
+ }
17
+
18
+ #modal-7{
19
+ max-width: 500px;
20
+ }
21
+
22
+ #modal-7 hr{
23
+ margin: 0 -30px;
24
+ }
25
+
26
+ #modal-7 header{
27
+ margin: -10px 0 10px 0;
28
+ }
29
+
30
+ #modal-7 .qsm-popup__close {
31
+ margin: -10px -10px 0 0;
32
+ font-size: 20px;
33
+ }
34
+
35
+ #modal-7-title{
36
+ color: gray;
37
+ opacity: 70%;
38
+ }
39
+
40
+ #modal-7 footer .dashicons{
41
+ font-size: 20px;
42
+ margin-right: 3px;
43
+ vertical-align: middle;
44
+ margin-left: -10px;
45
+ }
46
+
47
+ #modal-7 .qsm-popup__container{
48
+ max-width:560px;
49
+ padding-bottom: 20px;
50
+ }
51
+
52
+ .modal-7-table{
53
+ font-size: 16px;
54
+ }
55
+
56
+ #modal-7 footer{
57
+ margin-top: 15px;
58
+ }
59
+
60
+ .modal-7-table tr td{
61
+ vertical-align: top;
62
+ padding: 0 10px 5px 0
63
+ }
64
+
65
  @media screen and (min-width:700px) {
66
  .question-controls {
67
  flex-direction: row;
css/qsm-admin.css CHANGED
@@ -1267,7 +1267,7 @@ input#sc-shortcode-model-text,
1267
  input#sc-shortcode-model-text-link {
1268
  height: 30px;
1269
  }
1270
- div#modal-6 lable {
1271
  display: block;
1272
  font-size: 14px;
1273
  margin-bottom: 5px;
@@ -1512,19 +1512,17 @@ td.scheduled_time_start {
1512
  .qsm-view-preview-btn{
1513
  text-decoration: none;
1514
  line-height: normal;
1515
- margin-left: 5px;
1516
  }
1517
- .qsm-view-preview-btn span.dashicons{
 
1518
  line-height: 12px;
1519
- vertical-align: middle;
1520
- font-size: 25px;
1521
  }
1522
  .mlw_quiz_options a.button.button-default.qsm-btn-quiz-edit {
1523
- margin-left: 10px;
1524
- /*margin-top: 9px;*/
1525
  box-shadow: none;
1526
  float: right;
1527
- margin-right: 10px;
1528
  }
1529
  .mlw_quiz_options a.button.button-default.qsm-btn-quiz-edit:hover{
1530
  opacity: 0.8;
@@ -1536,8 +1534,8 @@ td.scheduled_time_start {
1536
  margin-top: 20px;
1537
  }
1538
  .mlw_quiz_options .edit-quiz-name{
1539
- float: right;
1540
- /*margin-top: 9px;*/
1541
  }
1542
  .qsm_text_customize_label{
1543
  position: fixed;
1267
  input#sc-shortcode-model-text-link {
1268
  height: 30px;
1269
  }
1270
+ div#modal-6 label {
1271
  display: block;
1272
  font-size: 14px;
1273
  margin-bottom: 5px;
1512
  .qsm-view-preview-btn{
1513
  text-decoration: none;
1514
  line-height: normal;
1515
+ margin-left: -5px;
1516
  }
1517
+ .qsm-view-preview-btn span.dashicons,
1518
+ .edit-quiz-name span.dashicons{
1519
  line-height: 12px;
1520
+ vertical-align: bottom;
 
1521
  }
1522
  .mlw_quiz_options a.button.button-default.qsm-btn-quiz-edit {
 
 
1523
  box-shadow: none;
1524
  float: right;
1525
+ margin-right: 5px;
1526
  }
1527
  .mlw_quiz_options a.button.button-default.qsm-btn-quiz-edit:hover{
1528
  opacity: 0.8;
1534
  margin-top: 20px;
1535
  }
1536
  .mlw_quiz_options .edit-quiz-name{
1537
+ float: none;
1538
+ text-decoration: none;
1539
  }
1540
  .qsm_text_customize_label{
1541
  position: fixed;
js/qsm-admin-question.js CHANGED
@@ -713,10 +713,17 @@ var import_button;
713
  });
714
  $( '.questions' ).on( 'click', '.delete-question-button', function( event ) {
715
  event.preventDefault();
 
 
 
 
 
 
 
 
 
716
  if( confirm('Are you sure?') ){
717
  var question_id = $(this).data('question-iid');
718
-
719
- // if( question_id ){
720
  console.log(question_id);
721
  $.ajax( {
722
  url: ajaxurl,
@@ -736,13 +743,26 @@ var import_button;
736
  }
737
  }
738
  } );
739
- // }
740
-
 
 
 
 
 
 
 
 
 
 
741
 
742
- $( this ).parents( '.question' ).remove();
 
743
  QSMQuestion.countTotal();
744
  $('.save-page-button').trigger('click');
745
  }
 
 
746
  });
747
  $( '.questions' ).on( 'click', '.delete-page-button', function( event ) {
748
  event.preventDefault();
713
  });
714
  $( '.questions' ).on( 'click', '.delete-question-button', function( event ) {
715
  event.preventDefault();
716
+ remove = $(this);
717
+ // opens-up question-delete modal
718
+ MicroModal.show('modal-7');
719
+ $('#unlink-question-button').attr('data-question-iid', $(this).data('question-iid'));
720
+ $('#delete-question-button').attr('data-question-iid', $(this).data('question-iid'));
721
+
722
+ // removes question from database
723
+ $('#delete-question-button').click(function(event){
724
+ event.preventDefault();
725
  if( confirm('Are you sure?') ){
726
  var question_id = $(this).data('question-iid');
 
 
727
  console.log(question_id);
728
  $.ajax( {
729
  url: ajaxurl,
743
  }
744
  }
745
  } );
746
+ remove.parents( '.question' ).remove();
747
+ QSMQuestion.countTotal();
748
+ $('.save-page-button').trigger('click');
749
+ }
750
+ MicroModal.close('modal-7');
751
+ });
752
+
753
+ // unlink question from a particular quiz.
754
+ $('#unlink-question-button').click(function(event){
755
+ event.preventDefault();
756
+ if( confirm('Are you sure?') ){
757
+ var question_id = $(this).data('question-iid');
758
 
759
+ console.log(question_id);
760
+ remove.parents( '.question' ).remove();
761
  QSMQuestion.countTotal();
762
  $('.save-page-button').trigger('click');
763
  }
764
+ MicroModal.close('modal-7');
765
+ });
766
  });
767
  $( '.questions' ).on( 'click', '.delete-page-button', function( event ) {
768
  event.preventDefault();
js/qsm-quiz.js CHANGED
@@ -784,15 +784,18 @@ function qmnFormSubmit( quiz_form_id ) {
784
  var quiz_id = +jQuery( '#' + quiz_form_id ).find( '.qmn_quiz_id' ).val();
785
  var $container = jQuery( '#' + quiz_form_id ).closest( '.qmn_quiz_container' );
786
  var result = qmnValidation( '#' + quiz_form_id + ' *', quiz_form_id );
 
 
 
 
787
  /**
788
- * Update Timer in MS
789
- */
 
790
  var timer_ms = jQuery('#' + quiz_form_id).find("input[name='timer_ms']").val();
791
  var new_timer_ms = qsmTimeInMS();
792
  jQuery('#' + quiz_form_id).find("input[name='timer_ms']").val(Math.abs(new_timer_ms - timer_ms));
793
 
794
- if ( ! result ) { return result; }
795
-
796
  jQuery( '.mlw_qmn_quiz input:radio' ).attr( 'disabled', false );
797
  jQuery( '.mlw_qmn_quiz input:checkbox' ).attr( 'disabled', false );
798
  jQuery( '.mlw_qmn_quiz select' ).attr( 'disabled', false );
@@ -1176,6 +1179,7 @@ jQuery(function() {
1176
  jQuery(this).val(timems);
1177
  });
1178
  setInterval(qmnTimeTakenTimer, 1000);
 
1179
  },
1180
  error: function (errorThrown) {
1181
  console.log('error');
784
  var quiz_id = +jQuery( '#' + quiz_form_id ).find( '.qmn_quiz_id' ).val();
785
  var $container = jQuery( '#' + quiz_form_id ).closest( '.qmn_quiz_container' );
786
  var result = qmnValidation( '#' + quiz_form_id + ' *', quiz_form_id );
787
+
788
+
789
+ if ( ! result ) { return result; }
790
+
791
  /**
792
+ * Update Timer in MS
793
+ */
794
+
795
  var timer_ms = jQuery('#' + quiz_form_id).find("input[name='timer_ms']").val();
796
  var new_timer_ms = qsmTimeInMS();
797
  jQuery('#' + quiz_form_id).find("input[name='timer_ms']").val(Math.abs(new_timer_ms - timer_ms));
798
 
 
 
799
  jQuery( '.mlw_qmn_quiz input:radio' ).attr( 'disabled', false );
800
  jQuery( '.mlw_qmn_quiz input:checkbox' ).attr( 'disabled', false );
801
  jQuery( '.mlw_qmn_quiz select' ).attr( 'disabled', false );
1179
  jQuery(this).val(timems);
1180
  });
1181
  setInterval(qmnTimeTakenTimer, 1000);
1182
+ MathJax.Hub.queue.Push(["Typeset", MathJax.Hub]);
1183
  },
1184
  error: function (errorThrown) {
1185
  console.log('error');
lang/quiz-master-next.pot CHANGED
@@ -114,11 +114,16 @@ msgstr ""
114
  msgid "Get a Free Addon!"
115
  msgstr ""
116
 
 
117
  #: mlw_quizmaster2.php:296
118
- msgid "QSM About"
119
  msgstr ""
120
 
121
  #: mlw_quizmaster2.php:297
 
 
 
 
122
  msgid "Help"
123
  msgstr ""
124
 
114
  msgid "Get a Free Addon!"
115
  msgstr ""
116
 
117
+
118
  #: mlw_quizmaster2.php:296
119
+ msgid "Roadmap"
120
  msgstr ""
121
 
122
  #: mlw_quizmaster2.php:297
123
+ msgid "About"
124
+ msgstr ""
125
+
126
+ #: mlw_quizmaster2.php:298
127
  msgid "Help"
128
  msgstr ""
129
 
mlw_quizmaster2.php CHANGED
@@ -2,14 +2,14 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 7.1.13
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
- * @version 7.1.13
13
  * @package QSM
14
  */
15
 
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
37
  * @var string
38
  * @since 4.0.0
39
  */
40
- public $version = '7.1.13';
41
 
42
  /**
43
  * QSM Alert Manager Object
@@ -130,7 +130,6 @@ class MLWQuizMasterNext {
130
  include 'php/admin/tools-page.php';
131
  include 'php/classes/class-qsm-changelog-generator.php';
132
  include 'php/admin/about-page.php';
133
- include 'php/admin/help-page.php';
134
  include 'php/admin/dashboard-widgets.php';
135
  include 'php/admin/options-page-questions-tab.php';
136
  include 'php/admin/options-page-contact-tab.php';
@@ -293,9 +292,10 @@ class MLWQuizMasterNext {
293
  add_submenu_page( 'qsm_dashboard', __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
294
  add_submenu_page( 'qsm_dashboard', __( 'Addon Settings', 'quiz-master-next' ), '<span style="color:#f39c12;">' . __( 'Addon Settings', 'quiz-master-next' ) . '</span>', 'moderate_comments', 'qmn_addons', 'qmn_addons_page' );
295
  add_submenu_page( 'qsm_dashboard', __( 'Get a Free Addon', 'quiz-master-next' ), '<span style="color:#f39c12;">' . esc_html__( 'Get a Free Addon!', 'quiz-master-next' ) . '</span>', 'moderate_comments', 'qsm-free-addon', 'qsm_display_optin_page' );
296
- add_submenu_page( 'qsm_dashboard', __( 'QSM Roadmap', 'quiz-master-next' ), __( 'QSM Roadmap', 'quiz-master-next' ), 'moderate_comments', 'qsm_roadmap_page', 'qsm_generate_roadmap_page' );
297
- add_submenu_page( 'qsm_dashboard', __( 'QSM About', 'quiz-master-next' ), __( 'QSM About', 'quiz-master-next' ), 'moderate_comments', 'qsm_about_page', 'qsm_generate_about_page' );
298
- add_submenu_page( 'qsm_dashboard', __( 'Help', 'quiz-master-next' ), __( 'Help', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_help', 'qsm_generate_help_page' );
 
299
  //Register screen option for dashboard page
300
  add_action("screen_settings", "qsm_dashboard_screen_options", 10, 2);
301
  }
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 7.1.14
6
  * Author: ExpressTech
7
  * Author URI: https://quizandsurveymaster.com/
8
  * Plugin URI: https://expresstech.io/
9
  * Text Domain: quiz-master-next
10
  *
11
  * @author QSM Team
12
+ * @version 7.1.14
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.14';
41
 
42
  /**
43
  * QSM Alert Manager Object
130
  include 'php/admin/tools-page.php';
131
  include 'php/classes/class-qsm-changelog-generator.php';
132
  include 'php/admin/about-page.php';
 
133
  include 'php/admin/dashboard-widgets.php';
134
  include 'php/admin/options-page-questions-tab.php';
135
  include 'php/admin/options-page-contact-tab.php';
292
  add_submenu_page( 'qsm_dashboard', __( 'Stats', 'quiz-master-next' ), __( 'Stats', 'quiz-master-next' ), 'moderate_comments', 'qmn_stats', 'qmn_generate_stats_page' );
293
  add_submenu_page( 'qsm_dashboard', __( 'Addon Settings', 'quiz-master-next' ), '<span style="color:#f39c12;">' . __( 'Addon Settings', 'quiz-master-next' ) . '</span>', 'moderate_comments', 'qmn_addons', 'qmn_addons_page' );
294
  add_submenu_page( 'qsm_dashboard', __( 'Get a Free Addon', 'quiz-master-next' ), '<span style="color:#f39c12;">' . esc_html__( 'Get a Free Addon!', 'quiz-master-next' ) . '</span>', 'moderate_comments', 'qsm-free-addon', 'qsm_display_optin_page' );
295
+ add_submenu_page( 'qsm_dashboard', __( 'Roadmap', 'quiz-master-next' ), __( 'Roadmap', 'quiz-master-next' ), 'moderate_comments', 'qsm_roadmap_page', 'qsm_generate_roadmap_page' );
296
+ // Merging Help page in About page
297
+ // add_submenu_page( 'qsm_dashboard', __( 'About', 'quiz-master-next' ), __( 'About', 'quiz-master-next' ), 'moderate_comments', 'qsm_about_page', 'qsm_generate_about_page' );
298
+ add_submenu_page( 'qsm_dashboard', __( 'About', 'quiz-master-next' ), __( 'About', 'quiz-master-next' ), 'moderate_comments', 'qsm_quiz_about', 'qsm_generate_about_page' );
299
  //Register screen option for dashboard page
300
  add_action("screen_settings", "qsm_dashboard_screen_options", 10, 2);
301
  }
php/admin/about-page.php CHANGED
@@ -1,6 +1,8 @@
1
  <?php
2
  /**
3
- * Generates the content for the about page.
 
 
4
  */
5
 
6
  if ( ! defined( 'ABSPATH' ) ) {
@@ -8,62 +10,229 @@ if ( ! defined( 'ABSPATH' ) ) {
8
  }
9
 
10
  /**
11
- * This function shows the about page. It also shows the changelog information.
12
  *
13
  * @return void
14
  * @since 6.2.0
15
  */
16
  function qsm_generate_about_page() {
17
-
18
  global $mlwQuizMasterNext;
19
  $version = $mlwQuizMasterNext->version;
20
- wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ), array(), $version );
 
 
 
 
 
21
  wp_enqueue_script( 'qsm_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'jquery' ), $version );
 
 
 
 
22
  ?>
23
- <style>
24
- div.qsm_icon_wrap {
25
- background: <?php echo 'url("' . plugins_url( '../../assets/icon-128x128.png', __FILE__ ) . '" )'; ?> no-repeat;
26
- }
27
- </style>
28
- <div class="wrap about-wrap">
29
- <h1><?php esc_html_e( 'Welcome To Quiz And Survey Master (Formerly Quiz Master Next)', 'quiz-master-next' ); ?></h1>
30
- <div class="qsm_icon_wrap"><?php echo esc_html( $version ); ?></div>
31
- <hr>
32
- <div class="qsm-tab-content tab-3" >
33
- <h2 style="text-align: left;margin-bottom: 35px;margin-top: 25px;font-weight: 500;">GitHub Contributors</h2>
34
- <?php
35
- $contributors = get_transient( 'qmn_contributors' );
36
- if ( false === $contributors ) {
37
- $response = wp_remote_get( 'https://api.github.com/repos/QuizandSurveyMaster/quiz_master_next/contributors', array( 'sslverify' => false ) );
38
- if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
39
- $contributors = array();
40
- } else {
41
- $contributors = json_decode( wp_remote_retrieve_body( $response ) );
42
- }
43
  }
44
- if ( is_array( $contributors ) & ! empty( $contributors ) ) {
45
- set_transient( 'qmn_contributors', $contributors, 3600 );
46
- $contributor_list = '<ul class="wp-people-group">';
47
- foreach ( $contributors as $contributor ) {
48
- $contributor_list .= '<li class="wp-person">';
49
- $contributor_list .= sprintf( '<a href="%s" title="%s">',
50
- esc_url( 'https://github.com/' . $contributor->login ),
51
- // translators: This is the 'title' attribute for GitHub contributors. This would add the GitHub user such as 'View fpcorso'.
52
- esc_html( __( 'View ', 'quiz-master-next' ) . $contributor->login )
53
- );
54
- $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
55
- $contributor_list .= '</a>';
56
- $contributor_list .= sprintf( '<a class="web" href="%s" target="_blank">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
57
- $contributor_list .= '</a>';
58
- $contributor_list .= '</li>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
59
  }
60
- $contributor_list .= '</ul>';
61
- echo $contributor_list;
62
- }
63
- ?>
64
- <a href="https://github.com/QuizandSurveyMaster/quiz_master_next" target="_blank" class="button-primary">View GitHub Repo</a>
65
- </div>
66
  </div>
67
  <?php
68
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
69
  ?>
1
  <?php
2
  /**
3
+ * Creates the Help page within the admin area
4
+ *
5
+ * @package QSM
6
  */
7
 
8
  if ( ! defined( 'ABSPATH' ) ) {
10
  }
11
 
12
  /**
13
+ * This function generates the help page.
14
  *
15
  * @return void
16
  * @since 6.2.0
17
  */
18
  function qsm_generate_about_page() {
 
19
  global $mlwQuizMasterNext;
20
  $version = $mlwQuizMasterNext->version;
21
+ if ( ! current_user_can( 'moderate_comments' ) ) {
22
+ return;
23
+ }
24
+ $tab_array = [['slug'=>'about', 'title'=>'About'],['slug'=>'help', 'title' => 'Help']];
25
+ $active_tab = isset($_GET['tab']) ? $_GET['tab'] : 'about';
26
+ wp_enqueue_style( 'qsm_admin_style', plugins_url( '../../css/qsm-admin.css', __FILE__ ) );
27
  wp_enqueue_script( 'qsm_admin_js', plugins_url( '../../js/admin.js', __FILE__ ), array( 'jquery' ), $version );
28
+
29
+ // Creates the widgets.
30
+ add_meta_box( 'wpss_mrts', __( 'Need Help?', 'quiz-master-next' ), 'qsm_documentation_meta_box_content', 'meta_box_help' );
31
+ add_meta_box( 'wpss_mrts', __( 'System Info', 'quiz-master-next' ), 'qsm_system_meta_box_content', 'meta_box_sys_info' );
32
  ?>
33
+
34
+ <?php if($active_tab == 'help'){?>
35
+ <div class="wrap qsm-help-page">
36
+ <h2><?php esc_html_e( 'Help Page', 'quiz-master-next' ); ?></h2>
37
+ <?php } elseif($active_tab == 'about') {?>
38
+ <style>
39
+ div.qsm_icon_wrap {
40
+ background: <?php echo 'url("' . plugins_url( '../../assets/icon-128x128.png', __FILE__ ) . '" )'; ?> no-repeat;
 
 
 
 
 
 
 
 
 
 
 
 
41
  }
42
+ </style>
43
+ <div class="wrap about-wrap">
44
+ <h1><?php esc_html_e( 'Welcome To Quiz And Survey Master (Formerly Quiz Master Next)', 'quiz-master-next' ); ?></h1>
45
+ <div class="qsm_icon_wrap"><?php echo esc_html( $version ); ?></div>
46
+ <?php } ?>
47
+
48
+ <h2 class="nav-tab-wrapper">
49
+ <?php
50
+ foreach ($tab_array as $tab) {
51
+ $active_class = '';
52
+ if ($active_tab == $tab['slug']) {
53
+ $active_class = 'nav-tab-active';
54
+ }
55
+ echo "<a href=\"?page=qsm_quiz_about&tab={$tab['slug']}\" class=\"nav-tab $active_class\">{$tab['title']}</a>";
56
+ }
57
+ ?>
58
+ </h2>
59
+ <br/>
60
+ <div>
61
+ <?php
62
+ if ($active_tab == 'help') {
63
+ qsm_show_adverts();
64
+ ?>
65
+ <div style="width:100%;" class="inner-sidebar1">
66
+ <?php do_meta_boxes( 'meta_box_help', 'advanced', '' ); ?>
67
+ </div>
68
+
69
+ <div style="width:100%;" class="inner-sidebar1">
70
+ <?php do_meta_boxes( 'meta_box_sys_info', 'advanced', '' ); ?>
71
+ </div>
72
+ <?php
73
+ } elseif($active_tab == 'about') {
74
+ ?>
75
+ <div class="qsm-tab-content tab-3" >
76
+ <h2 style="text-align: left;margin-bottom: 35px;margin-top: 25px;font-weight: 500;">GitHub Contributors</h2>
77
+ <?php
78
+ $contributors = get_transient( 'qmn_contributors' );
79
+ if ( false === $contributors ) {
80
+ $response = wp_remote_get( 'https://api.github.com/repos/QuizandSurveyMaster/quiz_master_next/contributors', array( 'sslverify' => false ) );
81
+ if ( is_wp_error( $response ) || 200 != wp_remote_retrieve_response_code( $response ) ) {
82
+ $contributors = array();
83
+ } else {
84
+ $contributors = json_decode( wp_remote_retrieve_body( $response ) );
85
+ }
86
+ }
87
+
88
+ if ( is_array( $contributors ) & ! empty( $contributors ) ) {
89
+ set_transient( 'qmn_contributors', $contributors, 3600 );
90
+ $contributor_list = '<ul class="wp-people-group">';
91
+ foreach ( $contributors as $contributor ) {
92
+ $contributor_list .= '<li class="wp-person">';
93
+ $contributor_list .= sprintf( '<a href="%s" title="%s">',
94
+ esc_url( 'https://github.com/' . $contributor->login ),
95
+ // translators: This is the 'title' attribute for GitHub contributors. This would add the GitHub user such as 'View fpcorso'.
96
+ esc_html( __( 'View ', 'quiz-master-next' ) . $contributor->login )
97
+ );
98
+ $contributor_list .= sprintf( '<img src="%s" width="64" height="64" class="gravatar" alt="%s" />', esc_url( $contributor->avatar_url ), esc_html( $contributor->login ) );
99
+ $contributor_list .= '</a>';
100
+ $contributor_list .= sprintf( '<a class="web" href="%s" rel="noopener" target="_blank">%s</a>', esc_url( 'https://github.com/' . $contributor->login ), esc_html( $contributor->login ) );
101
+ $contributor_list .= '</a>';
102
+ $contributor_list .= '</li>';
103
+ }
104
+ $contributor_list .= '</ul>';
105
+ echo $contributor_list;
106
+ }
107
+ ?>
108
+ <a href="https://github.com/QuizandSurveyMaster/quiz_master_next" rel="noopener" target="_blank" class="button-primary">View GitHub Repo</a>
109
+ </div>
110
+ <?php
111
  }
112
+ ?>
113
+ </div>
 
 
 
 
114
  </div>
115
  <?php
116
  }
117
+
118
+ /**
119
+ * This function creates the text that is displayed on the help page.
120
+ *
121
+ * @return void
122
+ * @since 4.4.0
123
+ */
124
+ function qsm_documentation_meta_box_content() {
125
+ ?>
126
+ <p><?php esc_html_e( 'Need help with the plugin? Try any of the following:', 'quiz-master-next' ); ?></p>
127
+ <ul>
128
+ <li>For assistance in using the plugin, read our <a href="https://quizandsurveymaster.com/docs/" rel="noopener" target="_blank">documentation</a></li>
129
+ <li>For support, fill out the form on our <a href="https://quizandsurveymaster.com/contact-support/?utm_source=qsm-help-page&utm_medium=plugin&utm_campaign=qsm_plugin&utm_content=contact_us" rel="noopener" target="_blank">Contact Us Page</a></li>
130
+ </ul>
131
+ <?php
132
+ }
133
+
134
+ /**
135
+ * This function echoes out the system info for the user.
136
+ *
137
+ * @return void
138
+ * @since 4.4.0
139
+ */
140
+ function qsm_system_meta_box_content() {
141
+ echo qsm_get_system_info();
142
+ }
143
+
144
+ /**
145
+ * This function gets the content that is in the system info
146
+ *
147
+ * @return return string This contains all of the system info from the admins server.
148
+ * @since 4.4.0
149
+ */
150
+ function qsm_get_system_info() {
151
+ global $wpdb;
152
+ global $mlwQuizMasterNext;
153
+
154
+ $sys_info = '';
155
+
156
+ $theme_data = wp_get_theme();
157
+ $theme = $theme_data->Name . ' ' . $theme_data->Version;
158
+ $parent_theme = $theme_data->Template;
159
+ if ( ! empty( $parent_theme ) ) {
160
+ $parent_theme_data = wp_get_theme( $parent_theme );
161
+ $parent_theme = $parent_theme_data->Name . ' ' . $parent_theme_data->Version;
162
+ }
163
+
164
+ $sys_info .= '<h3>'. __('Site Information', 'quiz-master-next') .'</h3>';
165
+ $sys_info .= __('Site URL:', 'quiz-master-next') . ' ' . site_url() . '<br />';
166
+ $sys_info .= __('Home URL:', 'quiz-master-next') . ' ' . home_url() . '<br />';
167
+ $sys_info .= __('Multisite: ', 'quiz-master-next') . ( is_multisite() ? 'Yes' : 'No' ) . '<br />';
168
+
169
+ $sys_info .= '<h3>'. __('WordPress Information', 'quiz-master-next') .'</h3>';
170
+ $sys_info .= __('Version: ', 'quiz-master-next') . get_bloginfo( 'version' ) . '<br />';
171
+ $sys_info .= __('Language: ', 'quiz-master-next') . ( defined( 'WPLANG' ) && WPLANG ? WPLANG : 'en_US' ) . '<br />';
172
+ $sys_info .= __('Permalink Structure: ', 'quiz-master-next') . ( get_option( 'permalink_structure' ) ? get_option( 'permalink_structure' ) : 'Default' ) . '<br>';
173
+ $sys_info .= __('Active Theme: ', 'quiz-master-next') . "{$theme}";
174
+ $sys_info .= __('Parent Theme: ', 'quiz-master-next') . "{$parent_theme}<br>";
175
+ $sys_info .= __('Debug Mode: ', 'quiz-master-next') . ( defined( 'WP_DEBUG' ) ? WP_DEBUG ? 'Enabled' : 'Disabled' : 'Not set' ) . '<br />';
176
+ $sys_info .= __('Memory Limit: ', 'quiz-master-next') . WP_MEMORY_LIMIT . '<br />';
177
+
178
+ $sys_info .= '<h3>'. __('Plugins Information', 'quiz-master-next') .'</h3>';
179
+ $plugin_mu = get_mu_plugins();
180
+ if ( count( $plugin_mu ) > 0 ) {
181
+ $sys_info .= '<h4>'. __('Must Use', 'quiz-master-next') .'</h4>';
182
+ foreach ( $plugin_mu as $plugin => $plugin_data ) {
183
+ $sys_info .= $plugin_data['Name'] . ': ' . $plugin_data['Version'] . "<br />";
184
+ }
185
+ }
186
+ $sys_info .= '<h4>'. __('Active', 'quiz-master-next') .'</h4>';
187
+ $plugins = get_plugins();
188
+ $active_plugins = get_option( 'active_plugins', array() );
189
+ foreach ( $plugins as $plugin_path => $plugin ) {
190
+ if ( ! in_array( $plugin_path, $active_plugins ) ) {
191
+ continue;
192
+ }
193
+ $sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
194
+ }
195
+ $sys_info .= '<h4>'. __('Inactive', 'quiz-master-next') .'</h4>';
196
+ foreach ( $plugins as $plugin_path => $plugin ) {
197
+ if ( in_array( $plugin_path, $active_plugins ) ) {
198
+ continue;
199
+ }
200
+ $sys_info .= $plugin['Name'] . ': ' . $plugin['Version'] . '<br />';
201
+ }
202
+
203
+ $sys_info .= '<h3>'. __('Server Information', 'quiz-master-next') .'</h3>';
204
+ $sys_info .= __('PHP : ', 'quiz-master-next') . PHP_VERSION . '<br />';
205
+ $sys_info .= __('MySQL : ', 'quiz-master-next') . $wpdb->db_version() . '<br />';
206
+ $sys_info .= __('Webserver : ', 'quiz-master-next') . $_SERVER['SERVER_SOFTWARE'] . '<br />';
207
+
208
+ $total_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes LIMIT 1" );
209
+ $total_active_quizzes = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_quizzes WHERE deleted = 0 LIMIT 1" );
210
+ $total_questions = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_questions LIMIT 1" );
211
+ $total_active_questions = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_questions WHERE deleted = 0 LIMIT 1" );
212
+ $total_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results LIMIT 1" );
213
+ $total_active_results = $wpdb->get_var( "SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results WHERE deleted = 0 LIMIT 1" );
214
+
215
+ $sys_info .= '<h3>'. __('QSM Information', 'quiz-master-next') .'</h3>';
216
+ $sys_info .= __('Initial Version : ', 'quiz-master-next') . get_option( 'qmn_original_version' ) . '<br />';
217
+ $sys_info .= __('Current Version : ', 'quiz-master-next') . $mlwQuizMasterNext->version . '<br />';
218
+ $sys_info .= __('Total Quizzes : ', 'quiz-master-next') . "{$total_quizzes}<br />";
219
+ $sys_info .= __('Total Active Quizzes : ', 'quiz-master-next') . "{$total_active_quizzes}<br />";
220
+ $sys_info .= __('Total Questions : ', 'quiz-master-next') . "{$total_questions}<br />";
221
+ $sys_info .= __('Total Active Questions : ', 'quiz-master-next') . "{$total_active_questions}<br />";
222
+ $sys_info .= __('Total Results : ', 'quiz-master-next') . "{$total_results}<br />";
223
+ $sys_info .= __('Total Active Results : ', 'quiz-master-next') . "{$total_active_results}<br />";
224
+
225
+ $sys_info .= '<h3>'. __('QSM Recent Logs', 'quiz-master-next') .'</h3>';
226
+ $recent_errors = $mlwQuizMasterNext->log_manager->get_logs();
227
+ if ( $recent_errors ) {
228
+ foreach ( $recent_errors as $error ) {
229
+ $sys_info .= "Log created at {$error->post_date}: {$error->post_title} - {$error->post_content}<br />";
230
+ }
231
+ } else {
232
+ $sys_info .= __('No recent logs','quiz-master-next') . '<br />';
233
+ }
234
+
235
+ return $sys_info;
236
+ }
237
+
238
  ?>
php/admin/addons-page.php CHANGED
@@ -357,7 +357,7 @@ function qsm_display_optin_page() {
357
  <!-- START - We recommend to place the below code where you want the form in your website html -->
358
  <div class="sib-form" style="text-align: center;">
359
  <div id="sib-form-container" class="sib-form-container">
360
- <div id="error-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-width:px; border-color:#ff4949;max-width:540px; border-width:px;">
361
  <div class="sib-form-message-panel__text sib-form-message-panel__text--center">
362
  <svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
363
  <path d="M256 40c118.621 0 216 96.075 216 216 0 119.291-96.61 216-216 216-119.244 0-216-96.562-216-216 0-119.203 96.602-216 216-216m0-32C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm-11.49 120h22.979c6.823 0 12.274 5.682 11.99 12.5l-7 168c-.268 6.428-5.556 11.5-11.99 11.5h-8.979c-6.433 0-11.722-5.073-11.99-11.5l-7-168c-.283-6.818 5.167-12.5 11.99-12.5zM256 340c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28z"
@@ -369,7 +369,7 @@ function qsm_display_optin_page() {
369
  </div>
370
  </div>
371
  <div></div>
372
- <div id="success-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#085229; background-color:#e7faf0; border-radius:3px; border-width:px; border-color:#13ce66;max-width:540px; border-width:px;">
373
  <div class="sib-form-message-panel__text sib-form-message-panel__text--center">
374
  <svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
375
  <path d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 464c-118.664 0-216-96.055-216-216 0-118.663 96.055-216 216-216 118.664 0 216 96.055 216 216 0 118.663-96.055 216-216 216zm141.63-274.961L217.15 376.071c-4.705 4.667-12.303 4.637-16.97-.068l-85.878-86.572c-4.667-4.705-4.637-12.303.068-16.97l8.52-8.451c4.705-4.667 12.303-4.637 16.97.068l68.976 69.533 163.441-162.13c4.705-4.667 12.303-4.637 16.97.068l8.451 8.52c4.668 4.705 4.637 12.303-.068 16.97z"
357
  <!-- START - We recommend to place the below code where you want the form in your website html -->
358
  <div class="sib-form" style="text-align: center;">
359
  <div id="sib-form-container" class="sib-form-container">
360
+ <div id="error-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#661d1d; background-color:#ffeded; border-radius:3px; border-width:px; border-color:#ff4949;max-width:540px;">
361
  <div class="sib-form-message-panel__text sib-form-message-panel__text--center">
362
  <svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
363
  <path d="M256 40c118.621 0 216 96.075 216 216 0 119.291-96.61 216-216 216-119.244 0-216-96.562-216-216 0-119.203 96.602-216 216-216m0-32C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm-11.49 120h22.979c6.823 0 12.274 5.682 11.99 12.5l-7 168c-.268 6.428-5.556 11.5-11.99 11.5h-8.979c-6.433 0-11.722-5.073-11.99-11.5l-7-168c-.283-6.818 5.167-12.5 11.99-12.5zM256 340c-15.464 0-28 12.536-28 28s12.536 28 28 28 28-12.536 28-28-12.536-28-28-28z"
369
  </div>
370
  </div>
371
  <div></div>
372
+ <div id="success-message" class="sib-form-message-panel" style="font-size:16px; text-align:left; font-family:Helvetica, sans-serif; color:#085229; background-color:#e7faf0; border-radius:3px; border-width:px; border-color:#13ce66;max-width:540px;">
373
  <div class="sib-form-message-panel__text sib-form-message-panel__text--center">
374
  <svg viewBox="0 0 512 512" class="sib-icon sib-notification__icon">
375
  <path d="M256 8C119.033 8 8 119.033 8 256s111.033 248 248 248 248-111.033 248-248S392.967 8 256 8zm0 464c-118.664 0-216-96.055-216-216 0-118.663 96.055-216 216-216 118.664 0 216 96.055 216 216 0 118.663-96.055 216-216 216zm141.63-274.961L217.15 376.071c-4.705 4.667-12.303 4.637-16.97-.068l-85.878-86.572c-4.667-4.705-4.637-12.303.068-16.97l8.52-8.451c4.705-4.667 12.303-4.637 16.97.068l68.976 69.533 163.441-162.13c4.705-4.667 12.303-4.637 16.97.068l8.451 8.52c4.668 4.705 4.637 12.303-.068 16.97z"
php/admin/admin-dashboard.php CHANGED
@@ -346,9 +346,9 @@ function qsm_dashboard_recent_taken_quiz( $widget_id ) {
346
  <div class="main">
347
  <ul class="recently-taken-quiz-ul">
348
  <?php
349
- $mlw_resutl_data = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted='0' ORDER BY result_id DESC LIMIT 2", ARRAY_A );
350
- if ( $mlw_resutl_data ) {
351
- foreach ( $mlw_resutl_data as $key => $single_result_arr ) {
352
  ?>
353
  <li>
354
  <?php
@@ -427,12 +427,12 @@ function qsm_dashboard_recent_taken_quiz( $widget_id ) {
427
  <p>
428
  <a href="admin.php?page=mlw_quiz_results">
429
  <?php
430
- $mlw_resutl_data = $wpdb->get_row( "SELECT DISTINCT COUNT(result_id) as total_result FROM {$wpdb->prefix}mlw_results WHERE deleted='0'", ARRAY_A );
431
- echo isset( $mlw_resutl_data['total_result'] ) ? __( 'See All Results ', 'quiz-master-next' ) : '';
432
  ?>
433
  </a>
434
  <?php
435
- echo isset( $mlw_resutl_data['total_result'] ) ? '(' . $mlw_resutl_data['total_result'] . ')' : '';
436
  ?>
437
  </p>
438
  </div>
346
  <div class="main">
347
  <ul class="recently-taken-quiz-ul">
348
  <?php
349
+ $mlw_result_data = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted=0 ORDER BY result_id DESC LIMIT 2", ARRAY_A );
350
+ if ( $mlw_result_data ) {
351
+ foreach ( $mlw_result_data as $key => $single_result_arr ) {
352
  ?>
353
  <li>
354
  <?php
427
  <p>
428
  <a href="admin.php?page=mlw_quiz_results">
429
  <?php
430
+ $mlw_result_data = $wpdb->get_row( "SELECT DISTINCT COUNT(result_id) as total_result FROM {$wpdb->prefix}mlw_results WHERE deleted=0", ARRAY_A );
431
+ echo isset( $mlw_result_data['total_result'] ) ? __( 'See All Results ', 'quiz-master-next' ) : '';
432
  ?>
433
  </a>
434
  <?php
435
+ echo isset( $mlw_result_data['total_result'] ) ? '(' . $mlw_result_data['total_result'] . ')' : '';
436
  ?>
437
  </p>
438
  </div>
php/admin/admin-results-details-page.php CHANGED
@@ -84,8 +84,8 @@ function qsm_generate_results_details_tab() {
84
  $quiz_id = intval( $results_data->quiz_id );
85
  $mlwQuizMasterNext->pluginHelper->prepare_quiz( $quiz_id );
86
 
87
- $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)" );
88
- $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)" );
89
 
90
  // If there is previous or next results, show buttons.
91
  echo '<div style="text-align:right; margin-top: 20px; margin-bottom: 20px;">';
84
  $quiz_id = intval( $results_data->quiz_id );
85
  $mlwQuizMasterNext->pluginHelper->prepare_quiz( $quiz_id );
86
 
87
+ $previous_results = $wpdb->get_var( $wpdb->prepare("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 < %d)", $result_id));
88
+ $next_results = $wpdb->get_var( $wpdb->prepare("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 > %d)", $result_id));
89
 
90
  // If there is previous or next results, show buttons.
91
  echo '<div style="text-align:right; margin-top: 20px; margin-bottom: 20px;">';
php/admin/admin-results-page.php CHANGED
@@ -163,9 +163,9 @@ function qsm_results_overview_tab_content() {
163
  }
164
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
165
  $quiz_id = intval( $_GET['quiz_id'] );
166
- $qsm_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE `deleted`='0' AND `quiz_id`='{$quiz_id}' {$search_phrase_sql}" );
167
  } else {
168
- $qsm_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE `deleted`='0' {$search_phrase_sql}" );
169
  }
170
 
171
  // Gets the order by arg. Uses switch to create SQL to prevent SQL injection.
@@ -203,9 +203,9 @@ function qsm_results_overview_tab_content() {
203
  $results_left = $qsm_results_count - ( $result_page * $table_limit );
204
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
205
  $quiz_id = intval( $_GET['quiz_id'] );
206
- $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted='0' AND quiz_id = %d $search_phrase_sql $order_by_sql LIMIT %d, %d", $quiz_id, $result_begin, $table_limit ) );
207
  } else {
208
- $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted = '0' $search_phrase_sql $order_by_sql LIMIT %d, %d", $result_begin, $table_limit ) );
209
  }
210
 
211
  wp_enqueue_script( 'jquery' );
163
  }
164
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
165
  $quiz_id = intval( $_GET['quiz_id'] );
166
+ $qsm_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE deleted=0 AND quiz_id='{$quiz_id}' {$search_phrase_sql}" );
167
  } else {
168
+ $qsm_results_count = $wpdb->get_var( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE deleted=0 {$search_phrase_sql}" );
169
  }
170
 
171
  // Gets the order by arg. Uses switch to create SQL to prevent SQL injection.
203
  $results_left = $qsm_results_count - ( $result_page * $table_limit );
204
  if ( isset( $_GET['quiz_id'] ) && ! empty( $_GET['quiz_id'] ) ) {
205
  $quiz_id = intval( $_GET['quiz_id'] );
206
+ $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted=0 AND quiz_id = %d $search_phrase_sql $order_by_sql LIMIT %d, %d", $quiz_id, $result_begin, $table_limit ) );
207
  } else {
208
+ $mlw_quiz_data = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE deleted=0 $search_phrase_sql $order_by_sql LIMIT %d, %d", $result_begin, $table_limit ) );
209
  }
210
 
211
  wp_enqueue_script( 'jquery' );
php/admin/functions.php CHANGED
@@ -199,19 +199,6 @@ function qsm_display_question_option($key, $single_option){
199
  </div>
200
  <?php
201
  break;
202
-
203
- case 'textarea':
204
- ?>
205
- <div id="<?php echo $key; ?>_area" class="qsm-row <?php echo $show_class; ?>">
206
- <label>
207
- <?php echo isset($single_option['label']) ? $single_option['label'] : ''; ?>
208
- <?php echo $tooltip; ?>
209
- <?php echo $document_text; ?>
210
- </label>
211
- <textarea name="<?php echo $key; ?>" id="<?php echo $key ?>"><?php echo isset($single_option['default']) ? $single_option['default'] : ''; ?></textarea>
212
- </div>
213
- <?php
214
- break;
215
 
216
  case 'number':
217
  ?>
199
  </div>
200
  <?php
201
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
202
 
203
  case 'number':
204
  ?>
php/admin/options-page-questions-tab.php CHANGED
@@ -567,6 +567,41 @@ function qsm_options_questions_tab_content() {
567
  </div>
568
  </script>
569
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
570
  }
571
 
572
 
567
  </div>
568
  </script>
569
  <?php
570
+
571
+ ?>
572
+ <div class="qsm-popup qsm-popup-slide" id="modal-7" aria-hidden="false">
573
+ <div class="qsm-popup__overlay" tabindex="-1" data-micromodal-close="">
574
+ <div class="qsm-popup__container" role="dialog" aria-modal="true" aria-labelledby="modal-7-title">
575
+ <header class="qsm-popup__header">
576
+ <h3 class="qsm-popup__title" id="modal-7-title"><?php _e('Delete Options', 'quiz-master-next'); ?></h3>
577
+ <a class="qsm-popup__close" aria-label="Close modal" data-micromodal-close=""></a>
578
+ </header>
579
+ <hr/>
580
+ <main class="qsm-popup__content" id="modal-7-content">
581
+ <form action='' method='post' id="delete-question-form">
582
+ <table class="modal-7-table">
583
+ <tr>
584
+ <td><strong style="color:#00449e"><?php _e('Unlink', 'quiz-master-next'); ?></strong></td>
585
+ <td><?php _e('Removes the question only from this quiz.', 'quiz-master-next'); ?></td>
586
+ <tr>
587
+ <tr>
588
+ <td><strong style="color:#dc3232"><?php _e('Delete', 'quiz-master-next'); ?></Strong></td>
589
+ <td><?php _e('Removes this question from database and everywhere. This action cannot be reversed.', 'quiz-master-next'); ?></td>
590
+ <tr>
591
+ </table>
592
+ </form>
593
+ </main>
594
+ <hr/>
595
+ <footer class="qsm-popup__footer">
596
+ <button id="unlink-question-button" class="qsm-popup__btn qsm-popup__btn-primary"><span class="dashicons dashicons-trash"></span><?php _e('Unlink', 'quiz-master-next'); ?></button>
597
+ <button id="delete-question-button" class="qsm-popup__btn qsm-popup__btn-primary"><span class="dashicons dashicons-warning"></span><?php _e('Delete', 'quiz-master-next'); ?></button>
598
+ <button id="cancel-button" class="qsm-popup__btn" data-micromodal-close="" aria-label="Close this dialog window"><?php _e('Cancel', 'quiz-master-next'); ?></button>
599
+ </footer>
600
+ </div>
601
+ </div>
602
+ </div>
603
+
604
+ <?php
605
  }
606
 
607
 
php/admin/options-page-style-tab.php CHANGED
@@ -39,7 +39,7 @@ function qsm_options_styling_tab_content() {
39
  $quiz_style = sanitize_textarea_field( htmlspecialchars( stripslashes( $_POST['quiz_css'] ), ENT_QUOTES ) );
40
 
41
  // Saves the new css.
42
- $results = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}mlw_quizzes SET quiz_stye='%s', theme_selected='%s', last_activity='%s' WHERE quiz_id=%d", $quiz_style, $quiz_theme, date( 'Y-m-d H:i:s' ), $style_quiz_id ) );
43
  if ( false !== $results ) {
44
  $mlwQuizMasterNext->alertManager->newAlert( __( 'The style has been saved successfully.', 'quiz-master-next' ), 'success' );
45
  $mlwQuizMasterNext->audit_manager->new_audit( "Styles Have Been Saved For Quiz Number $style_quiz_id" );
@@ -50,8 +50,7 @@ function qsm_options_styling_tab_content() {
50
  }
51
 
52
  if ( isset( $_GET['quiz_id'] ) ) {
53
- $table_name = $wpdb->prefix . 'mlw_quizzes';
54
- $mlw_quiz_options = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM $table_name WHERE quiz_id=%d LIMIT 1", $quiz_id ) );
55
  }
56
  $registered_templates = $mlwQuizMasterNext->pluginHelper->get_quiz_templates();
57
  ?>
39
  $quiz_style = sanitize_textarea_field( htmlspecialchars( stripslashes( $_POST['quiz_css'] ), ENT_QUOTES ) );
40
 
41
  // Saves the new css.
42
+ $results = $wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->prefix}mlw_quizzes SET quiz_stye=%s, theme_selected=%s, last_activity=%s WHERE quiz_id=%d", $quiz_style, $quiz_theme, date( 'Y-m-d H:i:s' ), $style_quiz_id ) );
43
  if ( false !== $results ) {
44
  $mlwQuizMasterNext->alertManager->newAlert( __( 'The style has been saved successfully.', 'quiz-master-next' ), 'success' );
45
  $mlwQuizMasterNext->audit_manager->new_audit( "Styles Have Been Saved For Quiz Number $style_quiz_id" );
50
  }
51
 
52
  if ( isset( $_GET['quiz_id'] ) ) {
53
+ $mlw_quiz_options = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d LIMIT 1", $quiz_id ) );
 
54
  }
55
  $registered_templates = $mlwQuizMasterNext->pluginHelper->get_quiz_templates();
56
  ?>
php/admin/quiz-options-page.php CHANGED
@@ -27,8 +27,9 @@ function qsm_generate_quiz_options() {
27
  //Check user capability
28
  $user = wp_get_current_user();
29
  if ( in_array( 'author', (array) $user->roles ) ) {
30
- $quiz_id = isset( $_GET['quiz_id'] ) ? intval( $_GET['quiz_id'] ) : 0;
31
- $quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user->ID ) );
 
32
  if(!$quiz_author_id){
33
  wp_die('You are not allow to edit this quiz, You need higher permission!');
34
  }
@@ -122,21 +123,23 @@ function qsm_generate_quiz_options() {
122
  <?php echo $quiz_name; ?>
123
  <?php
124
  if( $post_status == 'draft' ){ ?>
125
- <form method="POST" action="" style="display: inline-block; margin-left: 10px;">
126
  <?php wp_nonce_field( 'qsm_update_quiz_status','qsm_update_quiz_status_nonce' ); ?>
127
  <input type="hidden" name="quiz_post_id" value="<?php echo $post_id; ?>" />
128
- <input type="submit" class="button button-default" value="<?php _e('Publish Quiz', 'quiz-master-next'); ?>" />
129
  </form>
130
  <?php
131
  }
132
- ?>
133
- <a class="qsm-view-preview-btn" target="_blank" href="<?php echo $post_permalink; ?>">
134
- <span class="dashicons dashicons-external"></span>
 
 
 
135
  </a>
136
  <a class="button button-default qsm-btn-quiz-edit" href="<?php echo $edit_link; ?>">
137
- <span class="dashicons dashicons-admin-settings"></span> <?php _e('Post Settings', 'quiz-master-next'); ?>
138
  </a>
139
- <a href="#" class="edit-quiz-name button button-primary">Edit Name</a>
140
  </h1>
141
  <?php
142
  // Puts all output from tab into ob_get_contents below.
27
  //Check user capability
28
  $user = wp_get_current_user();
29
  if ( in_array( 'author', (array) $user->roles ) ) {
30
+ $user_id = sanitize_text_field($user->ID);
31
+ $quiz_id = isset( $_GET['quiz_id'] ) ? intval($_GET['quiz_id']) : 0;
32
+ $quiz_author_id = $wpdb->get_var( $wpdb->prepare( "SELECT quiz_author_id FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id=%d AND quiz_author_id=%d LIMIT 1", $quiz_id, $user_id) );
33
  if(!$quiz_author_id){
34
  wp_die('You are not allow to edit this quiz, You need higher permission!');
35
  }
123
  <?php echo $quiz_name; ?>
124
  <?php
125
  if( $post_status == 'draft' ){ ?>
126
+ <form method="POST" action="" style="display: inline-block; margin-right: 10px;float:right;">
127
  <?php wp_nonce_field( 'qsm_update_quiz_status','qsm_update_quiz_status_nonce' ); ?>
128
  <input type="hidden" name="quiz_post_id" value="<?php echo $post_id; ?>" />
129
+ <input type="submit" class="button button-primary" value="<?php _e('Publish Quiz', 'quiz-master-next'); ?>" />
130
  </form>
131
  <?php
132
  }
133
+ ?>
134
+ <a href="#" title="Edit Name" class="edit-quiz-name">
135
+ <span class="dashicons dashicons-edit"></span>
136
+ </a>
137
+ <a class="button button-default qsm-btn-quiz-edit" rel="noopener" target="_blank" href="<?php echo $post_permalink; ?>">
138
+ <span class="dashicons dashicons-welcome-view-site"></span>
139
  </a>
140
  <a class="button button-default qsm-btn-quiz-edit" href="<?php echo $edit_link; ?>">
141
+ <span class="dashicons dashicons-admin-settings"></span>
142
  </a>
 
143
  </h1>
144
  <?php
145
  // Puts all output from tab into ob_get_contents below.
php/admin/quizzes-page.php CHANGED
@@ -88,7 +88,7 @@ function qsm_generate_quizzes_surveys_page() {
88
  $where = '';
89
  $search = '';
90
  if (isset($_REQUEST['s']) && $_REQUEST['s'] != '') {
91
- $search = $_REQUEST['s'];
92
  $where = " quiz_name LIKE '%$search%'";
93
  }
94
 
@@ -121,7 +121,7 @@ function qsm_generate_quizzes_surveys_page() {
121
  }
122
  /*Set Request To Post as form method is Post.(AA)*/
123
  if (isset($_POST['btnSearchQuiz']) && $_POST['s'] != '') {
124
- $search = $_POST['s'];
125
  $condition = " WHERE deleted=0 AND quiz_name LIKE '%$search%'";
126
  $qry = stripslashes( $wpdb->prepare( "SELECT COUNT('quiz_id') FROM {$wpdb->prefix}mlw_quizzes%1s", $condition ) );
127
  $total = $wpdb->get_var($qry);
@@ -167,7 +167,7 @@ function qsm_generate_quizzes_surveys_page() {
167
  }
168
  /*Written to get results form search.(AA)*/
169
  if (isset($_POST['btnSearchQuiz']) && $_POST['s'] != '') {
170
- $search_quiz = $_POST['s'];
171
  $condition = " WHERE quiz_name LIKE '%$search_quiz%'";
172
  $qry = stripslashes( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_quizzes%1s", $condition) );
173
  $quizzes = $wpdb->get_results($qry );
@@ -266,7 +266,7 @@ function qsm_generate_quizzes_surveys_page() {
266
  <p class="search-box">
267
  <label class="screen-reader-text" for="quiz_search"><?php esc_html_e('Search', 'quiz-master-next'); ?></label>
268
  <!-- Changed Request to Post -->
269
- <input type="search" id="quiz_search" name="s" value="<?php echo isset($_POST['s']) && $_POST['s'] != '' ? $_POST['s'] : ''; ?>">
270
  <input id="search-submit" class="button" type="submit" name="btnSearchQuiz" value="Search Quiz">
271
  <?php if (class_exists('QSM_Export_Import')) { ?>
272
  <a class="button button-primary" href="<?php echo admin_url() . 'admin.php?page=qmn_addons&tab=export-and-import'; ?>" target="_blank"><?php _e('Import & Export', 'quiz-master-next'); ?></a>
@@ -340,8 +340,8 @@ function qsm_generate_quizzes_surveys_page() {
340
  <td class="manage-column column-cb check-column" id="cb"><input type="checkbox" name="delete-all-shortcodes-1" id="delete-all-shortcodes-1" value="0"></td>
341
  <th class="<?php echo $orderby_class; ?>">
342
  <?php
343
- $paged_slug = isset($_GET['paged']) && $_GET['paged'] != '' ? '&paged=' . $_GET['paged'] : '';
344
- $searched_slug = isset($_GET['s']) && $_GET['s'] != '&s=' ? $_GET['s'] : '';
345
  $sorting_url = '?page=mlw_quiz_list' . $paged_slug . $searched_slug;
346
  ?>
347
  <a href="<?php echo $sorting_url . $orderby_slug; ?>">
88
  $where = '';
89
  $search = '';
90
  if (isset($_REQUEST['s']) && $_REQUEST['s'] != '') {
91
+ $search = htmlspecialchars($_REQUEST['s'],ENT_QUOTES) ;
92
  $where = " quiz_name LIKE '%$search%'";
93
  }
94
 
121
  }
122
  /*Set Request To Post as form method is Post.(AA)*/
123
  if (isset($_POST['btnSearchQuiz']) && $_POST['s'] != '') {
124
+ $search = htmlspecialchars($_POST['s'] ,ENT_QUOTES) ;
125
  $condition = " WHERE deleted=0 AND quiz_name LIKE '%$search%'";
126
  $qry = stripslashes( $wpdb->prepare( "SELECT COUNT('quiz_id') FROM {$wpdb->prefix}mlw_quizzes%1s", $condition ) );
127
  $total = $wpdb->get_var($qry);
167
  }
168
  /*Written to get results form search.(AA)*/
169
  if (isset($_POST['btnSearchQuiz']) && $_POST['s'] != '') {
170
+ $search_quiz = htmlspecialchars($_POST['s'], ENT_QUOTES) ;
171
  $condition = " WHERE quiz_name LIKE '%$search_quiz%'";
172
  $qry = stripslashes( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_quizzes%1s", $condition) );
173
  $quizzes = $wpdb->get_results($qry );
266
  <p class="search-box">
267
  <label class="screen-reader-text" for="quiz_search"><?php esc_html_e('Search', 'quiz-master-next'); ?></label>
268
  <!-- Changed Request to Post -->
269
+ <input type="search" id="quiz_search" name="s" value="<?php echo isset($_POST['s']) && $_POST['s'] != '' ? htmlspecialchars($_POST['s'], ENT_QUOTES) : ''; ?>">
270
  <input id="search-submit" class="button" type="submit" name="btnSearchQuiz" value="Search Quiz">
271
  <?php if (class_exists('QSM_Export_Import')) { ?>
272
  <a class="button button-primary" href="<?php echo admin_url() . 'admin.php?page=qmn_addons&tab=export-and-import'; ?>" target="_blank"><?php _e('Import & Export', 'quiz-master-next'); ?></a>
340
  <td class="manage-column column-cb check-column" id="cb"><input type="checkbox" name="delete-all-shortcodes-1" id="delete-all-shortcodes-1" value="0"></td>
341
  <th class="<?php echo $orderby_class; ?>">
342
  <?php
343
+ $paged_slug = isset($_GET['paged']) && $_GET['paged'] != '' ? '&paged='.esc_attr($_GET['paged']) : '';
344
+ $searched_slug = isset($_GET['s']) && $_GET['s'] != ''? '&s='.esc_attr($_GET['s']) : '';
345
  $sorting_url = '?page=mlw_quiz_list' . $paged_slug . $searched_slug;
346
  ?>
347
  <a href="<?php echo $sorting_url . $orderby_slug; ?>">
php/classes/class-qmn-plugin-helper.php CHANGED
@@ -144,7 +144,7 @@ class QMNPluginHelper {
144
  }
145
 
146
  // Should we include deleted?
147
- $delete = "WHERE deleted='0'";
148
  if( $where != '' ){
149
  $delete = $delete . ' AND ' . $where;
150
  }
144
  }
145
 
146
  // Should we include deleted?
147
+ $delete = "WHERE deleted=0";
148
  if( $where != '' ){
149
  $delete = $delete . ' AND ' . $where;
150
  }
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -236,7 +236,7 @@ class QMNQuizManager {
236
  wp_enqueue_style('dashicons');
237
  wp_enqueue_script( 'jquery' );
238
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
239
- $result_unique_id = $_GET['result_id'];
240
  $query = $wpdb->prepare("SELECT result_id FROM {$wpdb->prefix}mlw_results WHERE unique_id = %s",$result_unique_id);
241
  $result = $wpdb->get_row($query,ARRAY_A);
242
  if( !empty($result) && isset($result['result_id']) ){
@@ -366,7 +366,7 @@ class QMNQuizManager {
366
  }
367
  if( $id && is_numeric($id) ){
368
  global $wpdb;
369
- $result_data = $wpdb->get_row("SELECT * FROM {$wpdb->prefix}mlw_results WHERE result_id = {$id}", ARRAY_A);
370
  if( $result_data ){
371
  $quiz_result = unserialize($result_data['quiz_results']);
372
  $response_data = array(
@@ -457,7 +457,8 @@ class QMNQuizManager {
457
  }
458
  $question_ids = apply_filters('qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options);
459
  $question_sql = implode(', ', $question_ids);
460
- $questions = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN (%1s) %2s %3s %4s", $question_sql, $cat_query, $order_by_sql, $limit_sql ));
 
461
 
462
  // If we are not using randomization, we need to put the questions in the order of the new question editor.
463
  // If a user has saved the pages in the question editor but still uses the older pagination options
@@ -480,7 +481,7 @@ class QMNQuizManager {
480
  $qids = implode(', ', $question_ids);
481
  $question_sql = " AND question_id IN ({$qids}) ";
482
  }
483
- $questions = $wpdb->get_results($wpdb->prepare("SELECT * FROM " . $wpdb->prefix . "mlw_questions WHERE quiz_id=%d AND deleted=0 {%1s} {%2s} {%3s} {%4s}", $quiz_id, $question_sql, $question_sql, $order_by_sql, $limit_sql));
484
  }
485
  $questions = apply_filters('qsm_load_questions_filter', $questions, $quiz_id, $quiz_options);
486
  // Returns an array of all the loaded questions.
@@ -2141,9 +2142,9 @@ function qmn_total_user_tries_check($display, $qmn_quiz_options, $qmn_array_for_
2141
  // Checks if the user is logged in. If so, check by user id. If not, check by IP.
2142
  if (is_user_logged_in()) {
2143
  $current_user = wp_get_current_user();
2144
- $mlw_qmn_user_try_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE user=%d AND deleted='0' AND quiz_id=%d", $current_user->ID, $qmn_array_for_variables['quiz_id']));
2145
  } else {
2146
- $mlw_qmn_user_try_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM " . $wpdb->prefix . "mlw_results WHERE user_ip='%s' AND deleted='0' AND quiz_id=%d", $qmn_array_for_variables['user_ip'], $qmn_array_for_variables['quiz_id']));
2147
  }
2148
 
2149
  // If user has already reached the limit for this quiz
@@ -2165,7 +2166,7 @@ function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_varia
2165
  global $qmn_allowed_visit;
2166
  if ($qmn_quiz_options->limit_total_entries != 0) {
2167
  global $wpdb;
2168
- $mlw_qmn_entries_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(quiz_id) FROM " . $wpdb->prefix . "mlw_results WHERE deleted='0' AND quiz_id=%d", $qmn_array_for_variables['quiz_id']));
2169
  if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries) {
2170
  $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->limit_total_entries_text, ENT_QUOTES));
2171
  $mlw_message = apply_filters('mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
236
  wp_enqueue_style('dashicons');
237
  wp_enqueue_script( 'jquery' );
238
  wp_enqueue_script( 'math_jax', '//cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML' );
239
+ $result_unique_id =sanitize_text_field($_GET['result_id']);
240
  $query = $wpdb->prepare("SELECT result_id FROM {$wpdb->prefix}mlw_results WHERE unique_id = %s",$result_unique_id);
241
  $result = $wpdb->get_row($query,ARRAY_A);
242
  if( !empty($result) && isset($result['result_id']) ){
366
  }
367
  if( $id && is_numeric($id) ){
368
  global $wpdb;
369
+ $result_data = $wpdb->get_row($wpdb->prepare("SELECT * FROM {$wpdb->prefix}mlw_results WHERE result_id = %d", $id), ARRAY_A);
370
  if( $result_data ){
371
  $quiz_result = unserialize($result_data['quiz_results']);
372
  $response_data = array(
457
  }
458
  $question_ids = apply_filters('qsm_load_questions_ids', $question_ids, $quiz_id, $quiz_options);
459
  $question_sql = implode(', ', $question_ids);
460
+ $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN (%1s) %2s %3s %4s", $question_sql, $cat_query, $order_by_sql, $limit_sql );
461
+ $questions = $wpdb->get_results( stripslashes($query));
462
 
463
  // If we are not using randomization, we need to put the questions in the order of the new question editor.
464
  // If a user has saved the pages in the question editor but still uses the older pagination options
481
  $qids = implode(', ', $question_ids);
482
  $question_sql = " AND question_id IN ({$qids}) ";
483
  }
484
+ $questions = $wpdb->get_results($wpdb->prepare("SELECT * FROM {$wpdb->prefix}mlw_questions WHERE quiz_id=%d AND deleted=0 {%1s} {%2s} {%3s} {%4s}", $quiz_id, $question_sql, $question_sql, $order_by_sql, $limit_sql));
485
  }
486
  $questions = apply_filters('qsm_load_questions_filter', $questions, $quiz_id, $quiz_options);
487
  // Returns an array of all the loaded questions.
2142
  // Checks if the user is logged in. If so, check by user id. If not, check by IP.
2143
  if (is_user_logged_in()) {
2144
  $current_user = wp_get_current_user();
2145
+ $mlw_qmn_user_try_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results WHERE user=%d AND deleted=0 AND quiz_id=%d", $current_user->ID, $qmn_array_for_variables['quiz_id']));
2146
  } else {
2147
+ $mlw_qmn_user_try_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(*) FROM {$wpdb->prefix}mlw_results WHERE user_ip=%s AND deleted=0 AND quiz_id=%d", $qmn_array_for_variables['user_ip'], $qmn_array_for_variables['quiz_id']));
2148
  }
2149
 
2150
  // If user has already reached the limit for this quiz
2166
  global $qmn_allowed_visit;
2167
  if ($qmn_quiz_options->limit_total_entries != 0) {
2168
  global $wpdb;
2169
+ $mlw_qmn_entries_count = $wpdb->get_var($wpdb->prepare("SELECT COUNT(quiz_id) FROM {$wpdb->prefix}mlw_results WHERE deleted=0 AND quiz_id=%d", $qmn_array_for_variables['quiz_id']));
2170
  if ($mlw_qmn_entries_count >= $qmn_quiz_options->limit_total_entries) {
2171
  $mlw_message = wpautop(htmlspecialchars_decode($qmn_quiz_options->limit_total_entries_text, ENT_QUOTES));
2172
  $mlw_message = apply_filters('mlw_qmn_template_variable_quiz_page', $mlw_message, $qmn_array_for_variables);
php/classes/class-qsm-questions.php CHANGED
@@ -79,7 +79,7 @@ class QSM_Questions {
79
  $question_sql = implode( ', ', $question_ids );
80
 
81
  // Get all questions.
82
- $question_array = $wpdb->get_results( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN ($question_sql)", 'ARRAY_A' );
83
 
84
  // Loop through questions and prepare serialized data.
85
  foreach ( $question_array as $question ) {
79
  $question_sql = implode( ', ', $question_ids );
80
 
81
  // Get all questions.
82
+ $question_array = $wpdb->get_results( $wpdb->prepare("SELECT * FROM {$wpdb->prefix}mlw_questions WHERE question_id IN (%1s)",$question_sql), 'ARRAY_A' );
83
 
84
  // Loop through questions and prepare serialized data.
85
  foreach ( $question_array as $question ) {
php/gdpr.php CHANGED
@@ -91,19 +91,27 @@ function qsm_data_exporter( $email, $page = 1 ) {
91
  $group_label = __( 'Form Responses', 'quiz-master-next' );
92
 
93
  // Prepare SQL for finding by user.
94
- $user_sql = '';
95
  if ( $user && isset( $user->ID ) && 0 !== $user->ID ) {
96
- $user_sql = "user = {$user->ID} OR ";
 
 
 
97
  }
98
 
99
  // Calculate query range.
100
- $total = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE %1s email = '%2s'", $user_sql, $email ) );
101
  $per_page = 25;
102
  $begin = $per_page * ( $page - 1 );
103
  $remaining = $total - ( $page * $per_page );
104
 
105
  // Get the results.
106
- $results = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE %1s email = '%2s' ORDER BY result_id DESC LIMIT %d, %d", $user_sql, $email, $begin, $per_page ) );
 
 
 
 
 
107
 
108
  // Cycle through adding to array.
109
  foreach ( $results as $result ) {
91
  $group_label = __( 'Form Responses', 'quiz-master-next' );
92
 
93
  // Prepare SQL for finding by user.
94
+ $user_id = 0;
95
  if ( $user && isset( $user->ID ) && 0 !== $user->ID ) {
96
+ $user_id = $user->ID;
97
+ $query = $wpdb->prepare( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE user = %d OR email = %s", $user_id, $email );
98
+ } else {
99
+ $query = $wpdb->prepare( "SELECT COUNT(result_id) FROM {$wpdb->prefix}mlw_results WHERE email = %s", $email );
100
  }
101
 
102
  // Calculate query range.
103
+ $total = $wpdb->get_var( $query );
104
  $per_page = 25;
105
  $begin = $per_page * ( $page - 1 );
106
  $remaining = $total - ( $page * $per_page );
107
 
108
  // Get the results.
109
+ if(0 !== $user_id){
110
+ $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE user = %d OR email = %s ORDER BY result_id DESC LIMIT %d, %d", $user_id, $email, $begin, $per_page );
111
+ } else {
112
+ $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE email = %s ORDER BY result_id DESC LIMIT %d, %d", $email, $begin, $per_page );
113
+ }
114
+ $results = $wpdb->get_results( $query );
115
 
116
  // Cycle through adding to array.
117
  foreach ( $results as $result ) {
php/question-types.php CHANGED
@@ -708,15 +708,15 @@ function qmn_large_open_review( $id, $question, $answers ) {
708
  );
709
  if ( isset( $_POST[ 'question' . $id ] ) ) {
710
  $decode_user_answer = sanitize_textarea_field( strval( stripslashes( htmlspecialchars_decode( $_POST[ 'question' . $id ], ENT_QUOTES ) ) ) );
711
- $mlw_user_answer = trim( $decode_user_answer );
712
  } else {
713
  $mlw_user_answer = ' ';
714
  }
715
- $return_array['user_text'] = $mlw_user_answer;
716
  foreach ( $answers as $answer ) {
717
- $decode_correct_text = strval( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) );
718
- $return_array['correct_text'] = trim( $decode_correct_text );
719
- if ( mb_strtoupper( $return_array['user_text'] ) == mb_strtoupper( $return_array['correct_text'] ) ) {
720
  $return_array['correct'] = 'correct';
721
  $return_array['points'] = $answer[1];
722
  break;
708
  );
709
  if ( isset( $_POST[ 'question' . $id ] ) ) {
710
  $decode_user_answer = sanitize_textarea_field( strval( stripslashes( htmlspecialchars_decode( $_POST[ 'question' . $id ], ENT_QUOTES ) ) ) );
711
+ $mlw_user_answer = trim(str_replace(' ','',preg_replace('/\s\s+/', '', $decode_user_answer )));
712
  } else {
713
  $mlw_user_answer = ' ';
714
  }
715
+ $return_array['user_text'] = $decode_user_answer;
716
  foreach ( $answers as $answer ) {
717
+ $return_array['correct_text'] = $decode_correct_text = strval( htmlspecialchars_decode( $answer[0], ENT_QUOTES ) );
718
+ $decode_correct_text = trim(str_replace(' ','', preg_replace('/\s\s+/', '', $decode_correct_text )));
719
+ if ( mb_strtoupper( $mlw_user_answer ) == mb_strtoupper( $decode_correct_text ) ) {
720
  $return_array['correct'] = 'correct';
721
  $return_array['points'] = $answer[1];
722
  break;
php/rest-api.php CHANGED
@@ -85,16 +85,20 @@ function qsm_register_rest_routes() {
85
  * @since 6.4.10
86
  * @param WP_REST_Request $request
87
  */
88
- function qsm_rest_get_bank_questions( WP_REST_Request $request ){
89
- if(is_user_logged_in()){
90
  global $wpdb;
91
- $category = isset($_REQUEST['category']) ? sanitize_text_field( $_REQUEST['category'] ) : '';
92
- $category_query = '';
93
- if($category){
94
- $category_query = " AND category = '$category'";
95
- }
96
- $total_count_query = $wpdb->get_row( stripslashes( $wpdb->prepare( "SELECT COUNT(question_id) as total_question FROM {$wpdb->prefix}mlw_questions WHERE deleted=0 AND deleted_question_bank=0%1s", $wpdb->esc_like( $category_query ) ) ), 'ARRAY_A' );
 
 
 
97
  $total_count = isset($total_count_query['total_question']) ? $total_count_query['total_question'] : 0;
 
98
  $settings = (array) get_option( 'qmn-settings' );
99
  $limit = 20;
100
  if ( isset( $settings['items_per_page_question_bank'] ) ) {
@@ -102,10 +106,16 @@ function qsm_rest_get_bank_questions( WP_REST_Request $request ){
102
  }
103
  $limit = $limit == '' || $limit == 0 ? 20 : $limit;
104
  $total_pages = ceil($total_count / $limit);
105
- $pageno = isset($_REQUEST['page']) ? $_REQUEST['page'] : 1;
106
  $offset = ($pageno-1) * $limit;
107
- $questions = $wpdb->get_results( stripslashes( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE deleted = 0 AND deleted_question_bank = 0%1s ORDER BY question_order ASC LIMIT %2s, %3s", $wpdb->esc_like( $category_query ), $offset, $limit ) ) , 'ARRAY_A' );
108
- $quiz_table = $wpdb->prefix . 'mlw_quizzes';
 
 
 
 
 
 
109
  $question_array = array();
110
  $question_array['pagination'] = array(
111
  'total_pages' => $total_pages,
@@ -115,8 +125,8 @@ function qsm_rest_get_bank_questions( WP_REST_Request $request ){
115
 
116
  $question_array['questions'] = array();
117
  foreach ( $questions as $question ) {
118
- $quiz_name = $wpdb->get_row( $wpdb->prepare( 'SELECT quiz_name FROM %1s WHERE quiz_id = %d', $quiz_table, $question['quiz_id'] ), ARRAY_A );
119
- $question['page'] = isset( $question['page'] ) ? $question['page'] : 0;
120
 
121
  $answers = maybe_unserialize( $question['answer_array'] );
122
  if ( ! is_array( $answers ) ) {
@@ -160,7 +170,7 @@ function qsm_rest_get_bank_questions( WP_REST_Request $request ){
160
  return array(
161
  'status' => 'error',
162
  'msg' => __('User not logged in', 'quiz-master-next'),
163
- );
164
  }
165
  }
166
 
@@ -412,11 +422,10 @@ function qsm_rest_get_questions( WP_REST_Request $request ) {
412
  } else {
413
  $questions = QSM_Questions::load_questions( 0 );
414
  }
415
- global $wpdb;
416
- $quiz_table = $wpdb->prefix . 'mlw_quizzes';
417
  $question_array = array();
418
  foreach ( $questions as $question ) {
419
- $quiz_name = $wpdb->get_row( $wpdb->prepare( 'SELECT quiz_name FROM %1s WHERE quiz_id = %d', $quiz_table, $question['quiz_id'] ), ARRAY_A );
420
  $question['page'] = isset( $question['page'] ) ? $question['page'] : 0;
421
  $question_data = array(
422
  'id' => $question['question_id'],
85
  * @since 6.4.10
86
  * @param WP_REST_Request $request
87
  */
88
+ function qsm_rest_get_bank_questions( WP_REST_Request $request ) {
89
+ if (is_user_logged_in()) {
90
  global $wpdb;
91
+ $category = isset($_REQUEST['category']) ? sanitize_text_field($_REQUEST['category']) : '';
92
+
93
+ if (!empty($category)) {
94
+ $query = $wpdb->prepare( "SELECT COUNT(question_id) as total_question FROM {$wpdb->prefix}mlw_questions WHERE deleted=0 AND deleted_question_bank=0 AND category=%s", $category );
95
+ } else {
96
+ $query = "SELECT COUNT(question_id) as total_question FROM {$wpdb->prefix}mlw_questions WHERE deleted=0 AND deleted_question_bank=0";
97
+ }
98
+
99
+ $total_count_query = $wpdb->get_row( $query, 'ARRAY_A' );
100
  $total_count = isset($total_count_query['total_question']) ? $total_count_query['total_question'] : 0;
101
+
102
  $settings = (array) get_option( 'qmn-settings' );
103
  $limit = 20;
104
  if ( isset( $settings['items_per_page_question_bank'] ) ) {
106
  }
107
  $limit = $limit == '' || $limit == 0 ? 20 : $limit;
108
  $total_pages = ceil($total_count / $limit);
109
+ $pageno = isset($_REQUEST['page']) ? (int) $_REQUEST['page'] : 1;
110
  $offset = ($pageno-1) * $limit;
111
+
112
+ if (!empty($category)) {
113
+ $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE deleted = 0 AND deleted_question_bank = 0 AND category = %s ORDER BY question_order ASC LIMIT %d, %d", $category, $offset, $limit );
114
+ } else {
115
+ $query = $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_questions WHERE deleted = 0 AND deleted_question_bank = 0 ORDER BY question_order ASC LIMIT %d, %d", $offset, $limit );
116
+ }
117
+
118
+ $questions = $wpdb->get_results( $query, 'ARRAY_A' );
119
  $question_array = array();
120
  $question_array['pagination'] = array(
121
  'total_pages' => $total_pages,
125
 
126
  $question_array['questions'] = array();
127
  foreach ( $questions as $question ) {
128
+ $quiz_name = $wpdb->get_row( $wpdb->prepare( "SELECT quiz_name FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id = %d", $question['quiz_id'] ), ARRAY_A );
129
+ $question['page'] = isset( $question['page'] ) ? (int) $question['page'] : 0;
130
 
131
  $answers = maybe_unserialize( $question['answer_array'] );
132
  if ( ! is_array( $answers ) ) {
170
  return array(
171
  'status' => 'error',
172
  'msg' => __('User not logged in', 'quiz-master-next'),
173
+ );
174
  }
175
  }
176
 
422
  } else {
423
  $questions = QSM_Questions::load_questions( 0 );
424
  }
425
+ global $wpdb;
 
426
  $question_array = array();
427
  foreach ( $questions as $question ) {
428
+ $quiz_name = $wpdb->get_row( $wpdb->prepare( "SELECT quiz_name FROM {$wpdb->prefix}mlw_quizzes WHERE quiz_id = %d", $question['quiz_id'] ), ARRAY_A );
429
  $question['page'] = isset( $question['page'] ) ? $question['page'] : 0;
430
  $question_data = array(
431
  'id' => $question['question_id'],
php/shortcodes.php CHANGED
@@ -53,9 +53,7 @@ function qsm_display_recent_quizzes($attrs) {
53
  global $wpdb;
54
  wp_enqueue_style('quizzes-list', plugins_url('../css/quizzes-list.css', __FILE__));
55
 
56
- $quiz_tbl = $wpdb->prefix . 'mlw_quizzes';
57
-
58
- $query = "SELECT quiz_id, quiz_name, quiz_settings FROM $quiz_tbl WHERE deleted=0 ORDER BY quiz_id DESC";
59
  $quizzes = $wpdb->get_results($query);
60
  $result = '<div class="outer-con">';
61
  $i = 0;
@@ -120,7 +118,7 @@ function qsm_generate_fb_header_metadata() {
120
  }
121
  global $mlwQuizMasterNext, $wpdb, $wp_query;
122
  $result_id = sanitize_text_field($_GET['result_id']);
123
- $results_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE unique_id = '%s'", $result_id ) );
124
  if ($results_data) {
125
  // Prepare responses array.
126
  if (is_serialized($results_data->quiz_results) && is_array(@unserialize($results_data->quiz_results))) {
53
  global $wpdb;
54
  wp_enqueue_style('quizzes-list', plugins_url('../css/quizzes-list.css', __FILE__));
55
 
56
+ $query = "SELECT quiz_id, quiz_name, quiz_settings FROM {$wpdb->prefix}mlw_quizzes WHERE deleted=0 ORDER BY quiz_id DESC";
 
 
57
  $quizzes = $wpdb->get_results($query);
58
  $result = '<div class="outer-con">';
59
  $i = 0;
118
  }
119
  global $mlwQuizMasterNext, $wpdb, $wp_query;
120
  $result_id = sanitize_text_field($_GET['result_id']);
121
+ $results_data = $wpdb->get_row( $wpdb->prepare( "SELECT * FROM {$wpdb->prefix}mlw_results WHERE unique_id = %s", $result_id ) );
122
  if ($results_data) {
123
  // Prepare responses array.
124
  if (is_serialized($results_data->quiz_results) && is_array(@unserialize($results_data->quiz_results))) {
php/template-variables.php CHANGED
@@ -169,14 +169,12 @@ function qsm_variable_poll_result($content, $mlw_quiz_array, $variables){
169
  return $content;
170
  }
171
  global $wpdb;
172
- $table_name = $wpdb->prefix . 'mlw_results';
173
- $table_question = $wpdb->prefix . 'mlw_questions';
174
- $total_query = $wpdb->get_row( $wpdb->prepare( "SELECT count(*) AS total_count FROM {$table_name} WHERE quiz_id = %d", $quiz_id ),ARRAY_A);
175
  $total_result = $total_query['total_count'];
176
- $ser_answer = $wpdb->get_row( $wpdb->prepare( "'SELECT answer_array FROM {$table_question} WHERE question_id = %d", $question_id ) ,ARRAY_A);
177
  $ser_answer_arry = unserialize($ser_answer['answer_array']);
178
  $ser_answer_arry_change = array_filter(array_merge(array(0), $ser_answer_arry));
179
- $total_quiz_results = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_results FROM {$table_name} WHERE quiz_id = %d", $quiz_id ) ,ARRAY_A);
180
  $answer_array = array();
181
  if($total_quiz_results){
182
  foreach ($total_quiz_results as $key => $value) {
@@ -265,8 +263,7 @@ function mlw_qmn_variable_social_share($content, $mlw_quiz_array) {
265
  function qsm_variable_result_id( $content, $mlw_quiz_array ) {
266
  while ( false !== strpos($content, '%RESULT_ID%') ) {
267
  global $wpdb;
268
- $table_name = $wpdb->prefix . 'mlw_results';
269
- $get_last_id = $wpdb->get_row("SELECT result_id FROM $table_name ORDER BY result_id DESC",ARRAY_A);
270
  $content = str_replace( "%RESULT_ID%" , $get_last_id['result_id'], $content);
271
  }
272
  return $content;
@@ -347,7 +344,7 @@ function mlw_qmn_variable_quiz_links($content, $mlw_quiz_array) {
347
  if (false !== strpos($content, '%RESULT_LINK%')) {
348
  $result_link = $quiz_link;
349
  if (isset($mlw_quiz_array['result_id'])) {
350
- $unique_id = $wpdb->get_var( $wpdb->prepare( "SELECT `unique_id` FROM `{$wpdb->prefix}mlw_results` WHERE `quiz_id`='{%1s}' AND `result_id`='{%2s}'", $mlw_quiz_array['quiz_id'], $mlw_quiz_array['result_id'] ) );
351
  $result_link = add_query_arg('result_id', $unique_id, $quiz_link);
352
  }
353
  $content = str_replace("%RESULT_LINK%", $result_link, $content);
@@ -777,8 +774,8 @@ function qsm_end_results_rank($result_display, $qmn_quiz_options, $qmn_array_for
777
  while (strpos($result_display, '%RANK%') !== false){
778
  global $wpdb;
779
  $mlw_quiz_id = $qmn_array_for_variables['quiz_id'];
780
- $mlw_result_id = $wpdb->get_var( $wpdb->prepare( "SELECT MAX(`result_id`) FROM `{$wpdb->prefix}mlw_results` WHERE `quiz_id`='%d' AND `deleted`='0'", $mlw_quiz_id ) );
781
- $mlw_result_data = $wpdb->get_results( $wpdb->prepare( "SELECT `result_id`, `correct_score`, `point_score`, `quiz_results` FROM `{$wpdb->prefix}mlw_results` WHERE `quiz_id`='%d' AND `deleted`='0'", $mlw_quiz_id ) );
782
  if (!empty($mlw_result_data)) {
783
  foreach ($mlw_result_data as $key => $mlw_eaches) {
784
  $time_taken = 0;
@@ -921,9 +918,17 @@ function qsm_questions_answers_shortcode_to_text($mlw_quiz_array, $qmn_question_
921
  foreach ($total_answers as $single_answer) {
922
  $current_answer_zero = trim( htmlspecialchars_decode($single_answer[0], ENT_QUOTES) );
923
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
924
- if (isset($single_answer[2]) && $single_answer[2] == 1 && strcasecmp( htmlspecialchars_decode($answer[1], ENT_QUOTES), $current_answer_zero ) == 0 ) {
925
- $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($answer[1], ENT_QUOTES) . '</span>';
926
- $do_show_wrong = false;
 
 
 
 
 
 
 
 
927
  }
928
  } else {
929
  if ( isset($single_answer[2]) && strcasecmp( htmlspecialchars_decode($answer[1], ENT_QUOTES), $current_answer_zero ) == 0 ) {
@@ -1206,11 +1211,6 @@ function qmn_polar_display_on_resultspage($id, $question, $answers,$answer) {
1206
  $left_polar_title_style = "style='font-weight:900;'";
1207
  $right_polar_title_style = "style='font-weight:100';";
1208
  }
1209
- else if($answer['points'] == $answers[0][1])
1210
- {
1211
- $left_polar_title_style = "style='font-weight:100;'";
1212
- $right_polar_title_style = "style='font-weight:900;'";
1213
- }
1214
  else if($answer['points'] == $check_point / 2)
1215
  {
1216
  $left_polar_title_style = "style='font-weight:400;'";
169
  return $content;
170
  }
171
  global $wpdb;
172
+ $total_query = $wpdb->get_row( $wpdb->prepare( "SELECT count(*) AS total_count FROM {$wpdb->prefix}mlw_results WHERE quiz_id = %d", $quiz_id ),ARRAY_A);
 
 
173
  $total_result = $total_query['total_count'];
174
+ $ser_answer = $wpdb->get_row( $wpdb->prepare( "SELECT answer_array FROM {$wpdb->prefix}mlw_questions WHERE question_id = %d", $question_id ) ,ARRAY_A);
175
  $ser_answer_arry = unserialize($ser_answer['answer_array']);
176
  $ser_answer_arry_change = array_filter(array_merge(array(0), $ser_answer_arry));
177
+ $total_quiz_results = $wpdb->get_results( $wpdb->prepare( "SELECT quiz_results FROM {$wpdb->prefix}mlw_results WHERE quiz_id = %d", $quiz_id ) ,ARRAY_A);
178
  $answer_array = array();
179
  if($total_quiz_results){
180
  foreach ($total_quiz_results as $key => $value) {
263
  function qsm_variable_result_id( $content, $mlw_quiz_array ) {
264
  while ( false !== strpos($content, '%RESULT_ID%') ) {
265
  global $wpdb;
266
+ $get_last_id = $wpdb->get_row("SELECT result_id FROM {$wpdb->prefix}mlw_results ORDER BY result_id DESC",ARRAY_A);
 
267
  $content = str_replace( "%RESULT_ID%" , $get_last_id['result_id'], $content);
268
  }
269
  return $content;
344
  if (false !== strpos($content, '%RESULT_LINK%')) {
345
  $result_link = $quiz_link;
346
  if (isset($mlw_quiz_array['result_id'])) {
347
+ $unique_id = $wpdb->get_var( $wpdb->prepare( "SELECT unique_id FROM {$wpdb->prefix}mlw_results WHERE quiz_id=%d AND result_id=%d", $mlw_quiz_array['quiz_id'], $mlw_quiz_array['result_id'] ) );
348
  $result_link = add_query_arg('result_id', $unique_id, $quiz_link);
349
  }
350
  $content = str_replace("%RESULT_LINK%", $result_link, $content);
774
  while (strpos($result_display, '%RANK%') !== false){
775
  global $wpdb;
776
  $mlw_quiz_id = $qmn_array_for_variables['quiz_id'];
777
+ $mlw_result_id = $wpdb->get_var( $wpdb->prepare( "SELECT MAX(result_id) FROM {$wpdb->prefix}mlw_results WHERE quiz_id=%d AND deleted=0", $mlw_quiz_id ) );
778
+ $mlw_result_data = $wpdb->get_results( $wpdb->prepare( "SELECT result_id, correct_score, point_score, quiz_results FROM {$wpdb->prefix}mlw_results WHERE quiz_id=%d AND deleted=0", $mlw_quiz_id ) );
779
  if (!empty($mlw_result_data)) {
780
  foreach ($mlw_result_data as $key => $mlw_eaches) {
781
  $time_taken = 0;
918
  foreach ($total_answers as $single_answer) {
919
  $current_answer_zero = trim( htmlspecialchars_decode($single_answer[0], ENT_QUOTES) );
920
  if ($form_type == 0 && ( $quiz_system == 0 || $quiz_system == 3 )) {
921
+ if (isset($single_answer[2]) && $single_answer[2] == 1) {
922
+ $actual_answer = htmlspecialchars_decode($answer[1], ENT_QUOTES);
923
+ if($answer['question_type'] == 5){
924
+ $actual_answer = trim(str_replace(' ','', preg_replace('/\s\s+/', '', $actual_answer )));
925
+ $current_answer_zero = trim(str_replace(' ','', preg_replace('/\s\s+/', '', $current_answer_zero )));
926
+ }
927
+
928
+ if(strcasecmp( $actual_answer, $current_answer_zero ) == 0 ) {
929
+ $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($answer[1], ENT_QUOTES) . '</span>';
930
+ $do_show_wrong = false;
931
+ }
932
  }
933
  } else {
934
  if ( isset($single_answer[2]) && strcasecmp( htmlspecialchars_decode($answer[1], ENT_QUOTES), $current_answer_zero ) == 0 ) {
1211
  $left_polar_title_style = "style='font-weight:900;'";
1212
  $right_polar_title_style = "style='font-weight:100';";
1213
  }
 
 
 
 
 
1214
  else if($answer['points'] == $check_point / 2)
1215
  {
1216
  $left_polar_title_style = "style='font-weight:400;'";
readme.txt CHANGED
@@ -4,11 +4,11 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
4
  Requires at least: 4.9
5
  Tested up to: 5.7
6
  Requires PHP: 5.4
7
- Stable tag: 7.1.13
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Create user-friendly and beautiful quizzes and surveys using Wordpress Quiz Plugin. Boost traffic and social shares on your website.
12
 
13
  == Description ==
14
 
@@ -47,7 +47,7 @@ You can assign categories to your questions using our quiz maker plugin. You can
47
  = Countdown Timer =
48
  Add countdown timer to your quizzes and effectively create skills assessment or online exams on your website.
49
 
50
- = Integrations =
51
  You can integrate Mailchimp, Activecampaign, Zapier, Campaign Monitor, Get Response to your quiz or surveys in order to create drip email campaigns and reachout to your audience. Checkout our [integrations](https://quizandsurveymaster.com/downloads/category/integrations/).
52
 
53
  = Other Useful Features =
@@ -68,7 +68,7 @@ You can integrate Mailchimp, Activecampaign, Zapier, Campaign Monitor, Get Respo
68
  * Create and display math formulas
69
  * And **Much** More...
70
 
71
- = [WordPress Quiz Plugin](https://quizandsurveymaster.com/) Addons =
72
  Quiz And Survey Master is fully functional and is packed with tons of features that will meet the needs of most, we do offer various extra features including:
73
 
74
  **Free Add-ons**
@@ -140,6 +140,14 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
140
 
141
  == Changelog ==
142
 
 
 
 
 
 
 
 
 
143
  = 7.1.13 (March 9, 2021) =
144
  * Bug: Fixed several security issues.
145
  * Bug: Fixed the issue of audio and video player not showing in question content
4
  Requires at least: 4.9
5
  Tested up to: 5.7
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.14
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Easily create exams, generate leads, surveys and any type of quiz with our popular WordPress Quiz Plugin. Custom flows, emails and create leaderboard
12
 
13
  == Description ==
14
 
47
  = Countdown Timer =
48
  Add countdown timer to your quizzes and effectively create skills assessment or online exams on your website.
49
 
50
+ = Lead Generation =
51
  You can integrate Mailchimp, Activecampaign, Zapier, Campaign Monitor, Get Response to your quiz or surveys in order to create drip email campaigns and reachout to your audience. Checkout our [integrations](https://quizandsurveymaster.com/downloads/category/integrations/).
52
 
53
  = Other Useful Features =
68
  * Create and display math formulas
69
  * And **Much** More...
70
 
71
+ = QSM Addons =
72
  Quiz And Survey Master is fully functional and is packed with tons of features that will meet the needs of most, we do offer various extra features including:
73
 
74
  **Free Add-ons**
140
 
141
  == Changelog ==
142
 
143
+ = 7.1.14 (March 25, 2021) =
144
+ * Bug: Fixed security and Vulnerability issues.
145
+ * Bug: Fixed the inability to recognize correct answer for Question type Paragraph.
146
+ * Bug: Fixed the issue of question not displaying when randomizing questions by category.
147
+ * Bug: Fixed the issue of [latex] shortcode not working on retake quiz.
148
+ * Enhancement: Added the feature to Unlink questions from quiz.
149
+ * Enhancement: UI improvements for Quiz Editor.
150
+
151
  = 7.1.13 (March 9, 2021) =
152
  * Bug: Fixed several security issues.
153
  * Bug: Fixed the issue of audio and video player not showing in question content