wp_tutor_quiz_attempts
StaticStores tutor quiz attempts data created by this plugin.
Column Definitions
| Column | Type | Nullable |
|---|---|---|
| 🔑attempt_id | bigint(20) | NO |
| course_id | bigint(20) | YES |
| quiz_id | bigint(20) | YES |
| user_id | bigint(20) | YES |
| total_questions | int(11) | YES |
| total_answered_questions | int(11) | YES |
| total_marks | decimal(9,2) | YES |
| earned_marks | decimal(9,2) | YES |
| attempt_info | text | YES |
| attempt_status | varchar(50) | YES |
| attempt_ip | varchar(250) | YES |
| attempt_started_at | datetime | YES |
| attempt_ended_at | datetime | YES |
| is_manually_reviewed | int(1) | YES |
| manually_reviewed_at | datetime | YES |
| result | varchar(10) | YES |
| user_id | bigint(20) | YES |
| quiz_id | bigint(20) | YES |
| question_id | bigint(20) | YES |
| quiz_attempt_id | bigint(20) | YES |
| given_answer | longtext | YES |
| question_mark | decimal(8,2) | YES |
| achieved_mark | decimal(8,2) | YES |
| minus_mark | decimal(8,2) | YES |
| is_correct | tinyint(4) | YES |
| quiz_id | bigint(20) | YES |
| question_title | text | YES |
| question_description | longtext | YES |
| answer_explanation | longtext | YES |
| question_type | varchar(50) | YES |
| question_mark | decimal(9,2) | YES |
| question_settings | longtext | YES |
| question_order | int(11) | YES |
| belongs_question_id | bigint(20) | YES |
| belongs_question_type | varchar(250) | YES |
| answer_title | text | YES |
| is_correct | tinyint(4) | YES |
| image_id | bigint(20) | YES |
| answer_two_gap_match | text | YES |
| answer_view_format | varchar(250) | YES |
| answer_settings | text | YES |
| answer_order | int(11) | YES |
| user_id | bigint(20) | YES |
| course_id | bigint(20) | YES |
| order_id | bigint(20) | YES |
| order_status | varchar(50) | YES |
| course_price_total | decimal(16,2) | YES |
| course_price_grand_total | decimal(16,2) | YES |
| instructor_amount | decimal(16,2) | YES |
| instructor_rate | decimal(16,2) | YES |
| admin_amount | decimal(16,2) | YES |
| admin_rate | decimal(16,2) | YES |
| commission_type | varchar(20) | YES |
| deduct_fees_amount | decimal(16,2) | YES |
| deduct_fees_name | varchar(250) | YES |
| deduct_fees_type | varchar(20) | YES |
| process_by | varchar(20) | YES |
| created_at | datetime | YES |
| user_id | bigint(20) | YES |
| amount | decimal(16,2) | YES |
| method_data | text | YES |
| status | varchar(50) | YES |
| updated_at | datetime | YES |
| created_at | datetime | YES |
| parent_id | BIGINT(20) UNSIGNED | YES |
| store | subscription | YES |
| user_id | BIGINT(20) UNSIGNED | NO |
| order_type | VARCHAR(50) | NO |
| subscription | order_status | NO |
| payment_status | VARCHAR(50) | NO |
| subtotal_price | DECIMAL(13, 2) | NO |
| tax_rate | DECIMAL(13, 2) | YES |
| tax_amount | DECIMAL(13, 2) | YES |
| total_price | DECIMAL(13, 2) | NO |
| coupon_amount | DECIMAL(13, 2) | YES |
| discount_type | ENUM('percentage', 'flat') | YES |
| discount_amount | DECIMAL(13, 2) | YES |
| discount_reason | TEXT | YES |
| fees | DECIMAL(13, 2) | YES |
| payment_payloads | LONGTEXT | YES |
| note | TEXT | YES |
| created_at_gmt | DATETIME | NO |
| created_by | BIGINT(20) UNSIGNED | NO |
| updated_at_gmt | DATETIME | YES |
| updated_by | BIGINT(20) UNSIGNED | NO |
| order_id | BIGINT(20) UNSIGNED | NO |
| meta_key | VARCHAR(255) | NO |
| meta_value | LONGTEXT | NO |
| created_at_gmt | DATETIME | NO |
| created_by | BIGINT(20) UNSIGNED | NO |
| updated_at_gmt | DATETIME | YES |
| updated_by | BIGINT(20) UNSIGNED | NO |
| order_id | BIGINT(20) UNSIGNED | NO |
| item_id | BIGINT(20) UNSIGNED | NO |
| coupon_status | VARCHAR(50) | YES |
| coupon_type | VARCHAR(100) | YES |
| coupon_title | VARCHAR(255) | NO |
| coupon_description | TEXT | YES |
| discount_type | ENUM('percentage', 'flat') | NO |
| discount_amount | DECIMAL(13, 2) | NO |
| applies_to | VARCHAR(100) | YES |
| specific_category | total_usage_limit | YES |
| minimum_quantity | purchase_requirement_value | YES |
| start_date_gmt | DATETIME | NO |
| expire_date_gmt | DATETIME | YES |
| created_at_gmt | DATETIME | NO |
| created_by | BIGINT(20) UNSIGNED | NO |
| updated_at_gmt | DATETIME | YES |
| updated_by | BIGINT(20) UNSIGNED | NO |
| reference_id | BIGINT(20) UNSIGNED | NO |
| coupon_code | VARCHAR(50) | NO |
| user_id | BIGINT(20) UNSIGNED | NO |
| user_id | BIGINT(20) UNSIGNED | YES |
| coupon_code | VARCHAR(50) | YES |
| created_at_gmt | DATETIME | NO |
| updated_at_gmt | DATETIME | YES |
| cart_id | BIGINT(20) UNSIGNED | NO |
| course_id | BIGINT(20) UNSIGNED | NO |
| user_id | BIGINT(20) UNSIGNED | YES |
| billing_first_name | VARCHAR(255) | NO |
| billing_last_name | VARCHAR(255) | NO |
| billing_email | VARCHAR(255) | NO |
| billing_phone | VARCHAR(20) | NO |
| billing_zip_code | VARCHAR(20) | NO |
| billing_address | TEXT | NO |
| billing_country | VARCHAR(100) | NO |
| billing_state | VARCHAR(100) | NO |
| billing_city | VARCHAR(100) | NO |
CREATE TABLE Statement
CREATE TABLE wp_tutor_quiz_attempts ( attempt_id bigint(20) NOT NULL AUTO_INCREMENT, course_id bigint(20) DEFAULT NULL, quiz_id bigint(20) DEFAULT NULL, user_id bigint(20) DEFAULT NULL, total_questions int(11) DEFAULT NULL, total_answered_questions int(11) DEFAULT NULL, total_marks decimal(9,2) DEFAULT NULL, earned_marks decimal(9,2) DEFAULT NULL, attempt_info text, attempt_status varchar(50) DEFAULT NULL, attempt_ip varchar(250) DEFAULT NULL, attempt_started_at datetime DEFAULT NULL, attempt_ended_at datetime DEFAULT NULL, is_manually_reviewed int(1) DEFAULT NULL, manually_reviewed_at datetime DEFAULT NULL, result varchar(10) DEFAULT NULL, PRIMARY KEY (attempt_id), INDEX (course_id), INDEX (quiz_id), INDEX (user_id), INDEX (result) ) $charset_collate;"; $quiz_attempt_answers = "CREATE TABLE wp_tutor_quiz_attempt_answers ( attempt_answer_id bigint(20) NOT NULL AUTO_INCREMENT, user_id bigint(20) DEFAULT NULL, quiz_id bigint(20) DEFAULT NULL, question_id bigint(20) DEFAULT NULL, quiz_attempt_id bigint(20) DEFAULT NULL, given_answer longtext, question_mark decimal(8,2) DEFAULT NULL, achieved_mark decimal(8,2) DEFAULT NULL, minus_mark decimal(8,2) DEFAULT NULL, is_correct tinyint(4) DEFAULT NULL, PRIMARY KEY (attempt_answer_id) ) $charset_collate;"; $tutor_quiz_questions = "CREATE TABLE wp_tutor_quiz_questions ( question_id bigint(20) NOT NULL AUTO_INCREMENT, quiz_id bigint(20) DEFAULT NULL, question_title text, question_description longtext, answer_explanation longtext DEFAULT '', question_type varchar(50) DEFAULT NULL, question_mark decimal(9,2) DEFAULT NULL, question_settings longtext, question_order int(11) DEFAULT NULL, PRIMARY KEY (question_id) ) $charset_collate;"; $tutor_quiz_question_answers = "CREATE TABLE wp_tutor_quiz_question_answers ( answer_id bigint(20) NOT NULL AUTO_INCREMENT, belongs_question_id bigint(20) DEFAULT NULL, belongs_question_type varchar(250) DEFAULT NULL, answer_title text, is_correct tinyint(4) DEFAULT NULL, image_id bigint(20) DEFAULT NULL, answer_two_gap_match text, answer_view_format varchar(250) DEFAULT NULL, answer_settings text, answer_order int(11) DEFAULT '0', PRIMARY KEY (answer_id) ) $charset_collate;"; $earning_table = "CREATE TABLE IF NOT EXISTS wp_tutor_earnings ( earning_id bigint(20) NOT NULL AUTO_INCREMENT, user_id bigint(20) DEFAULT NULL, course_id bigint(20) DEFAULT NULL, order_id bigint(20) DEFAULT NULL, order_status varchar(50) DEFAULT NULL, course_price_total decimal(16,2) DEFAULT NULL, course_price_grand_total decimal(16,2) DEFAULT NULL, instructor_amount decimal(16,2) DEFAULT NULL, instructor_rate decimal(16,2) DEFAULT NULL, admin_amount decimal(16,2) DEFAULT NULL, admin_rate decimal(16,2) DEFAULT NULL, commission_type varchar(20) DEFAULT NULL, deduct_fees_amount decimal(16,2) DEFAULT NULL, deduct_fees_name varchar(250) DEFAULT NULL, deduct_fees_type varchar(20) DEFAULT NULL, process_by varchar(20) DEFAULT NULL, created_at datetime DEFAULT NULL, PRIMARY KEY (earning_id), INDEX (user_id), INDEX (course_id), INDEX (order_id), INDEX (process_by) ) $charset_collate;"; $withdraw_table = "CREATE TABLE IF NOT EXISTS wp_tutor_withdraws ( withdraw_id bigint(20) NOT NULL AUTO_INCREMENT, user_id bigint(20) DEFAULT NULL, amount decimal(16,2) DEFAULT NULL, method_data text DEFAULT NULL, status varchar(50) DEFAULT NULL, updated_at datetime DEFAULT NULL, created_at datetime DEFAULT NULL, PRIMARY KEY (withdraw_id) ) $charset_collate;"; $orders_table = "CREATE TABLE wp_tutor_orders ( id BIGINT(20) UNSIGNED AUTO_INCREMENT, parent_id BIGINT(20) UNSIGNED DEFAULT 0, -- for subscription order, store subscription record id transaction_id VARCHAR(255) COMMENT 'Transaction id from payment gateway', user_id BIGINT(20) UNSIGNED NOT NULL, order_type VARCHAR(50) NOT NULL, -- single_order, subscription order_status VARCHAR(50) NOT NULL, payment_status VARCHAR(50) NOT NULL, subtotal_price DECIMAL(13, 2) NOT NULL, -- price calculation based on course sale price pre_tax_price DECIMAL(13, 2) NOT NULL, -- total price before adding tax tax_type VARCHAR(50), tax_rate DECIMAL(13, 2) COMMENT 'Tax percentage', tax_amount DECIMAL(13, 2), total_price DECIMAL(13, 2) NOT NULL, -- final price net_payment DECIMAL(13, 2) NOT NULL, -- calculated price if any refund is done else same as total_price coupon_code VARCHAR(255), coupon_amount DECIMAL(13, 2), discount_type ENUM('percentage', 'flat') DEFAULT NULL, discount_amount DECIMAL(13, 2), discount_reason TEXT, fees DECIMAL(13, 2), -- payment gateway fees earnings DECIMAL(13, 2), -- net earning refund_amount DECIMAL(13, 2), -- Refund amount payment_method VARCHAR(255), payment_payloads LONGTEXT, note TEXT, created_at_gmt DATETIME NOT NULL, created_by BIGINT(20) UNSIGNED NOT NULL, updated_at_gmt DATETIME, updated_by BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY user_id (user_id), KEY order_type (order_type), KEY payment_status (payment_status), KEY order_status (order_status), KEY transaction_id (transaction_id) ) $charset_collate;"; $order_meta_table = "CREATE TABLE wp_tutor_ordermeta ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, order_id BIGINT(20) UNSIGNED NOT NULL, meta_key VARCHAR(255) NOT NULL, meta_value LONGTEXT NOT NULL, created_at_gmt DATETIME NOT NULL, created_by BIGINT(20) UNSIGNED NOT NULL, updated_at_gmt DATETIME, updated_by BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY order_id (order_id), KEY meta_key (meta_key), CONSTRAINT fk_tutor_ordermeta_order_id FOREIGN KEY (order_id) REFERENCES wp_tutor_orders(id) ON DELETE CASCADE ) $charset_collate;"; $order_items_table = "CREATE TABLE wp_tutor_order_items ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, order_id BIGINT(20) UNSIGNED NOT NULL, item_id BIGINT(20) UNSIGNED NOT NULL, -- course id/plan id regular_price DECIMAL(13, 2) NOT NULL, -- course regular price sale_price VARCHAR(13) DEFAULT NULL, -- course sale price discount_price VARCHAR(13) DEFAULT NULL, -- course discount price coupon_code VARCHAR(255) DEFAULT NULL, -- coupon code PRIMARY KEY (id), KEY order_id (order_id), KEY item_id (item_id), CONSTRAINT fk_tutor_order_item_order_id FOREIGN KEY (order_id) REFERENCES wp_tutor_orders(id) ON DELETE CASCADE ) $charset_collate;"; $coupons_table = "CREATE TABLE wp_tutor_coupons ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, coupon_status VARCHAR(50), coupon_type VARCHAR(100) DEFAULT 'code', -- coupon type 'code' or 'automatic' coupon_code VARCHAR(50) NOT NULL, coupon_title VARCHAR(255) NOT NULL, coupon_description TEXT, discount_type ENUM('percentage', 'flat') NOT NULL, discount_amount DECIMAL(13, 2) NOT NULL, applies_to VARCHAR(100) DEFAULT 'all_courses_and_bundles', -- possible values 'all_courses_and_bundles', 'all_courses', 'all_bundles', 'specific_courses', 'specific_bundles', 'specific_category' total_usage_limit INT(10) UNSIGNED DEFAULT NULL, -- null for unlimited usage per_user_usage_limit TINYINT(4) UNSIGNED DEFAULT NULL, -- null for unlimited usage purchase_requirement VARCHAR(50) DEFAULT 'no_minimum', -- possible values 'no_minimum', 'minimum_purchase', 'minimum_quantity' purchase_requirement_value DECIMAL(13, 2), start_date_gmt DATETIME NOT NULL, expire_date_gmt DATETIME DEFAULT NULL, created_at_gmt DATETIME NOT NULL, created_by BIGINT(20) UNSIGNED NOT NULL, updated_at_gmt DATETIME, updated_by BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (id), UNIQUE KEY coupon_code (coupon_code), KEY start_date_gmt (start_date_gmt), KEY expire_date_gmt (expire_date_gmt) ) $charset_collate;"; $coupon_applications_table = "CREATE TABLE wp_tutor_coupon_applications ( coupon_code VARCHAR(50) NOT NULL, reference_id BIGINT(20) UNSIGNED NOT NULL, KEY coupon_code (coupon_code), KEY reference_id (reference_id), CONSTRAINT fk_tutor_coupon_application_coupon_code FOREIGN KEY (coupon_code) REFERENCES wp_tutor_coupons(coupon_code) ON DELETE CASCADE ) $charset_collate;"; $coupon_usage_table = "CREATE TABLE wp_tutor_coupon_usages ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, coupon_code VARCHAR(50) NOT NULL, user_id BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY coupon_code (coupon_code), KEY user_id (user_id), CONSTRAINT fk_tutor_coupon_usage_coupon_code FOREIGN KEY (coupon_code) REFERENCES wp_tutor_coupons(coupon_code) ON DELETE CASCADE, CONSTRAINT fk_tutor_coupon_usage_user_id FOREIGN KEY (user_id) REFERENCES wp_users(ID) ON DELETE CASCADE ) $charset_collate;"; $cart_table = "CREATE TABLE wp_tutor_carts ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id BIGINT(20) UNSIGNED DEFAULT NULL, coupon_code VARCHAR(50) DEFAULT NULL, created_at_gmt DATETIME NOT NULL, updated_at_gmt DATETIME, PRIMARY KEY (id), KEY user_id (user_id), KEY coupon_code (coupon_code), CONSTRAINT fk_tutor_cart_user_id FOREIGN KEY (user_id) REFERENCES wp_users(ID) ON DELETE CASCADE ) $charset_collate;"; $cart_items_table = "CREATE TABLE wp_tutor_cart_items ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, cart_id BIGINT(20) UNSIGNED NOT NULL, course_id BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (id), KEY cart_id (cart_id), KEY course_id (course_id), CONSTRAINT fk_tutor_cart_item_cart_id FOREIGN KEY (cart_id) REFERENCES wp_tutor_carts(id) ON DELETE CASCADE, CONSTRAINT fk_tutor_cart_item_course_id FOREIGN KEY (course_id) REFERENCES wp_posts(ID) ON DELETE CASCADE ) $charset_collate;"; $customer_table = "CREATE TABLE wp_tutor_customers ( id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, user_id BIGINT(20) UNSIGNED DEFAULT NULL, billing_first_name VARCHAR(255) NOT NULL, billing_last_name VARCHAR(255) NOT NULL, billing_email VARCHAR(255) NOT NULL, billing_phone VARCHAR(20) NOT NULL, billing_zip_code VARCHAR(20) NOT NULL, billing_address TEXT NOT NULL, billing_country VARCHAR(100) NOT NULL, billing_state VARCHAR(100) NOT NULL, billing_city VARCHAR(100) NOT NULL, PRIMARY KEY (id), KEY user_id (user_id), KEY billing_email (billing_email) ) $charset_collate;"; require_once ABSPATH . 'wp-admin/includes/upgrade.php'; dbDelta( $quiz_attempts_sql );Safe to delete?
If you have uninstalled Tutor LMS – eLearning and online course solution, this table is generally safe to remove. However, always back up your database first.
Note: Some plugins share tables or are dependencies of other plugins. Verify nothing else depends on this table before dropping it.
How to remove this table
DROP TABLE IF EXISTS `wp_tutor_quiz_attempts`;
Run this query using phpMyAdmin, Adminer, or your MySQL client. Back up first.
Other tables from Tutor LMS – eLearning and online course solution