Skip to content

Commit

Permalink
Merge pull request #2383 from QuizandSurveyMaster/CU-85zt92u5r-store-…
Browse files Browse the repository at this point in the history
…failed-results-in-audits

added alert for user if result not inserting in database
  • Loading branch information
zubairraeen authored Oct 23, 2023
2 parents fedd5c4 + 5c8bb78 commit ffb1f1c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
8 changes: 8 additions & 0 deletions css/common-rtl.css
Original file line number Diff line number Diff line change
Expand Up @@ -403,4 +403,12 @@ div .qsm-results-page .qmn_image_option {
-webkit-transition: background .25s ease-out;
-moz-transition: background .25s ease-out;
transition: background .25s ease-out;
}
.qsm-result-page-warning {
color: #842029;
background-color: #f8d7da;
border-color: #f5c2c7;
padding: 1rem;
border-radius: 0.25rem;
margin-bottom: 1rem;
}
8 changes: 8 additions & 0 deletions css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -626,4 +626,12 @@ body .ui-tooltip.ui-widget-content {
-webkit-transition: background .25s ease-out;
-moz-transition: background .25s ease-out;
transition: background .25s ease-out;
}
.qsm-result-page-warning {
color: #842029;
background-color: #f8d7da;
border-color: #f5c2c7;
padding: 1rem;
border-radius: 0.25rem;
margin-bottom: 1rem;
}
13 changes: 8 additions & 5 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 @@ -1859,6 +1859,9 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {

// Determines redirect/results page.
$results_pages = $this->display_results_text( $qmn_quiz_options, $qmn_array_for_variables );
if ( 1 === intval( $qmn_quiz_options->store_responses ) && ! $qmn_array_for_variables['response_saved'] ) {
$result_display .= '<div class="qsm-result-page-warning">' . __('Your responses are not being saved in the database due to a technical issue. Please contact the website administrator for assistance.', 'quiz-master-next') . '</div>';
}
$result_display .= $results_pages['display'];
$result_display = apply_filters( 'qmn_after_results_text', $result_display, $qmn_quiz_options, $qmn_array_for_variables );

Expand Down

0 comments on commit ffb1f1c

Please sign in to comment.