' . __('Your responses are not being saved in the database due to a technical issue. Please contact the website administrator for assistance.', 'quiz-master-next') . '
';
+ $result_display .= '
' . __("Sorry, there's an issue in saving your responses. Please let the website admin know about it.", "quiz-master-next") . '
';
}
$result_display .= $results_pages['display'];
$result_display = apply_filters( 'qmn_after_results_text', $result_display, $qmn_quiz_options, $qmn_array_for_variables );
@@ -1990,6 +2120,7 @@ public function submit_results( $qmn_quiz_options, $qmn_array_for_variables ) {
'result_status' => array(
'save_response' => $qmn_array_for_variables['response_saved'],
'id' => $qmn_array_for_variables['result_unique_id'],
+ 'error_details' => substr( $error_details, 0, 15 ),
),
);
$return_array = apply_filters( 'qsm_submit_results_return_array', $return_array, $qmn_array_for_variables );
diff --git a/php/classes/class-qsm-install.php b/php/classes/class-qsm-install.php
index 447871480..5c026f466 100644
--- a/php/classes/class-qsm-install.php
+++ b/php/classes/class-qsm-install.php
@@ -1610,11 +1610,11 @@ public function update() {
// Update 0.5
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'comment_section'" ) != 'comment_section' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD comment_field_text TEXT NOT NULL AFTER phone_field_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$sql = 'ALTER TABLE ' . $table_name . ' ADD comment_section INT NOT NULL AFTER admin_email';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$sql = 'ALTER TABLE ' . $table_name . ' ADD message_comment TEXT NOT NULL AFTER message_after';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET comment_field_text='Comments', comment_section=1, message_comment='Enter You Text Here'";
$results = $wpdb->query( $update_sql );
}
@@ -1622,7 +1622,7 @@ public function update() {
// Update 0.9.4
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'randomness_order'" ) != 'randomness_order' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD randomness_order INT NOT NULL AFTER system';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET randomness_order=0';
$results = $wpdb->query( $update_sql );
}
@@ -1630,7 +1630,7 @@ public function update() {
// Update 0.9.5
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_answer_template'" ) != 'question_answer_template' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_answer_template TEXT NOT NULL AFTER comment_field_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$mlw_question_answer_default = '%QUESTION% Answer Provided: %USER_ANSWER% Correct Answer: %CORRECT_ANSWER% Comments Entered: %USER_COMMENTS% ';
$update_sql = 'UPDATE ' . $table_name . " SET question_answer_template='" . $mlw_question_answer_default . "'";
$results = $wpdb->query( $update_sql );
@@ -1639,7 +1639,7 @@ public function update() {
// Update 0.9.6
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'contact_info_location'" ) != 'contact_info_location' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD contact_info_location INT NOT NULL AFTER send_admin_email';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET contact_info_location=0';
$results = $wpdb->query( $update_sql );
}
@@ -1647,7 +1647,7 @@ public function update() {
// Update 1.0
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'email_from_text'" ) != 'email_from_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD email_from_text TEXT NOT NULL AFTER comment_field_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET email_from_text='Wordpress'";
$results = $wpdb->query( $update_sql );
}
@@ -1655,7 +1655,7 @@ public function update() {
// Update 1.3.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'loggedin_user_contact'" ) != 'loggedin_user_contact' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD loggedin_user_contact INT NOT NULL AFTER randomness_order';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET loggedin_user_contact=0';
$results = $wpdb->query( $update_sql );
}
@@ -1663,7 +1663,7 @@ public function update() {
// Update 1.5.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_from_total'" ) != 'question_from_total' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_from_total INT NOT NULL AFTER comment_section';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET question_from_total=0';
$results = $wpdb->query( $update_sql );
}
@@ -1671,13 +1671,13 @@ public function update() {
// Update 1.6.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'total_user_tries'" ) != 'total_user_tries' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD total_user_tries INT NOT NULL AFTER question_from_total';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET total_user_tries=0';
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'total_user_tries_text'" ) != 'total_user_tries_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD total_user_tries_text TEXT NOT NULL AFTER total_user_tries';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET total_user_tries_text='Enter Your Text Here'";
$results = $wpdb->query( $update_sql );
}
@@ -1685,13 +1685,13 @@ public function update() {
// Update 1.8.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'message_end_template'" ) != 'message_end_template' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD message_end_template TEXT NOT NULL AFTER message_comment';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET message_end_template=''";
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'certificate_template'" ) != 'certificate_template' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD certificate_template TEXT NOT NULL AFTER total_user_tries_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET certificate_template='Enter your text here!'";
$results = $wpdb->query( $update_sql );
}
@@ -1699,31 +1699,31 @@ public function update() {
// Update 1.9.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'social_media'" ) != 'social_media' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD social_media INT NOT NULL AFTER certificate_template';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET social_media='0'";
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'social_media_text'" ) != 'social_media_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD social_media_text TEXT NOT NULL AFTER social_media';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET social_media_text='I just score a %CORRECT_SCORE%% on %QUIZ_NAME%!'";
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'pagination'" ) != 'pagination' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD pagination INT NOT NULL AFTER social_media_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET pagination=0';
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'pagination_text'" ) != 'pagination_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD pagination_text TEXT NOT NULL AFTER pagination';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET pagination_text='Next'";
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'timer_limit'" ) != 'timer_limit' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD timer_limit INT NOT NULL AFTER pagination_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . ' SET timer_limit=0';
$results = $wpdb->query( $update_sql );
}
@@ -1731,7 +1731,7 @@ public function update() {
// Update 2.1.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'quiz_stye'" ) != 'quiz_stye' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD quiz_stye TEXT NOT NULL AFTER timer_limit';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$mlw_style_default = '
div.mlw_qmn_quiz input[type=radio],
div.mlw_qmn_quiz input[type=submit],
@@ -1781,7 +1781,7 @@ public function update() {
// Update 2.2.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_numbering'" ) != 'question_numbering' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_numbering INT NOT NULL AFTER quiz_stye';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET question_numbering='0'";
$results = $wpdb->query( $update_sql );
}
@@ -1789,7 +1789,7 @@ public function update() {
// Update 2.8.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'quiz_settings'" ) != 'quiz_settings' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD quiz_settings TEXT NOT NULL AFTER question_numbering';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET quiz_settings=''";
$results = $wpdb->query( $update_sql );
}
@@ -1797,7 +1797,7 @@ public function update() {
// Update 3.0.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'theme_selected'" ) != 'theme_selected' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD theme_selected TEXT NOT NULL AFTER quiz_settings';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET theme_selected='default'";
$results = $wpdb->query( $update_sql );
}
@@ -1805,7 +1805,7 @@ public function update() {
// Update 3.3.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'last_activity'" ) != 'last_activity' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD last_activity DATETIME NOT NULL AFTER theme_selected';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET last_activity='%s'", gmdate( 'Y-m-d H:i:s' ) );
$results = $wpdb->query( $update_sql );
}
@@ -1813,25 +1813,25 @@ public function update() {
// Update 3.5.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'require_log_in'" ) != 'require_log_in' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD require_log_in INT NOT NULL AFTER last_activity';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET require_log_in='%d'", '0' );
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'require_log_in_text'" ) != 'require_log_in_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD require_log_in_text TEXT NOT NULL AFTER require_log_in';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( 'UPDATE ' . $table_name . " SET require_log_in_text='%s'", 'Enter Text Here' );
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'limit_total_entries'" ) != 'limit_total_entries' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD limit_total_entries INT NOT NULL AFTER require_log_in_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET limit_total_entries='%d'", '0' );
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'limit_total_entries_text'" ) != 'limit_total_entries_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD limit_total_entries_text TEXT NOT NULL AFTER limit_total_entries';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET limit_total_entries_text='%s'", 'Enter Text Here' );
$results = $wpdb->query( $update_sql );
}
@@ -1839,19 +1839,19 @@ public function update() {
// Update 7.3.8
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'quiz_author_id'" ) != 'quiz_author_id' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD quiz_author_id TEXT NOT NULL AFTER deleted';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
}
// Update 3.7.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'scheduled_timeframe'" ) != 'scheduled_timeframe' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD scheduled_timeframe TEXT NOT NULL AFTER limit_total_entries_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET scheduled_timeframe=''";
$results = $wpdb->query( stripslashes( esc_sql( $update_sql ) ) );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'scheduled_timeframe_text'" ) != 'scheduled_timeframe_text' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD scheduled_timeframe_text TEXT NOT NULL AFTER scheduled_timeframe';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET scheduled_timeframe_text='%s'", 'Enter Text Here' );
$results = $wpdb->query( $update_sql );
}
@@ -1859,13 +1859,13 @@ public function update() {
// Update 4.3.0
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'disable_answer_onselect'" ) != 'disable_answer_onselect' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD disable_answer_onselect INT NOT NULL AFTER scheduled_timeframe_text';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET disable_answer_onselect=%d", '0' );
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'ajax_show_correct'" ) != 'ajax_show_correct' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD ajax_show_correct INT NOT NULL AFTER disable_answer_onselect';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET ajax_show_correct=%d", '0' );
$results = $wpdb->query( $update_sql );
}
@@ -1875,23 +1875,23 @@ public function update() {
// Update 0.5
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'comments'" ) != 'comments' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD comments INT NOT NULL AFTER correct_answer';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$sql = 'ALTER TABLE ' . $table_name . ' ADD hints TEXT NOT NULL AFTER comments';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET comments=%d, hints=''", '1' );
$results = $wpdb->query( $update_sql );
}
// Update 0.8
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_order'" ) != 'question_order' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_order INT NOT NULL AFTER hints';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET question_order=%d", '0' );
$results = $wpdb->query( $update_sql );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_type'" ) != 'question_type' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_type INT NOT NULL AFTER question_order';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET question_type=%d", '0' );
$results = $wpdb->query( $update_sql );
}
@@ -1899,7 +1899,7 @@ public function update() {
// Update 1.1.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_answer_info'" ) != 'question_answer_info' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_answer_info TEXT NOT NULL AFTER correct_answer';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET question_answer_info=''";
$results = $wpdb->query( stripslashes( esc_sql( $update_sql ) ) );
}
@@ -1907,7 +1907,7 @@ public function update() {
// Update 2.5.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'answer_array'" ) != 'answer_array' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD answer_array TEXT NOT NULL AFTER question_name';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET answer_array=''";
$results = $wpdb->query( stripslashes( esc_sql( $update_sql ) ) );
}
@@ -1915,7 +1915,7 @@ public function update() {
// Update 3.1.1
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_settings'" ) != 'question_settings' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_settings TEXT NOT NULL AFTER question_type';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET question_settings=''";
$results = $wpdb->query( stripslashes( esc_sql( $update_sql ) ) );
}
@@ -1923,7 +1923,7 @@ public function update() {
// Update 4.0.0
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'category'" ) != 'category' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD category TEXT NOT NULL AFTER question_settings';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = 'UPDATE ' . $table_name . " SET category=''";
$results = $wpdb->query( stripslashes( esc_sql( $update_sql ) ) );
}
@@ -1931,7 +1931,7 @@ public function update() {
// Update 4.0.0
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'question_type_new'" ) != 'question_type_new' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD question_type_new TEXT NOT NULL AFTER question_type';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET question_type_new=%s", 'question_type' );
$results = $wpdb->query( $update_sql );
}
@@ -1940,21 +1940,21 @@ public function update() {
$user_email_template_data = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $wpdb->prefix . "mlw_quizzes LIKE 'user_email_template'" );
if ( 'text' === $user_email_template_data->Type ) {
$sql = 'ALTER TABLE ' . $wpdb->prefix . 'mlw_quizzes MODIFY user_email_template LONGTEXT';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
}
// Update 7.3.11
$user_message_after_data = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $wpdb->prefix . "mlw_quizzes LIKE 'message_after'" );
if ( 'text' === $user_message_after_data->Type ) {
$sql = 'ALTER TABLE ' . $wpdb->prefix . 'mlw_quizzes MODIFY message_after LONGTEXT';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
}
// Update 2.6.1
- $results = $wpdb->query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_qm_audit_trail CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' );
- $results = $wpdb->query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_questions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
- $results = $wpdb->query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_quizzes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
- $results = $wpdb->query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_results CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_qm_audit_trail CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;' );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_questions CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_quizzes CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_results CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci' );
global $wpdb;
$table_name = $wpdb->prefix . 'mlw_results';
@@ -1963,7 +1963,7 @@ public function update() {
// Update 2.6.4
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $table_name . " LIKE 'user'" ) != 'user' ) {
$sql = 'ALTER TABLE ' . $table_name . ' ADD user INT NOT NULL AFTER phone';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET user=%d", '0' );
$results = $wpdb->query( $update_sql );
}
@@ -1971,23 +1971,23 @@ public function update() {
// Update 4.7.0
if ( $wpdb->get_var( "SHOW COLUMNS FROM $table_name LIKE 'user_ip'" ) != 'user_ip' ) {
$sql = "ALTER TABLE $table_name ADD user_ip TEXT NOT NULL AFTER user";
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$update_sql = $wpdb->prepare( "UPDATE {$table_name} SET user_ip='%s'", 'Unknown' );
$results = $wpdb->query( $update_sql );
}
// Update 7.1.11
$user_message_after_data = $wpdb->get_row( 'SHOW COLUMNS FROM ' . $wpdb->prefix . "mlw_results LIKE 'point_score'" );
if ( 'FLOAT' != $user_message_after_data->Type ) {
- $results = $wpdb->query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_results MODIFY point_score FLOAT NOT NULL;' );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( 'ALTER TABLE ' . $wpdb->prefix . 'mlw_results MODIFY point_score FLOAT NOT NULL;' );
}
if ( $wpdb->get_var( 'SHOW COLUMNS FROM ' . $audit_table . " LIKE 'quiz_id'" ) != 'quiz_id' ) {
$sql = 'ALTER TABLE ' . $audit_table . ' ADD quiz_id TEXT NOT NULL AFTER action';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$sql = 'ALTER TABLE ' . $audit_table . ' ADD quiz_name TEXT NOT NULL AFTER quiz_id';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
$sql = 'ALTER TABLE ' . $audit_table . ' ADD form_data TEXT NOT NULL AFTER quiz_name';
- $results = $wpdb->query( $sql );
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query( $sql );
}
// Update 5.0.0
@@ -2010,7 +2010,7 @@ public function update() {
// Update 8.1.14
if ( ! $wpdb->query("SHOW KEYS FROM {$results_table_name} WHERE Key_name = 'unique_id_unique'" ) ) {
- $results = $wpdb->query("ALTER TABLE {$results_table_name} ADD UNIQUE (unique_id)");
+ $results = $mlwQuizMasterNext->wpdb_alter_table_query("ALTER TABLE {$results_table_name} ADD UNIQUE (unique_id)");
}
// Update 8.0.3
diff --git a/readme.txt b/readme.txt
index 5aa588bca..cbe460179 100644
--- a/readme.txt
+++ b/readme.txt
@@ -165,6 +165,9 @@ This is usually a theme conflict. You can [checkout out our common conflict solu
== Changelog ==
= 9.0.2 ( Beta ) =
* Bug: Fixed display shortcode php buffer due to invalid quiz id
+* Feature: Added Failed submission list in QSM menu
+* Feature: Added retrieve or delete failed submission
+* Enhancement: Added admin notification if database user does not have proper permission.
= 9.0.1 (April 25, 2024) =
* Bug: Fixed date format in %ANSWER_X% variable