wp_tutor_quiz_attempts

Static

Stores tutor quiz attempts data created by this plugin.

Column Definitions

ColumnTypeNullable
🔑attempt_idbigint(20)NO
course_idbigint(20)YES
quiz_idbigint(20)YES
user_idbigint(20)YES
total_questionsint(11)YES
total_answered_questionsint(11)YES
total_marksdecimal(9,2)YES
earned_marksdecimal(9,2)YES
attempt_infotextYES
attempt_statusvarchar(50)YES
attempt_ipvarchar(250)YES
attempt_started_atdatetimeYES
attempt_ended_atdatetimeYES
is_manually_reviewedint(1)YES
manually_reviewed_atdatetimeYES
resultvarchar(10)YES
user_idbigint(20)YES
quiz_idbigint(20)YES
question_idbigint(20)YES
quiz_attempt_idbigint(20)YES
given_answerlongtextYES
question_markdecimal(8,2)YES
achieved_markdecimal(8,2)YES
minus_markdecimal(8,2)YES
is_correcttinyint(4)YES
quiz_idbigint(20)YES
question_titletextYES
question_descriptionlongtextYES
answer_explanationlongtextYES
question_typevarchar(50)YES
question_markdecimal(9,2)YES
question_settingslongtextYES
question_orderint(11)YES
belongs_question_idbigint(20)YES
belongs_question_typevarchar(250)YES
answer_titletextYES
is_correcttinyint(4)YES
image_idbigint(20)YES
answer_two_gap_matchtextYES
answer_view_formatvarchar(250)YES
answer_settingstextYES
answer_orderint(11)YES
user_idbigint(20)YES
course_idbigint(20)YES
order_idbigint(20)YES
order_statusvarchar(50)YES
course_price_totaldecimal(16,2)YES
course_price_grand_totaldecimal(16,2)YES
instructor_amountdecimal(16,2)YES
instructor_ratedecimal(16,2)YES
admin_amountdecimal(16,2)YES
admin_ratedecimal(16,2)YES
commission_typevarchar(20)YES
deduct_fees_amountdecimal(16,2)YES
deduct_fees_namevarchar(250)YES
deduct_fees_typevarchar(20)YES
process_byvarchar(20)YES
created_atdatetimeYES
user_idbigint(20)YES
amountdecimal(16,2)YES
method_datatextYES
statusvarchar(50)YES
updated_atdatetimeYES
created_atdatetimeYES
parent_idBIGINT(20) UNSIGNEDYES
storesubscriptionYES
user_idBIGINT(20) UNSIGNEDNO
order_typeVARCHAR(50)NO
subscriptionorder_statusNO
payment_statusVARCHAR(50)NO
subtotal_priceDECIMAL(13, 2)NO
tax_rateDECIMAL(13, 2)YES
tax_amountDECIMAL(13, 2)YES
total_priceDECIMAL(13, 2)NO
coupon_amountDECIMAL(13, 2)YES
discount_typeENUM('percentage', 'flat')YES
discount_amountDECIMAL(13, 2)YES
discount_reasonTEXTYES
feesDECIMAL(13, 2)YES
payment_payloadsLONGTEXTYES
noteTEXTYES
created_at_gmtDATETIMENO
created_byBIGINT(20) UNSIGNEDNO
updated_at_gmtDATETIMEYES
updated_byBIGINT(20) UNSIGNEDNO
order_idBIGINT(20) UNSIGNEDNO
meta_keyVARCHAR(255)NO
meta_valueLONGTEXTNO
created_at_gmtDATETIMENO
created_byBIGINT(20) UNSIGNEDNO
updated_at_gmtDATETIMEYES
updated_byBIGINT(20) UNSIGNEDNO
order_idBIGINT(20) UNSIGNEDNO
item_idBIGINT(20) UNSIGNEDNO
coupon_statusVARCHAR(50)YES
coupon_typeVARCHAR(100)YES
coupon_titleVARCHAR(255)NO
coupon_descriptionTEXTYES
discount_typeENUM('percentage', 'flat')NO
discount_amountDECIMAL(13, 2)NO
applies_toVARCHAR(100)YES
specific_categorytotal_usage_limitYES
minimum_quantitypurchase_requirement_valueYES
start_date_gmtDATETIMENO
expire_date_gmtDATETIMEYES
created_at_gmtDATETIMENO
created_byBIGINT(20) UNSIGNEDNO
updated_at_gmtDATETIMEYES
updated_byBIGINT(20) UNSIGNEDNO
reference_idBIGINT(20) UNSIGNEDNO
coupon_codeVARCHAR(50)NO
user_idBIGINT(20) UNSIGNEDNO
user_idBIGINT(20) UNSIGNEDYES
coupon_codeVARCHAR(50)YES
created_at_gmtDATETIMENO
updated_at_gmtDATETIMEYES
cart_idBIGINT(20) UNSIGNEDNO
course_idBIGINT(20) UNSIGNEDNO
user_idBIGINT(20) UNSIGNEDYES
billing_first_nameVARCHAR(255)NO
billing_last_nameVARCHAR(255)NO
billing_emailVARCHAR(255)NO
billing_phoneVARCHAR(20)NO
billing_zip_codeVARCHAR(20)NO
billing_addressTEXTNO
billing_countryVARCHAR(100)NO
billing_stateVARCHAR(100)NO
billing_cityVARCHAR(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