Skip to content

Commit

Permalink
Merge pull request #1887 from QuizandSurveyMaster/dev
Browse files Browse the repository at this point in the history
Release 8.0.1
  • Loading branch information
etvarun authored Jun 17, 2022
2 parents ca9d229 + e9a2a60 commit c2c26ae
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
5 changes: 2 additions & 3 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 8.0
* Version: 8.0.1
* Author: ExpressTech
* Author URI: https://quizandsurveymaster.com/
* Plugin URI: https://expresstech.io/
* Text Domain: quiz-master-next
*
* @author QSM Team
* @version 8.0
* @package QSM
*/

Expand Down Expand Up @@ -44,7 +43,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '8.0';
public $version = '8.0.1';

/**
* QSM Alert Manager Object
Expand Down
41 changes: 21 additions & 20 deletions php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1480,7 +1480,7 @@ public function qsm_get_quiz_to_reload() {
* @return string The content for the results page section
*/
public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
global $qmn_allowed_visit;
global $wpdb, $qmn_allowed_visit;
$result_display = '';

$qmn_array_for_variables['user_ip'] = $this->get_user_ip();
Expand Down Expand Up @@ -1548,26 +1548,26 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
$result_display = apply_filters( 'qmn_after_check_comments', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
$unique_id = uniqid();
$results_id = 0;
// Creates our results array.
$results_array = array(
intval( $qmn_array_for_variables['timer'] ),
$qmn_array_for_variables['question_answers_array'],
htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
'contact' => $contact_responses,
'timer_ms' => intval( $qmn_array_for_variables['timer_ms'] ),
'pagetime' => $mlw_qmn_pagetime,
);
$results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
if ( isset( $results_array['parameters'] ) ) {
$qmn_array_for_variables['parameters'] = $results_array['parameters'];
}
$results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
$results_array['total_possible_points'] = $qmn_array_for_variables['total_possible_points'];
$results_array['total_attempted_questions'] = $qmn_array_for_variables['total_attempted_questions'];
$results_array['minimum_possible_points'] = $qmn_array_for_variables['minimum_possible_points'];
// If the store responses in database option is set to Yes.
if ( 0 != $qmn_quiz_options->store_responses ) {
// Creates our results array.
$results_array = array(
intval( $qmn_array_for_variables['timer'] ),
$qmn_array_for_variables['question_answers_array'],
htmlspecialchars( stripslashes( $qmn_array_for_variables['comments'] ), ENT_QUOTES ),
'contact' => $contact_responses,
'timer_ms' => intval( $qmn_array_for_variables['timer_ms'] ),
'pagetime' => $mlw_qmn_pagetime,
);
$results_array = apply_filters( 'qsm_results_array', $results_array, $qmn_array_for_variables );
if ( isset( $results_array['parameters'] ) ) {
$qmn_array_for_variables['parameters'] = $results_array['parameters'];
}
$results_array['hidden_questions'] = $qmn_array_for_variables['hidden_questions'];
$results_array['total_possible_points'] = $qmn_array_for_variables['total_possible_points'];
$results_array['total_attempted_questions'] = $qmn_array_for_variables['total_attempted_questions'];
// Inserts the responses in the database.
global $wpdb;
$table_name = $wpdb->prefix . 'mlw_results';
if ( isset( $_POST['update_result'] ) && ! empty( $_POST['update_result'] ) ) {
$results_id = sanitize_text_field( wp_unslash( $_POST['update_result'] ) );
Expand Down Expand Up @@ -1665,7 +1665,7 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
* Update the option `qmn_quiz_taken_cnt` value by 1 each time
* whenever the record inserted into the required table.
*/
if ( $results_insert ) {
if ( isset( $results_insert ) ) {
$rec_inserted = intval( get_option( 'qmn_quiz_taken_cnt' ) );
if ( 1000 > $rec_inserted ) {
if ( ! $rec_inserted ) {
Expand Down Expand Up @@ -1712,7 +1712,7 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
$result_display = apply_filters( 'qmn_end_results', $result_display, $qmn_quiz_options, $qmn_array_for_variables );

// Legacy Code.
do_action( 'mlw_qmn_load_results_page', $wpdb->insert_id, $qmn_quiz_options->quiz_settings );
do_action( 'mlw_qmn_load_results_page', $results_id, $qmn_quiz_options->quiz_settings );
} else {
$result_display .= apply_filters( 'qmn_captcha_varification_failed_msg', __( 'Captcha verification failed.', 'quiz-master-next' ), $qmn_quiz_options, $qmn_array_for_variables );
}
Expand Down Expand Up @@ -1779,6 +1779,7 @@ public static function check_answers( $options, $quiz_data ) {
$correct_status = 'incorrect';
$answer_points = 0;
$question_data = array();
$hidden_questions = array();
$total_possible_points = 0;
$attempted_question = 0;
$minimum_possible_points = 0;
Expand Down
3 changes: 2 additions & 1 deletion php/classes/class-qsm-emails.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public static function send_emails( $result_id ) {
'quiz_id' => $result_data['quiz_id'],
'quiz_name' => $result_data['quiz_name'],
'quiz_system' => $result_data['quiz_system'],
'form_type' => $result_data['form_type'],
'user_ip' => $result_data['user_ip'],
'user_name' => $result_data['name'],
'user_business' => $result_data['business'],
Expand All @@ -53,7 +54,7 @@ public static function send_emails( $result_id ) {
'question_answers_array' => $quiz_result[1],
'total_possible_points' => $quiz_result['total_possible_points'],
'total_attempted_questions' => $quiz_result['total_attempted_questions'],
'minimum_possible_points' => $quiz_result['minimum_possible_points'],
'minimum_possible_points' => isset( $quiz_result['minimum_possible_points'] ) ? $quiz_result['minimum_possible_points'] : 0,
'comments' => $quiz_result[2],
'result_id' => $result_id,
);
Expand Down
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: quiz, survey, lead, test, score, exam, questionnaire, question,wordpress q
Requires at least: 4.9
Tested up to: 6.0
Requires PHP: 5.4
Stable tag: 8.0
Stable tag: 8.0.1
License: GPLv2
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down Expand Up @@ -163,6 +163,9 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
18. Database

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

= 8.0 (June 13, 2022) =
* Feature: Added WPML compatibility
* Feature: Added option to select correct answer logic
Expand Down

0 comments on commit c2c26ae

Please sign in to comment.