Graduation project based on springboot online exam registration system - with source code 031706

Online Exam Registration System

Summary

With the rapid development of computer technology, the information development of school teaching and management has also made great progress, and the same is true for examinations. Compared with traditional examination methods, the online examination registration system has greatly improved the flexibility of the examination, and has been widely used in many fields. The biggest advantage of the online exam registration system is that it can dynamically manage various exam information, which greatly reduces the possibility of candidates cheating. Students can register for exams online, and play an efficient and convenient role in various exams. Teachers are freed from heavy work!

The online test registration system consists of three modules: user online registration module, test module and system management module. Among them, the system management module is the basis for the system to carry out examination information release and examination registration; the query sub-module realizes the recommendation of student examination information. Candidates log in to the system with their own names and passwords, sign up for the test, enter the test arrangement interface and set the test questions in advance according to the administrator, automatically generate test papers to take the test, and check their test results after the test is completed. This system adopts the object-oriented development mode for software development and hardware erection, which can well meet the needs of actual use, perfect the corresponding software erection and program coding work, and adopt MySQL as the main storage unit of background data , using the Spring boot framework, JSP technology, and Ajax technology to code and develop the business system, and realize all the functions of the system. This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the various requirements and technical problems of the online test registration system, prove the necessity and technical feasibility of the system, then give a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realize the online test registration The system's deployment runs use it.

Keywords: online registration exam; Springboot framework; MySQL database

Online examination registration system

Abstract

With the rapid development of computer technology, the information development of school teaching and management has also made great progress, and so has the examination. Compared with the traditional examination methods, the online examination registration system greatly improves the flexibility of the examination, and has been widely used in many fields. The biggest advantage of online examination registration system is that it can dynamically manage all kinds of examination information, which greatly reduces the possibility of candidates cheating. Students can register online, play an efficient and convenient role in all kinds of examinations, and free teachers from heavy work!

The online examination registration system consists of three modules: user online registration module, examination module and system management module. Among them, the system management module is to release the examination information and register the examination, which is the basis of the system operation; The query sub module realizes the recommendation of students' examination information. Candidates log in to the system through their own name and password, register for the examination, enter the examination arrangement interface, set the examination questions in advance according to the administrator, and automatically generate test papers to participate in the examination. After the examination is completed, they can view their examination results. The system adopts the object-oriented development mode for software development and hardware erection, which can well meet the needs of actual use, improve the corresponding software erection and program coding, take MySQL as the main storage unit of background data, and use spring boot framework, JSP technology and Ajax technology for business system coding and development, All the functions of the system are realized. This report first analyzes the background, function and significance of the research, which lays a foundation for the rationality of the research work. This paper analyzes the various requirements and technical problems of the online examination registration system, proves the necessity and technical feasibility of the system, and then makes a basic introduction to the technical software and design idea required by the design system. Finally, it realizes the deployment and operation of the online examination registration system.

Key words:Online registration examination; The Springboot framework; The MySQL database

Table of contents

Chapter 1 Introduction

1.1  Research background and significance

1.2 Development status at home and abroad 

Chapter 2 Introduction to Related Technologies

2.1  J2EE technology

2.2 MVVM pattern

2.3 B/S structure

2.4 Spring boot framework

2.5  Mysql database

Chapter 3 System Analysis

3.1  Feasibility analysis

3.2  Analysis of Functional Requirements

3.2.1  Foreground user functions

3.2.2  Background administrator function

3.3  Analysis of non-functional requirements

3.4  Security Requirements Analysis

3.4.1  System Security

3.4.2  Data Security

3.5  Data flow analysis

Chapter 4 System Design

4.1  System architecture design

4.2  Overall system design

4.3  System function design

4.4  Database design

4.4.1  Data Requirements Analysis

4.4.2  Database conceptual design

4.4.3  Database table design

Chapter 5 System Implementation

5.1  Implementation of registration module

5.2  Implementation of login module

5.3  Realization of User Profile Modification Module

5.4 Realization of Examination Information Recommendation List Management Module 

5.5 Realization of Exam Registration Module 

5.6 Realization of Examination Arrangement Management Module 

Chapter 6 System Testing

6.1  Test purpose

6.2  Functional test

6.3  Performance Test

Chapter 7 Summary and Outlook

references

thank you

  1. introduction
    1. research background and meaning

Examination is an important part of teaching activities, but due to the continuous increase of examination types and the continuous improvement of examination requirements, the traditional examination methods can no longer meet the needs of modern examinations. With the popularization and development of computer networks, how to use computers to conduct examinations, to improve teaching efficiency and examination quality, and to share teaching resources in a wider range is a topic worthy of in-depth research.

At present, most of the online examination systems are developed using access technology in Microsoft office, and VB and VC are used to write programs, which are unsatisfactory in terms of real-time performance, interactivity and access to databases on WEB servers. As the most popular dynamic page technology today, asp has unparalleled simplicity, real-time performance, rapidity, and easy control of the output format. It not only makes the program interaction more convenient, but more importantly, it also provides a very Convenient access to database functions. Therefore, using asp technology to develop the online examination system has obvious advantages.

With the progress of society and the continuous development of commodity economy, the society has higher and higher requirements for the knowledge and ability of laborers and technical personnel. Exams, as an important means of measuring people's ability, have further improved their status in modern life and penetrated into all aspects of society. Various academic examinations and qualification certificate examinations emerge in endlessly. At the same time, the development of Internet technology has revolutionized the technical means and carriers of the examination. The openness and distribution characteristics of the Internet and the huge computing power based on the Internet make the examination break through the limitations of time and space. Network applications continue to expand, such as the emergence of distance education and virtual universities; making the Web-based online examination system a reality. The web-based online examination system can take advantage of the network to establish a large, efficient, and shared question bank and realize examinations anytime and anywhere, reducing examination costs and human interference. Reduce the burden on teachers, save manpower, material resources, and financial resources.

    1. Development status at home and abroad

The most traditional examination we can think of is the imperial examination in ancient China. The imperial examination is an examination system for the selection of officials in the feudal dynasty. Due to the backwardness of technology at that time, the examination can only be taken once every few years. From the township examination to the general examination, and finally to the palace examination, such a set of examinations lasts for several years, and each examination only takes a short time to register. Sometimes, if you miss the opportunity to register, you have to wait another year or two. It is the backwardness of the examination method, and more importantly, the backwardness of the registration method. At the end of the 20th century and the beginning of the 21st century, many of our exams were unified across the country. At the beginning, the registration methods for many exams were on-site registration or by telephone registration, but these registration methods were still very cumbersome, and the person in charge of the exam registration The staff brought a lot of inconvenience, but also brought a lot of changes to foreign candidates. And now registering through the computer network, you will no longer encounter the tragedy of missing registration for a year or two. Therefore, registering for the exam online is good news for our students, teachers and all educators. It not only allows us to avoid the tediousness of the traditional registration method, but also brings convenience to many of our non-local candidates.

In Western countries, the earliest examination system also originated from the imperial examination system in our country. The imperial examination system in China's feudal society had a great influence on the West, and such an influence was probably in the second half of the sixteenth century. The first to spread the Chinese imperial examination system in the West were two Portuguese missionaries. The imperial examination system produced by the selection of officials is very optimistic. They have always praised the imperial examination system, and introduced the methods and contents of the imperial examination in their works in detail. After that, the imperial examination system was widely spread in Western countries. It has attracted widespread attention from western countries to China's imperial examination system and political system. It can be seen from this that the earliest examination systems in Western countries were also very imperfect and outdated examination methods. Obviously their examination registration systems are equally backward and need to be improved.

Therefore, the exam, a necessary link to test the effect of learning that is required by all countries in the world, first needs us to improve the registration method of the exam. Now that everyone is starting to plan the timing of the online exam, our exam registration method should be improved and perfected before the exam method is improved.

  1. Related technology introduction
    1. J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Since the "middleware" developed by different companies is not standardized enough, Sun launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

    1. MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only deals with data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

    1. B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

    1. Spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the cross concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ. Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

    1. Mysql database

Mysql has been updated many times, and the functional level has been very rich and perfect. From Mysql4 version to 5 version, a relatively large update has been made, and it has achieved good practical application results in actual commercial use. The latest version of Mysql supports the compression of information, and at the same time, it can also perform encryption to better meet the needs of information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers are also more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on the application map. The powerful backup function also ensures that users will feel more at ease during the use process, and the supported Office features also support users' self-installation and use. The display form of information has also been greatly updated, and two very useful display areas have been added, one is the information area, which has classified tables and text, and the display of the interface is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple information at the same time, which brings great convenience to the actual use of users.

In the actual implementation process of the online exam registration system designed in this article, the main reason for choosing the Mysql database is that there will be a large number of databases that are frequently operated during the application and development of the enterprise application system, and the data security The requirements are also very high. Combining these factors, Mysql with a relatively high safety factor was finally selected to store and operate the background data of the campus competition management system.

  1. system analysis
    1. Feasibility Analysis

To develop any system, it is necessary to analyze its feasibility and consider its time and resource constraints, which can reduce the risk of system development. At the same time, after the analysis, not only can manpower be used reasonably, but also the consumption of various resources can be saved. The following three aspects of technology, economy and society will be introduced.

In terms of practicality, the main tasks of this design are exam information, exam registration, online exams, exam results, user management, exam information management, etc., in line with the current development trend. From the perspective of users, while also considering system operating costs and human resources, it adopts a convenient way on the Internet to realize online business, making the business process more systematic and more convenient for user experience, which is more practical.

In terms of economy, since the main purpose of the online examination registration system designed in this project is to conduct information query management and retrieval services more conveniently and quickly, that is, information software that can be directly put into use. The main cost of the system is mainly concentrated on the operation of continuous maintenance and management update of the used data in the later period. However, once the system is put into actual operation and use, it can improve the efficiency of information query and retrieval. At the same time, it is also necessary to effectively ensure the security of the information of the inquirer. At the same time, the practical application brought by this online examination registration system The value of this aspect far exceeds the cost of developing and maintaining the actual system. Therefore, it is economically feasible to develop this software.

    1. Functional Requirements Analysis

The functions of the online test registration system are mainly divided into front-end students registering and logging in according to their own needs, browsing test information, online registration, and online mock test operations. The back-end system administrators are divided into ordinary administrators and super administrators due to different responsibilities. The administrators mainly deal with registered students, information data, detailed information of simulated test paper questions, test question management, and test scores.

The student use case diagram is shown below.

 

Figure 3-1 Student use case diagram

The administrator use case diagram is shown below.

 

Figure 3-2 Administrator use case diagram

      1. front-end user function

Front-end user needs.

Registered users have the following functions:

Account registration: The user fills in personal information and verifies the mobile phone number.

Login: Log in according to the account password.

Online registration data: users can submit registration online.

Exam Arrangement: Users can arrange the exam according to the exam time.

Maintain personal information: Users can modify their registration information at any time due to changes in personal information.

Examination Information: Users can browse the examination information in the system.

Test scores: Users can view their online test score data.

      1. Background administrator function

The administrator functions are as follows:

Change password: Administrators can change their own login passwords to the system at any time to ensure system security.

Processing of test question information: handling test paper examination results review, etc.

Examination registration management: review the examination registration submitted by students.

Examination information management: maintain examination information, add, delete, and modify information.

Exam list management: Classify and maintain test paper information, add, delete, and modify information.

Information data information management: release and delete relevant information data information.

Examination score management: review students' online examination papers and release test scores.

    1. Non-Functional Requirements Analysis

The first thing to consider is the system function software. In terms of specific design, whether it can better meet the basic functional requirements of various users. If it cannot better meet the needs of users, then the existence of this system is worthless. The non-functional analysis of the software system is carried out from 7 aspects, one is performance analysis, which is aimed at the system; one is security analysis, which is aimed at the system; the other is integrity analysis, which is aimed at the system; It is scalability analysis, for the system, and the other is performance analysis to adapt to the business. In the face of the comprehensive comparison and analysis of the students' examination papers and the performance of the system in seven aspects, such as performance, security, expansion, and integrity, it is found that corresponding non-functional requirements analysis is needed.

    1. Security Requirements Analysis
      1. system security

Security is very important to every system. A system with good security can protect enterprise information and user information from being stolen. Improving the security of the system is not only the responsibility of the user, but also the responsibility of the enterprise. Especially for student course examinations and systems, there must be good security to protect the entire system.

The system has authority control for users, and limits the authority of users according to the role barriers, so as to ensure the security of the system.

      1. data security

The data in the database is input from the outside world. When the data is input, due to various reasons, the input data will be invalid or dirty. Therefore, how to ensure that the input data conforms to the regulations has become the primary concern of database systems, especially multi-user relational database systems.

Therefore, when writing to the database, data integrity, correctness, and consistency must be guaranteed.

    1. Data Flow Analysis

Analyze the data flow of the system, and the users of the system are divided into two categories, general users and administrators. The system mainly processes interface information transmission, login information verification, registration information reception, and user response to various operations.

The top-level data flow diagram of the system is shown in the figure below.

 

Figure 3-2 Top-level data flow diagram

To judge the identity of the user, it is judged according to the login data, and then jumps to the corresponding function interface. The internal users of the system can operate the data, and the database center can receive the effective data stream transmitted by the system to perform corresponding operations on the data SQL statements.

The underlying data flow diagram of the system is shown in the figure below.

 

 

 Figure 3-3 The underlying data flow diagram

 

The system can be divided into two parts, the foreground and the background. After each operation, the system returns the operation result. The data connection between the foreground and the background is mainly through the database, which means that different operations are performed on the database respectively.

  1. system design
    1. System architecture design

The architecture design of the online exam registration system is mainly divided into three layers, mainly including the Web layer, the business layer, and the Model layer. The web layer also includes the View layer and the Controller layer, and the Model layer includes the metadata extension layer and the data access layer.

The system architecture is shown in the figure below.

MVVM is to abstract the state and behavior of the View in it, and let us separate the view UI from the business logic. Of course, ViewModel has already done these things for us. It can take out the data of Model and help deal with the business logic involved in View because of the need to display content. It forcibly separates the input, output, and processing of the application into three core parts, each of which has different functions.

 

Figure 4-1 System architecture diagram

View layer View refers to the interface that is seen by the user and can interact with it. Views can display relevant data to users and receive data entered by users, but do not perform any actual business operations on user data.

The model layer processes the data passed by the view layer through the control layer. The same model can provide data to different views, and can also be reused by different views. Since the main content of the Model is data, methods, and behaviors, it is also the part with the most complex logic and the largest amount of code in MVVM, which contains business logic that needs to be used in many applications, so the development of the model layer has become particularly important. Generally, large-scale changes will not be made to the model layer in the later stage, which is also the most stable part of MVVM. The control layer is mainly responsible for data transmission and processing request operations between the view layer and the model layer. When the user sends data and requests through the view, the control layer can receive the request and data and decide which models to call and which operations of the model to process the data and requests. After the processing is completed, the control layer returns the data to the corresponding view.

    1. Overall System Design

The online test registration system is generally divided into a front-end user module and a back-end administrator module.

The two modules appear to exist independently, but the accessed database is the same. The function of each module is made according to the previously completed demand analysis, and after consulting relevant materials.

To sum up, the functional structure diagram of the system is shown in the figure below.

 

Figure 4-2 System function structure diagram

    1. System function design

Login module: The login module is the entrance to the system, and all users must log in to access the system. To log in, you need to enter your username and password, and if you try to log in multiple times, you need to enter a verification code. When logging in, you need to choose the role of the user, whether it is a general user or an administrator to log in. After a successful login, the user's permissions will be obtained through the database and redirected to the user's home page.

Examination information data module: it can be divided into three modules: examination information data browsing, examination information data retrieval, and examination information data maintenance. Administrators have the authority to maintain examination information data, release new examination information data, and update existing examination information data etc.

Examination registration management module: Examination registration management is divided into examination addition and modification. Examination registration information is modified, added, and deleted by the administrator.

    1. Database Design
      1. Data Requirements Analysis

From the previous analysis, it can be seen that the most important things in the database are learning materials information, student information, simulated test information, as well as examination information and score information. The analysis can get the following data description:

Platform users: used to record various information of users, including student number, name, gender, mobile phone, email, photos and other data items.

Administrator: Record the login information of the administrator. Including user name, password, permissions and other data items.

Exam: the content stored for the exam, including the name of the exam paper, the date of the exam, and data items with pictures.

Online exam registration: store the user's exam registration information. Including data items such as exam registration for Western Sydney, content of exam registration materials, etc.

score. Store the user's test paper and test score information.

      1. Database conceptual design

According to the previous data flow chart, combined with the functional module design of the system, design each information entity that conforms to the system.

The ER diagram of the system is shown in the figure below.

 

Figure 4-3 System ER diagram

      1. database table design

The data sheets owned by the online exam registration system are as follows: student information sheet, exam information information sheet, exam registration sheet, exam arrangement sheet, and exam score sheet.

Due to the large number of data tables, only the main data tables of the system are displayed, as shown in the following table.

group_table :

name

type

length

not null

primary key

note

registered_user_id

int

11

yes

yes

registered user ID

user_number

varchar

64

yes

no

user ID

full_name

varchar

64

no

no

Name

id

varchar

255

no

no

ID card

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

user_id

int

11

yes

no

User ID

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

examination_results表:

name

type

length

not null

primary key

note

examination_results_id

int

11

yes

yes

Exam Score ID

test_name

varchar

64

no

no

Exam name

user_number

int

11

no

no

user ID

admission_number

varchar

64

no

no

Admission ticket number

achievement

varchar

64

no

no

score

grade

varchar

64

no

no

grade

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

examination_registration表:

name

type

length

not null

primary key

note

examination_registration_id

int

11

yes

yes

Exam Registration ID

test_name

varchar

64

no

no

Exam name

user_number

int

11

no

no

user ID

registration_number

varchar

64

no

no

registration number

test_number

varchar

64

no

no

exam number

examination_fee

varchar

64

no

no

Exam fee

id

varchar

64

no

no

ID card

full_name

varchar

64

no

no

Name

registration_information

varchar

255

no

no

Registration information

contact_number

varchar

64

no

no

contact number

examine_state

varchar

16

yes

no

Approval Status

pay_state

varchar

16

yes

no

Payment status

pay_type

varchar

16

no

no

Payment Types

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

examination_information表:

name

type

length

not null

primary key

note

examination_information_id

int

11

yes

yes

Exam Information ID

test_number

varchar

64

no

no

exam number

examination_type

varchar

64

no

no

Exam type

examination_time

varchar

64

no

no

examination time

relevant_attachments

varchar

255

no

no

Relevant attachments

test_name

varchar

64

no

no

Exam name

examination_fee

varchar

64

no

no

Exam fee

cover

varchar

255

no

no

the cover

registration_requirements

text

0

no

no

registration requirements

examination_introduction

longtext

0

no

no

Exam Introduction

hits

int

11

yes

no

hits

praise_len

int

11

yes

no

Likes

recommend

int

11

yes

no

Intelligent Recommendation

timer_title

varchar

64

no

no

timer title

timing_start_time

datetime

0

no

no

Timing start time

timing_end_time

datetime

0

no

no

Timing end time

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

examination_arrangement表:

name

type

length

not null

primary key

note

examination_arrangement_id

int

11

yes

yes

Exam Arrangement ID

registration_number

varchar

64

no

no

registration number

test_number

varchar

64

no

no

exam number

test_name

varchar

64

no

no

Exam name

user_number

int

11

no

no

user ID

full_name

varchar

64

no

no

Name

id

varchar

64

no

no

ID card

examination_room

varchar

64

考场

address

varchar

64

地址

examination_time

varchar

64

考试时间

admission_number

varchar

64

准考证号

admission_ticket

varchar

255

准考证

recommend

int

11

智能推荐

create_time

datetime

0

创建时间

update_time

timestamp

0

更新时间

  1. 系统实现
    1. 注册模块的实现

用户在填写数据的时候必须与注册页面上的验证相匹配否则会注册失败,注册页面的表单验证是通过验证的,用户名的长度必须在6到18之间,邮箱必须带有@符号,密码和密码确认必须相同,你输入的密码,系统会根据你输入密码的强度给出指定的值,电话号码和身份证号码必须要求输入格式与生活相符合,当你前台验证通过的时候你点击注册,表单会将你输入的值通过name值传递给后台并保存到数据库中。

用户注册流程图如下图所示。

 

图5-1用户注册流程图

用户注册界面如下图所示。

 

图5-2用户注册界面

用户注册逻辑代码如下:

/**

     * 注册

     * @param user

     * @return

     */

    @PostMapping("register")

    public Map<String, Object> signUp(@RequestBody User user) {

        // 查询用户

        Map<String, String> query = new HashMap<>();

        query.put("username",user.getUsername());

        List list = service.select(query, new HashMap<>()).getResultList();

        if (list.size()>0){

            return error(30000, "用户已存在");

        }

        user.setUserId(null);

        user.setPassword(service.encryption(user.getPassword()));

        service.save(user);

        return success(1);

}

/**

     * 用户ID:[0,8388607]用户获取其他与用户相关的数据

     */

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "user_id")

    private Integer userId;

    /**

     * 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

     */

    @Basic

    @Column(name = "state")

    private Integer state;

    /**

     * 所在用户组:[0,32767]决定用户身份和权限

     */

    @Basic

    @Column(name = "user_group")

    private String userGroup;

    /**

     * 上次登录时间:

     */

    @Basic

    @Column(name = "login_time")

    private Timestamp loginTime;

    /**

     * 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "phone")

    private String phone;

    /**

     * 手机认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "phone_state")

    private Integer phoneState;

    /**

     * 用户名:[0,16]用户登录时所用的账户名称

     */

    @Basic

    @Column(name = "username")

    private String username;

    /**

     * 昵称:[0,16]

     */

    @Basic

    @Column(name = "nickname")

    private String nickname;

    /**

     * 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

     */

    @Basic

    @Column(name = "password")

    private String password;

    /**

     * 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "email")

    private String email;

    /**

     * 邮箱认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "email_state")

    private Integer emailState;

    /**

     * 头像地址:[0,255]

     */

    @Basic

    @Column(name = "avatar")

    private String avatar;

    /**

     * 创建时间:

     */

    @Basic

    @Column(name = "create_time")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    private Timestamp createTime;

    @Basic

    @Transient

    private String code;

}

    1. 登录模块的实现

主要由两部分组成,登录前的登录界面以及登录后的用户功能界面。登录界面,要求用户输入用户名和密码,当用户名和密码其中一个输入为空时,给出提示“用户名,密码不能为空”。获取用户名和密码后到数据库中查找,如果用户名存在,以及对应的密码正确,则登录成功,否则登录失败。登录失败后给出提示,并把焦点停在文本框中。登录成功后将该次会话的全局变量username设置为用户名。登录成功后进入会员的功能模块,主要有会员基本信息修改,已经发布模拟考试信息管理,发布信息,和退出功能。退出功能是清除全局变量username的值,并跳回到首页。

登录流程图如下图所示。

 

图5-3登录流程图

用户登录界面如下图所示。

 

图5-4用户登录界面

用户登录的逻辑代码如下所示。

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

    public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

        log.info("[执行登录接口]");

        String username = data.get("username");

        String email = data.get("email");

        String phone = data.get("phone");

        String password = data.get("password");

        List resultList = null;

        Map<String, String> map = new HashMap<>();

        if(username != null && "".equals(username) == false){

            map.put("username", username);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(email != null && "".equals(email) == false){

            map.put("email", email);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(phone != null && "".equals(phone) == false){

            map.put("phone", phone);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }else{

            return error(30000, "账号或密码不能为空");

        }

        if (resultList == null || password == null) {

            return error(30000, "账号或密码不能为空");

        }

        //判断是否有这个用户

        if (resultList.size()<=0){

            return error(30000,"用户不存在");

        }

        User byUsername = (User) resultList.get(0);

        Map<String, String> groupMap = new HashMap<>();

        groupMap.put("name",byUsername.getUserGroup());

        List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

        if (groupList.size()<1){

            return error(30000,"用户组不存在");

        }

        UserGroup userGroup = (UserGroup) groupList.get(0);

        //查询用户审核状态

        if (!StringUtils.isEmpty(userGroup.getSourceTable())){

            String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

            String res = String.valueOf(service.runCountSql(sql).getSingleResult());

            if (res==null){

                return error(30000,"用户不存在");

            }

            if (!res.equals("已通过")){

                return error(30000,"该用户审核未通过");

            }

        }

        //查询用户状态

        if (byUsername.getState()!=1){

            return error(30000,"用户非可用状态,不能登录");

        }

        String md5password = service.encryption(password);

        if (byUsername.getPassword().equals(md5password)) {

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

            accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

            JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

            user.put("token", accessToken.getToken());

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

            return error(30000, "账号或密码不正确");

        }

}

    1. 用户资料修改模块的实现

用户登录/注册成功之后可以修改自己的基本信息。修改页面的表单中每一个input的name值都要与实体类中的参数相匹配,在用户点击修改页面的时候,如果改后用户名与数据库里面重复了,页面会提示该用户名已经存在了,否则通过Id来查询用户,并将用户的信息修改为表单提交的数据。

    1. 考试信息推荐列表管理模块的实现

如果考试信息推荐列表数据的信息需要修改,管理员可以通过查询考试信息推荐列表数据的基本信息来查询考试信息推荐列表数据,查询考试信息推荐列表数据是通过ajax技术来进行查询的,需要传递考试信息推荐列表数据的标题、编号等参数然后在返回到该页面中,可以选中要修改或删除的那条信息,如果选中了超过一条数据,页面会挑一个窗口提醒只能选择一条数,如果没有选中数据会挑一个窗口题型必须选择一条数据。当选择确认修改的时候,后台会根据传过来的id到数据库查询,并将结果返回到修改页面中,可以在修改页面中修改刚刚选中的信息当点击确认的时候from表单会将修改的数据提交到后台并保存到数据库中,就是说如果提交的数据数据库中存在就修改,否则就保存。

考试信息推荐列表展示界面如下图所示。

 

图5-5考试信息推荐列表展示界面

考试信息推荐列表的逻辑代码如下:

 @PostMapping("/add")

    @Transactional

    public Map<String, Object> add(HttpServletRequest request) throws IOException {

        service.insert(service.readBody(request.getReader()));

        return success(1);

    }

    @Transactional

    public Map<String, Object> addMap(Map<String,Object> map){

        service.insert(map);

        return success(1);

}

    public Map<String,Object> readBody(BufferedReader reader){

        BufferedReader br = null;

        StringBuilder sb = new StringBuilder("");

        try{

            br = reader;

            String str;

            while ((str = br.readLine()) != null){

                sb.append(str);

            }

            br.close();

            String json = sb.toString();

            return JSONObject.parseObject(json, Map.class);

        }catch (IOException e){

            e.printStackTrace();

        }finally{

            if (null != br){

                try{

                    br.close();

                }catch (IOException e){

                    e.printStackTrace();

                }

            }

        }

        return null;

}

    public void insert(Map<String,Object> body){

        StringBuffer sql = new StringBuffer("INSERT INTO ");

        sql.append("`").append(table).append("`").append(" (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

        }

        sql.deleteCharAt(sql.length()-1);

        sql.append(") VALUES (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("'").append(entry.getValue()).append("'").append(",");

            }else {

                sql.append(entry.getValue()).append(",");

            }

        }

        sql.deleteCharAt(sql.length() - 1);

        sql.append(")");

        log.info("[{}] - 插入操作:{}",table,sql);

        Query query = runCountSql(sql.toString());

        query.executeUpdate();

    }

    1. 考试安排模块的实现

考试安排功能需要考虑高并发,特对考试这一共享数据增加锁机制。在乐观锁、悲观锁以及线程锁中,综合考虑性能效率和错误的可接受性选择了乐观锁机制。乐观锁的实现方式是使用版本标识来确定读到的数据与提交时的数据是否一致,提交后修改版本标识,不一致时可以采取丢弃和再次尝试的策略。在数据库考试表(对应考试实体)设计中增加了version字段,每次数据提交时(更改考试状态)会判断version是否匹配,若不匹配停止本次提交,若匹配则提交成功并增加version的值。

考试安排功能整体流程:用户浏览考试信息时,同时会显示考试的状态,系统会在其显示详细信息的页面时便会判断考试的状态,若考试状态为可考,则会显示答题的链接按钮。在用户点击答题按钮时,会先通过拦截器判断用户是否登录,若未登录,会跳转至登录页面,提示用户先登录,若为登录用户就会跳转至填写报名信息的页面,填写好报名信息之后,点击提交按钮,报名成功之后返回提示信息,告知用户答题成功。

考试安排流程图如下图所示。

 

图5-6考试安排流程图

考试安排界面如下图所示。

 

图5-7考试安排界面

考试安排界面逻辑代码如下:

@RequestMapping(value = {"/avg_group", "/avg"})

public Map<String, Object> avg(HttpServletRequest request) {

        Query count = service.avg(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

    1. 考试报名管理模块的实现

根据需求,需要对考试报名管理进行添加、删除或修改详情信息。删除或修改考试报名管理时,系统根据考试报名管理的状态判定为可删除状态下,才会给出删除和修改链接,点击删除链接按钮时,请求到达后台,还会先查询考试报名管理状态再次做出判定能否删除。点击修改链接按钮时,会跳转到修改信息的页面,重新填写好数据后,数据提交到后台会对数据库中相应的记录做出修改。

添加考试报名管理时,会给出数据填写的页面,该页面根据填写好的考试报名管理编号同样会事先发送Ajax请求查询编号是否已存在,数据填写好之后提交到后台,会调用相关服务在数据库中插入记录。

考试报名管理流程图如下图所示。

 

图5-11考试报名管理流程图

考试报名添加页面设计效果如下图所示。

 

图5-12考试报名添加界面

考试报名管理页面效果如下图所示。

 

图5-13考试报名管理界面

考试报名管理界面关键代码如下:

@RestController

@RequestMapping("auth")

public class AuthController extends BaseController<Auth, AuthService> {

    /**

     * 服务对象

     */

    @Autowired

    public AuthController(AuthService service) {

        setService(service);

    }

}

  1. 系统测试
    1. 测试目的

对任何系统而言,测试都是必不可少的环节,测试可以发现系统存在的很多问题,所有的软件上线之前,都应该进行充足的测试之后才能保证上线后不会Bug频发,或者是功能不满足需求等问题的发生。下面分别从单元测试,功能测试和用例测试来对系统进行测试以保证系统的稳定性和可靠性。

    1. 功能测试

下表是考试报名功能的测试用例,检测了考试报名中对报名信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-1 考试报名的测试用例

功能描述

用于考试报名

测试目的

检测考试报名时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加报名,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加报名,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改报名,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改报名,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除报名,选择报名删除

提示删除成功

与预期结果一致

点击搜索报名,输入存在的报名名

查找出报名

与预期结果一致

点击搜索报名,输入不存在的报名名

不显示报名

与预期结果一致

下表是考试信息推荐列表功能的测试用例,检测了考试信息推荐列表中对考试信息推荐信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-2 考试信息推荐列表的测试用例

功能描述

用于考试信息推荐列表

测试目的

检测考试信息推荐列表时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加考试信息推荐,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加考试信息推荐,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改考试信息推荐,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改考试信息推荐,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除考试信息推荐,选择考试信息推荐删除

提示删除成功

与预期结果一致

点击搜索考试信息推荐,输入存在的考试信息推荐名

查找出考试信息推荐

与预期结果一致

点击搜索考试信息推荐,输入不存在的考试信息推荐名

不显示考试信息推荐

与预期结果一致

下表是考试分类管理功能的测试用例,检测了考试分类管理中分类列表的操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-3 考试分类管理的测试用例

功能描述

用于考试分类管理

测试目的

检测考试分类管理时各种操作的情况

测试数据以及操作

预期结果

实际结果

未选择分类,点击提交

提示请选择分类

与预期结果一致

未选择列表,点击提交

提示请选择列表

与预期结果一致

    1. 性能测试

使用阿里云PTS(Performance Testing Service)性能测试服务对线上系统进行压力测试。线上服务器环境为:1核心CPU,1G内存,1Mbps公网带宽,Centos7.0操作系统。

压测过程中使用了2台并发机器,每台机器20个用户并发,对系统主页,登录,数据查询和数据维护等模块进行并发访问,测试结果是有40个用户并发时,数据管理相关页面的响应时间甚至达到了7s,通过查看服务器出网流量发现已经达到1381kb/s,可以看出服务器的带宽已经达到峰值,如果系统使用5Mbps的带宽,系统的响应时间和TPS将会大大增加。在整个测试的过程中,CPU的使用率占用仅8%,也提现出带宽瓶颈对系统的影响非常严重。

  1. 总结与展望

随着计算机互联网技术的迅猛发展,各行各业都已经实现采用计算机相关技术对日益放大的数据进行管理。该课题是在线学习与模拟考试为核心展开的,主要是为了实现学生在线考试报名信息化管理的需求。

本研究针对学生在线考试报名需求建模,数据建模及过程建模分析设计并实现课程考试系统的过程。给出系统应用架构并分析优劣势,通过功能分解图,系统组件图描述功能需求。设计建立了数据库,给出系统关键数据结构的定义。通过类关系图描述组件间的协作关系,给出各个类的定义方法。通过描述每一个类的字段,属性及方法实现校园竞赛管理系统的前后端代码。最终给出系统集成整合方法,完成学生在线考试报名的设计与实现。系统投入运行时,各功能均运行正常。系统的每个界面的操作符合常规逻辑,对使用者来说操作简单,界面友好。整个系统的各个功能设计合理,体现了人性化。

但是由于自己在系统开发过程中对一些用到的相关知识和技术掌握不够牢固,再加上自身开发经验欠缺,因此系统在有些方面的功能还不够完善,考虑的不够全面,因此整个系统还有待日后逐步完善。

参考文献

  1. 单树倩,任佳勋.基于SpringBoot和Vue框架的数据库原理网站设计与实现[J].电脑知识与技术,2021,17(30):40-41+50.
  2. [2]田成龙,陆晓寒,严梦瑶,周鑫.基于SpringBoot的成绩排名系统[J].软件,2021,42(10):129-132.
  3. 喻佳,吴丹新.基于SpringBoot的Web快速开发框架[J].电脑编程技巧与维护,2021(09):31-33.
  4. [4]李鹏.基于SpringBoot快速开发平台的实现[J].电子技术与软件工程,2021(12):36-37.

[5]张华.基于Spring和Vue的专升本自荐考试报名系统设计[J].电子技术与软件工程,2021(08):202-203.

[6]张鑫鑫.基于.net的报名管理平台的设计与开发[J].电脑知识与技术,2020,16(15):130-131.

[7]荣先钊,林宇驰.基于SSM框架的考试报名系统的设计与实现[J].信息与电脑(理论版),2019(13):56-57.

[8]韦仲园.高新考试报名APP的设计与实现[J].电子技术与软件工程,2019(04):47-48.

[9]张志祥,何光军.大学英语四六级考试报名系统照片资料库的构建与应用——以重庆医科大学为例[J].文化创新比较研究,2019,3(07):176-177.

[10]石琴,施阳.考试报名与成绩查询系统的设计与实现[J].电脑知识与技术,2019,15(01):96-98.

[11]周冰洁.基于ASP.NET技术的CET考试报名系统的设计与应用研究[J].科技创新与应用,2019(04):99.

[12]胡云峰,陈皖芬.HTML5+JQuery mobile+Ajax在线考试报名系统设计与实现——以文山学院在线考试报名系统为例[J].文山学院学报,2019,29(06):53-55.

[13]石飞,宁宁宁.基于Web的考试报名系统的设计与实现[J].电脑知识与技术,2018,12(13):88-90.

[14]李方, 基于AJAX技术与.NET架构的网上报名信息综合处理平台的研究. 浙江省,义乌工商职业技术学院,2018-06-23.

[15]邓绯.基于B/S模式的技能考试报名系统研究与设计[J].齐齐哈尔大学学报(自然科学版),2018,31(03):59-62.

[16]贾家新.基于B/S网上考试报名系统的设计与实现[J].湖北成人教育学院学报,2018,20(06):7-8.

[2]Recupero Patricia R,Rumschlag Jessica S,Rainey Samara E. The Mental Status Exam at the Movies: The Use of Film in a Behavioral Medicine Course for Physician Assistants.[J]. Academic psychiatry : the journal of the American Association of Directors of Psychiatric Residency Training and the Association for Academic Psychiatry,2021(prepublish):

thank you

This design took 3 months. In this graduation project, it is inseparable from the guidance of the instructor to make things go smoothly. The instructor has given me a lot of help both in the graduation design experience and in the completion of the thesis. On the other hand, I have benefited a lot from the teacher's serious and responsible work attitude, prudent teaching spirit and strong theoretical level. His diligent and cautious attitude towards teaching and educating people also left me with a particularly deep feeling. I have learned a lot from my teachers. In theory and practice, my skills have been greatly improved. Here, I would like to express my heartfelt gratitude to the teachers.

After all the research and development of this graduation project, my system research and development has experienced a special progress from requirement analysis to realization of detailed functions, to final testing and maintenance. Let me have a deeper understanding of system development. Now my hands-on ability and ability to deal with doubts alone have also gained a particularly large increase in practice and learning. This is the best harvest of this graduation project.

Finally, during the whole system development process, the classmates and friends around me gave me a lot of opinions, so I quickly confirmed the business idea of ​​the system. Here, I sincerely express my gratitude to them.

Like+Favorite+Follow → private message to receive the source code and database

Guess you like

Origin blog.csdn.net/weixin_61498557/article/details/131393425