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

Version Description

(June 22, 2020) = * Bug: Fixed validation issue in email with spaces. * Bug: Fixed issues with settings related to number of times a user can take quiz. * Bug: Fixed missing time calculation while retaking quiz. * Bug: Fixed incorrect calculation of %QUESTION_ANSWER_CORRECT% and %QUESTION_ANSWER_INCORRECT% variables. * Bug: Fixed time up popup with advanced timer on retaking quiz. * Bug: Removed irrelevant queries running behind the scene on each admin page. * Bug: Removed duplicate column name database error. * Bug: Removed orphaned plugin settings on its deletion. * Bug: Fixed issues with fill in the blank question type when using polylang. * Enhancement: Added user notification for collecting and storing IP addresses setting. * Bug: Fixed inconsistent polar question type title.

Download this release

Release Info

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

Code changes from version 6.4.11 to 6.4.12

css/common.css CHANGED
@@ -16,11 +16,18 @@
16
  .mlw_qmn_question{
17
  display: block;
18
  }
 
 
 
 
 
19
  .polar-question-title{
20
  margin-bottom: 50px;
21
- font-size: 20px;
22
  line-height: 20px;
23
  }
 
 
24
  .question-type-polar-s{
25
  display: inline-block !important;
26
  position: relative;
16
  .mlw_qmn_question{
17
  display: block;
18
  }
19
+
20
+ .mlw_qmn_question.polar-question-title {
21
+ margin-bottom: 10px;
22
+ }
23
+
24
  .polar-question-title{
25
  margin-bottom: 50px;
26
+ font-size: 16px;
27
  line-height: 20px;
28
  }
29
+
30
+
31
  .question-type-polar-s{
32
  display: inline-block !important;
33
  position: relative;
js/qsm-quiz.js CHANGED
@@ -22,7 +22,7 @@ var QSM;
22
  QSM.initPagination( quizID );
23
  if ( quiz.hasOwnProperty( 'timer_limit' ) && 0 != quiz.timer_limit ) {
24
  QSM.initTimer( quizID );
25
- }
26
  });
27
  }
28
  },
@@ -65,18 +65,17 @@ var QSM;
65
  } else {
66
  QSM.activateTimer( quizID );
67
  $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.stoptimer-p').show();
68
- }
69
  // ...else, we must be using the questions per page option.
70
  } else {
71
  if ( qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page ) {
72
  $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
73
  event.preventDefault();
74
- if(qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')){
75
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
76
-
77
  if( $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.qmn_pagination > .current_page_hidden').val() == start_timer){
78
  QSM.activateTimer( quizID );
79
- $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.stoptimer-p').show();
80
  }
81
  }else{
82
  if ( ! qmn_quiz_data[ quizID ].timerStatus && ( 0 == $( '.quiz_begin:visible' ).length || ( 1 == $( '.quiz_begin:visible' ).length && qmnValidatePage( 'quizForm' + quizID ) ) ) ) {
@@ -431,6 +430,22 @@ var QSM;
431
  // Global Variables
432
  var qsmTitleText = document.title;
433
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
  /**
435
  * Limit multiple response based on question limit
436
  * @returns {undefined}
@@ -493,11 +508,10 @@ function qmnValidation( element, quiz_form_id ) {
493
  qmnResetError( quiz_form_id );
494
  jQuery( element ).each(function(){
495
  if ( jQuery( this ).attr( 'class' )) {
496
- if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) > -1 && this.value !== "" ) {
497
- var x = this.value;
498
- var atpos = x.indexOf('@');
499
- var dotpos = x.lastIndexOf( '.' );
500
- if ( atpos < 1 || dotpos < atpos + 2 || dotpos + 2>= x.length ) {
501
  qmnDisplayError( email_error, jQuery( this ), quiz_form_id );
502
  result = false;
503
  }
@@ -592,12 +606,13 @@ function qmnFormSubmit( quiz_form_id ) {
592
  jQuery( '.mlw_answer_open_text' ).attr( 'disabled', false );
593
 
594
  //Convert serialize data into index array
595
- var unindexed_array = jQuery( '#' + quiz_form_id ).serializeArray();
596
  var fd = new FormData();
597
- jQuery.each(unindexed_array,function(key,input){
598
  fd.append(input.name,input.value);
599
  });
600
  fd.append("action", 'qmn_process_quiz');
 
601
 
602
  qsmEndTimeTakenTimer();
603
  if ( qmn_quiz_data[quiz_id].hasOwnProperty( 'timer_limit' ) ) {
@@ -605,6 +620,7 @@ function qmnFormSubmit( quiz_form_id ) {
605
  }
606
  jQuery( '#' + quiz_form_id + ' input[type=submit]' ).attr( 'disabled', 'disabled' );
607
  qsmDisplayLoading( $container );
 
608
  jQuery.ajax({
609
  url: qmn_ajax_object.ajaxurl,
610
  data: fd,
@@ -968,9 +984,11 @@ jQuery(function() {
968
  }
969
  });
970
 
971
- jQuery( '.qmn_quiz_form' ).on( "submit", function( event ) {
972
- event.preventDefault();
973
- qmnFormSubmit( this.id );
 
 
974
  });
975
 
976
  jQuery(document).on('click','.btn-reload-quiz',function(e){
@@ -987,10 +1005,17 @@ jQuery(function() {
987
  },
988
  success: function (response) {
989
  parent_div.replaceWith(response);
 
 
 
 
 
 
990
  QSM.initPagination( quiz_id );
991
  },
992
  error: function (errorThrown) {
993
- alert(errorThrown);
 
994
  }
995
  });
996
  });
@@ -1107,12 +1132,12 @@ jQuery(function() {
1107
  });
1108
 
1109
  //Submit the form on popup click
1110
- jQuery('.submit-the-form').click(function(e){
1111
  e.preventDefault();
1112
- var quiz_id = jQuery(this).data('quiz_id');
1113
- jQuery('#quizForm' + quiz_id ).submit();
1114
  jQuery('#modal-3').removeClass('is-open');
1115
- });
1116
  });
1117
 
1118
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
22
  QSM.initPagination( quizID );
23
  if ( quiz.hasOwnProperty( 'timer_limit' ) && 0 != quiz.timer_limit ) {
24
  QSM.initTimer( quizID );
25
+ }
26
  });
27
  }
28
  },
65
  } else {
66
  QSM.activateTimer( quizID );
67
  $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.stoptimer-p').show();
68
+ }
69
  // ...else, we must be using the questions per page option.
70
  } else {
71
  if ( qmn_quiz_data[quizID].hasOwnProperty('pagination') && qmn_quiz_data[quizID].first_page ) {
72
  $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.mlw_next' ).on( 'click', function(event) {
73
  event.preventDefault();
74
+ if(qmn_quiz_data[quizID].hasOwnProperty('advanced_timer')){
75
  var start_timer = parseInt(qmn_quiz_data[quizID].advanced_timer.start_timer_page);
 
76
  if( $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.qmn_pagination > .current_page_hidden').val() == start_timer){
77
  QSM.activateTimer( quizID );
78
+ $( '#quizForm' + quizID ).closest( '.qmn_quiz_container' ).find( '.stoptimer-p').show();
79
  }
80
  }else{
81
  if ( ! qmn_quiz_data[ quizID ].timerStatus && ( 0 == $( '.quiz_begin:visible' ).length || ( 1 == $( '.quiz_begin:visible' ).length && qmnValidatePage( 'quizForm' + quizID ) ) ) ) {
430
  // Global Variables
431
  var qsmTitleText = document.title;
432
 
433
+ /**
434
+ * Validates an email ID.
435
+ *
436
+ * @param email The Email Id to validate.
437
+ * @returns Boolean
438
+ */
439
+ function isEmail( email ) {
440
+ var regex = /^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
441
+ if( ! regex.test( email ) ) {
442
+ return false;
443
+ }else{
444
+ return true;
445
+ }
446
+ }
447
+
448
+
449
  /**
450
  * Limit multiple response based on question limit
451
  * @returns {undefined}
508
  qmnResetError( quiz_form_id );
509
  jQuery( element ).each(function(){
510
  if ( jQuery( this ).attr( 'class' )) {
511
+ if( jQuery( this ).attr( 'class' ).indexOf( 'mlwEmail' ) !== -1 && this.value !== "" ) {
512
+ // Remove any trailing and preceeding space.
513
+ var x = jQuery.trim( this.value );
514
+ if ( ! isEmail( x ) ) {
 
515
  qmnDisplayError( email_error, jQuery( this ), quiz_form_id );
516
  result = false;
517
  }
606
  jQuery( '.mlw_answer_open_text' ).attr( 'disabled', false );
607
 
608
  //Convert serialize data into index array
609
+ var unindexed_array = jQuery( '#' + quiz_form_id ).serializeArray();
610
  var fd = new FormData();
611
+ jQuery.each(unindexed_array,function(key,input){
612
  fd.append(input.name,input.value);
613
  });
614
  fd.append("action", 'qmn_process_quiz');
615
+
616
 
617
  qsmEndTimeTakenTimer();
618
  if ( qmn_quiz_data[quiz_id].hasOwnProperty( 'timer_limit' ) ) {
620
  }
621
  jQuery( '#' + quiz_form_id + ' input[type=submit]' ).attr( 'disabled', 'disabled' );
622
  qsmDisplayLoading( $container );
623
+ // console.log( 'submitted data:' + unindexed_array );
624
  jQuery.ajax({
625
  url: qmn_ajax_object.ajaxurl,
626
  data: fd,
984
  }
985
  });
986
 
987
+ // jQuery( '.qmn_quiz_form' ).on( "submit", function( event ) {
988
+ jQuery(document).on( 'click', ".qsm-submit-btn", function( event ) {
989
+ event.preventDefault();
990
+ var form = jQuery(this).closest('form')[0];
991
+ qmnFormSubmit( form.id );
992
  });
993
 
994
  jQuery(document).on('click','.btn-reload-quiz',function(e){
1005
  },
1006
  success: function (response) {
1007
  parent_div.replaceWith(response);
1008
+ // Restart the timer for retake quiz.
1009
+ setInterval( qmnTimeTakenTimer, 1000 );
1010
+
1011
+ // Reset the timer clock on retake quiz.
1012
+ QSM.initTimer( quiz_id );
1013
+
1014
  QSM.initPagination( quiz_id );
1015
  },
1016
  error: function (errorThrown) {
1017
+ console.log( 'error' );
1018
+ alert( );
1019
  }
1020
  });
1021
  });
1132
  });
1133
 
1134
  //Submit the form on popup click
1135
+ jQuery(document).on( 'click', '.submit-the-form', function(e) {
1136
  e.preventDefault();
1137
+ // Triggger the click event on the quiz form's submit button.
1138
+ jQuery( '.qsm-submit-btn' ).trigger( 'click' );
1139
  jQuery('#modal-3').removeClass('is-open');
1140
+ } );
1141
  });
1142
 
1143
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
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: 6.4.11
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 6.4.11
13
  * @package QSM
14
  */
15
 
@@ -37,7 +37,7 @@ class MLWQuizMasterNext {
37
  * @var string
38
  * @since 4.0.0
39
  */
40
- public $version = '6.4.11';
41
 
42
  /**
43
  * QSM Alert Manager Object
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
+ * Version: 6.4.12
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 6.4.12
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '6.4.12';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/functions.php CHANGED
@@ -26,27 +26,45 @@ function qsm_redirect_to_edit_page($quiz_id){
26
  }
27
 
28
  add_action('admin_init','qsm_add_author_column_in_db');
 
29
  /**
30
  * @since 6.4.6
31
  * Insert new column in quiz table
32
  */
33
- function qsm_add_author_column_in_db(){
34
- if( get_option('qsm_update_db_column', '') != '1' ){
35
- global $wpdb;
36
- $quiz_table_name = $wpdb->prefix . "mlw_quizzes";
37
- $row = $wpdb->get_row("SELECT * FROM $quiz_table_name");
38
- if (!isset($row->quiz_author_id)) {
39
- $wpdb->query("ALTER TABLE $quiz_table_name ADD quiz_author_id INT NOT NULL");
40
- }
41
- $result_table_name = $wpdb->prefix . "mlw_results";
42
- $row = $wpdb->get_row("SELECT * FROM $result_table_name");
43
- if ( !isset($row->unique_id) ) {
44
- $wpdb->query("ALTER TABLE $result_table_name ADD unique_id varchar(255) NOT NULL");
45
- }
46
- update_option('qsm_update_db_column', '1');
47
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
  }
49
 
 
50
  add_action('admin_init', 'qsm_change_the_post_type');
51
  /**
52
  * @since version 6.4.8
@@ -78,4 +96,34 @@ function qsm_change_the_post_type(){
78
  update_option('qsm_change_the_post_type', '1');
79
  flush_rewrite_rules();
80
  }
81
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
 
28
  add_action('admin_init','qsm_add_author_column_in_db');
29
+
30
  /**
31
  * @since 6.4.6
32
  * Insert new column in quiz table
33
  */
34
+ function qsm_add_author_column_in_db() {
35
+
36
+ if( get_option('qsm_update_db_column', '') != '1' ) {
37
+
38
+ global $wpdb;
39
+
40
+ /*
41
+ * Array of table and its column mapping.
42
+ * Each array's item key refers to the table to be altered and its value refers
43
+ * to the array of column and its definition to be added.
44
+ */
45
+ $table_column_arr = array(
46
+ $wpdb->prefix . 'mlw_quizzes' => array( 'quiz_author_id' => 'INT NOT NULL' ),
47
+ $wpdb->prefix . 'mlw_results' => array( 'unique_id' => 'VARCHAR(255) NOT NULL' ),
48
+ );
49
+
50
+ foreach( $table_column_arr as $table => $column_def ) {
51
+ foreach( $column_def as $col_name => $col_def ) {
52
+ $table_col_obj = $wpdb->get_results( $wpdb->prepare(
53
+ 'SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = %s AND TABLE_NAME = %s AND COLUMN_NAME = %s ', $wpdb->dbname, $table, $col_name
54
+ ) );
55
+
56
+ if ( empty( $table_col_obj ) ) {
57
+ $wpdb->query( 'ALTER TABLE ' . $table . ' ADD ' . $col_name . ' ' . $col_def );
58
+ }
59
+ }
60
+ }
61
+
62
+ update_option( 'qsm_update_db_column', '1' );
63
+
64
+ }
65
  }
66
 
67
+
68
  add_action('admin_init', 'qsm_change_the_post_type');
69
  /**
70
  * @since version 6.4.8
96
  update_option('qsm_change_the_post_type', '1');
97
  flush_rewrite_rules();
98
  }
99
+ }
100
+
101
+
102
+ add_action('admin_init', 'qsm_update_question_type_col_val');
103
+
104
+ /**
105
+ * Replace `fill-in-the-blank` value in question_type_column for Fill
106
+ * In The Blank question types.
107
+ *
108
+ * @since version 6.4.12
109
+ */
110
+ function qsm_update_question_type_col_val() {
111
+
112
+ global $wpdb;
113
+ global $mlwQuizMasterNext;
114
+
115
+ if ( version_compare( $mlwQuizMasterNext->version, '6.4.12', '<' ) ) {
116
+ if( get_option('qsm_upated_question_type_val') != '1' ) {
117
+ $table_name = $wpdb->prefix . 'mlw_questions';
118
+ $status = $wpdb->query(
119
+ $wpdb->prepare(
120
+ "UPDATE " . $table_name . " SET `question_type_new` = REPLACE( `question_type_new`, 'fill-in-the-blank', %d )", 14 )
121
+ );
122
+
123
+ if( $status ) {
124
+ update_option('qsm_upated_question_type_val', '1');
125
+ }
126
+ }
127
+ }
128
+ }
129
+
php/admin/settings-page.php CHANGED
@@ -273,9 +273,11 @@ class QMNGlobalSettingsPage {
273
  if ( '1' == $ip_collection ) {
274
  $checked = " checked='checked'";
275
  }
276
- echo '<label class="switch">';
277
  echo "<input type='checkbox' name='qmn-settings[ip_collection]' id='qmn-settings[ip_collection]' value='1'$checked />";
278
- echo '<span class="slider round"></span></label>';
 
 
279
  }
280
 
281
  /**
273
  if ( '1' == $ip_collection ) {
274
  $checked = " checked='checked'";
275
  }
276
+ echo '<label class="switch">';
277
  echo "<input type='checkbox' name='qmn-settings[ip_collection]' id='qmn-settings[ip_collection]' value='1'$checked />";
278
+ echo '<span class="slider round"></span></label>';
279
+ echo "<span class='global-sub-text' for='qmn-settings[ip_collection]'>"
280
+ . __( "You must not restrict number of quiz attempts when this option is enabled.", 'quiz-master-next' ) . "</span>";
281
  }
282
 
283
  /**
php/classes/class-qmn-quiz-creator.php CHANGED
@@ -105,7 +105,7 @@ class QMNQuizCreator {
105
  'comment_section' => 1,
106
  'question_from_total' => 0,
107
  'total_user_tries' => 0,
108
- 'total_user_tries_text' => 'You are only allowed 1 try and have already submitted your quiz.',
109
  'certificate_template' => '',
110
  'social_media' => 0,
111
  'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!',
105
  'comment_section' => 1,
106
  'question_from_total' => 0,
107
  'total_user_tries' => 0,
108
+ 'total_user_tries_text' => 'You have utilized all of your attempts to pass this quiz.',
109
  'certificate_template' => '',
110
  'social_media' => 0,
111
  'social_media_text' => 'I just scored %CORRECT_SCORE%% on %QUIZ_NAME%!',
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -1130,6 +1130,21 @@ class QMNQuizManager {
1130
  );
1131
  }
1132
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1133
  $results_id = $wpdb->insert_id;
1134
 
1135
  // Hook is fired after the responses are submitted. Passes responses, result ID, quiz settings, and response data.
1130
  );
1131
  }
1132
 
1133
+ /*
1134
+ * Update the option `qmn_quiz_taken_cnt` value by 1 each time
1135
+ * whenever the record inserted into the required table.
1136
+ */
1137
+ if( $results_insert ) {
1138
+ $rec_inserted = intval( get_option( 'qmn_quiz_taken_cnt' ) );
1139
+ if( 1000 > $rec_inserted ) {
1140
+ if( ! $rec_inserted ) {
1141
+ update_option( 'qmn_quiz_taken_cnt', 1, true );
1142
+ }else {
1143
+ update_option( 'qmn_quiz_taken_cnt', ++$rec_inserted );
1144
+ }
1145
+ }
1146
+ }
1147
+
1148
  $results_id = $wpdb->insert_id;
1149
 
1150
  // Hook is fired after the responses are submitted. Passes responses, result ID, quiz settings, and response data.
php/classes/class-qmn-review-message.php CHANGED
@@ -73,8 +73,7 @@ class QMN_Review_Message {
73
  */
74
  public function check_results_amount() {
75
  global $wpdb;
76
- $table_name = $wpdb->prefix."mlw_results";
77
- $amount = $wpdb->get_var( "SELECT COUNT(result_id) FROM $table_name WHERE deleted=0" );
78
  return intval( $amount );
79
  }
80
 
73
  */
74
  public function check_results_amount() {
75
  global $wpdb;
76
+ $amount = get_option( 'qmn_quiz_taken_cnt' );
 
77
  return intval( $amount );
78
  }
79
 
php/question-types.php CHANGED
@@ -1034,7 +1034,10 @@ function qmn_question_type_fill_blank()
1034
  'extra_inputs' => array(),
1035
  'function' => ''
1036
  );
1037
- $mlwQuizMasterNext->pluginHelper->register_question_type(__("Fill In The Blank", 'quiz-master-next'), 'qmn_fill_blank_display', true, 'qmn_fill_blank_review', $edit_args );
 
 
 
1038
  }
1039
 
1040
 
@@ -1209,7 +1212,7 @@ function qmn_polar_display($id, $question, $answers) {
1209
  } else {
1210
  $mlw_requireClass = "";
1211
  }
1212
- $question_title = "<div class='polar-question-title'>". do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)) ."</div>";
1213
  $input_text .= "<div class='left-polar-title'>" . $answers[0][0] ."</div>";
1214
  $input_text .= "<div class='slider-main-wrapper'><input type='hidden' class='qmn_polar $mlw_requireClass' id='question" . $id . "' name='question" . $id . "' />";
1215
  $input_text .= '<div id="slider-'. $id .'"></div></div>';
1034
  'extra_inputs' => array(),
1035
  'function' => ''
1036
  );
1037
+
1038
+ $mlwQuizMasterNext->pluginHelper->register_question_type(__("Fill In The Blank", 'quiz-master-next'), 'qmn_fill_blank_display', true, 'qmn_fill_blank_review', $edit_args, null, 14 );
1039
+
1040
+
1041
  }
1042
 
1043
 
1212
  } else {
1213
  $mlw_requireClass = "";
1214
  }
1215
+ $question_title = "<div class='mlw_qmn_question polar-question-title'>". do_shortcode(htmlspecialchars_decode($question, ENT_QUOTES)) ."</div>";
1216
  $input_text .= "<div class='left-polar-title'>" . $answers[0][0] ."</div>";
1217
  $input_text .= "<div class='slider-main-wrapper'><input type='hidden' class='qmn_polar $mlw_requireClass' id='question" . $id . "' name='question" . $id . "' />";
1218
  $input_text .= '<div id="slider-'. $id .'"></div></div>';
php/template-variables.php CHANGED
@@ -78,6 +78,8 @@ function qsm_variable_single_question_answer( $content, $mlw_quiz_array ){
78
  if( $question_id === 'X'){
79
  $content = str_replace( "%QUESTION_ANSWER_". $question_id ."%" , '', $content);
80
  return $content;
 
 
81
  }
82
  $question_answers_array = isset($mlw_quiz_array['question_answers_array']) ? $mlw_quiz_array['question_answers_array'] : array();
83
  $key = array_search( $question_id, array_column($question_answers_array, 'id'));
78
  if( $question_id === 'X'){
79
  $content = str_replace( "%QUESTION_ANSWER_". $question_id ."%" , '', $content);
80
  return $content;
81
+ }else if( $question_id === 'CORRECT' || $question_id === 'INCORRECT' || $question_id === 'GROUP' ){
82
+ return $content;
83
  }
84
  $question_answers_array = isset($mlw_quiz_array['question_answers_array']) ? $mlw_quiz_array['question_answers_array'] : array();
85
  $key = array_search( $question_id, array_column($question_answers_array, 'id'));
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
- Stable tag: 6.4.11
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -121,6 +121,19 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
121
 
122
  == Changelog ==
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
  = 6.4.11 (May 22, 2020) =
125
  * Bug: Removed static data from about us page.
126
  * Bug: Fixed progress bar JS error and its calculation issues.
4
  Requires at least: 4.9
5
  Tested up to: 5.4
6
  Requires PHP: 5.4
7
+ Stable tag: 6.4.12
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
121
 
122
  == Changelog ==
123
 
124
+ = 6.4.12 (June 22, 2020) =
125
+ * Bug: Fixed validation issue in email with spaces.
126
+ * Bug: Fixed issues with settings related to number of times a user can take quiz.
127
+ * Bug: Fixed missing time calculation while retaking quiz.
128
+ * Bug: Fixed incorrect calculation of %QUESTION_ANSWER_CORRECT% and %QUESTION_ANSWER_INCORRECT% variables.
129
+ * Bug: Fixed time up popup with advanced timer on retaking quiz.
130
+ * Bug: Removed irrelevant queries running behind the scene on each admin page.
131
+ * Bug: Removed duplicate column name database error.
132
+ * Bug: Removed orphaned plugin settings on its deletion.
133
+ * Bug: Fixed issues with fill in the blank question type when using polylang.
134
+ * Enhancement: Added user notification for collecting and storing IP addresses setting.
135
+ * Bug: Fixed inconsistent polar question type title.
136
+
137
  = 6.4.11 (May 22, 2020) =
138
  * Bug: Removed static data from about us page.
139
  * Bug: Fixed progress bar JS error and its calculation issues.
uninstall.php CHANGED
@@ -10,18 +10,19 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
10
  }
11
 
12
  global $wpdb;
13
- $table_name = $wpdb->prefix . 'mlw_results';
14
- $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
15
 
16
- $table_name = $wpdb->prefix . 'mlw_quizzes';
17
- $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
18
-
19
- $table_name = $wpdb->prefix . 'mlw_questions';
20
- $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
21
-
22
- $table_name = $wpdb->prefix . 'mlw_qm_audit_trail';
23
- $results = $wpdb->query( "DROP TABLE IF EXISTS $table_name" );
24
 
 
 
 
 
 
25
  // Taken from Easy Digital Downloads. Much better way of doing it than I was doing :)
26
  // Cycle through custom post type array, retreive all posts, delete each one.
27
  $qsm_post_types = array( 'qsm_quiz', 'qmn_log' );
@@ -41,10 +42,33 @@ foreach ( $qsm_post_types as $post_type ) {
41
  }
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
 
45
- delete_option( 'mlw_quiz_master_version' );
46
- delete_option( 'mlw_qmn_review_notice' );
47
- delete_option( 'mlw_advert_shows' );
48
- delete_option( 'qmn-settings' );
49
- delete_option( 'qmn-tracking-notice' );
 
 
 
 
 
50
 
 
 
 
 
10
  }
11
 
12
  global $wpdb;
 
 
13
 
14
+ $qsm_tables = array(
15
+ 'mlw_results',
16
+ 'mlw_quizzes',
17
+ 'mlw_questions',
18
+ 'mlw_qm_audit_trail',
19
+ );
 
 
20
 
21
+ // Drop the tables associated with our plugin.
22
+ foreach( $qsm_tables as $table_name ) {
23
+ $wpdb->query( 'DROP TABLE IF EXISTS ' . $wpdb->prefix . $table_name );
24
+ }
25
+
26
  // Taken from Easy Digital Downloads. Much better way of doing it than I was doing :)
27
  // Cycle through custom post type array, retreive all posts, delete each one.
28
  $qsm_post_types = array( 'qsm_quiz', 'qmn_log' );
42
  }
43
  }
44
 
45
+ $qsm_options = array(
46
+ 'qmn_original_version',
47
+ 'mlw_advert_shows',
48
+ 'qmn_review_message_trigger',
49
+ 'qsm_update_db_column',
50
+ 'qsm_change_the_post_type',
51
+ 'qmn_quiz_taken_cnt',
52
+ 'qmn-settings',
53
+ 'mlw_quiz_master_version',
54
+ 'qmn_tracker_last_time',
55
+ 'qmn-tracking-notice',
56
+ 'mlw_qmn_review_notice',
57
+ 'qsm_upated_question_type_val',
58
+ );
59
 
60
+ // Remove the orphaned options now.
61
+ foreach( $qsm_options as $option_name ) {
62
+ delete_option( $option_name );
63
+ }
64
+
65
+ $qsm_transients = array(
66
+ 'qsm_sidebar_feed_data',
67
+ 'qmn_contributors',
68
+ 'qsm_ads_data',
69
+ );
70
 
71
+ // Remove the orphaned transients now.
72
+ foreach( $qsm_transients as $transient_name ) {
73
+ delete_transient( $transient_name );
74
+ }