Skip to content

Commit

Permalink
Merge pull request #2386 from QuizandSurveyMaster/CU-85zta2cwk-update…
Browse files Browse the repository at this point in the history
…-options-UI

update draft quiz message
  • Loading branch information
zubairraeen authored Oct 26, 2023
2 parents 4b7068d + ade551f commit 83d291a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 13 additions & 1 deletion php/classes/class-qmn-quiz-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,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 @@ -1574,6 +1574,18 @@ public function ajax_submit_results() {
);
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,
),
)
);
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 Down
4 changes: 3 additions & 1 deletion php/classes/class-qsm-install.php
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,10 @@ public static function install() {
time_taken_real DATETIME NOT NULL,
quiz_results MEDIUMTEXT NOT NULL,
deleted INT NOT NULL,
unique_id varchar(255) NOT NULL,
unique_id varchar(100) NOT NULL,
form_type INT NOT NULL,
page_name varchar(255) NOT NULL,
page_url varchar(255) NOT NULL,
UNIQUE (unique_id),
PRIMARY KEY (result_id)
) $charset_collate;";
Expand Down

0 comments on commit 83d291a

Please sign in to comment.