JAVA-based web at B / S mode self-testing system

Recently I learned about online self-test system project, the record about this online platform in this system self-test project, or learning to use again later when convenient to be able to timely read. In the completion of this project, considering a lot of the framework. The final decision to use SSM (MYECLIPSE), the frame is extremely portable, multi-platform, ease of operability and so on. This framework can write and run in perfect MYECLIPSE development tools, online self-test system as a background item. Description of the project is this: discusses the design method of self-testing system based on JAVA technology online. The system uses B / S mode, the server uses the JAVA technology to complete the database access and generate dynamic page, the background database system uses MYSQL. The system includes an intelligent papers and automatic batch volume, performance publishing capabilities. Details of the test paper is an intelligent algorithm that provides a content according to the requirements of the test subject and the difficulty of distribution of scientific and rational papers.
When demand analysis of online self-test system project, obtain system administrator login roles include the user. Corresponding to the user can be carried out into the system by logging into your account. Systems have different privileges for different roles.

The summary results for all data systems: the administrator (admin), user (yonghu), subject (kemu), questions (shiti)

Administrators table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | administrator the above mentioned id 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password

 

user table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | user the above mentioned id 
Xingming |  VARCHAR ( 255 ) |  | Name 
nianling |  VARCHAR ( 255 ) |  | Age 
Zhiye |  VARCHAR ( 255 ) |  | occupation 
quanxian |  VARCHAR ( 255 ) |  |Permissions 
username |  VARCHAR ( 255 ) |  | account 
password |  VARCHAR ( 255 ) |  | password

 

Chart of Accounts

Field Name | Type | properties | Description 
ID |  the INT ( . 11 ) |  a PRIMARY  KEY  | Account ID 
Zhonglei |  VARCHAR ( 255 ) |  | kind 
leixing |  VARCHAR ( 255 ) |  | type

 

Examination Table

Field Name | Type | property | describe 
the above mentioned id |  INT ( 11 ) |  PRIMARY  KEY  | questions the above mentioned id 
neirong |  VARCHAR ( 255 ) |  | Content 
biaoti |  VARCHAR ( 255 ) |  | title 
Shijian |  VARCHAR ( 255 ) |  | time 
Chengji |  VARCHAR ( 255 ) |  | Achievement

 

 

SET FOREIGN_KEY_CHECKS=0;

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

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

-- Table structure for ggwangshangziceshixt

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

DROP TABLE IF EXISTS `t_admin`;

CREATE TABLE `t_admin` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '管理员id',`username` VARCHAR(255) DEFAULT NULL COMMENT '账号', `password` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' password ' , a PRIMARY  KEY (` id`) 

) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' Administrators ' ; 

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

the DROP  TABLE  the IF  EXISTS `t_yonghu`; 

the CREATE  TABLE ` t_yonghu` ( `id` the INT ( . 11 ) the NOT  NULL the AUTO_INCREMENT the COMMENT ' user id' , `Xingming` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' name ' ,` nianling` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' Age ' , `zhiye` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' occupation ' ,` quanxian` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' authority ' , `username` VARCHAR ( 255) DEFAULT NULL COMMENT '账号',`password` VARCHAR(255) DEFAULT NULL COMMENT '密码',PRIMARY KEY (`id`)

) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户';

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

DROP TABLE IF EXISTS `t_kemu`;

CREATE TABLE `t_kemu` (`id` INT(11) The NOT  NULL the AUTO_INCREMENT the COMMENT ' Account ID ' , `zhonglei` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' type ' ,` leixing` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' type ' , a PRIMARY  KEY ( `id`) 

) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' subjects ' ; 

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

DROP TABLE IF EXISTS `t_shiti`;

CREATE TABLE `t_shiti` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '试题id',`neirong` VARCHAR(255) DEFAULT NULL COMMENT '内容',`biaoti` VARCHAR(255) DEFAULT NULL COMMENT '标题',`shijian` VARCHAR(255) DEFAULT NULLThe COMMENT ' time ' , `chengji` VARCHAR ( 255 ) the DEFAULT  NULL the COMMENT ' results ' , a PRIMARY  KEY (` id`) 

) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' questions ' ;

 

 

Add subject modules:

In kemuController defined in tianjiakemuact subjects receiving incoming page parameter, defined as kemu. Wherein kemu comprising fields: Category, type, using the account tianjiakemuact objects stored in the database is defined in kemuMapper insert method, the matching database and insert into kemu achieve account statement data into the database. The part of the core code is as follows:

The subjects by adding the page transmission method kemudao insert into the database kemudao.insert (kemu);

Add the account information successfully, save the message request, the user is given the page prompt request.setAttribute ( "message", "Account successfully added");

Return to subject management interface

return "forward:/tianjiakemu.action";

Query module subjects:

Subjects query module implementations to initiate kemuguanli.action request page. By this request, the server response kemuController class kemuguanli, query operation data in the process by selectByexample. After all subjects information query, save it to request the kemuall in, on display in the page and return kemuguanli.jsp, the part of the core code is as follows:

Generating a subject-based sample, defined by the example query KemuExample example = new KemuExample ();

Check out all of the method by selectByExample kemudao the subject information List kemuall = kemudao.selectByExample (example);

The subject information stored in the request, on display request.setAttribute ( "kemuall", kemuall) page by foreach method;

Return to subject management interface

return "forward:/kemuguanli.action";

Modify subject modules:

Click the Edit button, you can jump to the account edit page. In subjects modify the page, the initialization of the subject of all the information, and the information is filled with correspondence to the corresponding edit field. After the subjects finished editing information, page by encapsulating the data post method is a subject entity, passed into the kemuController. In xiugaikemu the reception, after reception is completed, the call updateByPrimaryKeySelective method kemuMapper modified. The part of the code as follows:

Corresponding modified by modifying the method according kemudao account id kemudao.updateByPrimaryKeySelective (kemu);

The subjects successfully modify information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "modify subject information successfully");

Return to subject management interface

return "forward:/kemuguanli.action";

Delete subject modules:

Delete function implementation is subject, by clicking the Delete Account button to get the server to initiate the request. Subjects included in the request id information is used in the accepted kemuController the int id, and the id deleteByPrimaryKey method of kemudao passed. Acting in accordance with the method deletes the corresponding account id. Finally, the success of the delete account information back page, the part of the core code is as follows:

Delete by deleting the corresponding method according kemudao account id kemudao.deleteByPrimaryKey (id);

Subjects will be deleted success information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "delete account success");

Return to subject management interface

return "forward:/kemuguanli.action";

Guess you like

Origin www.cnblogs.com/wsnqf/p/11593163.html