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

Version Description

(October 29, 2020) = * Bug: Fixed division by zero error while limiting number of questions. * Bug: Fixed inclusion of file upload question type in calculation of average point and average category point.

Download this release

Release Info

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

Code changes from version 7.1.5 to 7.1.6

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.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 7.1.5
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.5';
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.6
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.6
13
  * @package QSM
14
  */
15
 
37
  * @var string
38
  * @since 4.0.0
39
  */
40
+ public $version = '7.1.6';
41
 
42
  /**
43
  * QSM Alert Manager Object
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -906,15 +906,19 @@ class QMNQuizManager {
906
  $pages_count = 1;
907
  $current_page_number = 1;
908
  foreach ($qmn_quiz_questions as $mlw_question) {
909
- if( $pagination_optoin == 1 ){
910
- $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
911
- $current_page_number++;
912
- }else{
913
- if ($pages_count % $pagination_optoin == 1 || $pages_count == 1) { // beginning of the row or first.
914
  $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
915
  $current_page_number++;
 
 
 
 
 
916
  }
917
- }
918
  $question_id_list .= $mlw_question->question_id . "Q";
919
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
920
 
@@ -937,7 +941,9 @@ class QMNQuizManager {
937
  $question_display .= "<br /><br />";
938
  }
939
  $question_display .= "</div>";
940
- if( $pagination_optoin == 1 ){
 
 
941
  $question_display .= '</div><!-- .qsm-auto-page-row -->';
942
  }else if ($pages_count % $pagination_optoin == 0 || $pages_count == count($qmn_quiz_questions)) { // end of the row or last
943
  $question_display .= '</div><!-- .qsm-auto-page-row -->';
906
  $pages_count = 1;
907
  $current_page_number = 1;
908
  foreach ($qmn_quiz_questions as $mlw_question) {
909
+ if( $pagination_optoin == 0 ){
910
+ $question_display .= "<div class='quiz_section {$animation_effect} question-section-id-{$mlw_question->question_id} slide{$mlw_qmn_section_count}'>";
911
+ } else {
912
+ if( $pagination_optoin == 1 ){
 
913
  $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
914
  $current_page_number++;
915
+ }else{
916
+ if ($pages_count % $pagination_optoin == 1 || $pages_count == 1) { // beginning of the row or first.
917
+ $question_display .='<div class="qsm-auto-page-row qsm-apc-' . $current_page_number . '" style="display: none;">';
918
+ $current_page_number++;
919
+ }
920
  }
921
+ }
922
  $question_id_list .= $mlw_question->question_id . "Q";
923
  $mlw_qmn_section_count = $mlw_qmn_section_count + 1;
924
 
941
  $question_display .= "<br /><br />";
942
  }
943
  $question_display .= "</div>";
944
+ if( $pagination_optoin == 0 ){
945
+ $question_display .= '</div><!-- .quiz_section -->';
946
+ } else if( $pagination_optoin == 1 ){
947
  $question_display .= '</div><!-- .qsm-auto-page-row -->';
948
  }else if ($pages_count % $pagination_optoin == 0 || $pages_count == count($qmn_quiz_questions)) { // end of the row or last
949
  $question_display .= '</div><!-- .qsm-auto-page-row -->';
php/template-variables.php CHANGED
@@ -279,11 +279,17 @@ function mlw_qmn_variable_point_score($content, $mlw_quiz_array)
279
  $content = str_replace( "%POINT_SCORE%" , $mlw_quiz_array["total_points"], $content);
280
  return $content;
281
  }
282
- function mlw_qmn_variable_average_point($content, $mlw_quiz_array)
283
- {
284
- if ($mlw_quiz_array["total_questions"] != 0)
285
- {
286
- $mlw_average_points = round($mlw_quiz_array["total_points"]/$mlw_quiz_array["total_questions"], 2);
 
 
 
 
 
 
287
  }
288
  else
289
  {
@@ -552,7 +558,9 @@ function qmn_variable_average_category_points( $content, $mlw_quiz_array ) {
552
  }
553
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
554
  if ( $answer["category"] == $category_name ) {
555
- $total_questions += 1;
 
 
556
  $return_points += $answer["points"];
557
  }
558
  }
279
  $content = str_replace( "%POINT_SCORE%" , $mlw_quiz_array["total_points"], $content);
280
  return $content;
281
  }
282
+ function mlw_qmn_variable_average_point($content, $mlw_quiz_array){
283
+ $question_total = 0;
284
+ if( isset( $mlw_quiz_array['question_answers_array'] ) ){
285
+ foreach( $mlw_quiz_array['question_answers_array'] as $single_question ){
286
+ if( $single_question['question_type'] !== '11' ){
287
+ $question_total++;
288
+ }
289
+ }
290
+ }
291
+ if ($mlw_quiz_array["total_questions"] != 0 && $question_total != 0){
292
+ $mlw_average_points = round($mlw_quiz_array["total_points"]/$question_total, 2);
293
  }
294
  else
295
  {
558
  }
559
  foreach ( $mlw_quiz_array['question_answers_array'] as $answer ) {
560
  if ( $answer["category"] == $category_name ) {
561
+ if( $answer['question_type'] !== '11' ){
562
+ $total_questions += 1;
563
+ }
564
  $return_points += $answer["points"];
565
  }
566
  }
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.1
6
  Requires PHP: 5.4
7
- Stable tag: 7.1.5
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -135,6 +135,10 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
135
 
136
  == Changelog ==
137
 
 
 
 
 
138
  = 7.1.5 (October 26, 2020) =
139
  * Bug: Fixed logic addon rules not being copied while duplicating quiz.
140
  * Bug: Fixed vietnamese accents and special characters not being recognized in quiz result page.
4
  Requires at least: 4.9
5
  Tested up to: 5.5.1
6
  Requires PHP: 5.4
7
+ Stable tag: 7.1.6
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
135
 
136
  == Changelog ==
137
 
138
+ = 7.1.6 (October 29, 2020) =
139
+ * Bug: Fixed division by zero error while limiting number of questions.
140
+ * Bug: Fixed inclusion of file upload question type in calculation of average point and average category point.
141
+
142
  = 7.1.5 (October 26, 2020) =
143
  * Bug: Fixed logic addon rules not being copied while duplicating quiz.
144
  * Bug: Fixed vietnamese accents and special characters not being recognized in quiz result page.