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

Version Description

(November 18, 2020) = * Bug: Fixed required field not working while using Date question type. * Bug: Fixed the issue of right answers containing apostrophes marked as incorrect in Multiple Response/ Multiple Choice questions * Bug: Fixed incorrect message while using rich answer type while using Show results inline option. * Bug: Fixed CSS overlapping issue for quiz_section class while using auto pagination. * Bug: Fixed continuous loading of result page while using landing page addon. * Bug: Fixed number question type not being recorded while using Force submit after timer expires. * Enhancement: Allowed plus, dash, bracket and slash in phone contact field. * Enhancement: Added option to limit the characters in Number question type.

Download this release

Release Info

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

Code changes from version 7.1.7 to 7.1.8

css/common.css CHANGED
@@ -247,6 +247,14 @@ footer.qsm-popup__footer button.qsm-popup-secondary-button:hover{
247
  margin-bottom: 0;
248
  margin-top: 10px;
249
  }
 
 
 
 
 
 
 
 
250
  @media screen and (max-width: 767px){
251
  .question-type-polar-s .left-polar-title,
252
  .question-type-polar-s .slider-main-wrapper,
247
  margin-bottom: 0;
248
  margin-top: 10px;
249
  }
250
+ .quiz_section.qmn_error .mlw_answer_date{
251
+ border: 1px solid #da4f49;
252
+ background: #F2DEDE;
253
+ padding: 5px;
254
+ -webkit-border-radius: 3px;
255
+ -moz-border-radius: 3px;
256
+ border-radius: 3px;
257
+ }
258
  @media screen and (max-width: 767px){
259
  .question-type-polar-s .left-polar-title,
260
  .question-type-polar-s .slider-main-wrapper,
js/qsm-quiz.js CHANGED
@@ -185,7 +185,7 @@ var QSMPageTimer;
185
  $( ".mlw_qmn_quiz select" ).attr( 'disabled', true );
186
  $( ".mlw_qmn_question_comment" ).attr( 'disabled', true );
187
  $( ".mlw_answer_open_text" ).attr( 'disabled', true );
188
- $( ".mlw_answer_number" ).attr( 'disabled', true );
189
 
190
  $quizForm.closest( '.qmn_quiz_container' ).addClass( 'qsm_timer_ended' );
191
  $quizForm.closest( '.qmn_quiz_container' ).prepend('<p style="color: red;">Quiz time is over</p>');
@@ -714,7 +714,10 @@ function qmnValidation( element, quiz_form_id ) {
714
  qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
715
  result = false;
716
  }
717
-
 
 
 
718
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
719
  qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
720
  result = false;
@@ -1318,6 +1321,10 @@ jQuery(function() {
1318
  var $container = jQuery('#quizForm' + quiz_id).closest('.qmn_quiz_container');
1319
  qsmScrollTo($container);
1320
  });
 
 
 
 
1321
  });
1322
 
1323
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
185
  $( ".mlw_qmn_quiz select" ).attr( 'disabled', true );
186
  $( ".mlw_qmn_question_comment" ).attr( 'disabled', true );
187
  $( ".mlw_answer_open_text" ).attr( 'disabled', true );
188
+ $( ".mlw_answer_number" ).attr( 'readonly', true );
189
 
190
  $quizForm.closest( '.qmn_quiz_container' ).addClass( 'qsm_timer_ended' );
191
  $quizForm.closest( '.qmn_quiz_container' ).prepend('<p style="color: red;">Quiz time is over</p>');
714
  qmnDisplayError( number_error, jQuery( this ), quiz_form_id );
715
  result = false;
716
  }
717
+ if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredDate' ) > -1 && this.value === "" ) {
718
+ qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
719
+ result = false;
720
+ }
721
  if( jQuery( this ).attr( 'class' ).indexOf( 'mlwRequiredText' ) > -1 && this.value === "" ) {
722
  qmnDisplayError( empty_error, jQuery( this ), quiz_form_id );
723
  result = false;
1321
  var $container = jQuery('#quizForm' + quiz_id).closest('.qmn_quiz_container');
1322
  qsmScrollTo($container);
1323
  });
1324
+
1325
+ jQuery(document).on('keyup', '.mlwPhoneNumber', function(e){
1326
+ this.value = this.value.replace(/[^- +()0-9\.]/g,'');
1327
+ });
1328
  });
1329
 
1330
  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: 7.1.7
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.7
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.7';
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: 7.1.8
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.8
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.8';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/options-page-questions-tab.php CHANGED
@@ -404,7 +404,7 @@ function qsm_options_questions_tab_content() {
404
  'type' => 'text',
405
  'priority' => '7',
406
  'default' => '',
407
- 'show' => '3, 14',
408
  'documentation_link' => 'https://quizandsurveymaster.com/docs/v7/advanced-options/#Limit-Text'
409
  ),
410
  'limit_multiple_response' => array(
404
  'type' => 'text',
405
  'priority' => '7',
406
  'default' => '',
407
+ 'show' => '3, 14, 7',
408
  'documentation_link' => 'https://quizandsurveymaster.com/docs/v7/advanced-options/#Limit-Text'
409
  ),
410
  'limit_multiple_response' => array(
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -182,7 +182,7 @@ class QMNQuizManager {
182
  public function qsm_get_question_quick_result(){
183
  global $wpdb;
184
  $question_id = isset($_POST['question_id']) ? intval($_POST['question_id']) : 0;
185
- $answer = isset( $_POST['answer'] ) ? sanitize_textarea_field( $_POST['answer'] ) : '';
186
  $question_array = $wpdb->get_row( "SELECT answer_array, question_answer_info FROM {$wpdb->prefix}mlw_questions WHERE question_id = ($question_id)", 'ARRAY_A' );
187
  $answer_array = unserialize($question_array['answer_array']);
188
  $correct_info_text = isset( $question_array['question_answer_info'] ) ? $question_array['question_answer_info'] : '';
@@ -190,8 +190,8 @@ class QMNQuizManager {
190
  $got_ans = false;
191
  $correct_answer = false;
192
  if($answer_array && $got_ans === false){
193
- foreach ($answer_array as $key => $value) {
194
- if($value[0] == $answer && $value[2] == 1){
195
  $got_ans = true;
196
  $correct_answer = true;
197
  break;
@@ -2162,7 +2162,7 @@ function qmn_total_tries_check($display, $qmn_quiz_options, $qmn_array_for_varia
2162
 
2163
  add_filter('qmn_begin_quiz', 'qmn_pagination_check', 10, 3);
2164
 
2165
- function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variables) {
2166
  if ($qmn_quiz_options->pagination != 0) {
2167
  global $wpdb;
2168
  global $qmn_json_data;
@@ -2173,7 +2173,7 @@ function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variab
2173
  $questions = QSM_Questions::load_questions_by_pages($qmn_quiz_options->quiz_id);
2174
  $total_questions = count($questions);
2175
  }
2176
- $display .= "<style>.quiz_section { display: none; }</style>";
2177
 
2178
  $qmn_json_data["pagination"] = array(
2179
  'amount' => $qmn_quiz_options->pagination,
182
  public function qsm_get_question_quick_result(){
183
  global $wpdb;
184
  $question_id = isset($_POST['question_id']) ? intval($_POST['question_id']) : 0;
185
+ $answer = isset( $_POST['answer'] ) ? wp_kses_post( $_POST['answer'] ) : '';
186
  $question_array = $wpdb->get_row( "SELECT answer_array, question_answer_info FROM {$wpdb->prefix}mlw_questions WHERE question_id = ($question_id)", 'ARRAY_A' );
187
  $answer_array = unserialize($question_array['answer_array']);
188
  $correct_info_text = isset( $question_array['question_answer_info'] ) ? $question_array['question_answer_info'] : '';
190
  $got_ans = false;
191
  $correct_answer = false;
192
  if($answer_array && $got_ans === false){
193
+ foreach ($answer_array as $key => $value) {
194
+ if( htmlspecialchars_decode( $value[0], ENT_QUOTES ) == $answer && $value[2] == 1 ){
195
  $got_ans = true;
196
  $correct_answer = true;
197
  break;
2162
 
2163
  add_filter('qmn_begin_quiz', 'qmn_pagination_check', 10, 3);
2164
 
2165
+ function qmn_pagination_check($display, $qmn_quiz_options, $qmn_array_for_variables) {
2166
  if ($qmn_quiz_options->pagination != 0) {
2167
  global $wpdb;
2168
  global $qmn_json_data;
2173
  $questions = QSM_Questions::load_questions_by_pages($qmn_quiz_options->quiz_id);
2174
  $total_questions = count($questions);
2175
  }
2176
+ //$display .= "<style>.quiz_section { display: none; }</style>";
2177
 
2178
  $qmn_json_data["pagination"] = array(
2179
  'amount' => $qmn_quiz_options->pagination,
php/classes/class-qsm-contact-manager.php CHANGED
@@ -124,12 +124,15 @@ class QSM_Contact_Manager {
124
  if ( ( 'true' === $fields[ $i ]["required"] || true === $fields[ $i ]["required"] ) && ! $fields_hidden ) {
125
  $class = 'mlwRequiredText qsm_required_text';
126
  }
 
 
 
127
  if($fields[ $i ]['use'] == 'phone' && 'true' === $fields[ $i ]["required"] || true === $fields[ $i ]["required"] ){
128
- $class = 'mlwRequiredNumber qsm_required_text';
129
  }
130
  ?>
131
  <span class='mlw_qmn_question qsm_question'><?php echo $fields[ $i ]['label']; ?></span>
132
- <input <?php if($contact_disable_autofill){ echo "autocomplete='off'"; } ?> type='<?php echo $fields[ $i ]['use'] == 'phone' ? 'number' : 'text'; ?>' <?php if( $fields[ $i ]['use'] == 'phone' ){ ?> onkeydown="return event.keyCode !== 69" <?php } ?> class='<?php echo esc_attr( $class ); ?>' name='contact_field_<?php echo $i; ?>' value='<?php echo esc_attr( $value ); ?>' placeholder="<?php echo $fields[ $i ]['label']; ?>" />
133
  <?php
134
  break;
135
 
124
  if ( ( 'true' === $fields[ $i ]["required"] || true === $fields[ $i ]["required"] ) && ! $fields_hidden ) {
125
  $class = 'mlwRequiredText qsm_required_text';
126
  }
127
+ if( $fields[ $i ]['use'] == 'phone' ){
128
+ $class = 'mlwPhoneNumber';
129
+ }
130
  if($fields[ $i ]['use'] == 'phone' && 'true' === $fields[ $i ]["required"] || true === $fields[ $i ]["required"] ){
131
+ $class = 'mlwPhoneNumber mlwRequiredNumber qsm_required_text';
132
  }
133
  ?>
134
  <span class='mlw_qmn_question qsm_question'><?php echo $fields[ $i ]['label']; ?></span>
135
+ <input <?php if($contact_disable_autofill){ echo "autocomplete='off'"; } ?> type='<?php echo $fields[ $i ]['use'] == 'phone' ? 'text' : 'text'; ?>' <?php if( $fields[ $i ]['use'] == 'phone' ){ ?> onkeydown="return event.keyCode !== 69" <?php } ?> class='<?php echo esc_attr( $class ); ?>' name='contact_field_<?php echo $i; ?>' value='<?php echo esc_attr( $value ); ?>' placeholder="<?php echo $fields[ $i ]['label']; ?>" />
136
  <?php
137
  break;
138
 
php/question-types.php CHANGED
@@ -310,7 +310,7 @@ function qmn_horizontal_multiple_choice_display($id, $question, $answers)
310
  $mlw_answer_total++;
311
  if ($answer[0] != "")
312
  {
313
- $question_display .= "<span class='mlw_horizontal_choice'><input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='".esc_attr($answer[0])."' /><label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label></span>";
314
  }
315
  }
316
  $question_display .= "<input type='radio' style='display: none;' name='question".$id."' id='question".$id."_none' checked='checked' value='' />";
@@ -352,7 +352,7 @@ function qmn_horizontal_multiple_choice_review($id, $question, $answers)
352
  $sinel_answer_cmp = preg_replace("/\s+|\n+|\r/", ' ', htmlentities( $answer_option ));
353
  if ( $rich_text_comapre == $sinel_answer_cmp ){
354
  $return_array["points"] = $answer[1];
355
- $return_array["user_text"] = strval(htmlspecialchars_decode($answer[0], ENT_QUOTES));
356
  if ($answer[2] == 1){
357
  $return_array["correct"] = "correct";
358
  }
@@ -363,7 +363,7 @@ function qmn_horizontal_multiple_choice_review($id, $question, $answers)
363
  } else{
364
  if ( $mlw_user_answer == trim( stripslashes( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ) ){
365
  $return_array["points"] = $answer[1];
366
- $return_array["user_text"] = strval(htmlspecialchars_decode($answer[0], ENT_QUOTES));
367
  if ($answer[2] == 1)
368
  {
369
  $return_array["correct"] = "correct";
@@ -807,12 +807,14 @@ function qmn_number_display($id, $question, $answers)
807
  {
808
  $question_display = '';
809
  global $mlwQuizMasterNext;
810
- $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
 
 
811
  if ($required == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";}
812
  //$question_title = apply_filters('the_content', $question);
813
  $new_question_title = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'question_title');
814
  $question_display .= qsm_question_title_func($question, '', $new_question_title);
815
- $question_display .= "<input type='number' class='mlw_answer_number $mlw_requireClass' name='question".$id."' />";
816
  return apply_filters('qmn_number_display_front',$question_display,$id, $question, $answers);
817
  }
818
 
310
  $mlw_answer_total++;
311
  if ($answer[0] != "")
312
  {
313
+ $question_display .= "<span class='mlw_horizontal_choice'><input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='". $answer[0] ."' /><label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label></span>";
314
  }
315
  }
316
  $question_display .= "<input type='radio' style='display: none;' name='question".$id."' id='question".$id."_none' checked='checked' value='' />";
352
  $sinel_answer_cmp = preg_replace("/\s+|\n+|\r/", ' ', htmlentities( $answer_option ));
353
  if ( $rich_text_comapre == $sinel_answer_cmp ){
354
  $return_array["points"] = $answer[1];
355
+ $return_array["user_text"] = $answer[0];
356
  if ($answer[2] == 1){
357
  $return_array["correct"] = "correct";
358
  }
363
  } else{
364
  if ( $mlw_user_answer == trim( stripslashes( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ) ){
365
  $return_array["points"] = $answer[1];
366
+ $return_array["user_text"] = $answer[0];
367
  if ($answer[2] == 1)
368
  {
369
  $return_array["correct"] = "correct";
807
  {
808
  $question_display = '';
809
  global $mlwQuizMasterNext;
810
+ $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
811
+ $limit_text = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'limit_text');
812
+ $limit_text_att = $limit_text ? "maxlength='". $limit_text ."' oninput='javascript: if (this.value.length > this.maxLength) this.value = this.value.slice(0, this.maxLength);'" : '';
813
  if ($required == 0) {$mlw_requireClass = "mlwRequiredNumber";} else {$mlw_requireClass = "";}
814
  //$question_title = apply_filters('the_content', $question);
815
  $new_question_title = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'question_title');
816
  $question_display .= qsm_question_title_func($question, '', $new_question_title);
817
+ $question_display .= "<input type='number' $limit_text_att class='mlw_answer_number $mlw_requireClass' name='question".$id."' />";
818
  return apply_filters('qmn_number_display_front',$question_display,$id, $question, $answers);
819
  }
820
 
php/template-variables.php CHANGED
@@ -728,7 +728,8 @@ function qmn_variable_category_average_points($content, $mlw_quiz_array)
728
 
729
  add_filter('qmn_end_results', 'qsm_end_results_rank', 9999, 3);
730
  function qsm_end_results_rank($result_display, $qmn_quiz_options, $qmn_array_for_variables)
731
- {
 
732
  global $wpdb;
733
  $mlw_quiz_id = $qmn_array_for_variables['quiz_id'];
734
  $mlw_result_id = $wpdb->get_var("SELECT MAX(`result_id`) FROM `{$wpdb->prefix}mlw_results` WHERE `quiz_id`='{$mlw_quiz_id}' AND `deleted`='0'");
@@ -760,7 +761,7 @@ function qsm_end_results_rank($result_display, $qmn_quiz_options, $qmn_array_for
760
  }
761
  }
762
  $result_display = str_replace("%RANK%", $mlw_rank, $result_display);
763
-
764
  return $result_display;
765
  }
766
 
@@ -936,7 +937,7 @@ function qsm_questions_answers_shortcode_to_text($mlw_quiz_array, $qmn_question_
936
  }
937
  } else {
938
  foreach ($total_answers as $single_answer) {
939
- $single_answer_option = htmlspecialchars_decode($single_answer[0], ENT_QUOTES);
940
  if (isset($single_answer[2]) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer_option ) {
941
  $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
942
  } else if (isset($single_answer[2]) && $single_answer[2] == 1) {
728
 
729
  add_filter('qmn_end_results', 'qsm_end_results_rank', 9999, 3);
730
  function qsm_end_results_rank($result_display, $qmn_quiz_options, $qmn_array_for_variables)
731
+ {
732
+ while (strpos($result_display, '%RANK%') !== false){
733
  global $wpdb;
734
  $mlw_quiz_id = $qmn_array_for_variables['quiz_id'];
735
  $mlw_result_id = $wpdb->get_var("SELECT MAX(`result_id`) FROM `{$wpdb->prefix}mlw_results` WHERE `quiz_id`='{$mlw_quiz_id}' AND `deleted`='0'");
761
  }
762
  }
763
  $result_display = str_replace("%RANK%", $mlw_rank, $result_display);
764
+ }
765
  return $result_display;
766
  }
767
 
937
  }
938
  } else {
939
  foreach ($total_answers as $single_answer) {
940
+ $single_answer_option = $single_answer[0];
941
  if (isset($single_answer[2]) && $single_answer[2] == 1 && htmlspecialchars_decode($answer[1], ENT_QUOTES) == $single_answer_option ) {
942
  $question_with_answer_text .= '<span class="qsm-text-correct-option qsm-text-user-correct-answer">' . htmlspecialchars_decode($single_answer[0], ENT_QUOTES) . '</span>';
943
  } else if (isset($single_answer[2]) && $single_answer[2] == 1) {
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.5.3
6
  Requires PHP: 5.4
7
- Stable tag: 7.1.7
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -135,6 +135,16 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
135
 
136
  == Changelog ==
137
 
 
 
 
 
 
 
 
 
 
 
138
  = 7.1.7 (November 10, 2020) =
139
  * Bug: Fixed math formula not showing on result page.
140
  * Bug: Fixed incorrect results while using %POLL_RESULTS_X% template variable.
4
  Requires at least: 4.9
5
  Tested up to: 5.5.3
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.8
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
135
 
136
  == Changelog ==
137
 
138
+ = 7.1.8 (November 18, 2020) =
139
+ * Bug: Fixed required field not working while using Date question type.
140
+ * Bug: Fixed the issue of right answers containing apostrophes marked as incorrect in Multiple Response/ Multiple Choice questions
141
+ * Bug: Fixed incorrect message while using rich answer type while using Show results inline option.
142
+ * Bug: Fixed CSS overlapping issue for quiz_section class while using auto pagination.
143
+ * Bug: Fixed continuous loading of result page while using landing page addon.
144
+ * Bug: Fixed number question type not being recorded while using Force submit after timer expires.
145
+ * Enhancement: Allowed plus, dash, bracket and slash in phone contact field.
146
+ * Enhancement: Added option to limit the characters in Number question type.
147
+
148
  = 7.1.7 (November 10, 2020) =
149
  * Bug: Fixed math formula not showing on result page.
150
  * Bug: Fixed incorrect results while using %POLL_RESULTS_X% template variable.