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

Version Description

(June 17, 2022) = * Hotfix: Fixed issues while using random questions with question limit

Download this release

Release Info

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

Code changes from version 8.0 to 8.0.1

mlw_quizmaster2.php CHANGED
@@ -2,14 +2,13 @@
2
  /**
3
  * Plugin Name: Quiz And Survey Master
4
  * Description: Easily and quickly add quizzes and surveys to your website.
5
- * Version: 8.0
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 8.0
13
  * @package QSM
14
  */
15
 
@@ -44,7 +43,7 @@ class MLWQuizMasterNext {
44
  * @var string
45
  * @since 4.0.0
46
  */
47
- public $version = '8.0';
48
 
49
  /**
50
  * 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: 8.0.1
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
  * @package QSM
13
  */
14
 
43
  * @var string
44
  * @since 4.0.0
45
  */
46
+ public $version = '8.0.1';
47
 
48
  /**
49
  * QSM Alert Manager Object
php/classes/class-qmn-quiz-manager.php CHANGED
@@ -1480,7 +1480,7 @@ class QMNQuizManager {
1480
  * @return string The content for the results page section
1481
  */
1482
  public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
1483
- global $qmn_allowed_visit;
1484
  $result_display = '';
1485
 
1486
  $qmn_array_for_variables['user_ip'] = $this->get_user_ip();
@@ -1548,26 +1548,26 @@ class QMNQuizManager {
1548
  $result_display = apply_filters( 'qmn_after_check_comments', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
1549
  $unique_id = uniqid();
1550
  $results_id = 0;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1551
  // If the store responses in database option is set to Yes.
1552
  if ( 0 != $qmn_quiz_options->store_responses ) {
1553
- // Creates our results array.
1554
- $results_array = array(
1555
- intval( $qmn_array_for_variables['timer'] ),
1556
- $qmn_array_for_variables['question_answers_array'],
1557
- htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
1558
- 'contact' => $contact_responses,
1559
- 'timer_ms' => intval( $qmn_array_for_variables['timer_ms'] ),
1560
- 'pagetime' => $mlw_qmn_pagetime,
1561
- );
1562
- $results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
1563
- if ( isset( $results_array['parameters'] ) ) {
1564
- $qmn_array_for_variables['parameters'] = $results_array['parameters'];
1565
- }
1566
- $results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
1567
- $results_array['total_possible_points'] = $qmn_array_for_variables['total_possible_points'];
1568
- $results_array['total_attempted_questions'] = $qmn_array_for_variables['total_attempted_questions'];
1569
  // Inserts the responses in the database.
1570
- global $wpdb;
1571
  $table_name = $wpdb->prefix . 'mlw_results';
1572
  if ( isset( $_POST['update_result'] ) && ! empty( $_POST['update_result'] ) ) {
1573
  $results_id = sanitize_text_field( wp_unslash( $_POST['update_result'] ) );
@@ -1665,7 +1665,7 @@ class QMNQuizManager {
1665
  * Update the option `qmn_quiz_taken_cnt` value by 1 each time
1666
  * whenever the record inserted into the required table.
1667
  */
1668
- if ( $results_insert ) {
1669
  $rec_inserted = intval( get_option( 'qmn_quiz_taken_cnt' ) );
1670
  if ( 1000 > $rec_inserted ) {
1671
  if ( ! $rec_inserted ) {
@@ -1712,7 +1712,7 @@ class QMNQuizManager {
1712
  $result_display = apply_filters( 'qmn_end_results', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
1713
 
1714
  // Legacy Code.
1715
- do_action( 'mlw_qmn_load_results_page', $wpdb->insert_id, $qmn_quiz_options->quiz_settings );
1716
  } else {
1717
  $result_display .= apply_filters( 'qmn_captcha_varification_failed_msg', __( 'Captcha verification failed.', 'quiz-master-next' ), $qmn_quiz_options, $qmn_array_for_variables );
1718
  }
@@ -1779,6 +1779,7 @@ class QMNQuizManager {
1779
  $correct_status = 'incorrect';
1780
  $answer_points = 0;
1781
  $question_data = array();
 
1782
  $total_possible_points = 0;
1783
  $attempted_question = 0;
1784
  $minimum_possible_points = 0;
1480
  * @return string The content for the results page section
1481
  */
1482
  public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
1483
+ global $wpdb, $qmn_allowed_visit;
1484
  $result_display = '';
1485
 
1486
  $qmn_array_for_variables['user_ip'] = $this->get_user_ip();
1548
  $result_display = apply_filters( 'qmn_after_check_comments', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
1549
  $unique_id = uniqid();
1550
  $results_id = 0;
1551
+ // Creates our results array.
1552
+ $results_array = array(
1553
+ intval( $qmn_array_for_variables['timer'] ),
1554
+ $qmn_array_for_variables['question_answers_array'],
1555
+ htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
1556
+ 'contact' => $contact_responses,
1557
+ 'timer_ms' => intval( $qmn_array_for_variables['timer_ms'] ),
1558
+ 'pagetime' => $mlw_qmn_pagetime,
1559
+ );
1560
+ $results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
1561
+ if ( isset( $results_array['parameters'] ) ) {
1562
+ $qmn_array_for_variables['parameters'] = $results_array['parameters'];
1563
+ }
1564
+ $results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
1565
+ $results_array['total_possible_points'] = $qmn_array_for_variables['total_possible_points'];
1566
+ $results_array['total_attempted_questions'] = $qmn_array_for_variables['total_attempted_questions'];
1567
+ $results_array['minimum_possible_points'] = $qmn_array_for_variables['minimum_possible_points'];
1568
  // If the store responses in database option is set to Yes.
1569
  if ( 0 != $qmn_quiz_options->store_responses ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1570
  // Inserts the responses in the database.
 
1571
  $table_name = $wpdb->prefix . 'mlw_results';
1572
  if ( isset( $_POST['update_result'] ) && ! empty( $_POST['update_result'] ) ) {
1573
  $results_id = sanitize_text_field( wp_unslash( $_POST['update_result'] ) );
1665
  * Update the option `qmn_quiz_taken_cnt` value by 1 each time
1666
  * whenever the record inserted into the required table.
1667
  */
1668
+ if ( isset( $results_insert ) ) {
1669
  $rec_inserted = intval( get_option( 'qmn_quiz_taken_cnt' ) );
1670
  if ( 1000 > $rec_inserted ) {
1671
  if ( ! $rec_inserted ) {
1712
  $result_display = apply_filters( 'qmn_end_results', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
1713
 
1714
  // Legacy Code.
1715
+ do_action( 'mlw_qmn_load_results_page', $results_id, $qmn_quiz_options->quiz_settings );
1716
  } else {
1717
  $result_display .= apply_filters( 'qmn_captcha_varification_failed_msg', __( 'Captcha verification failed.', 'quiz-master-next' ), $qmn_quiz_options, $qmn_array_for_variables );
1718
  }
1779
  $correct_status = 'incorrect';
1780
  $answer_points = 0;
1781
  $question_data = array();
1782
+ $hidden_questions = array();
1783
  $total_possible_points = 0;
1784
  $attempted_question = 0;
1785
  $minimum_possible_points = 0;
php/classes/class-qsm-emails.php CHANGED
@@ -34,6 +34,7 @@ class QSM_Emails {
34
  'quiz_id' => $result_data['quiz_id'],
35
  'quiz_name' => $result_data['quiz_name'],
36
  'quiz_system' => $result_data['quiz_system'],
 
37
  'user_ip' => $result_data['user_ip'],
38
  'user_name' => $result_data['name'],
39
  'user_business' => $result_data['business'],
@@ -53,7 +54,7 @@ class QSM_Emails {
53
  'question_answers_array' => $quiz_result[1],
54
  'total_possible_points' => $quiz_result['total_possible_points'],
55
  'total_attempted_questions' => $quiz_result['total_attempted_questions'],
56
- 'minimum_possible_points' => $quiz_result['minimum_possible_points'],
57
  'comments' => $quiz_result[2],
58
  'result_id' => $result_id,
59
  );
34
  'quiz_id' => $result_data['quiz_id'],
35
  'quiz_name' => $result_data['quiz_name'],
36
  'quiz_system' => $result_data['quiz_system'],
37
+ 'form_type' => $result_data['form_type'],
38
  'user_ip' => $result_data['user_ip'],
39
  'user_name' => $result_data['name'],
40
  'user_business' => $result_data['business'],
54
  'question_answers_array' => $quiz_result[1],
55
  'total_possible_points' => $quiz_result['total_possible_points'],
56
  'total_attempted_questions' => $quiz_result['total_attempted_questions'],
57
+ 'minimum_possible_points' => isset( $quiz_result['minimum_possible_points'] ) ? $quiz_result['minimum_possible_points'] : 0,
58
  'comments' => $quiz_result[2],
59
  'result_id' => $result_id,
60
  );
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: 6.0
6
  Requires PHP: 5.4
7
- Stable tag: 8.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -163,6 +163,9 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
163
  18. Database
164
 
165
  == Changelog ==
 
 
 
166
  = 8.0 (June 13, 2022) =
167
  * Feature: Added WPML compatibility
168
  * Feature: Added option to select correct answer logic
4
  Requires at least: 4.9
5
  Tested up to: 6.0
6
  Requires PHP: 5.4
7
+ Stable tag: 8.0.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
163
  18. Database
164
 
165
  == Changelog ==
166
+ = 8.0.1 (June 17, 2022) =
167
+ * Hotfix: Fixed issues while using random questions with question limit
168
+
169
  = 8.0 (June 13, 2022) =
170
  * Feature: Added WPML compatibility
171
  * Feature: Added option to select correct answer logic