Design and Implementation of Computer Basic Question Answering System Based on WeChat Mini Program

This project is mainly to solve the problem of the lack of face-to-face communication between teachers and students in the autonomous learning of computer majors. The answering system can be directly logged in through WeChat, and the teacher can answer online The questions raised by students greatly facilitate the time cost of students and teachers and improve the efficiency of learning. The system is mainly divided into two modules: the user side and the administrator side. The user side is divided into two different identities: teacher and student. This article uses mpvue+koa2+mysql technology to design and implement a basic computer question answering system, which allows teachers and students of computer majors to exchange learning materials and doubts in learning without being restricted by time and place. Compared with traditional learning apps, the functions are more specific and targeted. And now many institutions have online education platforms, most of which are presented to users in the form of web pages or APPs. As WeChat plays an indispensable role in life, WeChat applets are favored by users because of the advantage of not occupying mobile phone memory space. Love it, so it is very meaningful to develop an online education platform based on WeChat applet.
Keywords: WeChat applet; computer basics; answering questions;

Application Analysis of Visual Design Elements of WeChat Mini Program
Abstract
Mini Programs are a new open source, and developers may quickly develop a new Mini Program. Mini Programs may be easily accessed and disseminated in WeChat. WeChat Mini Program, referred to as Mini Program, English name Mini Program, is a kind of application does not need to download and install can be used, it realizes the application "At your fingertips;" dream, user scan or search can open the application. After the application is fully open, developers of enterprises, governments, media, other organizations or individuals can apply for the registration of Mini Programs. Applets, subscription Numbers, service Numbers, enterprise Numbers are parallel systems. Applet is a brand-new way to connect users and services. It can be easily acquired and disseminated in WeChat and has excellent user experience .Many things that people work and live can be accomplished by Mini Programs. Common Mini Programs, such as those developed by the catering giant KFC, can completely replace the APP.

Key words: WeChat; Mini Program;

Contents
Chinese Abstract I
English Abstract II
1 Introduction 1
1.1 Foreword 1
1.2 The source and background of the
subject 1 1.3 The significance and content of the subject research 1
2 Development plan and related technology introduction 3
2.1 System development plan 3
2.2 Selection and introduction of development tools 3
2.3 Frame selection-----MPVUE+KOA2 4
2.3.1 Front-end adopts mpvue framework 4
2.3.2 Back-end adopts koa2 framework 4
2.3.3 Front-end contact process 5
2.4 Development language-----css+JavaScript 5
2.5 Database Solution-MySQL 6
2.5.1 Introduction to MySQL 6
2.5.2 SQL Language Classification 6
2.6 Development Environment 6
2.7 System Development Summary 7
3 Demand Analysis 8
3.1 Demand Proposal 8
3.2 Demand Analysis 8
3.3 Use Case Diagram 10
3.4 Operating environment 11
4 Database analysis and design 12
4.1 Database conceptual model design 12
4.2 Database ER diagram 12
4.3 Create database 16
5 System overall design and implementation 20
5.1 System configuration 20
5.2 Part of the system flow chart 21
5.2.1 Login flow chart 21
Figure 5.1 Login flow chart 21
5.2.2 Add question flow chart 22
5.2.3 Question answering flow chart 22
5.3 Function module realization 22
5.3.1 Design and realization of login page 23
5.3 .2 Design and implementation of the home page 24
5.3.3 Design and implementation of the message module 25
5.3.4 Design and implementation of the class module 27
5.3.5 Design and implementation of the personal information module 29
5.3.6 Design and implementation of the administrator module 33
6 System Test 34
6.1 Test Objective 34
6.2 Test Method 34
6.3 Test Environment 34
6.4 Test Plan 34
6.5 Test Results 38
7 Conclusion 39
References 40
Acknowledgements 41

1 Introduction
1.1 Foreword At
present, we have entered the mobile intelligent society, mobile devices can quickly connect to the Internet, and various APPs on mobile intelligent terminals facilitate everyone's study and life. According to statistics, the use of WeChat in mobile smart terminals accounts for as high as 98%. The mini program is a new type of application developed and launched by WeChat. Users can use the program in WeChat without downloading and installing. Therefore, small programs play different roles in various fields, greatly improving people's quality of life and work efficiency. For the education industry, schools, as the pioneers of education and technology, also need to change the teaching model [13-15] in the rapid development of the Internet [13-15], and are no longer limited to traditional classroom teaching. The online and offline tutoring method is adopted, so that the communication between students and teachers is not restricted by time and place, and students’ problems can quickly get feedback from the teacher.
1.2 Source and background of the subject
WeChat is the most popular social communication software with the highest application rate. Mini Programs are a new type of application developed by WeChat, which is easy to use and has a wide coverage. Compared with the traditional APP, the applet can call the WeChat basic framework, API interface, etc., which improves the development efficiency of the program. In addition, the applet can quickly spread in WeChat and has a very large number of users [1-3]. Mini Programs do not need to be downloaded and do not occupy mobile phone memory. Soon after it was launched, users quickly reached 400 million, and they have been quickly promoted and applied in many fields, such as catering, service and other industries. In the field of education, mobile learning has gradually become the trend of future development. The limitations of the traditional teaching model include fewer teachers, more students, limited class time, only face-to-face questions, etc. Students’ questions cannot be answered, and the more they listen, the more they don’t understand. The phenomenon gradually exposed. The traditional teaching model occupies a lot of time and resources in answering questions, and there are many problems such as untimely answering and limited courseware time, which can no longer meet the requirements of students in answering questions. And because of the fast-paced life, more and more people use fragmented time to study at any place, which has gradually expanded to the college education system (such as MOOCs, micro-classes). At present, there are many learning apps, which have a long development cycle and high cost. The WeChat applet is embedded in WeChat, and users can open it directly after installing WeChat. The development cost is low, and the maintenance cost is significantly reduced. [4-6].
1.3 The significance of the subject research and the content
education field, small programs are also constantly being integrated into it. Many learning apps that are used by the public have also developed small programs, but they are not specifically used for a major or a class of subjects on campus. Small program. The micro-learning platform can provide users with a portable mobile learning platform to meet people's learning needs anytime and anywhere, using free time to improve personal knowledge and skills. This system research is based on WeChat applet design and development of answering systems for mobile learning and fragmented learning. It mainly uses the advantages of WeChat social traffic on campus. Users can learn and communicate through WeChat groups and friends. The promotion and dissemination speed of the information technology learning system based on WeChat applet is fast and the audience is wide. Users can use their smartphones to learn anytime and anywhere, and they can interrupt learning at any time. It is a long-standing demand that the learning of academic knowledge in the classroom can be combined with online teaching answering guidance. In view of learners’ desire for fragmented knowledge learning and mobile learning, as well as to meet their real needs for the combination of timely learning and systematization, it becomes a real need to review classroom content and test learning effects anytime and anywhere. Therefore, we developed a system based on this demand. This light application for vertical domain knowledge learning is of practical significance for learning this domain knowledge.

2 Development plan and related technology introduction
2.1 System development plan
During the development of the computer-based Q&A system, by carefully considering the needs and goals of the system, select a suitable life cycle model. This computer-based Q&A system will use the commonly used waterfall life cycle.
The Waterfall Model is the first model proposed in 1970. Its core is to process complex problems and complete the design and implementation of system functions in steps. Its development process corresponds to the software life cycle. Each stage has a goal that needs to be completed. It is top-down like a waterfall, is widely used, and is document-driven. The completion of each stage requires two necessary conditions: one is that the documentation of this stage is completed; the other is that the quality of this stage has been approved by relevant inspectors. In addition, verification and testing must be completed at each stage. The execution of the last part begins with delivery.

Insert picture description here


The biggest advantage of computer-based Q&A system development using this model is that the system development process has a standardized development process. The main goal of this topic is that teachers and students can discuss problems more in-depth, make the discussion of exercises after class more convenient, and use fragmented time to achieve the purpose of improving their professional knowledge. In the needs analysis process, the detailed content of the problem-solving process and the problems that need to be solved can be specified. The scope of application of this model requires clear system requirements. Because the requirement analysis has been completed in the early stage, it can serve well for the implementation of the later code. The final test link can also better verify the content of the requirement analysis and improve the function of the entire system.
2.2 Selection and introduction of development tools
This system uses WeChat developer tools + sublime Text code editor as development tools. WeChat developer tools have many encapsulated interfaces and functions, and many functions can be used directly, such as uploading, debugging and other functions, which are very convenient for developers. Because the WeChat development team has published the Mini Program Design Guidelines on the official website, during the development period, developers can view the development documents and design guidelines on the Mini Program's official website to develop WeChat Mini Programs simply and efficiently.
Sublime Tex is an advanced code (text) editor. It has a beautiful user interface, such as support for code highlighting, which makes the interface look neater and each code segment is clearer. Compatibility is also very high, supports mainstream operating systems, and also contains a variety of plug-ins, which is convenient and fast.
2.3 Framework selection-----MPVUE+KOA2
2.3.1 The front-end adopts the mpvue framework.
mpvue is a set of frameworks specially used for the front-end development of small programs. Developers can get started when they have a preliminary understanding of development. In terms of development efficiency, It is said that the advantages are obvious, which makes the development experience very good. The developer writes Vue.js code, and mpvue parses it into code that can be run by the applet and executes it. In addition, it is very convenient to get a runnable project by executing a command. Compared with the native framework, it has the advantages of fast implementation, code reuse, low cost and high efficiency.

Insert picture description here


Insert picture description here


2.3.2 The back-end uses koa2 framework
express is the predecessor of koa2, and the development teams of the two are also the same. The only difference is that the syntax used by the two is different. The former uses ES5 syntax, and asynchronous operations are handled through callback functions. koa2 uses async/await+Promise in ES7 to handle asynchronous operations, which not only has strong code readability, but also supports native async/await. It is characterized by light weight, robustness, and expressiveness, and the async syntax has enhanced error handling.
With the advent of the separation of front and back ends, the front and back ends can be developed in parallel, which greatly improves development efficiency and project performance. Different routing components make different responses according to different URLs and methods, and because there are many routes in a project, if the routing processing and response are placed in a middleware function, it will seriously affect the readability of the code And maintainability. Koa routing, unified management in the server/routes/index.js file. Receive different api requests, find the corresponding processed file, check or modify the data, and return the processed information.
2.3.3 Front-end contact process:
a. When the front end clicks the button, the method corresponding to this button is called, such as the login function (login()): http://localhost:5757/weapp/+login, and the login file corresponding to the back end is found.
b. After receiving the request, the backend finds the login file with the specific execution statement through the statement in server/routes/index.js
c. First receives the data transmitted by the front end, then operates the database, and returns the required information to Front-end, this is the whole process of front-end and back-end connection.
This system adopts the above-mentioned development framework, so that the front-end and back-end connection need not be too close. This is also if the front-end page needs to be adjusted, the back-end basically does not need to be changed, which improves the reusability of the system.
2.4 Development Language-CSS+JavaScript
Cascading Style Sheet is a computer language used to express file styles such as XML or HTML. CSS contains almost all fonts and font size styles, which can achieve precise control over the layout of web page elements. Not only is it indispensable in the decoration of static pages, of course it needs to be used in conjunction with other scripting languages.
JavaScript is a high-level programming language with the characteristics of function-first lightweight, interpreted or just-in-time compilation. It is not only suitable for developing web interfaces, but also widely used in non-browser environments.
The development of this system chooses css+javascript because css has the following advantages:
a. Code reuse: write it once and introduce it to multiple pages. Reduce the amount of code, more concise.
b. Improved page loading speed: only one rule needs to be written, and there is no need to write HTML markup attributes every time, so the amount of code is reduced, which means that the page loads faster and takes less time.
c. Convenient maintenance: Because the code in one place can be referenced in another place, you only need to modify one place when you modify it to achieve the purpose of updating all elements.
d. Compatibility: It can be applied to a variety of different types of equipment, and content optimization.
JavaScript has the following advantages:

a. No need to compile first when using, the server will execute step by step while the program is running.
b. Provides many functional features, which are convenient for learning and use. Because many of them are already written, the development is better.
c. Contains a lot of programming language libraries, which is more convenient and faster in the development process.
d. Development objects can be defined quickly. The development process is diversified and fast and flexible at the same time.
2.5 Database Solutions-----MySQL
2.5.1 Introduction to
MySQL MySQL is a popular, distributed and open source database management system, which now belongs to Oracle Corporation.
In recent years, the included functions have been continuously improved, and the performance has also been continuously improved, as well as the advantage of free and open source, so there are more and more users. Mainly, the structured management of the collected data can help to add, access and process the data and store the data in different data tables in the database. The database provides convenient and flexible programming conditions for objects, such as databases, tables, and views. Among them, the general standardized language used to access the database is the structured query language, which is the most important.
2.5.2 SQL language classification
SQL language can be divided into 4 categories according to its function:
a. DQL: mainly for data query, it is query statement.
b. DDL: Data definition, used to create data objects, or modify or delete them.
c. DML: Data manipulation language, which mainly manages the commands for operating data, including update, delete, etc.;
d. DCL: Control language, which includes the control of access to the database, or the shutdown and startup of services.
2.6 Development environment
Based on the current popular WeChat applet development portfolio considerations, the development environment of Windows xp (win10) + node.js + mysql was selected.
Node.js is the runtime environment of javaScript. The basic functions that can be achieved by other back-end development languages ​​are the same. The development of back-end programs through it can be the same as some commonly used back-end languages, such as PHP, Java, Python, etc. JavaScript can only run in the browser before, and Node broke this situation. This realizes the unification of the front-end and back-end programming environment, which reduces the development cost and is more convenient and faster. Not only that, in the case of high concurrency, its processing power is also very strong, and the development is fast, the cost is low, and the learning is fast. So choose the node.js operating environment.
The version of MySQL is 8.0.16, which is a relational database. Data can be stored in corresponding tables and placed according to corresponding relationships to form the database of the entire system. Because the data is not stored together, it is more convenient to organize the data and improve the flexibility of data use. Because its use is free and the source code is open, we chose it in terms of the cost of use. Of course, the advantages are not only this, but also have the advantages of small size and fast speed.
2.7 System development summary
By studying the system development plan, the selection and use of development tools, the selection of system development architecture, the study and research of database solutions, and the familiarization of the development environment, a conclusion is drawn:
based on WeChat applet computer basic question and answer The system uses WeChat developer tools for design and coding implementation, and uses MySQL for database table structure design and management operations. Basically realize four modules: student function module, teacher function module, administrator function module and general function module.
3 Requirement analysis
The purpose of software requirement analysis is to put forward complete, accurate, clear and specific requirements for the target system—computer-based Q&A system, refine and refine the software feasibility analysis established during the system development plan, and analyze various possibilities The solution is to divide a large and vague system into multiple small modules with clear functions. Requirement analysis is used to determine what work the system must complete. It is the most important step in the software definition phase.
The task of software requirements analysis is: in-depth analysis and description of system functions and performance, determining software design constraints and details of the interface between the software and other system elements, defining other effectiveness requirements of software functions, and solving the "what" problem of the target system .
3.1 Proposal of requirements The proposal of
requirements mainly focuses on analyzing the purpose of the system. Requirements and analysis focus on the user's point of view of the system. It is the most in-depth discussion between users and developers in the early stage of system development, so that developers can understand the precise needs of users. Such definitions are called system specifications and act as a bridge between users and developers.
In the development of computer-based Q&A system, demand analysis mainly includes two parts: one is the demand analysis of system functions, and the other is the demand analysis of graphical user interface. The system function analysis mainly includes the demand analysis of the content modules of the basic Q&A system, and the demand analysis of the mini program operation function. According to the results of the two demand analysis, the detailed design part of the mini program development will give the database design of the system design, Realize the design of technology. In terms of graphical user interface requirements analysis, what we need to do is to design scientific, beautiful, reasonable page effects that satisfy users for different pages in the mini program, such as page layout effects, selection of table controls, image processing effects, and Animation effect.
3.2 Requirement analysis
Through further analysis of the main functions of the computer-based question answering system [12], we have fully understood the system role of the system and its functions, and fully considered the scalability, portability, and reusability of the system, etc. Software design quality features, so that the design meets the user's requirements as much as possible. According to the data flow and data structure in the system, the principle of the system overview is drawn, and the system demand model is obtained.
The information data involved in the basic computer question answering system includes user information, question information, comment information, classroom information, announcement information, file information, private message information, and feedback information data. The operations involved mainly include user information management and problem information management. Ask questions, operations, and so on. After the above-mentioned investigation and design, the basic computer question answering system is mainly composed of four modules: student function module, teacher function module, general function module and administrator function module. It should have the following functions:
a. The functions of the student function module are as follows:
(1) Asking questions: Log in to the main page, and the college can submit questions. The question raised can be divided into two parts: question title and question content. The content of the question can be the most basic text message or a picture.
(2) View the questions I asked: List all the questions raised by the current user.
(3) Join the class: This module is very important, including the questioning discussion area and the study area. In this module, students follow the teacher to learn basic computer knowledge, and can ask questions about the knowledge they have learned in the questioning discussion area or discuss with other class members.
b. The functions of the teacher function module are as follows:
(1) Create classroom: Teachers can create their own classroom, and after entering, they can manage class members (view member information, delete members). In the class, you can publish learning materials, and you can also answer questions raised by students during the learning process.
(2) Answer the questions: When viewing all the questions, answer the questions raised by the students. You can also collect valuable questions.
(3) View my answers: you can view all the questions answered.
c. General functional modules:
(1) Personal information management: Users log in through WeChat and can edit their personal information (nickname, avatar, identity, etc.) after logging in.
(2) Message notification: including viewing the comments of the questions posted on the homepage, private messages from other users, and notifications of the classes that have joined.
(3) View all questions: When viewing all the questions, you can learn a lot of knowledge from other people's questions and the teacher's answers, and you can bookmark the questions and answers you are interested in.
(4) View my favorites: View the questions that have been favorited.
d. Administrator function module:
(1) Question management: all questions can be managed, and some irrelevant questions or worthless answers can be deleted.
(2) User management: manage all users.

According to the demand analysis of the Q&A system function and the principle of separate design of the functional modules, the functional structure diagram of the system is constructed, as shown in Figure 3.1:

Insert picture description here


Paper download: please click to download """