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

Version Description

(March 16, 2020)= * Bug: Hint not readable * Bug: Full html of the option is being output in the ID of wrapper div and in the value of the option ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/849 ) * Bug: QSM not picking up user select answer when empty spaces at the end * Feature: Added checkbox for selecting questions from question bank ( https://wordpress.org/support/topic/adding-questions-from-question-bank/ ) * Feature: Take to quiz edit after creating a new quiz * Feature: added 'deselect answer' button for multiple choice and horizontal multiple choice question type

Download this release

Release Info

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

Code changes from version 6.4.4 to 6.4.5

css/common.css CHANGED
@@ -65,6 +65,9 @@
65
  top: -7px;
66
  border-radius: 0px;
67
  }
 
 
 
68
  @media screen and (max-width: 767px){
69
  .question-type-polar-s .left-polar-title,
70
  .question-type-polar-s .slider-main-wrapper,
65
  top: -7px;
66
  border-radius: 0px;
67
  }
68
+ .qsm-deselect-answer{
69
+ float: right;
70
+ }
71
  @media screen and (max-width: 767px){
72
  .question-type-polar-s .left-polar-title,
73
  .question-type-polar-s .slider-main-wrapper,
css/jquery-ui.css CHANGED
@@ -778,6 +778,7 @@ button.ui-button::-moz-focus-inner {
778
  max-width: 300px;
779
  -webkit-box-shadow: 0 0 5px #aaa;
780
  box-shadow: 0 0 5px #aaa;
 
781
  }
782
  body .ui-tooltip {
783
  border-width: 2px;
778
  max-width: 300px;
779
  -webkit-box-shadow: 0 0 5px #aaa;
780
  box-shadow: 0 0 5px #aaa;
781
+ opacity: 1 !important;
782
  }
783
  body .ui-tooltip {
784
  border-width: 2px;
js/qsm-admin-question.js CHANGED
@@ -82,6 +82,7 @@ var import_button;
82
  $cat_html += '</select>';
83
  $( '#question-bank' ).prepend($cat_html);
84
  }
 
85
  },
86
  addQuestionToQuestionBank: function( question ) {
87
  var questionText = QSMQuestion.prepareQuestionText( question.name );
@@ -519,11 +520,29 @@ var import_button;
519
 
520
  $( '.qsm-popup-bank' ).on( 'click', '.import-button', function( event) {
521
  event.preventDefault();
522
- $(this).text('').text('Adding Question');
523
  import_button = $(this);
524
  QSMQuestion.addQuestionFromQuestionBank( $( this ).parents( '.question-bank-question' ).data( 'question-id' ) );
525
  $('.import-button').addClass('disable_import');
526
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
 
528
  $( '.save-page-button' ).on( 'click', function( event ) {
529
  event.preventDefault();
82
  $cat_html += '</select>';
83
  $( '#question-bank' ).prepend($cat_html);
84
  }
85
+ $( '#question-bank' ).prepend('<button class="button button-primary" id="qsm-import-selected-question">Import All Selected Questions</button>');
86
  },
87
  addQuestionToQuestionBank: function( question ) {
88
  var questionText = QSMQuestion.prepareQuestionText( question.name );
520
 
521
  $( '.qsm-popup-bank' ).on( 'click', '.import-button', function( event) {
522
  event.preventDefault();
523
+ $(this).text('').text('Adding Question');
524
  import_button = $(this);
525
  QSMQuestion.addQuestionFromQuestionBank( $( this ).parents( '.question-bank-question' ).data( 'question-id' ) );
526
  $('.import-button').addClass('disable_import');
527
  });
528
+
529
+ //Click on selected question button.
530
+ $( '.qsm-popup-bank' ).on( 'click', '#qsm-import-selected-question', function( event) {
531
+ var $total_selction = $('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').length;
532
+ if($total_selction === 0){
533
+ alert('No question is selected.');
534
+ }else{
535
+ $.fn.reverse = [].reverse;
536
+ $($('#question-bank').find('[name="qsm-question-checkbox[]"]:checked').parents('.question-bank-question').reverse()).each(function(){
537
+ $(this).find('.import-button').text('').text('Adding Question');
538
+ import_button = $(this).find('.import-button');
539
+ QSMQuestion.addQuestionFromQuestionBank( $( this ).data( 'question-id' ) );
540
+ $(this).find('.import-button').text('').text('Add Question');
541
+ });
542
+ $('.import-button').addClass('disable_import');
543
+ $('#question-bank').find('[name="qsm-question-checkbox[]"]').attr('checked',false)
544
+ }
545
+ });
546
 
547
  $( '.save-page-button' ).on( 'click', function( event ) {
548
  event.preventDefault();
js/qsm-quiz.js CHANGED
@@ -927,7 +927,13 @@ jQuery(function() {
927
  }
928
  });
929
  return false;
930
- });
 
 
 
 
 
 
931
  });
932
 
933
  var qsmTimerInterval = setInterval( qmnTimeTakenTimer, 1000 );
927
  }
928
  });
929
  return false;
930
+ });
931
+
932
+ //Deselect all answer on select
933
+ jQuery('.qsm-deselect-answer').click(function(e){
934
+ e.preventDefault();
935
+ jQuery(this).parents('.quiz_section').find('input[type="radio"]').prop('checked', false);
936
+ });
937
  });
938
 
939
  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.4
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.4
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.4';
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.5
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.5
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '6.4.5';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/admin/functions.php CHANGED
@@ -11,3 +11,16 @@ function qsm_fetch_data_from_xml() {
11
  return $xml = simplexml_load_string($body);
12
  }
13
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  return $xml = simplexml_load_string($body);
12
  }
13
  }
14
+
15
+ add_action('qmn_quiz_created','qsm_redirect_to_edit_page',10,1);
16
+ /**
17
+ * @since 6.4.5
18
+ * @param int $quiz_id Quiz id.
19
+ */
20
+ function qsm_redirect_to_edit_page($quiz_id){
21
+ $url = admin_url( 'admin.php?page=mlw_quiz_options&&quiz_id=' . $quiz_id ); ?>
22
+ <script>
23
+ window.location.href = '<?php echo $url; ?>';
24
+ </script>
25
+ <?php
26
+ }
php/admin/options-page-questions-tab.php CHANGED
@@ -258,6 +258,9 @@ function qsm_options_questions_tab_content() {
258
  <!-- View for question in question bank -->
259
  <script type="text/template" id="tmpl-single-question-bank-question">
260
  <div class="question-bank-question" data-question-id="{{data.id}}" data-category-name="{{data.category}}">
 
 
 
261
  <div><p>{{{data.question}}}</p><p style="font-size: 12px;color: gray;font-style: italic;"><b>Quiz Name:</b> {{data.quiz_name}} <# if ( data.category != '' ) { #> <b>Category:</b> {{data.category}} <# } #></p>
262
  </div>
263
  <div><a href="#" class="import-button button">Add Question</a></div>
258
  <!-- View for question in question bank -->
259
  <script type="text/template" id="tmpl-single-question-bank-question">
260
  <div class="question-bank-question" data-question-id="{{data.id}}" data-category-name="{{data.category}}">
261
+ <div class="question-bank-selection">
262
+ <input type="checkbox" name="qsm-question-checkbox[]" class="qsm-question-checkbox" />
263
+ </div>
264
  <div><p>{{{data.question}}}</p><p style="font-size: 12px;color: gray;font-style: italic;"><b>Quiz Name:</b> {{data.quiz_name}} <# if ( data.category != '' ) { #> <b>Category:</b> {{data.category}} <# } #></p>
265
  </div>
266
  <div><a href="#" class="import-button button">Add Question</a></div>
php/classes/class-qsm-install.php CHANGED
@@ -580,6 +580,25 @@ class QSM_Install {
580
  );
581
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
582
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
583
  //Setting for animation
584
  $field_array = array(
585
  'id' => 'quiz_animation',
580
  );
581
  $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
582
 
583
+ //Setting for pagination of quiz
584
+ $field_array = array(
585
+ 'id' => 'enable_deselect_option',
586
+ 'label' => __('Enable Deselect Option <br/> Note: This option is only for Multiple Choice and Horizontal Multiple Choice', 'quiz-master-next'),
587
+ 'type' => 'radio',
588
+ 'options' => array(
589
+ array(
590
+ 'label' => __('Yes', 'quiz-master-next'),
591
+ 'value' => 1
592
+ ),
593
+ array(
594
+ 'label' => __('No', 'quiz-master-next'),
595
+ 'value' => 0
596
+ ),
597
+ ),
598
+ 'default' => 0
599
+ );
600
+ $mlwQuizMasterNext->pluginHelper->register_quiz_setting( $field_array, 'quiz_options' );
601
+
602
  //Setting for animation
603
  $field_array = array(
604
  'id' => 'quiz_animation',
php/question-types.php CHANGED
@@ -102,11 +102,12 @@ function qmn_multiple_choice_display($id, $question, $answers)
102
  {
103
  $question_display = '';
104
  global $mlwQuizMasterNext;
105
- $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
 
106
  if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
107
  //$question_title = apply_filters('the_content', $question);
108
- $question_display .= qsm_question_title_func($question);
109
- $question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
110
  if (is_array($answers))
111
  {
112
  $mlw_answer_total = 0;
@@ -115,9 +116,13 @@ function qmn_multiple_choice_display($id, $question, $answers)
115
  $mlw_answer_total++;
116
  if ($answer[0] != "")
117
  {
118
- $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".esc_attr($answer[0])."'>";
119
- $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='".htmlentities(esc_attr($answer[0]))."' /> <label for='question".$id."_".$mlw_answer_total."'>".htmlspecialchars_decode($answer[0], ENT_QUOTES)."</label>";
120
- $question_display .= "</div>";
 
 
 
 
121
  }
122
  }
123
  $question_display .= "<input type='radio' style='display: none;' name='question".$id."' id='question".$id."_none' checked='checked' value='No Answer Provided' />";
@@ -150,7 +155,7 @@ function qmn_multiple_choice_review($id, $question, $answers)
150
  }
151
  foreach($answers as $answer)
152
  {
153
- if ( $mlw_user_answer == esc_attr( $answer[0] ) )
154
  {
155
  $return_array["points"] = $answer[1];
156
  $return_array["user_text"] = $answer[0];
@@ -266,7 +271,7 @@ function qmn_horizontal_multiple_choice_display($id, $question, $answers)
266
  $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
267
  if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
268
  //$question_title = apply_filters('the_content', $question);
269
- $question_display .= qsm_question_title_func($question);
270
  $question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
271
  if (is_array($answers))
272
  {
@@ -1258,13 +1263,18 @@ function qmn_polar_review($id, $question, $answers) {
1258
  function qsm_question_title_func($question,$question_type = ''){
1259
  //$question_title = apply_filters('the_content', $question);
1260
  $question_title = $question;
1261
- global $wp_embed;
1262
  $question_title = $wp_embed->run_shortcode($question_title);
1263
  $polar_extra_class = '';
1264
  if($question_type == 'polar'){
1265
  $polar_extra_class = 'question-type-polar-s';
1266
  }
1267
- $question_display = "<span class='mlw_qmn_question {$polar_extra_class}' >" . do_shortcode( htmlspecialchars_decode( $question_title, ENT_QUOTES ) ) . "</span>";
 
 
 
 
 
1268
  return $question_display;
1269
  }
1270
  ?>
102
  {
103
  $question_display = '';
104
  global $mlwQuizMasterNext;
105
+ $answerEditor = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'answerEditor');
106
+ $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
107
  if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
108
  //$question_title = apply_filters('the_content', $question);
109
+ $question_display .= qsm_question_title_func($question,'multiple_choice');
110
+ $question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
111
  if (is_array($answers))
112
  {
113
  $mlw_answer_total = 0;
116
  $mlw_answer_total++;
117
  if ($answer[0] != "")
118
  {
119
+ if($answerEditor === 'rich'){
120
+ $question_display .= "<div class='qmn_mc_answer_wrap' id='question$id-$mlw_answer_total'>";
121
+ }else{
122
+ $question_display .= "<div class='qmn_mc_answer_wrap' id='question".$id."-".esc_attr($answer[0])."'>";
123
+ }
124
+ $question_display .= "<input type='radio' class='qmn_quiz_radio' name='question".$id."' id='question".$id."_".$mlw_answer_total."' value='". trim( htmlentities(esc_attr($answer[0])) ) ."' /> <label for='question".$id."_".$mlw_answer_total."'>". trim( htmlspecialchars_decode($answer[0], ENT_QUOTES) ) ."</label>";
125
+ $question_display .= "</div>";
126
  }
127
  }
128
  $question_display .= "<input type='radio' style='display: none;' name='question".$id."' id='question".$id."_none' checked='checked' value='No Answer Provided' />";
155
  }
156
  foreach($answers as $answer)
157
  {
158
+ if ( $mlw_user_answer == trim( esc_attr( $answer[0] ) ) )
159
  {
160
  $return_array["points"] = $answer[1];
161
  $return_array["user_text"] = $answer[0];
271
  $required = $mlwQuizMasterNext->pluginHelper->get_question_setting($id, 'required');
272
  if ($required == 0) {$mlw_requireClass = "mlwRequiredRadio";} else {$mlw_requireClass = "";}
273
  //$question_title = apply_filters('the_content', $question);
274
+ $question_display .= qsm_question_title_func($question,'horizontal_multiple_choice');
275
  $question_display .= "<div class='qmn_radio_answers $mlw_requireClass'>";
276
  if (is_array($answers))
277
  {
1263
  function qsm_question_title_func($question,$question_type = ''){
1264
  //$question_title = apply_filters('the_content', $question);
1265
  $question_title = $question;
1266
+ global $wp_embed,$mlwQuizMasterNext;
1267
  $question_title = $wp_embed->run_shortcode($question_title);
1268
  $polar_extra_class = '';
1269
  if($question_type == 'polar'){
1270
  $polar_extra_class = 'question-type-polar-s';
1271
  }
1272
+ $qmn_quiz_options = $mlwQuizMasterNext->quiz_settings->get_quiz_options();
1273
+ $deselect_answer = '';
1274
+ if( isset($qmn_quiz_options->enable_deselect_option) && $qmn_quiz_options->enable_deselect_option == 1 && ($question_type == 'multiple_choice' || $question_type == 'horizontal_multiple_choice') ){
1275
+ $deselect_answer = '<a href="#" class="qsm-deselect-answer">Deselect Answer</a>';
1276
+ }
1277
+ $question_display = "<span class='mlw_qmn_question {$polar_extra_class}' >" . do_shortcode( htmlspecialchars_decode( $question_title, ENT_QUOTES ) ) . $deselect_answer . "</span>";
1278
  return $question_display;
1279
  }
1280
  ?>
php/template-variables.php CHANGED
@@ -269,9 +269,11 @@ function qsm_contact_field_variable( $content, $results_array ) {
269
  */
270
  function qsm_all_contact_fields_variable( $content, $results ) {
271
  $return = '';
272
- for ( $i = 0; $i < count( $results["contact"] ); $i++ ) {
273
- $return .= $results["contact"][ $i ]["label"] . ": " . $results["contact"][ $i ]["value"] . "<br>";
274
- }
 
 
275
  $content = str_replace( "%CONTACT_ALL%" , $return, $content );
276
  return $content;
277
  }
@@ -296,7 +298,7 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
296
  $qmn_questions[ $question['question_id'] ] = $question['question_answer_info'];
297
  }
298
 
299
- // Cycles through each answer in the responses.
300
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
301
  if ( $answer["correct"] === "correct" ){
302
  $user_answer_class = "qmn_user_correct_answer";
@@ -312,7 +314,7 @@ function mlw_qmn_variable_question_answers( $content, $mlw_quiz_array ) {
312
  if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
313
  $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'><img src='$answer[1]'/></span>", $mlw_question_answer_display);
314
  }else{
315
- $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".htmlspecialchars_decode($answer[1], ENT_QUOTES).'</span>', $mlw_question_answer_display);
316
  }
317
  }else{
318
  $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".htmlspecialchars_decode($answer[1], ENT_QUOTES).'</span>', $mlw_question_answer_display);
269
  */
270
  function qsm_all_contact_fields_variable( $content, $results ) {
271
  $return = '';
272
+ if( isset( $results["contact"] ) && ( is_array($results["contact"]) || is_object( $results["contact"] ) ) ){
273
+ for ( $i = 0; $i < count( $results["contact"] ); $i++ ) {
274
+ $return .= $results["contact"][ $i ]["label"] . ": " . $results["contact"][ $i ]["value"] . "<br>";
275
+ }
276
+ }
277
  $content = str_replace( "%CONTACT_ALL%" , $return, $content );
278
  return $content;
279
  }
298
  $qmn_questions[ $question['question_id'] ] = $question['question_answer_info'];
299
  }
300
 
301
+ // Cycles through each answer in the responses.
302
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
303
  if ( $answer["correct"] === "correct" ){
304
  $user_answer_class = "qmn_user_correct_answer";
314
  if($file_extension == '.jpg' || $file_extension == 'jepg' || $file_extension == '.png' || $file_extension == '.gif'){
315
  $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'><img src='$answer[1]'/></span>", $mlw_question_answer_display);
316
  }else{
317
+ $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".trim( htmlspecialchars_decode($answer[1], ENT_QUOTES) ).'</span>', $mlw_question_answer_display);
318
  }
319
  }else{
320
  $mlw_question_answer_display = str_replace( "%USER_ANSWER%" , "<span class='$user_answer_class'>".htmlspecialchars_decode($answer[1], ENT_QUOTES).'</span>', $mlw_question_answer_display);
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.3.2
6
  Requires PHP: 5.4
7
- Stable tag: 6.4.4
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -121,6 +121,14 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
121
 
122
  == Changelog ==
123
 
 
 
 
 
 
 
 
 
124
  = 6.4.4 (Feb 24, 2020)=
125
  * Bug: Security Issues reported by WORDFENCE
126
  * Bug: Change text in Get a Free Addon page
4
  Requires at least: 4.9
5
  Tested up to: 5.3.2
6
  Requires PHP: 5.4
7
+ Stable tag: 6.4.5
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
121
 
122
  == Changelog ==
123
 
124
+ = 6.4.5 (March 16, 2020)=
125
+ * Bug: Hint not readable
126
+ * Bug: Full html of the option is being output in the ID of wrapper div and in the value of the option ( https://github.com/QuizandSurveyMaster/quiz_master_next/issues/849 )
127
+ * Bug: QSM not picking up user select answer when empty spaces at the end
128
+ * Feature: Added checkbox for selecting questions from question bank ( https://wordpress.org/support/topic/adding-questions-from-question-bank/ )
129
+ * Feature: Take to quiz edit after creating a new quiz
130
+ * Feature: added 'deselect answer' button for multiple choice and horizontal multiple choice question type
131
+
132
  = 6.4.4 (Feb 24, 2020)=
133
  * Bug: Security Issues reported by WORDFENCE
134
  * Bug: Change text in Get a Free Addon page