-- phpMyAdmin SQL Dump
-- version 5.2.1
-- https://www.phpmyadmin.net/
--
-- 主机： 127.0.0.1:3306
-- 生成日期： 2024-12-25 03:42:26
-- 服务器版本： 8.0.31
-- PHP 版本： 7.4.33

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
START TRANSACTION;
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- 数据库： `test`
--

-- --------------------------------------------------------

--
-- 表的结构 `answer`
--

DROP TABLE IF EXISTS `answer`;
CREATE TABLE IF NOT EXISTS `answer` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `exam_id` bigint DEFAULT NULL,
  `user_id` bigint DEFAULT NULL,
  `teacher_id` bigint DEFAULT NULL,
  `answers` text CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci,
  `score` varchar(255) DEFAULT NULL,
  `name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL,
  `question_ids` varchar(255) DEFAULT NULL,
  `is_score` varchar(255) DEFAULT NULL,
  `submit_Time` datetime DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=205 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- 转存表中的数据 `answer`
--

INSERT INTO `answer` (`id`, `exam_id`, `user_id`, `teacher_id`, `answers`, `score`, `name`, `question_ids`, `is_score`, `submit_Time`) VALUES
(195, 4, 4, 3, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]}]', '10', '考试2', '1', '已评分', '2024-12-16 16:44:33'),
(197, 5, 4, 3, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":2,\"name\":\"以下哪种语言是面向对象的?\",\"type\":\"单选题\",\"options\":[\"A. Java\",\"B. C\",\"C. Assembly\",\"D. Python\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":4,\"name\":\"HTML是什么的缩写?\",\"type\":\"单选题\",\"options\":[\"A. HyperText Markup Language\",\"B. HyperText Modeling Language\",\"C. HyperText Management Language\",\"D. HyperText Method Language\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":5,\"name\":\"以下哪些是Python的数据类型?\",\"type\":\"多选题\",\"options\":[\"A. Cascading Style Sheets\",\"B. Centralized Style Sheets\",\"C. Creative Style Sheets\",\"D. Computer Style Sheets\"],\"answer\":\"ABCD\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":\"0\",\"userAnswers\":[\"A\",\"B\",\"C\",\"D\"]},{\"id\":6,\"name\":\"什么是CSS?\",\"type\":\"单选题\",\"options\":[\"A. Cascading Style Sheets\",\"B. Centralized Style Sheets\",\"C. Creative Style Sheets\",\"D. Computer Style Sheets\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]}]', '50', '考试3', '1,2,4,5,6', '已评分', '2024-12-16 22:12:23'),
(198, 4, 1, 3, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]}]', '10', '考试2', '1', '已评分', '2024-12-17 15:11:42'),
(202, 5, 1, 3, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]},{\"id\":2,\"name\":\"以下哪种语言是面向对象的?\",\"type\":\"单选题\",\"options\":[\"A. Java\",\"B. C\",\"C. Assembly\",\"D. Python\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]},{\"id\":4,\"name\":\"HTML是什么的缩写?\",\"type\":\"单选题\",\"options\":[\"A. HyperText Markup Language\",\"B. HyperText Modeling Language\",\"C. HyperText Management Language\",\"D. HyperText Method Language\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]},{\"id\":5,\"name\":\"以下哪些是Python的数据类型?\",\"type\":\"多选题\",\"options\":[\"A. Cascading Style Sheets\",\"B. Centralized Style Sheets\",\"C. Creative Style Sheets\",\"D. Computer Style Sheets\"],\"answer\":\"ABCD\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\",\"B\",\"C\",\"D\"]},{\"id\":6,\"name\":\"什么是CSS?\",\"type\":\"单选题\",\"options\":[\"A. Cascading Style Sheets\",\"B. Centralized Style Sheets\",\"C. Creative Style Sheets\",\"D. Computer Style Sheets\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]}]', '50', '考试3', '1,2,4,5,6', '未评分', '2024-12-17 15:31:22'),
(203, 3, 4, 2, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":2,\"name\":\"以下哪种语言是面向对象的?\",\"type\":\"单选题\",\"options\":[\"A. Java\",\"B. C\",\"C. Assembly\",\"D. Python\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":4,\"name\":\"HTML是什么的缩写?\",\"type\":\"单选题\",\"options\":[\"A. HyperText Markup Language\",\"B. HyperText Modeling Language\",\"C. HyperText Management Language\",\"D. HyperText Method Language\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\"]},{\"id\":5,\"name\":\"以下哪些是Python的数据类型?\",\"type\":\"多选题\",\"options\":[\"A. Cascading Style Sheets\",\"B. Centralized Style Sheets\",\"C. Creative Style Sheets\",\"D. Computer Style Sheets\"],\"answer\":\"ABCD\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"A\",\"B\",\"C\",\"D\"]},{\"id\":25,\"name\":\"简述一下计算机的组成原理？\",\"type\":\"主观题\",\"options\":[],\"answer\":\"123\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":\"9\",\"userAnswers\":[\"123\"]},{\"id\":24,\"name\":\"1+1=？\",\"type\":\"单选题\",\"options\":[\"A：1\",\"B：2\",\"C：3\",\"D：4\"],\"answer\":\"B\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"B\"]},{\"id\":21,\"name\":\"1+1=?\",\"type\":\"填空题\",\"options\":[],\"answer\":\"2\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"2\"]},{\"id\":19,\"name\":\"1\",\"type\":\"单选题\",\"options\":[\"A：1\",\"B：1\",\"C：1\",\"D：1\"],\"answer\":\"D\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":10,\"userAnswers\":[\"D\"]}]', '79', '123', '1,2,4,5,25,24,21,19', '已评分', '2024-12-19 13:50:44'),
(204, 13, 4, 2, '[{\"id\":1,\"name\":\"什么是数据库?\",\"type\":\"单选题\",\"options\":[\"A. 数据存储\",\"B. 数据库\",\"C. 数据表\",\"D. 数据项\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]},{\"id\":2,\"name\":\"以下哪种语言是面向对象的?\",\"type\":\"单选题\",\"options\":[\"A. Java\",\"B. C\",\"C. Assembly\",\"D. Python\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]},{\"id\":4,\"name\":\"HTML是什么的缩写?\",\"type\":\"单选题\",\"options\":[\"A. HyperText Markup Language\",\"B. HyperText Modeling Language\",\"C. HyperText Management Language\",\"D. HyperText Method Language\"],\"answer\":\"A\",\"score\":10,\"userId\":null,\"user\":null,\"userScore\":0,\"userAnswers\":[\"A\"]}]', '30', '试卷10', '1,2,4', '已评分', '2024-12-24 23:40:56');

-- --------------------------------------------------------

--
-- 表的结构 `comment`
--

DROP TABLE IF EXISTS `comment`;
CREATE TABLE IF NOT EXISTS `comment` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(255) NOT NULL,
  `content` varchar(255) DEFAULT NULL,
  `time` datetime(6) DEFAULT NULL,
  `parent_id` bigint DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- 转存表中的数据 `comment`
--

INSERT INTO `comment` (`id`, `username`, `content`, `time`, `parent_id`) VALUES
(6, 'chx', '123', '2024-12-23 14:24:17.637000', NULL),
(7, 'chx', '456', '2024-12-23 15:59:38.945000', NULL),
(8, 'chx2', '@chx  46', '2024-12-23 16:00:06.741000', 6);

-- --------------------------------------------------------

--
-- 表的结构 `exam`
--

DROP TABLE IF EXISTS `exam`;
CREATE TABLE IF NOT EXISTS `exam` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `title` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '考试标题',
  `img` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '封面图',
  `start_time` datetime DEFAULT NULL COMMENT '考试开始时间',
  `end_time` datetime DEFAULT NULL COMMENT '考试结束时间',
  `question_ids` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '试题列表',
  `total` int DEFAULT NULL COMMENT '考试总分',
  `user_id` int DEFAULT NULL COMMENT '用户ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='考试表' ROW_FORMAT=DYNAMIC;

--
-- 转存表中的数据 `exam`
--

INSERT INTO `exam` (`id`, `title`, `img`, `start_time`, `end_time`, `question_ids`, `total`, `user_id`) VALUES
(2, '测试', 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg', '2024-05-29 00:00:00', '2024-12-16 16:42:00', '1,2,4,5,6', 50, 2),
(3, '123', 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg', '2024-06-08 08:00:00', '2024-12-20 19:51:00', '1,2,4,5,25,24,21,19', 110, 2),
(4, '考试2', 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg', '2024-11-05 03:55:00', '2024-12-31 12:00:00', '1', 10, 3),
(5, '考试3', 'https://cdn.pixabay.com/photo/2015/04/23/22/00/tree-736885__480.jpg', '2024-11-05 03:55:00', '2024-12-31 19:12:00', '1,2,4,5,6', 50, 3);

-- --------------------------------------------------------

--
-- 表的结构 `question`
--

DROP TABLE IF EXISTS `question`;
CREATE TABLE IF NOT EXISTS `question` (
  `id` int NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` text CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '题目文本',
  `type` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '题型',
  `options` varchar(1000) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '选择题选项',
  `answer` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '正确答案',
  `score` int DEFAULT NULL COMMENT '分值',
  `user_id` int DEFAULT NULL COMMENT '用户ID',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='试题表' ROW_FORMAT=DYNAMIC;

--
-- 转存表中的数据 `question`
--

INSERT INTO `question` (`id`, `name`, `type`, `options`, `answer`, `score`, `user_id`) VALUES
(1, '什么是数据库?', '单选题', '[\"A. 数据存储\", \"B. 数据库\", \"C. 数据表\", \"D. 数据项\"]', 'A', 10, 3),
(2, '以下哪种语言是面向对象的?', '单选题', '[\"A. Java\", \"B. C\", \"C. Assembly\", \"D. Python\"]', 'A', 10, 3),
(4, 'HTML是什么的缩写?', '单选题', '[\"A. HyperText Markup Language\", \"B. HyperText Modeling Language\", \"C. HyperText Management Language\", \"D. HyperText Method Language\"]', 'A', 10, 3),
(5, '以下哪些是Python的数据类型?', '多选题', '[\"A. Cascading Style Sheets\", \"B. Centralized Style Sheets\", \"C. Creative Style Sheets\", \"D. Computer Style Sheets\"]', 'ABCD', 10, 3),
(6, '什么是CSS?', '单选题', '[\"A. Cascading Style Sheets\", \"B. Centralized Style Sheets\", \"C. Creative Style Sheets\", \"D. Computer Style Sheets\"]', 'A', 10, 3),
(9, 'React是哪家公司开发的?', '多选题', '[\"A. Facebook\", \"B. Google\", \"C. Microsoft\", \"D. Apple\"]', 'ABCD', 10, 3),
(10, '机器学习的主要分类有哪些?', '多选题', '[\"A. Cascading Style Sheets\", \"B. Centralized Style Sheets\", \"C. Creative Style Sheets\", \"D. Computer Style Sheets\"]', 'ABCD', 10, 3),
(13, '1+2=？', '单选题', '[\"A. 1\", \"B. 2\", \"C. 3\", \"D. 4\"]', 'C', 10, 3),
(14, '1+1+1+1=？', '单选题', '[\"A. 1\", \"B. 2\", \"C. 3\", \"D. 4\"]', 'D', 10, 3),
(15, '1+0=？', '单选题', '[\"A. 1\", \"B. 22222\", \"C. 3\", \"D. 4\"]\n', '2', 10, 3),
(16, '10+10=？', '单选题', '[\"A. 1\", \"B. 22222\", \"C. 3\", \"D. 20\"]\n', 'D', 10, 3),
(17, '1+2+3=?', '单选题', '[\"A. 1\", \"B. 6\", \"C. 3\", \"D. 20\"]', 'D', 10, 3),
(18, '1+10=?', '单选题', '[\"A：11\",\"B：22\",\"C：22\",\"D：113\"]', 'D', 10, 3),
(19, '1', '单选题', '[\"A：1\",\"B：1\",\"C：1\",\"D：1\"]', 'D', 10, 3),
(20, '1+1=2对吗', '判断题', '', '对', 10, 3),
(21, '1+1=?', '填空题', '{\"0\":\"A：\",\"1\":\"B：\",\"2\":\"C：\",\"3\":\"D：\"}', '2', 10, 3),
(22, '1+1=2?', '判断题', '', '对', 10, 3),
(23, '1+1+1=3?', '判断题', '', '对', 10, 3),
(24, '1+1=？', '单选题', '[\"A：1\",\"B：2\",\"C：3\",\"D：4\"]', 'B', 10, 3),
(25, '简述一下计算机的组成原理？', '主观题', NULL, '计算机的组成原理', 10, 3);

-- --------------------------------------------------------

--
-- 表的结构 `user`
--

DROP TABLE IF EXISTS `user`;
CREATE TABLE IF NOT EXISTS `user` (
  `id` bigint NOT NULL AUTO_INCREMENT,
  `username` varchar(50) NOT NULL,
  `password` varchar(100) NOT NULL,
  `role` varchar(20) NOT NULL COMMENT '用户角色：student, teacher, admin',
  `email` varchar(255) DEFAULT NULL,
  `mobile` varchar(255) DEFAULT NULL,
  `avatar` varchar(255) DEFAULT NULL,
  `gender` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- 转存表中的数据 `user`
--

INSERT INTO `user` (`id`, `username`, `password`, `role`, `email`, `mobile`, `avatar`, `gender`, `address`) VALUES
(1, 'student', '$2a$10$fclE/Dgq1Ej5fEG9cNwIZu.Me0aFCbGy3naccAZOa/Fa/1tBAsZGq', 'student', NULL, NULL, 'http://localhost:8080/file/download?name=bf0d4510-f8db-4afb-bf9e-4fa76da41b4e_user.png', '男', ''),
(2, 'teacher', '$2a$10$fclE/Dgq1Ej5fEG9cNwIZu.Me0aFCbGy3naccAZOa/Fa/1tBAsZGq', 'teacher', NULL, NULL, NULL, NULL, NULL),
(3, 'admin', '$2a$10$fclE/Dgq1Ej5fEG9cNwIZu.Me0aFCbGy3naccAZOa/Fa/1tBAsZGq', 'admin', NULL, NULL, NULL, NULL, NULL),
(4, 'chx', '$2a$10$fclE/Dgq1Ej5fEG9cNwIZu.Me0aFCbGy3naccAZOa/Fa/1tBAsZGq', 'student', '12313156', '1233456', 'http://localhost:8080/file/download?name=c5ab3687-2f15-428e-a8e9-4e07bb1ef56d_user.png', '男', '北京市 市辖区 东城区'),
(18, 'chx2', '$2a$10$TtgftGGLDzMgy7TOPbnBJuXZpybkFApZMaZPA8yPg3iqeMJR8CZNm', 'student', NULL, NULL, 'http://localhost:8080/file/download?name=24d23157-044d-46b2-b6f2-759ce9e6d287_背景1.jpg', NULL, '');
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
