# ************************************************************
# Sequel Ace SQL dump
# Version 20096
#
# https://sequel-ace.com/
# https://github.com/Sequel-Ace/Sequel-Ace
#
# Host: 127.0.0.1 (MySQL 8.0.42)
# Database: db_ujian_online
# Generation Time: 2026-08-06 03:24:02 +0000
# ************************************************************





# Dump of table classrooms
# ------------------------------------------------------------

CREATE TABLE `classrooms` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `classrooms_title_unique` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `classrooms` (`id`, `title`, `created_at`, `updated_at`)
VALUES
	(1,'test','2026-06-09 11:07:05','2026-06-09 11:07:05');



# Dump of table exam_questions
# ------------------------------------------------------------

CREATE TABLE `exam_questions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `exam_id` bigint unsigned NOT NULL,
  `question_id` bigint unsigned NOT NULL,
  `order_number` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exam_questions_exam_id_foreign` (`exam_id`),
  KEY `exam_questions_question_id_foreign` (`question_id`),
  CONSTRAINT `exam_questions_exam_id_foreign` FOREIGN KEY (`exam_id`) REFERENCES `exams` (`id`) ON DELETE CASCADE,
  CONSTRAINT `exam_questions_question_id_foreign` FOREIGN KEY (`question_id`) REFERENCES `questions` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `exam_questions` (`id`, `exam_id`, `question_id`, `order_number`, `created_at`, `updated_at`)
VALUES
	(1,1,1,NULL,NULL,NULL);



# Dump of table exams
# ------------------------------------------------------------

CREATE TABLE `exams` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `lesson_id` bigint unsigned NOT NULL,
  `classroom_id` bigint unsigned NOT NULL,
  `duration` int NOT NULL,
  `description` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `random_question` enum('Y','N') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Y',
  `random_answer` enum('Y','N') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'Y',
  `show_answer` enum('Y','N') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'N',
  `question_weights` json DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `exams_lesson_id_foreign` (`lesson_id`),
  KEY `exams_classroom_id_foreign` (`classroom_id`),
  CONSTRAINT `exams_classroom_id_foreign` FOREIGN KEY (`classroom_id`) REFERENCES `classrooms` (`id`) ON DELETE CASCADE,
  CONSTRAINT `exams_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `exams` (`id`, `title`, `lesson_id`, `classroom_id`, `duration`, `description`, `random_question`, `random_answer`, `show_answer`, `question_weights`, `created_at`, `updated_at`)
VALUES
	(1,'test',1,1,8,'<p>test</p>','N','N','N','{\"pg\": 15, \"isian\": 20, \"uraian\": 25, \"menjodohkan\": 15, \"pg_kompleks\": 25}','2026-06-09 11:08:11','2026-06-09 11:08:11');



# Dump of table failed_jobs
# ------------------------------------------------------------

CREATE TABLE `failed_jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `uuid` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `connection` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `queue` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `exception` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `failed_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `failed_jobs_uuid_unique` (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


# Dump of table job_batches
# ------------------------------------------------------------

CREATE TABLE `job_batches` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `total_jobs` int NOT NULL,
  `pending_jobs` int NOT NULL,
  `failed_jobs` int NOT NULL,
  `failed_job_ids` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `options` mediumtext COLLATE utf8mb4_unicode_ci,
  `cancelled_at` int DEFAULT NULL,
  `created_at` int NOT NULL,
  `finished_at` int DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table jobs
# ------------------------------------------------------------

CREATE TABLE `jobs` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `queue` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `attempts` tinyint unsigned NOT NULL,
  `reserved_at` int unsigned DEFAULT NULL,
  `available_at` int unsigned NOT NULL,
  `created_at` int unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `jobs_queue_index` (`queue`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table lesson_user
# ------------------------------------------------------------

CREATE TABLE `lesson_user` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `lesson_id` bigint unsigned NOT NULL,
  `user_id` bigint unsigned NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `lesson_user_lesson_id_user_id_unique` (`lesson_id`,`user_id`),
  KEY `lesson_user_user_id_foreign` (`user_id`),
  CONSTRAINT `lesson_user_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE CASCADE,
  CONSTRAINT `lesson_user_user_id_foreign` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;



# Dump of table lessons
# ------------------------------------------------------------

CREATE TABLE `lessons` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `title` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `lessons_title_unique` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `lessons` (`id`, `title`, `created_at`, `updated_at`)
VALUES
	(1,'test','2026-06-09 11:07:00','2026-06-09 11:07:00');



# Dump of table migrations
# ------------------------------------------------------------

CREATE TABLE `migrations` (
  `id` int unsigned NOT NULL AUTO_INCREMENT,
  `migration` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `batch` int NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=34 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `migrations` (`id`, `migration`, `batch`)
VALUES
	(1,'0001_01_01_000000_create_users_table',1),
	(2,'0001_01_01_000001_create_cache_table',1),
	(3,'0001_01_01_000002_create_jobs_table',1),
	(4,'2025_05_26_075743_create_lessons_table',1),
	(5,'2025_05_26_075825_create_classrooms_table',1),
	(6,'2025_05_26_075908_create_exams_table',1),
	(7,'2025_05_26_075946_create_students_table',1),
	(8,'2025_05_26_080020_create_questions_table',1),
	(9,'2025_05_26_080059_create_exam_sessions_table',1),
	(10,'2025_05_26_080133_create_exam_groups_table',1),
	(11,'2025_05_26_080216_create_answers_table',1),
	(12,'2025_05_26_080250_create_grades_table',1),
	(13,'2025_05_26_082522_add_two_factor_columns_to_users_table',1),
	(14,'2026_02_21_143723_add_image_to_questions_table',1),
	(15,'2026_02_23_132407_create_settings_table',1),
	(16,'2026_04_07_131906_alter_questions_table_for_bank_soal',1),
	(17,'2026_04_07_131907_create_exam_questions_table',1),
	(18,'2026_04_07_133546_add_kompetensi_to_questions_table',1),
	(19,'2026_04_07_143828_change_answer_column_type_in_answers_table',1),
	(20,'2026_04_07_205300_add_question_weights_and_manual_score',1),
	(21,'2026_04_07_211604_drop_classroom_id_from_questions_table',1),
	(22,'2026_04_10_000001_add_role_to_users_table',1),
	(23,'2026_04_10_000002_create_lesson_user_table',1),
	(24,'2026_04_11_200000_change_nisn_to_string_in_students_table',1),
	(25,'2026_04_13_223632_add_leave_count_to_grades_table',1),
	(26,'2026_04_14_054000_add_performance_indexes_to_answers_and_grades_tables',1),
	(27,'2026_04_28_121126_make_difficulty_nullable_in_questions_table',1),
	(28,'2026_05_16_100000_add_session_id_to_students_table',2),
	(29,'2026_05_16_063350_add_option_images_to_questions_table',3),
	(30,'2026_08_05_212729_add_min_time_submit_to_settings_table',4),
	(31,'2026_08_05_214014_add_token_to_exam_sessions_table',5),
	(32,'2026_08_05_215158_add_enable_auto_block_to_settings_table',6),
	(33,'2026_08_05_215158_add_is_blocked_to_grades_table',6);




# Dump of table questions
# ------------------------------------------------------------

CREATE TABLE `questions` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `question` text COLLATE utf8mb4_unicode_ci NOT NULL,
  `image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_1` text COLLATE utf8mb4_unicode_ci,
  `option_1_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_2` text COLLATE utf8mb4_unicode_ci,
  `option_2_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_3` text COLLATE utf8mb4_unicode_ci,
  `option_3_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_4` text COLLATE utf8mb4_unicode_ci,
  `option_4_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `option_5` text COLLATE utf8mb4_unicode_ci,
  `option_5_image` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  `lesson_id` bigint unsigned DEFAULT NULL,
  `type` enum('pg','pg_kompleks','menjodohkan','isian','uraian') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'pg',
  `difficulty` enum('mudah','sedang','sulit') COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `kompetensi` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `answer` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `questions_lesson_id_foreign` (`lesson_id`),
  CONSTRAINT `questions_lesson_id_foreign` FOREIGN KEY (`lesson_id`) REFERENCES `lessons` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `questions` (`id`, `question`, `image`, `option_1`, `option_1_image`, `option_2`, `option_2_image`, `option_3`, `option_3_image`, `option_4`, `option_4_image`, `option_5`, `option_5_image`, `created_at`, `updated_at`, `lesson_id`, `type`, `difficulty`, `kompetensi`, `answer`)
VALUES
	(1,'<p>test</p>',NULL,'ajhghghg jhgjhgjhgjhg jgjhgjhgjhgj jhgjhgjhgjhhgfhgf jhjhjkajhghghg jhgjhgjhgjhg jgjhgjhgjhgj jhgjhgjhgjhhgfhgf jhjhjkajhghghg jhgjhgjhgjhg jgjhgjhgjhgj jhgjhgjhgjhhgfhgf jhjhjkajhghghg jhgjhgjhgjhg jgjhgjhgjhgj jhgjhgjhgjhhgfhgf jhjhjk',NULL,'c',NULL,'d',NULL,'e',NULL,NULL,NULL,'2026-06-09 11:07:54','2026-06-09 11:09:34',1,'pg',NULL,NULL,'\"[\\\"4\\\"]\"');



# Dump of table sessions
# ------------------------------------------------------------

CREATE TABLE `sessions` (
  `id` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `user_id` bigint unsigned DEFAULT NULL,
  `ip_address` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `user_agent` text COLLATE utf8mb4_unicode_ci,
  `payload` longtext COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_activity` int NOT NULL,
  PRIMARY KEY (`id`),
  KEY `sessions_user_id_index` (`user_id`),
  KEY `sessions_last_activity_index` (`last_activity`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `sessions` (`id`, `user_id`, `ip_address`, `user_agent`, `payload`, `last_activity`)
VALUES
	('PszDChbgxJoEDVBVmaJEhvg9ElL84fB5LHaAK6ss',1,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36','YTo0OntzOjY6Il90b2tlbiI7czo0MDoiMmhnUTNnTjhmNlEzN0hqR2hweHJ4M2FKMHVTVTg2MXpUVGVBd1JIYyI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6ODM6Imh0dHA6Ly91amlhbi1vbmxpbmUudGVzdC9hZG1pbi9wcmludC1jYXJkcy9wcmludD9wYXBlcl9zaXplPUE0JnN0dWRlbnRfaWRzJTVCMCU1RD0xIjt9czo2OiJfZmxhc2giO2E6Mjp7czozOiJvbGQiO2E6MDp7fXM6MzoibmV3IjthOjA6e319czo1MDoibG9naW5fd2ViXzU5YmEzNmFkZGMyYjJmOTQwMTU4MGYwMTRjN2Y1OGVhNGUzMDk4OWQiO2k6MTt9',1785942874),
	('Sv8y6pgghATCojFWLhx7gqssxkD4rgQEckc9C8O0',NULL,'127.0.0.1','Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36','YTo0OntzOjY6Il90b2tlbiI7czo0MDoiVXlhSEVGczBuTmN4OGpHWjVwanVvNmM0cXRkTUNNbmJxaVNzYXJpMSI7czo5OiJfcHJldmlvdXMiO2E6MTp7czozOiJ1cmwiO3M6NDI6Imh0dHA6Ly91amlhbi1vbmxpbmUudGVzdC9zdHVkZW50L2Rhc2hib2FyZCI7fXM6NjoiX2ZsYXNoIjthOjI6e3M6Mzoib2xkIjthOjA6e31zOjM6Im5ldyI7YTowOnt9fXM6NTQ6ImxvZ2luX3N0dWRlbnRfNTliYTM2YWRkYzJiMmY5NDAxNTgwZjAxNGM3ZjU4ZWE0ZTMwOTg5ZCI7aToxO30=',1785942265);



# Dump of table settings
# ------------------------------------------------------------

CREATE TABLE `settings` (
  `id` bigint unsigned NOT NULL AUTO_INCREMENT,
  `app_name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `app_logo` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `enable_min_time_submit` tinyint(1) NOT NULL DEFAULT '0',
  `min_time_submit` int NOT NULL DEFAULT '0',
  `enable_auto_block` tinyint(1) NOT NULL DEFAULT '0',
  `created_at` timestamp NULL DEFAULT NULL,
  `updated_at` timestamp NULL DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;


INSERT INTO `settings` (`id`, `app_name`, `app_logo`, `enable_min_time_submit`, `min_time_submit`, `enable_auto_block`, `created_at`, `updated_at`)
VALUES
	(1,'Laravel',NULL,1,5,1,'2026-05-18 00:16:37','2026-08-05 14:56:31');




