JavaWeb online examination system (simple version)

JavaWeb Online Examination System

About the Author

Author name: Programming Ming Ming Shiyin
Introduction: CSDN blog expert, has been engaged in software development for many years, proficient in Java, JavaScript, bloggers also learn and grow step by step from scratch, know the importance of learning and accumulation, and like to play with the majority of ADCs Wild Upgrade, welcome your attention, and look forward to learning, growing, and taking off with you!

System Interface Diagram

insert image description here

introduction:

Recently, I was thinking about making a simple version of the online examination system, but I couldn't find any reference on the Internet, so I made it myself.

degree of difficulty(easy access

Because there is a relatively basic grammar, it is relatively easy for Java beginners and friends who are not very good at basics
Backend:
1. Using Java Servlet itself is Java syntax, seamless link, and no more configuration, web.xml can be easily configured once.
2. Use C3P0 to connect to the database, and the configuration files, codes, and jar packages are all in place without secondary operations.
3. The code adopts Service and Dao layered logic, which is clear and practical, and the code is simple and easy to understand.
Front end:
1. Jsp is also Java grammar, no need to learn new things, just write Java code directly.
2. HTML only needs the simplest grammar of commonly used tags, and Xiaobai can easily understand it.
3.css is just a little page style, very easy.
4.JavaScript needs to understand the basic grammar, which is necessary for learning the web.
5. Jquery is a JavaScript plug-in library, which is only used to interact with the background, and only use $.post to interact with the background.

The most important thing is to let you understand how to develop a web system with Java through relatively simple and basic grammar, and fully understand the entire development process, thereby improving your confidence in learning and increasing your sense of accomplishment.

development environment

It’s just my personal favorite, or you can choose your own favorite
Development tools: eclipse/myEclipse
Database: mysql
Web container: tomcat
jdk version: 1.6

System functions

insert image description here

Character introduction

1. Administrator
Authority: The administrator is the role with the most authority and has all the authority of the system.
insert image description here

2. teacher
Permissions: student management, test questions management, test paper management, test records, password management, login module.
insert image description here

3. Students
Permissions: test paper management (exam), test record (view), password management, login module.
insert image description here

Table Structure Introduction

user table

//用户表
CREATE TABLE `user` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `no` varchar(20) default NULL COMMENT '账号-学生一般用学号',
  `name` varchar(100) not NULL COMMENT '名字',
  `password` varchar(20) not NULL COMMENT '密码',
  `sex` varchar(20) default NULL COMMENT '性别',
  `phone` varchar(20) default NULL COMMENT '电话',
  `role_id` int(11) default NULL COMMENT '角色 0管理员,1老师,2学员',
  `isValid` varchar(4) default 'Y' COMMENT '是否有效,Y有效,其他无效',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Insert admin data by default

//插入管理的数据
INSERT INTO `user` VALUES ('1', 'admin', '管理员', '123', '1', '111', '0', 'Y');

menu table

CREATE TABLE `menu` (
  `id` int(11) NOT NULL,
  `menuCode` varchar(8) default NULL COMMENT '菜单编码',
  `menuName` varchar(16) default NULL COMMENT '菜单名字',
  `menuLevel` varchar(2) default NULL COMMENT '菜单级别',
  `menuParentCode` varchar(8) default NULL COMMENT '菜单的父code',
  `menuClick` varchar(16) default NULL COMMENT '点击触发的函数',
  `menuRight` varchar(8) default NULL COMMENT '2表示学员,1表示老师,0管理员,可以用逗号组合使用',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

The data inserted by default ( it is recommended to insert line by line, anyway, my mysql does it one by one, otherwise the Chinese characters behind will be garbled )

INSERT INTO `menu` VALUES ('1', '001', '老师管理', '1', null, 'adminManage', '0');
INSERT INTO `menu` VALUES ('2', '002', '学员管理', '1', null, 'userManage', '0,1');
INSERT INTO `menu` VALUES ('3', '003', '试题管理', '1', null, 'itemManage', '0,1');
INSERT INTO `menu` VALUES ('4', '004', '试卷管理', '1', null, 'examManage', '0,1,2');
INSERT INTO `menu` VALUES ('5', '005', '考试记录', '1', null, 'recordManage', '0,1,2');
INSERT INTO `menu` VALUES ('6', '006', '修改密码', '1', null, 'modPwd', '0,1,2');
INSERT INTO `menu` VALUES ('7', '007', '退出系统', '1', null, 'logout', '0,1,2');

Topic table

//题目表
CREATE TABLE `item` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `name` varchar(100) default NULL COMMENT '题名',
  `content` varchar(1000) not NULL COMMENT '内容',
  `type` int(11) not NULL COMMENT '类型:1单选 2多选 3判断 4主观',
  `answer` varchar(1000) default NULL  COMMENT '答案',
  `itemVals` varchar(1000) default NULL  COMMENT '选项',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Exam sheet

//试卷表
CREATE TABLE `exam` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `name` varchar(100) default NULL COMMENT '试卷名称',
  `userId` int(11) not NULL COMMENT '创建人',
  `time` int(11) not NULL COMMENT '考试时长',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Examination paper test question relationship table

//试卷试题关系表
CREATE TABLE `exam_item_rel` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `level` int(11) not NULL COMMENT '属于第几大题',
  `itemId` int(11) not NULL COMMENT '试题ID',
  `examId` int(11) not NULL COMMENT '试卷ID',
  `count` int(11) not NULL COMMENT '分数',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Exam record sheet

//考试记录表
CREATE TABLE `record` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `examId` int(11) not NULL COMMENT '试卷id',
  `userId` int(11) not NULL COMMENT '考试人id',
  `starttime` datetime default NULL COMMENT '开始时间',
  `endtime` datetime default NULL COMMENT '结束时间',
  `count` varchar(100) default NULL COMMENT '分数',
  `state` varchar(100) default NULL COMMENT '试卷状态 1考试中,2阅卷中,3已阅卷',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

Exam Record Relationship Table

CREATE TABLE `record_rel` (
  `id` int(11) NOT NULL auto_increment COMMENT '主键',
  `recordId` int(11) not NULL COMMENT '记录ID',
  `itemId` int(11) not NULL COMMENT '试题ID',
  `answer` varchar(100) default NULL COMMENT '学生答案',
  `count` int(11) default NULL COMMENT '当前题分数',
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

System module introduction

teacher management

Only administrators have the authority to add, modify, and delete teachers.
insert image description here
insert image description here

student management

Teachers and administrators have the authority to add, modify, and delete.
insert image description here
insert image description here

Question Management

Teachers and administrators have the authority to add, modify, delete, and view.
insert image description here
insert image description here

Test paper management

Teachers and administrators have the authority to add, modify, delete, and view.
Students have an exam function.
insert image description here

insert image description here

Exam Records

Teachers and administrators have the authority to view and grade papers (for subjective questions).
Students have the ability to view their exam records.
insert image description here
insert image description here

registration function

insert image description here

change Password

insert image description here

code directory

java file
insert image description here
page
insert image description here
backend layering
insert image description here


Summarize

Because there is a similar system beforeaccumulation, so the coding efficiency compareshighWell, this is also an old programmer'sability, with code referenceCVIt's very fast, haha! I also hope to bring some help to my friends!

important point

1. The style is relatively simple, and may not look good, because no effort has been spent on styling.
2. The design of the table may not be particularly perfect, and the functions are relatively simple, so I made it based on my feeling.
3. It is inevitable that there will be some bugs, but it is not for online use. I think it is enough for reference learning.
4. There are also deployment documents in the code.

How to get the code :

After subscribing to my column " JavaWeb Project Combat ", you can contact the blogger to get all the articles in the column and 1-2 favorite codes . The articles in the column have been on the csdn hot list and are trustworthy! There are currently [6] examples in the column, and the column will be updated to more than 15 in the next 2 months, usually once a week, so check out my column . **

Popular column recommendation

【1】Java mini-games (Tetris, Airplane Wars, Plants vs. Zombies, etc.)
【2】JavaWeb project combat (library management, online exams, dormitory management
, etc.) Code, etc.)
[4] 200 cases of getting started with Java Xiaobai
[5] Learning Java from zero, learning Java with fun
[6] Idea from zero to proficient

Guess you like

Origin blog.csdn.net/dkm123456/article/details/118641005#comments_25820925