Skip to content

Commit

Permalink
Merge pull request #2388 from QuizandSurveyMaster/dev2
Browse files Browse the repository at this point in the history
Release 8.1.18
  • Loading branch information
etvarun authored Oct 26, 2023
2 parents 44f8aa8 + 7bb157f commit cc5c487
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 14 deletions.
4 changes: 2 additions & 2 deletions mlw_quizmaster2.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Plugin Name: Quiz And Survey Master
* Description: Easily and quickly add quizzes and surveys to your website.
* Version: 8.1.17
* Version: 8.1.18
* Author: ExpressTech
* Author URI: https://quizandsurveymaster.com/
* Plugin URI: https://expresstech.io/
Expand Down Expand Up @@ -43,7 +43,7 @@ class MLWQuizMasterNext {
* @var string
* @since 4.0.0
*/
public $version = '8.1.17';
public $version = '8.1.18';

/**
* QSM Alert Manager Object
Expand Down
35 changes: 24 additions & 11 deletions php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -509,13 +509,13 @@ public function display_shortcode( $atts ) {
if (encryptedData === undefined) {
var encryptedData = {};
}
encryptionKey['.$quiz_id.'] = "'.hash('sha256',time().$quiz_id).'";
data['.$quiz_id.'] = '.wp_json_encode($encryption).';
jsonString['.$quiz_id.'] = JSON.stringify(data['.$quiz_id.']);
encryptedData['.$quiz_id.'] = CryptoJS.AES.encrypt(jsonString['.$quiz_id.'], encryptionKey['.$quiz_id.']).toString();';
Expand Down Expand Up @@ -1567,7 +1567,7 @@ public function ajax_submit_results() {
$post_status = get_post_status( $post_ids[0] );
}

if ( is_null( $options ) || 1 == $options->deleted || 'publish' !== $post_status ) {
if ( is_null( $options ) || 1 == $options->deleted ) {
echo wp_json_encode(
array(
'display' => __( 'This quiz is no longer available.', 'quiz-master-next' ),
Expand All @@ -1577,8 +1577,21 @@ public function ajax_submit_results() {
),
)
);
die();
wp_die();
}
if ( 'publish' !== $post_status ) {
echo wp_json_encode(
array(
'display' => __( 'This quiz is in draft mode and is not recording your responses. Please publish the quiz to start recording your responses.', 'quiz-master-next' ),
'redirect' => false,
'result_status' => array(
'save_response' => false,
),
)
);
wp_die();
}

$qsm_option = isset( $options->quiz_settings ) ? maybe_unserialize( $options->quiz_settings ) : array();
$qsm_option = array_map( 'maybe_unserialize', $qsm_option );
$dateStr = $qsm_option['quiz_options']['scheduled_time_end'];
Expand All @@ -1595,7 +1608,7 @@ public function ajax_submit_results() {
),
)
);
die();
wp_die();
}
if ( 0 != $options->limit_total_entries ) {
$mlw_qmn_entries_count = $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(quiz_id) FROM {$wpdb->prefix}mlw_results WHERE deleted=0 AND quiz_id=%d", $options->quiz_id ) );
Expand All @@ -1609,7 +1622,7 @@ public function ajax_submit_results() {
),
)
);
die();
wp_die();
}
}
if ( 0 != $options->total_user_tries ) {
Expand All @@ -1636,7 +1649,7 @@ public function ajax_submit_results() {
),
)
);
die();
wp_die();
}
}
$data = array(
Expand All @@ -1646,7 +1659,7 @@ public function ajax_submit_results() {
'quiz_payment_id' => isset( $_POST['main_payment_id'] ) ? sanitize_text_field( wp_unslash( $_POST['main_payment_id'] ) ) : '',
);
echo wp_json_encode( $this->submit_results( $options, $data ) );
die();
wp_die();
}

/**
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.3
Requires PHP: 5.4
Stable tag: 8.1.17
Stable tag: 8.1.18
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.1.18 (October 26, 2023) =
* Enhancement: Updated the message when you submit a quiz in draft mode

= 8.1.17 (October 11, 2023) =
* Feature: Added option to include custom text when the answer choice limit exceeds in multiple response type questions.
* Feature: Added a new feature to accept shortcodes in the text set to display at the end of quizzes.
Expand Down

0 comments on commit cc5c487

Please sign in to comment.