Today we will analyze the expert a question bank system (in the education sector, for the assessment of student learning, annual / semester must perform various exercises and exams, therefore, the question of work to become one of the main tasks of teachers. The current the work is often a question of subjective propositions and still remain in the manual stage, there are two major drawbacks: First, teachers empirically the topic, so the degree of difficulty of questions, covering the amount of questions and topics discussed herein and is not easy to guarantee. exam to achieve a knowledge-based expert system for generating, expertise related exam after it is stored in the knowledge base, the system can automatically generate the exam. the system provides users with an intelligent question bank development environment, the development of various types of exam the system has great application value.) the project uses the framework for SSM (MYECLIPSE), the choice of development tools for MYECLIPSE. Exam expert system project as a background.
To complete the system, we first need to analyze the needs of the system. Expert exam should include a system administrator user role, user. In order to allow the user a smooth landing system to complete the related operations, landing roles you need to set up an account and password for each field.
The summary results of all system data: administrator (admin), user (yonghu), professional (zhuanye), 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 Zhiwu | VARCHAR ( 255 ) | | post quanxian | VARCHAR ( 255 ) | | rights username | VARCHAR ( 255 ) | |Account password | VARCHAR ( 255 ) | | password
Professional table
Field Name | Type | property | describe the above mentioned id | INT ( 11 ) | PRIMARY KEY | specializing in the above mentioned id jingguan | VARCHAR ( 255 ) | | administered ruanjiangongcheng | VARCHAR ( 255 ) | | Software Engineering dianzixinxi | VARCHAR ( 255 ) | | Electronic Information
Examination Table
Field Name | Type | properties | Description ID | the INT ( . 11 ) | a PRIMARY KEY | questions ID Zhonglei | VARCHAR ( 255 ) | | kind leixing | VARCHAR ( 255 ) | | type neirong | VARCHAR ( 255 ) | | Content
SET FOREIGN_KEY_CHECKS=0; -- ---------------------------- -- ---------------------------- -- Table structure for ggtikuzhuanjiaxt -- ---------------------------- 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 ' ,` zhiwu` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' duties ' , `quanxian` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' rights ' ,` username` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' account number ' , `password` VARCHAR ( 255) DEFAULT NULL COMMENT '密码',PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='用户'; -- ---------------------------- DROP TABLE IF EXISTS `t_zhuanye`; CREATE TABLE `t_zhuanye` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '专业id',`jingguan` VARCHAR(255 ) the DEFAULT NULL the COMMENT ' administered ' , `ruanjiangongcheng` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' Software Engineering ' ,` dianzixinxi` VARCHAR ( 255 ) the DEFAULT NULL the COMMENT ' electronic information ' , a PRIMARY KEY ( `id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' professional ' ; - ---------------------------- DROP TABLE IF EXISTS `t_shiti`; CREATE TABLE `t_shiti` (`id` INT(11) NOT NULL AUTO_INCREMENT COMMENT '试题id',`zhonglei` VARCHAR(255) DEFAULT NULL COMMENT '种类',`leixing` VARCHAR(255) DEFAULT NULL COMMENT '类型',`neirong` VARCHAR(255) The DEFAULT NULL the COMMENT ' content ' , a PRIMARY KEY ( `id`) ) ENGINE = MyISAM the DEFAULT the CHARSET = UTF8 the COMMENT = ' questions ' ;
Add professional modules:
By post method from the page, the incoming information to the professional back-end server, the tianjiazhuanyeact
Receiving, field comprises administered, software engineering, electronic information using the insert method to add data to the data synchronization
Database, add the operation is complete. Add the definition of a successful message, add professional success, and save it to request specific code is as follows:
The page transmitted by the insert method zhuanyedao professional added to the database in zhuanyedao.insert (zhuanye);
Add the information professional success, to save the message request, the user is given prompt request.setAttribute in the page ( "message", "add professional success");
Back Professional Management Interface
return "forward:/tianjiazhuanye.action";
Professional query module:
Professional query module implementations to initiate zhuanyeguanli.action request page. By this request, the server response zhuanyeController class zhuanyeguanli, query operation data in the process by selectByexample. After all the professional information query, save it to request the zhuanyeall in, on display in the page and return zhuanyeguanli.jsp, the part of the core code is as follows:
Generating sample professional category, query by example defined ZhuanyeExample example = new ZhuanyeExample ();
Check out all the professional information List zhuanyeall = zhuanyedao.selectByExample (example) by selectByExample method of zhuanyedao;
The professional information saved to the request, make the show request.setAttribute ( "zhuanyeall", zhuanyeall) page by foreach method;
Back Professional Management Interface
return "forward:/zhuanyeguanli.action";
Modify the Module:
Upon completion of professional information to fill the page modification, the portion of the data into xiugaizhuanye.action address, and submit by post. After receiving submitted by xiugaizhuanye in zhuanyeController in all fields packaged as a specialized entity. And the entity in the incoming updateByPrimaryKeySelective zhuanyedao method, the definition of the field is updated by the remaining professional professional id In this method, the portion includes a field administered, software engineering, electronic information, the portion of the core code is as follows:
Corresponding modified professional zhuanyedao.updateByPrimaryKeySelective (zhuanye) by modifying the method according to the id of zhuanyedao;
Professional success will modify information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "modify the information professional success");
Back Professional Management Interface
return "forward:/zhuanyeguanli.action";
Delete the Module:
Delete functions to achieve professional way, by clicking the Delete button in professional, initiating get request to the server. Id request includes professional information, in the receiving zhuanyeController the int id, and the id of incoming deleteByPrimaryKey zhuanyedao method. The role of this method is based on the id delete the corresponding professional. Finally, delete the expertise to successfully return to the page of information, the part of the core code is as follows:
Delete by deleting the corresponding method according zhuanyedao id Professional zhuanyedao.deleteByPrimaryKey (id);
Professional success will delete information stored in the message request, give the user prompt request.setAttribute in the page ( "message", "delete professional success");
Back Professional Management Interface
return "forward:/zhuanyeguanli.action";